| 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 4519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4530 glGenBuffersARB(1, &service_id); | 4530 glGenBuffersARB(1, &service_id); |
| 4531 CreateBuffer(client_id, service_id); | 4531 CreateBuffer(client_id, service_id); |
| 4532 buffer = GetBuffer(client_id); | 4532 buffer = GetBuffer(client_id); |
| 4533 } | 4533 } |
| 4534 } | 4534 } |
| 4535 LogClientServiceForInfo(buffer, client_id, "glBindBufferBase"); | 4535 LogClientServiceForInfo(buffer, client_id, "glBindBufferBase"); |
| 4536 if (buffer) { | 4536 if (buffer) { |
| 4537 // TODO(kbr): track indexed bound buffers. | 4537 // TODO(kbr): track indexed bound buffers. |
| 4538 service_id = buffer->service_id(); | 4538 service_id = buffer->service_id(); |
| 4539 } | 4539 } |
| 4540 switch (target) { |
| 4541 case GL_TRANSFORM_FEEDBACK_BUFFER: { |
| 4542 GLint max_transform_feedback_separate_attribs = 0; |
| 4543 DoGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, |
| 4544 &max_transform_feedback_separate_attribs); |
| 4545 if (index >= |
| 4546 static_cast<GLuint>(max_transform_feedback_separate_attribs)) { |
| 4547 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, |
| 4548 "glBindBufferBase", "index out of range"); |
| 4549 return; |
| 4550 } |
| 4551 break; |
| 4552 } |
| 4553 case GL_UNIFORM_BUFFER: { |
| 4554 GLint max_uniform_buffer_bindings = 0; |
| 4555 DoGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, |
| 4556 &max_uniform_buffer_bindings); |
| 4557 if (index >= static_cast<GLuint>(max_uniform_buffer_bindings)) { |
| 4558 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, |
| 4559 "glBindBufferBase", "index out of range"); |
| 4560 return; |
| 4561 } |
| 4562 break; |
| 4563 } |
| 4564 default: |
| 4565 LOCAL_SET_GL_ERROR_INVALID_ENUM( |
| 4566 "glBindBufferBase", target, "invalid target"); |
| 4567 return; |
| 4568 } |
| 4569 state_.SetBoundBuffer(target, buffer); |
| 4540 glBindBufferBase(target, index, service_id); | 4570 glBindBufferBase(target, index, service_id); |
| 4541 } | 4571 } |
| 4542 | 4572 |
| 4543 void GLES2DecoderImpl::DoBindBufferRange(GLenum target, GLuint index, | 4573 void GLES2DecoderImpl::DoBindBufferRange(GLenum target, GLuint index, |
| 4544 GLuint client_id, | 4574 GLuint client_id, |
| 4545 GLintptr offset, | 4575 GLintptr offset, |
| 4546 GLsizeiptr size) { | 4576 GLsizeiptr size) { |
| 4547 Buffer* buffer = NULL; | 4577 Buffer* buffer = NULL; |
| 4548 GLuint service_id = 0; | 4578 GLuint service_id = 0; |
| 4549 if (client_id != 0) { | 4579 if (client_id != 0) { |
| (...skipping 11197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15747 } | 15777 } |
| 15748 | 15778 |
| 15749 // Include the auto-generated part of this file. We split this because it means | 15779 // Include the auto-generated part of this file. We split this because it means |
| 15750 // we can easily edit the non-auto generated parts right here in this file | 15780 // we can easily edit the non-auto generated parts right here in this file |
| 15751 // instead of having to edit some template or the code generator. | 15781 // instead of having to edit some template or the code generator. |
| 15752 #include "base/macros.h" | 15782 #include "base/macros.h" |
| 15753 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 15783 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 15754 | 15784 |
| 15755 } // namespace gles2 | 15785 } // namespace gles2 |
| 15756 } // namespace gpu | 15786 } // namespace gpu |
| OLD | NEW |