diff options
author | zmo <zmo@chromium.org> | 2015-05-14 12:13:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-14 19:14:10 +0000 |
commit | 5ee097e78c8c254607c02ee7614bba0abe41d956 (patch) | |
tree | 2eb60bf5914c1eb0bda2191d523afbc75349fee3 /gpu/command_buffer/service/gles2_cmd_decoder_autogen.h | |
parent | 55c68a9a9aecbdc22fd06a99aa93b98881405d88 (diff) | |
download | chromium_src-5ee097e78c8c254607c02ee7614bba0abe41d956.zip chromium_src-5ee097e78c8c254607c02ee7614bba0abe41d956.tar.gz chromium_src-5ee097e78c8c254607c02ee7614bba0abe41d956.tar.bz2 |
Add ES3 commands GetVertexAttribI{u}iv to GPU command buffer.
BUG=429053
TEST=gpu_unittests
R=piman@chromium.org
Review URL: https://codereview.chromium.org/1136713003
Cr-Commit-Position: refs/heads/master@{#329892}
Diffstat (limited to 'gpu/command_buffer/service/gles2_cmd_decoder_autogen.h')
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_autogen.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h index 27a7f41..c68b8a5 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h @@ -2070,6 +2070,74 @@ error::Error GLES2DecoderImpl::HandleGetVertexAttribiv( return error::kNoError; } +error::Error GLES2DecoderImpl::HandleGetVertexAttribIiv( + uint32_t immediate_data_size, + const void* cmd_data) { + if (!unsafe_es3_apis_enabled()) + return error::kUnknownCommand; + const gles2::cmds::GetVertexAttribIiv& c = + *static_cast<const gles2::cmds::GetVertexAttribIiv*>(cmd_data); + (void)c; + GLuint index = static_cast<GLuint>(c.index); + GLenum pname = static_cast<GLenum>(c.pname); + typedef cmds::GetVertexAttribIiv::Result Result; + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); + Result* result = GetSharedMemoryAs<Result*>( + c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); + GLint* params = result ? result->GetData() : NULL; + if (params == NULL) { + return error::kOutOfBounds; + } + LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetVertexAttribIiv"); + // Check that the client initialized the result. + if (result->size != 0) { + return error::kInvalidArguments; + } + DoGetVertexAttribIiv(index, pname, params); + GLenum error = glGetError(); + if (error == GL_NO_ERROR) { + result->SetNumResults(num_values); + } else { + LOCAL_SET_GL_ERROR(error, "GetVertexAttribIiv", ""); + } + return error::kNoError; +} + +error::Error GLES2DecoderImpl::HandleGetVertexAttribIuiv( + uint32_t immediate_data_size, + const void* cmd_data) { + if (!unsafe_es3_apis_enabled()) + return error::kUnknownCommand; + const gles2::cmds::GetVertexAttribIuiv& c = + *static_cast<const gles2::cmds::GetVertexAttribIuiv*>(cmd_data); + (void)c; + GLuint index = static_cast<GLuint>(c.index); + GLenum pname = static_cast<GLenum>(c.pname); + typedef cmds::GetVertexAttribIuiv::Result Result; + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); + Result* result = GetSharedMemoryAs<Result*>( + c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); + GLuint* params = result ? result->GetData() : NULL; + if (params == NULL) { + return error::kOutOfBounds; + } + LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetVertexAttribIuiv"); + // Check that the client initialized the result. + if (result->size != 0) { + return error::kInvalidArguments; + } + DoGetVertexAttribIuiv(index, pname, params); + GLenum error = glGetError(); + if (error == GL_NO_ERROR) { + result->SetNumResults(num_values); + } else { + LOCAL_SET_GL_ERROR(error, "GetVertexAttribIuiv", ""); + } + return error::kNoError; +} + error::Error GLES2DecoderImpl::HandleHint(uint32_t immediate_data_size, const void* cmd_data) { const gles2::cmds::Hint& c = *static_cast<const gles2::cmds::Hint*>(cmd_data); |