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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1752703003: Fix transform feedback bugs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gpu_unittests Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 146791ccd59551da9e795c7aec485cd95f1a825b..41282f92e8389798f3510c66ad155d123ebca746 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -4537,6 +4537,34 @@ void GLES2DecoderImpl::DoBindBufferBase(GLenum target, GLuint index,
// TODO(kbr): track indexed bound buffers.
service_id = buffer->service_id();
}
+ switch (target) {
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
+ int max_transform_feedback_separate_attribs;
Zhenyao Mo 2016/03/09 17:12:42 init it to 0
qiankun 2016/03/10 01:05:30 Done.
+ DoGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,
+ &max_transform_feedback_separate_attribs);
+ if (index >=
+ static_cast<GLuint>(max_transform_feedback_separate_attribs)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
Zhenyao Mo 2016/03/09 17:12:42 INVALID_VALUE
qiankun 2016/03/10 01:05:30 Done.
+ "glBindBufferBase", "index out of range");
+ return;
+ }
+ break;
+ case GL_UNIFORM_BUFFER:
+ int max_uniform_buffer_bindings;
Zhenyao Mo 2016/03/09 17:12:42 init it to 0
qiankun 2016/03/10 01:05:30 Done.
+ DoGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS,
+ &max_uniform_buffer_bindings);
+ if (index >= static_cast<GLuint>(max_uniform_buffer_bindings)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
Zhenyao Mo 2016/03/09 17:12:42 INVALID_VALUE
qiankun 2016/03/10 01:05:30 Done.
+ "glBindBufferBase", "index out of range");
+ return;
+ }
+ break;
+ default:
+ LOCAL_SET_GL_ERROR_INVALID_ENUM(
+ "glBindBufferBase", target, "invalid target");
+ return;
+ }
+ state_.SetBoundBuffer(target, buffer);
glBindBufferBase(target, index, service_id);
}

Powered by Google App Engine
This is Rietveld 408576698