summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/gles2_cmd_decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer/service/gles2_cmd_decoder.cc')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 706407a..3d8b0af 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -679,6 +679,10 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
// Wrapper for DoGetIntegerv.
void DoGetIntegerv(GLenum pname, GLint* params);
+ // Gets the max value in a range in a buffer.
+ GLuint DoGetMaxValueInBuffer(
+ GLuint buffer_id, GLsizei count, GLenum type, GLuint offset);
+
// Wrapper for glRenderbufferParameteriv.
void DoGetRenderbufferParameteriv(
GLenum target, GLenum pname, GLint* params);
@@ -2354,6 +2358,20 @@ error::Error GLES2DecoderImpl::HandleDrawElements(
return error::kNoError;
}
+GLuint GLES2DecoderImpl::DoGetMaxValueInBuffer(
+ GLuint buffer_id, GLsizei count, GLenum type, GLuint offset) {
+ GLuint max_vertex_accessed = 0;
+ BufferManager::BufferInfo* info = GetBufferInfo(buffer_id);
+ if (info->target() != GL_ELEMENT_ARRAY_BUFFER) {
+ SetGLError(GL_INVALID_OPERATION);
+ } else {
+ if (!info->GetMaxValueForRange(offset, count, type, &max_vertex_accessed)) {
+ SetGLError(GL_INVALID_OPERATION);
+ }
+ }
+ return max_vertex_accessed;
+}
+
// Calls glShaderSource for the various versions of the ShaderSource command.
// Assumes that data / data_size points to a piece of memory that is in range
// of whatever context it came from (shared memory, immediate memory, bucket