Chromium Code Reviews| 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 1c7b0199371cf8732b1335d8db811af47c840545..89f33588e4d2926a24b299816da42cd0f30aa9af 100755 |
| --- a/gpu/command_buffer/build_gles2_cmd_buffer.py |
| +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py |
| @@ -1283,6 +1283,7 @@ _PEPPER_INTERFACES = [ |
| # extension_flag: Function is an extension and should be enabled only when |
| # the corresponding feature info flag is enabled. Implies |
| # 'extension': True. |
| +# not_shared: For GENn types, True if objects can't be shared between contexts |
| _FUNCTION_INFO = { |
| 'ActiveTexture': { |
| @@ -2353,6 +2354,7 @@ _FUNCTION_INFO = { |
| 'resource_types': 'Queries', |
| 'unit_test': False, |
| 'pepper_interface': 'Query', |
| + 'not_shared': 'True', |
| }, |
| 'DeleteQueriesEXT': { |
| 'type': 'DELn', |
| @@ -4048,9 +4050,20 @@ class GENnHandler(TypeHandler): |
| self.WriteClientGLCallLog(func, file) |
| for arg in func.GetOriginalArgs(): |
| arg.WriteClientSideValidationCode(file, func) |
| - code = """ GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| - GetIdHandler(id_namespaces::k%(resource_types)s)-> |
| - MakeIds(this, 0, %(args)s); |
| + not_shared = func.GetInfo('not_shared') |
| + if not_shared: |
| + alloc_code = ( |
| +""" IdAllocatorInterface* 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)) |
| + else: |
| + alloc_code = (""" GetIdHandler(id_namespaces::k%(resource_types)s)-> |
| + MakeIds(this, 0, %(args)s);""" % args) |
| + args['alloc_code'] = alloc_code |
|
no sievers
2014/07/08 22:54:04
what's this line needed for?
hj.r.chung
2014/07/09 05:26:46
I added 'alloc_code' because only that portion of
|
| + |
| + code = """ GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| +%(alloc_code)s |
| %(name)sHelper(%(args)s); |
| helper_->%(name)sImmediate(%(args)s); |
| if (share_group_->bind_generates_resource()) |
| @@ -4486,7 +4499,7 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) { |
| """ % func.GetOriginalArgs()[1].name) |
| file.Write(""" GPU_CLIENT_DCHECK_CODE_BLOCK({ |
| for (GLsizei i = 0; i < n; ++i) { |
| - DCHECK(%s[i] != 0); |
| + DCHECK_NE(0, %s[i]); |
| } |
| }); |
| """ % func.GetOriginalArgs()[1].name) |