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

Issue 661220: Added support for glGetString, glGetShaderSource,... (Closed)

Created:
10 years, 10 months ago by greggman
Modified:
9 years, 7 months ago
Reviewers:
apatrick_chromium
CC:
chromium-reviews, Paweł Hajdan Jr.
Visibility:
Public.

Description

Added support for glGetString, glGetShaderSource, glGetProgramInfoLog and glGetShaderInfoLog This turned up lots of issues. * glGetShaderiv needed to be wrapped so it returns the size of the shader the user passed in. Not the munged shader sent to GL. * Another issue that came up is that client side validation is needed to ensure that the client side GLES2Implementation does not generate bad commands. For example, calling glUniform1iv with a negative count would generate a bad command. The service side would see that and think the program was malicious and stop processing commands. So, that means I had to add some client side validation and wrap glGetError on the client side so I can synthisize GL errors there. TEST=lots of unit tests. BUG=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=40193

Patch Set 1 #

Total comments: 5

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+747 lines, -559 lines) Patch
M gpu/command_buffer/build_gles2_cmd_buffer.py View 1 23 chunks +207 lines, -72 lines 0 comments Download
M gpu/command_buffer/client/gles2_cmd_helper_autogen.h View 1 3 chunks +8 lines, -23 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation.h View 1 4 chunks +19 lines, -4 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation.cc View 1 16 chunks +133 lines, -26 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation_autogen.h View 1 10 chunks +115 lines, -21 lines 0 comments Download
M gpu/command_buffer/common/GLES2/gl2types.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_format.h View 1 4 chunks +8 lines, -0 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_format_autogen.h View 1 12 chunks +52 lines, -107 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_format_test_autogen.h View 1 3 chunks +9 lines, -31 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_utils.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_utils.cc View 1 2 chunks +46 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/common_decoder.h View 1 2 chunks +3 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/common_decoder.cc View 1 2 chunks +5 lines, -3 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.cc View 1 7 chunks +32 lines, -52 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_autogen.h View 1 4 chunks +22 lines, -75 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc View 1 4 chunks +14 lines, -13 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h View 1 3 chunks +63 lines, -11 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h View 1 16 chunks +6 lines, -119 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
greggman
10 years, 10 months ago (2010-02-26 23:41:54 UTC) #1
apatrick_chromium
10 years, 10 months ago (2010-02-27 00:21:34 UTC) #2
lgtm

http://codereview.chromium.org/661220/diff/1/19
File gpu/command_buffer/build_gles2_cmd_buffer.py (right):

http://codereview.chromium.org/661220/diff/1/19#newcode1396
gpu/command_buffer/build_gles2_cmd_buffer.py:1396: test =
self._remove_expected_call_re.sub('', test)
How about not generating the expected calls in the first place?

http://codereview.chromium.org/661220/diff/1/16
File gpu/command_buffer/client/gles2_implementation.cc (right):

http://codereview.chromium.org/661220/diff/1/16#newcode375
gpu/command_buffer/client/gles2_implementation.cc:375: if (level < 0 || height <
0 || width < 0) {
Random thought... If we're at all concerned about performance, we could do this:
((level | height | width) < 0). Just thought I'd mention it while I remember.

http://codereview.chromium.org/661220/diff/1/11
File gpu/command_buffer/common/gles2_cmd_utils.cc (right):

http://codereview.chromium.org/661220/diff/1/11#newcode404
gpu/command_buffer/common/gles2_cmd_utils.cc:404: uint32
GLES2Util::GLErrorToErrorBit(uint32 error) {
These GL error constants are all in the range 0x500 to 0x506. You could just
do:
uint32 bit = error - GL_INVALID_ENUM;
DCHECK(bit < 32);
return bit;

http://codereview.chromium.org/661220/diff/1/12
File gpu/command_buffer/common/gles2_cmd_utils.h (right):

http://codereview.chromium.org/661220/diff/1/12#newcode17
gpu/command_buffer/common/gles2_cmd_utils.h:17: namespace GLErrorBit {
lower case / underscores for namespaces?

http://codereview.chromium.org/661220/diff/1/8
File gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h (right):

http://codereview.chromium.org/661220/diff/1/8#newcode1122
gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h:1122:
kServiceProgramId, GL_INFO_LOG_LENGTH, _))    .WillOnce(
This is in a funny place.

Powered by Google App Engine
This is Rietveld 408576698