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

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: 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
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)
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation.h » ('j') | gpu/command_buffer/client/gles2_implementation.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698