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

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 error msg 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..4391dda7f6d581ec6c277d958dc49962a211d99a 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -4537,6 +4537,36 @@ 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: {
+ GLint max_transform_feedback_separate_attribs = 0;
+ 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_VALUE,
+ "glBindBufferBase", "index out of range");
+ return;
+ }
+ break;
+ }
+ case GL_UNIFORM_BUFFER: {
+ GLint max_uniform_buffer_bindings = 0;
+ 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_VALUE,
+ "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);
}
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698