summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/client/gles2_implementation.cc
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-22 05:17:15 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-22 05:17:15 +0000
commit1958e0ef0fe59e392cab9bb351401beeb64e8379 (patch)
tree2dab1d4b2cdbbb50c1c6263b85430988d0ebecdb /gpu/command_buffer/client/gles2_implementation.cc
parent9040ad23a3950685b08523d12305d9afcbbc7551 (diff)
downloadchromium_src-1958e0ef0fe59e392cab9bb351401beeb64e8379.zip
chromium_src-1958e0ef0fe59e392cab9bb351401beeb64e8379.tar.gz
chromium_src-1958e0ef0fe59e392cab9bb351401beeb64e8379.tar.bz2
A bunch more GLES2 conformance test fixes.
1) All the glIsXXX functions were wrong 2) unlike buffers, renderbuffers, framebuffers, etc texture 0 is valid. 3) UseProgram accepts 0. 4) make glShaderSource fail if passed a NULL pointer (the spec doesn't say this afaict) TEST=conformance tests BUG=none Review URL: http://codereview.chromium.org/1750005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45293 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/client/gles2_implementation.cc')
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 39b55d0..583b0d5 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -690,6 +690,11 @@ void GLES2Implementation::ShaderSource(
// Compute the total size.
uint32 total_size = 1;
for (GLsizei ii = 0; ii < count; ++ii) {
+ // I shouldn't have to check for this. The spec doesn't allow this
+ if (!source[ii]) {
+ SetGLError(GL_INVALID_VALUE);
+ return;
+ }
total_size += (length && length[ii] >= 0) ? length[ii] : strlen(source[ii]);
}
@@ -699,6 +704,7 @@ void GLES2Implementation::ShaderSource(
uint32 offset = 0;
for (GLsizei ii = 0; ii <= count; ++ii) {
const char* src = ii < count ? source[ii] : "";
+
uint32 size = ii < count ? (length ? length[ii] : strlen(src)) : 1;
while (size) {
uint32 part_size = std::min(size, max_size);