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

Unified Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 878793002: Add CopyTexSubImage3D to GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « gpu/GLES2/gl2chromium_autogen.h ('k') | gpu/command_buffer/client/gles2_c_lib_autogen.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 577861a1d0d108368157550d4fb93ee350ed8e86..a2dc137604c6e147fdb910d8b4f4beb630b29a37 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -1712,6 +1712,10 @@ _FUNCTION_INFO = {
'decoder_func': 'DoCopyTexSubImage2D',
'defer_reads': True,
},
+ 'CopyTexSubImage3D': {
+ 'defer_reads': True,
+ 'unsafe': True,
+ },
'CreateImageCHROMIUM': {
'type': 'Manual',
'cmd_args':
@@ -7551,21 +7555,29 @@ class SizeArgument(Argument):
def WriteValidationCode(self, file, func):
"""overridden from Argument."""
- file.Write(" if (%s < 0) {\n" % self.name)
- file.Write(
- " LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, \"gl%s\", \"%s < 0\");\n" %
- (func.original_name, self.name))
- file.Write(" return error::kNoError;\n")
- file.Write(" }\n")
+ if func.IsUnsafe():
+ return
+ code = """ if (%(var_name)s < 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "gl%(func_name)s", "%(var_name)s < 0");
+ return error::kNoError;
+ }
+"""
+ file.Write(code % {
+ "var_name": self.name,
+ "func_name": func.original_name,
+ })
def WriteClientSideValidationCode(self, file, func):
"""overridden from Argument."""
- file.Write(" if (%s < 0) {\n" % self.name)
- file.Write(
- " SetGLError(GL_INVALID_VALUE, \"gl%s\", \"%s < 0\");\n" %
- (func.original_name, self.name))
- file.Write(" return;\n")
- file.Write(" }\n")
+ code = """ if (%(var_name)s < 0) {
+ SetGLError(GL_INVALID_VALUE, "gl%(func_name)s", "%(var_name)s < 0");
+ return;
+ }
+"""
+ file.Write(code % {
+ "var_name": self.name,
+ "func_name": func.original_name,
+ })
class SizeNotNegativeArgument(SizeArgument):
« no previous file with comments | « gpu/GLES2/gl2chromium_autogen.h ('k') | gpu/command_buffer/client/gles2_c_lib_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698