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

Unified Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 371363002: Query objects should not be shared between contexts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reverted DCHECK -> DCHECK_NE change to avoid error Created 6 years, 5 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
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a9e13bc2cde4075ee83139a89d5add42554ebb71 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
+
+ code = """ GPU_CLIENT_SINGLE_THREAD_CHECK();
+%(alloc_code)s
%(name)sHelper(%(args)s);
helper_->%(name)sImmediate(%(args)s);
if (share_group_->bind_generates_resource())
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698