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

Unified Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 5254006: Initialize destinations variables before calling GL functions... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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
===================================================================
--- gpu/command_buffer/build_gles2_cmd_buffer.py (revision 68425)
+++ gpu/command_buffer/build_gles2_cmd_buffer.py (working copy)
@@ -2145,6 +2145,11 @@
else:
self.WriteGLES2ImplementationDeclaration(func, file)
+ def WriteDestinationInitalizationValidation(self, func, file):
+ """Writes the client side destintion initialization validation."""
+ for arg in func.GetOriginalArgs():
+ arg.WriteDestinationInitalizationValidation(file, func)
+
def WriteImmediateCmdComputeSize(self, func, file):
"""Writes the size computation code for the immediate version of a cmd."""
file.Write(" static uint32 ComputeSize(uint32 size_in_bytes) {\n")
@@ -4000,6 +4005,7 @@
'GLfloat': 'float',
'GLclampf': 'float',
}
+ need_validation_ = ['GLsizei*', 'GLboolean*', 'GLenum*', 'GLint*']
def __init__(self, name, type):
self.name = name
@@ -4049,6 +4055,20 @@
"""Writes the validation code for an argument."""
pass
+ def WriteDestinationInitalizationValidation(self, file, func):
+ """Writes the client side destintion initialization validation."""
+ pass
+
+ def WriteDestinationInitalizationValidatationIfNeeded(self, file, func):
+ """Writes the client side destintion initialization validation if needed."""
+ parts = self.type.split(" ")
+ if len(parts) > 1:
+ return
+ if parts[0] in self.need_validation_:
+ file.Write(" GL_CLIENT_VALIDATE_DESTINATION_INITALIZATION(%s, %s);\n" %
+ (self.type[:-1], self.name))
+
+
def WriteGetAddress(self, file):
"""Writes the code to get the address this argument refers to."""
pass
@@ -4233,7 +4253,11 @@
"""Overridden from Argument."""
return None
+ def WriteDestinationInitalizationValidation(self, file, func):
+ """Overridden from Argument."""
+ self.WriteDestinationInitalizationValidatationIfNeeded(file, func)
+
class BucketPointerArgument(Argument):
"""A class that represents an bucket argument to a function."""
@@ -4258,7 +4282,11 @@
"""Overridden from Argument."""
return None
+ def WriteDestinationInitalizationValidation(self, file, func):
+ """Overridden from Argument."""
+ self.WriteDestinationInitalizationValidatationIfNeeded(file, func)
+
class PointerArgument(Argument):
"""A class that represents a pointer argument to a function."""
@@ -4328,7 +4356,11 @@
return InputStringBucketArgument(self.name, self.type)
return BucketPointerArgument(self.name, self.type)
+ def WriteDestinationInitalizationValidation(self, file, func):
+ """Overridden from Argument."""
+ self.WriteDestinationInitalizationValidatationIfNeeded(file, func)
+
class InputStringBucketArgument(Argument):
"""An string input argument where the string is passed in a bucket."""
@@ -4649,6 +4681,10 @@
"""Writes the GLES2 Implemention declaration."""
self.type_handler.WriteGLES2ImplementationHeader(self, file)
+ def WriteDestinationInitalizationValidation(self, file):
+ """Writes the client side destintion initialization validation."""
+ self.type_handler.WriteDestinationInitalizationValidation(self, file)
+
def WriteFormatTest(self, file):
"""Writes the cmd's format test."""
self.type_handler.WriteFormatTest(self, file)
@@ -5136,6 +5172,7 @@
file.Write("%s GLES2%s(%s) {\n" %
(func.return_type, func.name,
func.MakeTypedOriginalArgString("")))
+ func.WriteDestinationInitalizationValidation(file)
comma = ""
if len(func.GetOriginalArgs()):
comma = " << "
« no previous file with comments | « chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc ('k') | gpu/command_buffer/client/gles2_c_lib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698