Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 8264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8275 | 8275 |
| 8276 if (count == 0 || primcount == 0) { | 8276 if (count == 0 || primcount == 0) { |
| 8277 return error::kNoError; | 8277 return error::kNoError; |
| 8278 } | 8278 } |
| 8279 | 8279 |
| 8280 GLuint max_vertex_accessed; | 8280 GLuint max_vertex_accessed; |
| 8281 Buffer* element_array_buffer = | 8281 Buffer* element_array_buffer = |
| 8282 state_.vertex_attrib_manager->element_array_buffer(); | 8282 state_.vertex_attrib_manager->element_array_buffer(); |
| 8283 | 8283 |
| 8284 if (!element_array_buffer->GetMaxValueForRange( | 8284 if (!element_array_buffer->GetMaxValueForRange( |
| 8285 offset, count, type, &max_vertex_accessed)) { | 8285 offset, count, type, |
| 8286 state_.GetEnabled(GL_PRIMITIVE_RESTART_FIXED_INDEX), | |
|
piman
2016/03/19 00:56:11
nit: state_.enable_flags.primitive_restart_fixed_i
Ken Russell (switch to Gerrit)
2016/03/19 04:06:53
Done here and below.
| |
| 8287 &max_vertex_accessed)) { | |
| 8286 LOCAL_SET_GL_ERROR( | 8288 LOCAL_SET_GL_ERROR( |
| 8287 GL_INVALID_OPERATION, function_name, "range out of bounds for buffer"); | 8289 GL_INVALID_OPERATION, function_name, "range out of bounds for buffer"); |
| 8288 return error::kNoError; | 8290 return error::kNoError; |
| 8289 } | 8291 } |
| 8290 | 8292 |
| 8291 if (IsDrawValid(function_name, max_vertex_accessed, instanced, primcount)) { | 8293 if (IsDrawValid(function_name, max_vertex_accessed, instanced, primcount)) { |
| 8292 if (!ClearUnclearedTextures()) { | 8294 if (!ClearUnclearedTextures()) { |
| 8293 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "out of memory"); | 8295 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "out of memory"); |
| 8294 return error::kNoError; | 8296 return error::kNoError; |
| 8295 } | 8297 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8373 GLuint GLES2DecoderImpl::DoGetMaxValueInBufferCHROMIUM( | 8375 GLuint GLES2DecoderImpl::DoGetMaxValueInBufferCHROMIUM( |
| 8374 GLuint buffer_id, GLsizei count, GLenum type, GLuint offset) { | 8376 GLuint buffer_id, GLsizei count, GLenum type, GLuint offset) { |
| 8375 GLuint max_vertex_accessed = 0; | 8377 GLuint max_vertex_accessed = 0; |
| 8376 Buffer* buffer = GetBuffer(buffer_id); | 8378 Buffer* buffer = GetBuffer(buffer_id); |
| 8377 if (!buffer) { | 8379 if (!buffer) { |
| 8378 // TODO(gman): Should this be a GL error or a command buffer error? | 8380 // TODO(gman): Should this be a GL error or a command buffer error? |
| 8379 LOCAL_SET_GL_ERROR( | 8381 LOCAL_SET_GL_ERROR( |
| 8380 GL_INVALID_VALUE, "GetMaxValueInBufferCHROMIUM", "unknown buffer"); | 8382 GL_INVALID_VALUE, "GetMaxValueInBufferCHROMIUM", "unknown buffer"); |
| 8381 } else { | 8383 } else { |
| 8382 if (!buffer->GetMaxValueForRange( | 8384 if (!buffer->GetMaxValueForRange( |
| 8383 offset, count, type, &max_vertex_accessed)) { | 8385 offset, count, type, |
| 8386 state_.GetEnabled(GL_PRIMITIVE_RESTART_FIXED_INDEX), | |
|
piman
2016/03/19 00:56:11
This is used by the client side, for client-side b
Ken Russell (switch to Gerrit)
2016/03/19 04:06:53
Added a comment about how this value is used and w
| |
| 8387 &max_vertex_accessed)) { | |
| 8384 // TODO(gman): Should this be a GL error or a command buffer error? | 8388 // TODO(gman): Should this be a GL error or a command buffer error? |
| 8385 LOCAL_SET_GL_ERROR( | 8389 LOCAL_SET_GL_ERROR( |
| 8386 GL_INVALID_OPERATION, | 8390 GL_INVALID_OPERATION, |
| 8387 "GetMaxValueInBufferCHROMIUM", "range out of bounds for buffer"); | 8391 "GetMaxValueInBufferCHROMIUM", "range out of bounds for buffer"); |
| 8388 } | 8392 } |
| 8389 } | 8393 } |
| 8390 return max_vertex_accessed; | 8394 return max_vertex_accessed; |
| 8391 } | 8395 } |
| 8392 | 8396 |
| 8393 void GLES2DecoderImpl::DoShaderSource( | 8397 void GLES2DecoderImpl::DoShaderSource( |
| (...skipping 7857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 16251 } | 16255 } |
| 16252 | 16256 |
| 16253 // Include the auto-generated part of this file. We split this because it means | 16257 // Include the auto-generated part of this file. We split this because it means |
| 16254 // we can easily edit the non-auto generated parts right here in this file | 16258 // we can easily edit the non-auto generated parts right here in this file |
| 16255 // instead of having to edit some template or the code generator. | 16259 // instead of having to edit some template or the code generator. |
| 16256 #include "base/macros.h" | 16260 #include "base/macros.h" |
| 16257 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 16261 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 16258 | 16262 |
| 16259 } // namespace gles2 | 16263 } // namespace gles2 |
| 16260 } // namespace gpu | 16264 } // namespace gpu |
| OLD | NEW |