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

Side by Side Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 546026: Adds unit tests for glDrawArrays and glDrawBuffers... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """code generator for GL command buffers.""" 7 """code generator for GL command buffers."""
8 8
9 import os 9 import os
10 import os.path 10 import os.path
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); 130 GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
131 GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); 131 GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
132 GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLidShader* shaders, GLenum binaryformat, const void* binary, GLsizei length); 132 GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLidShader* shaders, GLenum binaryformat, const void* binary, GLsizei length);
133 GL_APICALL void GL_APIENTRY glShaderSource (GLidShader shader, GLsizei c ount, const char** str, const GLint* length); 133 GL_APICALL void GL_APIENTRY glShaderSource (GLidShader shader, GLsizei c ount, const char** str, const GLint* length);
134 GL_APICALL void GL_APIENTRY glStencilFunc (GLenumCmpFunction func, GLint ref, GLuint mask); 134 GL_APICALL void GL_APIENTRY glStencilFunc (GLenumCmpFunction func, GLint ref, GLuint mask);
135 GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenumFaceType face, GLenumCmpFunction func, GLint ref, GLuint mask); 135 GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenumFaceType face, GLenumCmpFunction func, GLint ref, GLuint mask);
136 GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); 136 GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
137 GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenumFaceType face, GLuint mask); 137 GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenumFaceType face, GLuint mask);
138 GL_APICALL void GL_APIENTRY glStencilOp (GLenumStencilOp fail, GLenumSte ncilOp zfail, GLenumStencilOp zpass); 138 GL_APICALL void GL_APIENTRY glStencilOp (GLenumStencilOp fail, GLenumSte ncilOp zfail, GLenumStencilOp zpass);
139 GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenumFaceType face, GL enumStencilOp fail, GLenumStencilOp zfail, GLenumStencilOp zpass); 139 GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenumFaceType face, GL enumStencilOp fail, GLenumStencilOp zfail, GLenumStencilOp zpass);
140 GL_APICALL void GL_APIENTRY glTexImage2D (GLenumTextureTarget target, GL int level, GLintTextureFormat internalformat, GLsizei width, GLsizei height, GLi nt border, GLenumTextureFormat format, GLenumPixelType type, const void* pixels) ; 140 GL_APICALL void GL_APIENTRY glTexImage2D (GLenumTextureTarget target, GL int level, GLintTextureFormat internalformat, GLsizei width, GLsizei height, GLi ntTextureBorder border, GLenumTextureFormat format, GLenumPixelType type, const void* pixels);
141 GL_APICALL void GL_APIENTRY glTexParameterf (GLenumTextureBindTarget tar get, GLenumTextureParameter pname, GLfloat param); 141 GL_APICALL void GL_APIENTRY glTexParameterf (GLenumTextureBindTarget tar get, GLenumTextureParameter pname, GLfloat param);
142 GL_APICALL void GL_APIENTRY glTexParameterfv (GLenumTextureBindTarget ta rget, GLenumTextureParameter pname, const GLfloat* params); 142 GL_APICALL void GL_APIENTRY glTexParameterfv (GLenumTextureBindTarget ta rget, GLenumTextureParameter pname, const GLfloat* params);
143 GL_APICALL void GL_APIENTRY glTexParameteri (GLenumTextureBindTarget tar get, GLenumTextureParameter pname, GLint param); 143 GL_APICALL void GL_APIENTRY glTexParameteri (GLenumTextureBindTarget tar get, GLenumTextureParameter pname, GLint param);
144 GL_APICALL void GL_APIENTRY glTexParameteriv (GLenumTextureBindTarget ta rget, GLenumTextureParameter pname, const GLint* params); 144 GL_APICALL void GL_APIENTRY glTexParameteriv (GLenumTextureBindTarget ta rget, GLenumTextureParameter pname, const GLint* params);
145 GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenumTextureTarget target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenu mTextureFormat format, GLenumPixelType type, const void* pixels); 145 GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenumTextureTarget target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenu mTextureFormat format, GLenumPixelType type, const void* pixels);
146 GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x); 146 GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
147 GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v); 147 GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
148 GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x); 148 GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
149 GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v); 149 GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
150 GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfl oat y); 150 GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfl oat y);
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 'GL_UNSIGNED_BYTE', 777 'GL_UNSIGNED_BYTE',
778 'GL_SHORT', 778 'GL_SHORT',
779 'GL_UNSIGNED_SHORT', 779 'GL_UNSIGNED_SHORT',
780 # 'GL_FIXED', // This is not available on Desktop GL. 780 # 'GL_FIXED', // This is not available on Desktop GL.
781 'GL_FLOAT', 781 'GL_FLOAT',
782 ], 782 ],
783 'invalid': [ 783 'invalid': [
784 'GL_DOUBLE', 784 'GL_DOUBLE',
785 ], 785 ],
786 }, 786 },
787 'TextureBorder': {
788 'type': 'GLint',
789 'valid': [
790 '0',
791 ],
792 'invalid': [
793 '1',
794 ],
795 },
787 'VertexAttribSize': { 796 'VertexAttribSize': {
788 'type': 'GLint', 797 'type': 'GLint',
789 'valid': [ 798 'valid': [
790 '1', 799 '1',
791 '2', 800 '2',
792 '3', 801 '3',
793 '4', 802 '4',
794 ], 803 ],
795 'invalid': [ 804 'invalid': [
796 '0', 805 '0',
(...skipping 2495 matching lines...) Expand 10 before | Expand all | Expand 10 after
3292 3301
3293 def __init__(self, name, type): 3302 def __init__(self, name, type):
3294 match = re.match("(GLid\w+)", type) 3303 match = re.match("(GLid\w+)", type)
3295 self.resource_type = match.group(1)[4:] 3304 self.resource_type = match.group(1)[4:]
3296 type = type.replace(match.group(1), "GLuint") 3305 type = type.replace(match.group(1), "GLuint")
3297 Argument.__init__(self, name, type) 3306 Argument.__init__(self, name, type)
3298 3307
3299 def WriteGetCode(self, file): 3308 def WriteGetCode(self, file):
3300 """Overridden from Argument.""" 3309 """Overridden from Argument."""
3301 file.Write(" %s %s;\n" % (self.type, self.name)) 3310 file.Write(" %s %s;\n" % (self.type, self.name))
3302 file.Write(" if (!id_map_.GetServiceId(c.%s, &%s)) {\n" % 3311 file.Write(" if (!id_manager_->GetServiceId(c.%s, &%s)) {\n" %
3303 (self.name, self.name)) 3312 (self.name, self.name))
3304 file.Write(" SetGLError(GL_INVALID_VALUE);\n") 3313 file.Write(" SetGLError(GL_INVALID_VALUE);\n")
3305 file.Write(" return parse_error::kParseNoError;\n") 3314 file.Write(" return parse_error::kParseNoError;\n")
3306 file.Write(" }\n") 3315 file.Write(" }\n")
3307 3316
3308 def GetValidArg(self, offset, index): 3317 def GetValidArg(self, offset, index):
3309 return "client_%s_id_" % self.resource_type.lower() 3318 return "client_%s_id_" % self.resource_type.lower()
3310 3319
3311 def GetValidGLArg(self, offset, index): 3320 def GetValidGLArg(self, offset, index):
3312 return "kService%sId" % self.resource_type 3321 return "kService%sId" % self.resource_type
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
3956 3965
3957 if options.generate_command_id_tests: 3966 if options.generate_command_id_tests:
3958 gen.WriteCommandIdTest("common/gles2_cmd_id_test_autogen.h") 3967 gen.WriteCommandIdTest("common/gles2_cmd_id_test_autogen.h")
3959 3968
3960 if gen.errors > 0: 3969 if gen.errors > 0:
3961 print "%d errors" % gen.errors 3970 print "%d errors" % gen.errors
3962 sys.exit(1) 3971 sys.exit(1)
3963 3972
3964 if __name__ == '__main__': 3973 if __name__ == '__main__':
3965 main(sys.argv[1:]) 3974 main(sys.argv[1:])
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698