| 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 // A class to emulate GLES2 over command buffers. | 5 // A class to emulate GLES2 over command buffers. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 8 | 8 |
| 9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
| 10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
| (...skipping 3802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3813 void GLES2Implementation::BindBufferStub(GLenum target, GLuint buffer) { | 3813 void GLES2Implementation::BindBufferStub(GLenum target, GLuint buffer) { |
| 3814 helper_->BindBuffer(target, buffer); | 3814 helper_->BindBuffer(target, buffer); |
| 3815 if (share_group_->bind_generates_resource()) | 3815 if (share_group_->bind_generates_resource()) |
| 3816 helper_->CommandBufferHelper::OrderingBarrier(); | 3816 helper_->CommandBufferHelper::OrderingBarrier(); |
| 3817 } | 3817 } |
| 3818 | 3818 |
| 3819 void GLES2Implementation::BindBufferBaseHelper( | 3819 void GLES2Implementation::BindBufferBaseHelper( |
| 3820 GLenum target, GLuint index, GLuint buffer_id) { | 3820 GLenum target, GLuint index, GLuint buffer_id) { |
| 3821 // TODO(zmo): See note #1 above. | 3821 // TODO(zmo): See note #1 above. |
| 3822 // TODO(zmo): See note #2 above. | 3822 // TODO(zmo): See note #2 above. |
| 3823 switch (target) { |
| 3824 case GL_TRANSFORM_FEEDBACK_BUFFER: |
| 3825 if (index >= |
| 3826 static_cast<GLuint>( |
| 3827 capabilities_.max_transform_feedback_separate_attribs)) { |
| 3828 SetGLError(GL_INVALID_VALUE, |
| 3829 "glBindBufferBase", "index out of range"); |
| 3830 return; |
| 3831 } |
| 3832 if (bound_transform_feedback_buffer_ != buffer_id) { |
| 3833 bound_transform_feedback_buffer_ = buffer_id; |
| 3834 } |
| 3835 break; |
| 3836 case GL_UNIFORM_BUFFER: |
| 3837 if (index >= |
| 3838 static_cast<GLuint>(capabilities_.max_uniform_buffer_bindings)) { |
| 3839 SetGLError(GL_INVALID_VALUE, |
| 3840 "glBindBufferBase", "index out of range"); |
| 3841 return; |
| 3842 } |
| 3843 if (bound_uniform_buffer_ != buffer_id) { |
| 3844 bound_uniform_buffer_ = buffer_id; |
| 3845 } |
| 3846 break; |
| 3847 default: |
| 3848 SetGLError(GL_INVALID_ENUM, "glBindBufferBase", "invalid target"); |
| 3849 return; |
| 3850 } |
| 3823 GetIdHandler(id_namespaces::kBuffers)->MarkAsUsedForBind( | 3851 GetIdHandler(id_namespaces::kBuffers)->MarkAsUsedForBind( |
| 3824 this, target, index, buffer_id, &GLES2Implementation::BindBufferBaseStub); | 3852 this, target, index, buffer_id, &GLES2Implementation::BindBufferBaseStub); |
| 3825 } | 3853 } |
| 3826 | 3854 |
| 3827 void GLES2Implementation::BindBufferBaseStub( | 3855 void GLES2Implementation::BindBufferBaseStub( |
| 3828 GLenum target, GLuint index, GLuint buffer) { | 3856 GLenum target, GLuint index, GLuint buffer) { |
| 3829 helper_->BindBufferBase(target, index, buffer); | 3857 helper_->BindBufferBase(target, index, buffer); |
| 3830 if (share_group_->bind_generates_resource()) | 3858 if (share_group_->bind_generates_resource()) |
| 3831 helper_->CommandBufferHelper::Flush(); | 3859 helper_->CommandBufferHelper::Flush(); |
| 3832 } | 3860 } |
| (...skipping 2714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6547 CheckGLError(); | 6575 CheckGLError(); |
| 6548 } | 6576 } |
| 6549 | 6577 |
| 6550 // Include the auto-generated part of this file. We split this because it means | 6578 // Include the auto-generated part of this file. We split this because it means |
| 6551 // we can easily edit the non-auto generated parts right here in this file | 6579 // we can easily edit the non-auto generated parts right here in this file |
| 6552 // instead of having to edit some template or the code generator. | 6580 // instead of having to edit some template or the code generator. |
| 6553 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 6581 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 6554 | 6582 |
| 6555 } // namespace gles2 | 6583 } // namespace gles2 |
| 6556 } // namespace gpu | 6584 } // namespace gpu |
| OLD | NEW |