diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-19 15:21:51 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-19 15:21:51 +0000 |
commit | bf83584effe27d702e9ec5c82389b356ca87340d (patch) | |
tree | c75d6714ee479bbec6224d63db83a61e3bf9f9e4 /gpu | |
parent | 7b9f060ac59198fd6d2c242e3db3bf95c1d90db5 (diff) | |
download | chromium_src-bf83584effe27d702e9ec5c82389b356ca87340d.zip chromium_src-bf83584effe27d702e9ec5c82389b356ca87340d.tar.gz chromium_src-bf83584effe27d702e9ec5c82389b356ca87340d.tar.bz2 |
Needed to allow querying the current VAO binding
Note: This isn't enough to make them actually work
correctly with client side arrays. That still needs
some way to know what the currently bound
element array buffer is
BUG=160482
Review URL: https://chromiumcodereview.appspot.com/11416032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168529 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
5 files changed, 20 insertions, 0 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index 927764b..4ad9dbd 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -537,6 +537,8 @@ _ENUM_LISTS = { 'GL_UNPACK_FLIP_Y_CHROMIUM', 'GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM', 'GL_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM', + # we can add this because we emulate it if the driver does not support it. + 'GL_VERTEX_ARRAY_BINDING_OES', 'GL_VIEWPORT', ], 'invalid': [ diff --git a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h index 6a4bee0..e006a77 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h @@ -801,6 +801,7 @@ std::string GLES2Util::GetStringGLState(uint32 value) { "GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM" }, { GL_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, "GL_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM" }, + { GL_VERTEX_ARRAY_BINDING_OES, "GL_VERTEX_ARRAY_BINDING_OES" }, { GL_VIEWPORT, "GL_VIEWPORT" }, { GL_BLEND_COLOR, "GL_BLEND_COLOR" }, { GL_BLEND_EQUATION_RGB, "GL_BLEND_EQUATION_RGB" }, diff --git a/gpu/command_buffer/service/gl_utils.h b/gpu/command_buffer/service/gl_utils.h index a723031..bd3ca49 100644 --- a/gpu/command_buffer/service/gl_utils.h +++ b/gpu/command_buffer/service/gl_utils.h @@ -107,6 +107,9 @@ // GL_OES_compressed_ETC1_RGB8_texture #define GL_ETC1_RGB8_OES 0x8D64 +// GL_OES_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 + #define GL_GLEXT_PROTOTYPES 1 // GL_ARB_get_program_binary diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 2a59487..6f6fa31 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -3801,6 +3801,19 @@ bool GLES2DecoderImpl::GetHelper( } } return true; + case GL_VERTEX_ARRAY_BINDING_OES: + *num_written = 1; + if (params) { + if (state_.vertex_attrib_manager != default_vertex_attrib_manager_) { + GLuint client_id = 0; + vertex_array_manager_->GetClientId( + state_.vertex_attrib_manager->service_id(), &client_id); + *params = client_id; + } else { + *params = 0; + } + } + return true; case GL_TEXTURE_BINDING_2D: *num_written = 1; if (params) { diff --git a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h index 9f1dece..8029af4 100644 --- a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h @@ -166,6 +166,7 @@ static GLenum valid_g_l_state_table[] = { GL_UNPACK_FLIP_Y_CHROMIUM, GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, GL_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, + GL_VERTEX_ARRAY_BINDING_OES, GL_VIEWPORT, GL_BLEND_COLOR, GL_BLEND_EQUATION_RGB, |