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

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

Issue 1165553003: Fine tuning glGetInternalformativ. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_cmd_helper_autogen.h » ('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/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 2707 matching lines...) Expand 10 before | Expand all | Expand 10 after
2718 'client_test': False, 2718 'client_test': False,
2719 'unsafe': True 2719 'unsafe': True
2720 }, 2720 },
2721 'GetIntegeri_v': { 2721 'GetIntegeri_v': {
2722 'type': 'GETn', 2722 'type': 'GETn',
2723 'result': ['SizedResult<GLint>'], 2723 'result': ['SizedResult<GLint>'],
2724 'client_test': False, 2724 'client_test': False,
2725 'unsafe': True 2725 'unsafe': True
2726 }, 2726 },
2727 'GetInternalformativ': { 2727 'GetInternalformativ': {
2728 'type': 'GETn', 2728 'type': 'Custom',
2729 'data_transfer_methods': ['shm'],
2729 'result': ['SizedResult<GLint>'], 2730 'result': ['SizedResult<GLint>'],
2731 'cmd_args':
2732 'GLenumRenderBufferTarget target, GLenumRenderBufferFormat format, '
2733 'GLenumInternalFormatParameter pname, GLint* params',
2730 'unsafe': True, 2734 'unsafe': True,
2731 }, 2735 },
2732 'GetMaxValueInBufferCHROMIUM': { 2736 'GetMaxValueInBufferCHROMIUM': {
2733 'type': 'Is', 2737 'type': 'Is',
2734 'decoder_func': 'DoGetMaxValueInBufferCHROMIUM', 2738 'decoder_func': 'DoGetMaxValueInBufferCHROMIUM',
2735 'result': ['GLuint'], 2739 'result': ['GLuint'],
2736 'unit_test': False, 2740 'unit_test': False,
2737 'client_test': False, 2741 'client_test': False,
2738 'extension': True, 2742 'extension': True,
2739 'chromium': True, 2743 'chromium': True,
(...skipping 3629 matching lines...) Expand 10 before | Expand all | Expand 10 after
6369 if not shadowed: 6373 if not shadowed:
6370 file.Write(' LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("%s");\n' % func.name) 6374 file.Write(' LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("%s");\n' % func.name)
6371 file.Write(code) 6375 file.Write(code)
6372 func.WriteHandlerImplementation(file) 6376 func.WriteHandlerImplementation(file)
6373 if shadowed: 6377 if shadowed:
6374 code = """ result->SetNumResults(num_values); 6378 code = """ result->SetNumResults(num_values);
6375 return error::kNoError; 6379 return error::kNoError;
6376 } 6380 }
6377 """ 6381 """
6378 else: 6382 else:
6379 code = """ GLenum error = glGetError(); 6383 code = """ GLenum error = LOCAL_PEEK_GL_ERROR("%(func_name)s");
6380 if (error == GL_NO_ERROR) { 6384 if (error == GL_NO_ERROR) {
6381 result->SetNumResults(num_values); 6385 result->SetNumResults(num_values);
6382 } else {
6383 LOCAL_SET_GL_ERROR(error, "%(func_name)s", "");
6384 } 6386 }
6385 return error::kNoError; 6387 return error::kNoError;
6386 } 6388 }
6387 6389
6388 """ 6390 """
6389 file.Write(code % {'func_name': func.name}) 6391 file.Write(code % {'func_name': func.name})
6390 6392
6391 def WriteGLES2Implementation(self, func, file): 6393 def WriteGLES2Implementation(self, func, file):
6392 """Overrriden from TypeHandler.""" 6394 """Overrriden from TypeHandler."""
6393 impl_decl = func.GetInfo('impl_decl') 6395 impl_decl = func.GetInfo('impl_decl')
(...skipping 4677 matching lines...) Expand 10 before | Expand all | Expand 10 after
11071 Format(gen.generated_cpp_filenames) 11073 Format(gen.generated_cpp_filenames)
11072 11074
11073 if gen.errors > 0: 11075 if gen.errors > 0:
11074 print "%d errors" % gen.errors 11076 print "%d errors" % gen.errors
11075 return 1 11077 return 1
11076 return 0 11078 return 0
11077 11079
11078 11080
11079 if __name__ == '__main__': 11081 if __name__ == '__main__':
11080 sys.exit(main(sys.argv[1:])) 11082 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_cmd_helper_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698