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

Unified Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 2076213002: Decompress ETC texture data when there is no native support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Validate PBOs Created 4 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 6ce5b3c72a8bf8985211f66deedf14f81cb94b98..f666771bafe8473edc2006c537fd5b7c0bac87e2 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -2324,6 +2324,8 @@ _PEPPER_INTERFACES = [
# decoder_func: defines which function to call in the decoder to execute the
# corresponding GL command. If not specified the GL command will
# be called directly.
+# check_decoder_func_result: Signals that the decoder_func returns an error
+# that should be checked. Defaults to False.
# gl_test_func: GL function that is expected to be called when testing.
# cmd_args: The arguments to use for the command. This overrides generating
# them based on the GL function arguments.
@@ -2602,12 +2604,14 @@ _FUNCTION_INFO = {
'type': 'Data',
'data_transfer_methods': ['bucket', 'shm'],
'decoder_func': 'DoCompressedTexImage2D',
+ 'check_decoder_func_result': True,
'trace_level': 1,
},
'CompressedTexSubImage2D': {
'type': 'Data',
'data_transfer_methods': ['bucket', 'shm'],
'decoder_func': 'DoCompressedTexSubImage2D',
+ 'check_decoder_func_result': True,
'trace_level': 1,
},
'CopyTexImage2D': {
@@ -2625,6 +2629,7 @@ _FUNCTION_INFO = {
'type': 'Data',
'data_transfer_methods': ['bucket', 'shm'],
'decoder_func': 'DoCompressedTexImage3D',
+ 'check_decoder_func_result': True,
'unsafe': True,
'trace_level': 1,
},
@@ -2632,6 +2637,7 @@ _FUNCTION_INFO = {
'type': 'Data',
'data_transfer_methods': ['bucket', 'shm'],
'decoder_func': 'DoCompressedTexSubImage3D',
+ 'check_decoder_func_result': True,
'unsafe': True,
'trace_level': 1,
},
@@ -4953,17 +4959,25 @@ static_assert(offsetof(%(cmd_name)s::Result, %(field_name)s) == %(offset)d,
f.write(" group_->Get%sServiceId(%s, &%s);\n" %
(id_type, id_type.lower(), id_type.lower()))
+ def WriteGLFunctionCallCode(self, func, f):
+ """Writes the call to the GL function."""
+ if func.ShouldCheckGLFunctionResult():
+ f.write(" error::Error error = ")
+ f.write(" %s(%s);\n" %
+ (func.GetGLFunctionName(), func.MakeOriginalArgString("")))
+ if func.ShouldCheckGLFunctionResult():
+ f.write(" if (error != error::kNoError)")
+ f.write(" return error;")
+
def WriteImmediateHandlerImplementation (self, func, f):
"""Writes the handler impl for the immediate version of a command."""
self.__WriteIdMapping(func, f)
- f.write(" %s(%s);\n" %
- (func.GetGLFunctionName(), func.MakeOriginalArgString("")))
+ self.WriteGLFunctionCallCode(func, f)
def WriteBucketHandlerImplementation (self, func, f):
"""Writes the handler impl for the bucket version of a command."""
self.__WriteIdMapping(func, f)
- f.write(" %s(%s);\n" %
- (func.GetGLFunctionName(), func.MakeOriginalArgString("")))
+ self.WriteGLFunctionCallCode(func, f)
def WriteServiceHandlerFunctionHeader(self, func, f):
"""Writes function header for service implementation handlers."""
@@ -5527,8 +5541,7 @@ class StateSetHandler(TypeHandler):
if item.get('cached', False):
f.write(" state_.%s = %s;\n" %
(CachedStateName(item), args[ndx].name))
- f.write(" %s(%s);\n" %
- (func.GetGLFunctionName(), func.MakeOriginalArgString("")))
+ self.WriteGLFunctionCallCode(func, f)
f.write(" }\n")
def WriteServiceUnitTest(self, func, f, *extras):
@@ -5612,8 +5625,7 @@ class StateSetRGBAlphaHandler(TypeHandler):
if 'state_flag' in state:
f.write(" %s = true;\n" % state['state_flag'])
if not func.GetInfo("no_gl"):
- f.write(" %s(%s);\n" %
- (func.GetGLFunctionName(), func.MakeOriginalArgString("")))
+ self.WriteGLFunctionCallCode(func, f)
f.write(" }\n")
@@ -5648,8 +5660,7 @@ class StateSetFrontBackSeparateHandler(TypeHandler):
if 'state_flag' in state:
f.write(" %s = true;\n" % state['state_flag'])
if not func.GetInfo("no_gl"):
- f.write(" %s(%s);\n" %
- (func.GetGLFunctionName(), func.MakeOriginalArgString("")))
+ self.WriteGLFunctionCallCode(func, f)
f.write(" }\n")
@@ -5674,8 +5685,7 @@ class StateSetFrontBackHandler(TypeHandler):
if 'state_flag' in state:
f.write(" %s = true;\n" % state['state_flag'])
if not func.GetInfo("no_gl"):
- f.write(" %s(%s);\n" %
- (func.GetGLFunctionName(), func.MakeOriginalArgString("")))
+ self.WriteGLFunctionCallCode(func, f)
f.write(" }\n")
@@ -9663,6 +9673,9 @@ class Function(object):
return self.GetInfo('decoder_func')
return "gl%s" % self.original_name
+ def ShouldCheckGLFunctionResult(self):
+ return self.GetInfo('check_decoder_func_result', False)
+
def GetGLTestFunctionName(self):
gl_func_name = self.GetInfo('gl_test_func')
if gl_func_name == None:

Powered by Google App Engine
This is Rietveld 408576698