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 // 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) { | |
|
Zhenyao Mo
2016/03/02 17:09:36
You will need to validate index before caching the
qiankun
2016/03/03 10:14:15
Done.
| |
| 3824 case GL_TRANSFORM_FEEDBACK_BUFFER: | |
| 3825 if (bound_transform_feedback_buffer_ != buffer_id) { | |
| 3826 bound_transform_feedback_buffer_ = buffer_id; | |
| 3827 } | |
| 3828 break; | |
| 3829 case GL_UNIFORM_BUFFER: | |
| 3830 if (bound_uniform_buffer_ != buffer_id) { | |
| 3831 bound_uniform_buffer_ = buffer_id; | |
| 3832 } | |
| 3833 break; | |
| 3834 default: | |
| 3835 break; | |
| 3836 } | |
| 3823 GetIdHandler(id_namespaces::kBuffers)->MarkAsUsedForBind( | 3837 GetIdHandler(id_namespaces::kBuffers)->MarkAsUsedForBind( |
| 3824 this, target, index, buffer_id, &GLES2Implementation::BindBufferBaseStub); | 3838 this, target, index, buffer_id, &GLES2Implementation::BindBufferBaseStub); |
| 3825 } | 3839 } |
| 3826 | 3840 |
| 3827 void GLES2Implementation::BindBufferBaseStub( | 3841 void GLES2Implementation::BindBufferBaseStub( |
| 3828 GLenum target, GLuint index, GLuint buffer) { | 3842 GLenum target, GLuint index, GLuint buffer) { |
| 3829 helper_->BindBufferBase(target, index, buffer); | 3843 helper_->BindBufferBase(target, index, buffer); |
| 3830 if (share_group_->bind_generates_resource()) | 3844 if (share_group_->bind_generates_resource()) |
| 3831 helper_->CommandBufferHelper::Flush(); | 3845 helper_->CommandBufferHelper::Flush(); |
| 3832 } | 3846 } |
| (...skipping 2714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6547 CheckGLError(); | 6561 CheckGLError(); |
| 6548 } | 6562 } |
| 6549 | 6563 |
| 6550 // Include the auto-generated part of this file. We split this because it means | 6564 // 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 | 6565 // 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. | 6566 // instead of having to edit some template or the code generator. |
| 6553 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 6567 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 6554 | 6568 |
| 6555 } // namespace gles2 | 6569 } // namespace gles2 |
| 6556 } // namespace gpu | 6570 } // namespace gpu |
| OLD | NEW |