Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Unified Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 2826043002: Do not share FBOs/VAOs/Transform feedback objects across contexts (Closed)
Patch Set: added DeleteFramebuffers() expectation Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/build_gles2_cmd_buffer.py
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index 44cfccc05e92052f09357ccaf3737cefbaca7c03..564cca7d72e335e7543b29a6f7bd319d1318f4ad 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -2917,6 +2917,7 @@ _FUNCTION_INFO = {
'gl_test_func': 'glGenFramebuffersEXT',
'resource_type': 'Framebuffer',
'resource_types': 'Framebuffers',
+ 'not_shared': 'True',
},
'GenRenderbuffers': {
'type': 'GENn', 'gl_test_func': 'glGenRenderbuffersEXT',
@@ -2942,6 +2943,7 @@ _FUNCTION_INFO = {
'resource_type': 'TransformFeedback',
'resource_types': 'TransformFeedbacks',
'es3': True,
+ 'not_shared': 'True',
},
'GetActiveAttrib': {
'type': 'Custom',
@@ -4245,6 +4247,7 @@ _FUNCTION_INFO = {
'resource_types': 'VertexArrays',
'unit_test': False,
'pepper_interface': 'VertexArrayObject',
+ 'not_shared': 'True',
},
'BindVertexArrayOES': {
'type': 'Bind',
@@ -6037,28 +6040,34 @@ class GENnHandler(TypeHandler):
arg.WriteClientSideValidationCode(f, func)
not_shared = func.GetInfo('not_shared')
if not_shared:
- alloc_code = (
-
-""" IdAllocator* id_allocator = GetIdAllocator(id_namespaces::k%s);
- for (GLsizei ii = 0; ii < n; ++ii)
- %s[ii] = id_allocator->AllocateID();""" %
- (func.GetInfo('resource_types'), func.GetOriginalArgs()[1].name))
+ alloc_code = ("""\
+ IdAllocator* id_allocator = GetIdAllocator(IdNamespaces::k%s);
+ for (GLsizei ii = 0; ii < n; ++ii)
+ %s[ii] = id_allocator->AllocateID();""" %
+ (func.GetInfo('resource_types'), func.GetOriginalArgs()[1].name))
else:
- alloc_code = (""" GetIdHandler(id_namespaces::k%(resource_types)s)->
+ alloc_code = ("""\
+ GetIdHandler(SharedIdNamespaces::k%(resource_types)s)->
MakeIds(this, 0, %(args)s);""" % args)
args['alloc_code'] = alloc_code
- code = """ GPU_CLIENT_SINGLE_THREAD_CHECK();
-%(alloc_code)s
- %(name)sHelper(%(args)s);
- helper_->%(name)sImmediate(%(args)s);
- if (share_group_->bind_generates_resource())
- helper_->CommandBufferHelper::Flush();
-%(log_code)s
- CheckGLError();
-}
+ code = """\
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ %(alloc_code)s
+ %(name)sHelper(%(args)s);
+ helper_->%(name)sImmediate(%(args)s);
+ """
+ if not not_shared:
+ code += """\
+ if (share_group_->bind_generates_resource())
+ helper_->CommandBufferHelper::Flush();
+ """
+ code += """\
+ %(log_code)s
+ CheckGLError();
+ }
-"""
+ """
f.write(code % args)
def WriteGLES2ImplementationUnitTest(self, func, f):
@@ -6348,10 +6357,10 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
f.write(" GLuint client_id;\n")
if func.return_type == "GLsync":
f.write(
- " GetIdHandler(id_namespaces::kSyncs)->\n")
+ " GetIdHandler(SharedIdNamespaces::kSyncs)->\n")
else:
f.write(
- " GetIdHandler(id_namespaces::kProgramsAndShaders)->\n")
+ " GetIdHandler(SharedIdNamespaces::kProgramsAndShaders)->\n")
f.write(" MakeIds(this, 0, 1, &client_id);\n")
f.write(" helper_->%s(%s);\n" %
(func.name, func.MakeCmdArgString("")))

Powered by Google App Engine
This is Rietveld 408576698