summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-21 19:07:28 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-21 19:07:28 +0000
commit037896bd6c0f953d16b89ceba70d55d58b8b2a92 (patch)
tree4591892b95de830a92660b15d6e488c3f6f72568 /gpu
parent1410abe16939cfe1da825444216e01518041742f (diff)
downloadchromium_src-037896bd6c0f953d16b89ceba70d55d58b8b2a92.zip
chromium_src-037896bd6c0f953d16b89ceba70d55d58b8b2a92.tar.gz
chromium_src-037896bd6c0f953d16b89ceba70d55d58b8b2a92.tar.bz2
A few fixes for GLES2 for the conformance tests.
TEST=conformance tests BUG=none Review URL: http://codereview.chromium.org/1719003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45215 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc20
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc5
2 files changed, 20 insertions, 5 deletions
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 5eff5df..39b55d0 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -682,7 +682,7 @@ void GLES2Implementation::VertexAttribPointer(
void GLES2Implementation::ShaderSource(
GLuint shader, GLsizei count, const char** source, const GLint* length) {
- if (count < 0) {
+ if (count < 0 || shader == 0) {
SetGLError(GL_INVALID_VALUE);
return;
}
@@ -690,7 +690,7 @@ void GLES2Implementation::ShaderSource(
// Compute the total size.
uint32 total_size = 1;
for (GLsizei ii = 0; ii < count; ++ii) {
- total_size += length ? length[ii] : strlen(source[ii]);
+ total_size += (length && length[ii] >= 0) ? length[ii] : strlen(source[ii]);
}
// Concatenate all the strings in to a bucket on the service.
@@ -765,6 +765,9 @@ void GLES2Implementation::CompressedTexImage2D(
SetGLError(GL_INVALID_VALUE);
return;
}
+ if (height == 0 || width == 0) {
+ return;
+ }
// TODO(gman): Switch to use buckets always or at least if no room in shared
// memory.
DCHECK_LE(image_size,
@@ -826,6 +829,9 @@ void GLES2Implementation::TexSubImage2D(
SetGLError(GL_INVALID_VALUE);
return;
}
+ if (height == 0 || width == 0) {
+ return;
+ }
const int8* source = static_cast<const int8*>(pixels);
GLsizeiptr max_size = transfer_buffer_.GetLargestFreeOrPendingSize();
uint32 temp_size;
@@ -980,6 +986,7 @@ void GLES2Implementation::GetAttachedShaders(
typedef gles2::GetAttachedShaders::Result Result;
uint32 size = Result::ComputeSize(maxcount);
Result* result = transfer_buffer_.AllocTyped<Result>(size);
+ result->SetNumResults(0);
helper_->GetAttachedShaders(
program,
transfer_buffer_id_,
@@ -998,6 +1005,7 @@ void GLES2Implementation::GetShaderPrecisionFormat(
GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
typedef gles2::GetShaderPrecisionFormat::Result Result;
Result* result = static_cast<Result*>(result_buffer_);
+ result->success = false;
helper_->GetShaderPrecisionFormat(
shadertype, precisiontype, result_shm_id(), result_shm_offset());
WaitForCmd();
@@ -1036,14 +1044,20 @@ const GLubyte* GLES2Implementation::GetString(GLenum name) {
void GLES2Implementation::GetUniformfv(
GLuint program, GLint location, GLfloat* params) {
+ typedef gles2::GetUniformfv::Result Result;
+ Result* result = static_cast<Result*>(result_buffer_);
+ result->SetNumResults(0);
helper_->GetUniformfv(
program, location, result_shm_id(), result_shm_offset());
WaitForCmd();
- static_cast<gles2::GetUniformfv::Result*>(result_buffer_)->CopyResult(params);
+ result->CopyResult(params);
}
void GLES2Implementation::GetUniformiv(
GLuint program, GLint location, GLint* params) {
+ typedef gles2::GetUniformiv::Result Result;
+ Result* result = static_cast<Result*>(result_buffer_);
+ result->SetNumResults(0);
helper_->GetUniformiv(
program, location, result_shm_id(), result_shm_offset());
WaitForCmd();
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 3cc59e6..13654c1 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2886,12 +2886,12 @@ void GLES2DecoderImpl::DoBufferData(
}
if (size < 0) {
SetGLError(GL_INVALID_VALUE);
- DoBufferData(target, size, data, usage);
+ return;
}
BufferManager::BufferInfo* info = GetBufferInfoForTarget(target);
if (!info) {
SetGLError(GL_INVALID_OPERATION);
- DoBufferData(target, size, data, usage);
+ return;
}
// Clear the buffer to 0 if no initial data was passed in.
scoped_array<int8> zero;
@@ -2948,6 +2948,7 @@ void GLES2DecoderImpl::DoBufferSubData(
BufferManager::BufferInfo* info = GetBufferInfoForTarget(target);
if (!info) {
SetGLError(GL_INVALID_OPERATION);
+ return;
}
if (!info->SetRange(offset, size, data)) {
SetGLError(GL_INVALID_VALUE);