OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """code generator for GLES2 command buffers.""" | 6 """code generator for GLES2 command buffers.""" |
7 | 7 |
8 import itertools | 8 import itertools |
9 import os | 9 import os |
10 import os.path | 10 import os.path |
(...skipping 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2189 'resource_type': 'VertexArray', | 2189 'resource_type': 'VertexArray', |
2190 'resource_types': 'VertexArrays', | 2190 'resource_types': 'VertexArrays', |
2191 'unit_test': False, | 2191 'unit_test': False, |
2192 }, | 2192 }, |
2193 'BindVertexArrayOES': { | 2193 'BindVertexArrayOES': { |
2194 'type': 'Bind', | 2194 'type': 'Bind', |
2195 'gl_test_func': 'glBindVertexArrayOES', | 2195 'gl_test_func': 'glBindVertexArrayOES', |
2196 'decoder_func': 'DoBindVertexArrayOES', | 2196 'decoder_func': 'DoBindVertexArrayOES', |
2197 'gen_func': 'GenVertexArraysOES', | 2197 'gen_func': 'GenVertexArraysOES', |
2198 'unit_test': False, | 2198 'unit_test': False, |
| 2199 'client_test': False, |
2199 }, | 2200 }, |
2200 'DeleteVertexArraysOES': { | 2201 'DeleteVertexArraysOES': { |
2201 'type': 'DELn', | 2202 'type': 'DELn', |
2202 'gl_test_func': 'glDeleteVertexArraysOES', | 2203 'gl_test_func': 'glDeleteVertexArraysOES', |
2203 'resource_type': 'VertexArray', | 2204 'resource_type': 'VertexArray', |
2204 'resource_types': 'VertexArrays', | 2205 'resource_types': 'VertexArrays', |
2205 'unit_test': False, | 2206 'unit_test': False, |
2206 }, | 2207 }, |
2207 'IsVertexArrayOES': { | 2208 'IsVertexArrayOES': { |
2208 'type': 'Is', | 2209 'type': 'Is', |
(...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3576 file.Write( | 3577 file.Write( |
3577 "%(return_type)s GLES2Implementation::%(name)s(%(typed_args)s) {\n" % | 3578 "%(return_type)s GLES2Implementation::%(name)s(%(typed_args)s) {\n" % |
3578 args) | 3579 args) |
3579 func.WriteDestinationInitalizationValidation(file) | 3580 func.WriteDestinationInitalizationValidation(file) |
3580 self.WriteClientGLCallLog(func, file) | 3581 self.WriteClientGLCallLog(func, file) |
3581 for arg in func.GetOriginalArgs(): | 3582 for arg in func.GetOriginalArgs(): |
3582 arg.WriteClientSideValidationCode(file, func) | 3583 arg.WriteClientSideValidationCode(file, func) |
3583 code = """ GPU_CLIENT_SINGLE_THREAD_CHECK(); | 3584 code = """ GPU_CLIENT_SINGLE_THREAD_CHECK(); |
3584 GetIdHandler(id_namespaces::k%(resource_types)s)-> | 3585 GetIdHandler(id_namespaces::k%(resource_types)s)-> |
3585 MakeIds(this, 0, %(args)s); | 3586 MakeIds(this, 0, %(args)s); |
| 3587 %(name)sHelper(%(args)s); |
3586 helper_->%(name)sImmediate(%(args)s); | 3588 helper_->%(name)sImmediate(%(args)s); |
3587 helper_->CommandBufferHelper::Flush(); | 3589 helper_->CommandBufferHelper::Flush(); |
3588 %(log_code)s | 3590 %(log_code)s |
3589 } | 3591 } |
3590 | 3592 |
3591 """ | 3593 """ |
3592 file.Write(code % args) | 3594 file.Write(code % args) |
3593 | 3595 |
3594 def WriteGLES2ImplementationUnitTest(self, func, file): | 3596 def WriteGLES2ImplementationUnitTest(self, func, file): |
3595 """Overrriden from TypeHandler.""" | 3597 """Overrriden from TypeHandler.""" |
(...skipping 3829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7425 gen.WriteGLES2Header("../../third_party/khronos/GLES2/gl2chromium.h") | 7427 gen.WriteGLES2Header("../../third_party/khronos/GLES2/gl2chromium.h") |
7426 | 7428 |
7427 if gen.errors > 0: | 7429 if gen.errors > 0: |
7428 print "%d errors" % gen.errors | 7430 print "%d errors" % gen.errors |
7429 return 1 | 7431 return 1 |
7430 return 0 | 7432 return 0 |
7431 | 7433 |
7432 | 7434 |
7433 if __name__ == '__main__': | 7435 if __name__ == '__main__': |
7434 sys.exit(main(sys.argv[1:])) | 7436 sys.exit(main(sys.argv[1:])) |
OLD | NEW |