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/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
(...skipping 2300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2311 | 2311 |
2312 void GLES2Implementation::GenValuebuffersCHROMIUMHelper( | 2312 void GLES2Implementation::GenValuebuffersCHROMIUMHelper( |
2313 GLsizei /* n */, | 2313 GLsizei /* n */, |
2314 const GLuint* /* valuebuffers */) { | 2314 const GLuint* /* valuebuffers */) { |
2315 } | 2315 } |
2316 | 2316 |
2317 void GLES2Implementation::GenSamplersHelper( | 2317 void GLES2Implementation::GenSamplersHelper( |
2318 GLsizei /* n */, const GLuint* /* samplers */) { | 2318 GLsizei /* n */, const GLuint* /* samplers */) { |
2319 } | 2319 } |
2320 | 2320 |
| 2321 void GLES2Implementation::GenTransformFeedbacksHelper( |
| 2322 GLsizei /* n */, const GLuint* /* transformfeedbacks */) { |
| 2323 } |
| 2324 |
2321 // NOTE #1: On old versions of OpenGL, calling glBindXXX with an unused id | 2325 // NOTE #1: On old versions of OpenGL, calling glBindXXX with an unused id |
2322 // generates a new resource. On newer versions of OpenGL they don't. The code | 2326 // generates a new resource. On newer versions of OpenGL they don't. The code |
2323 // related to binding below will need to change if we switch to the new OpenGL | 2327 // related to binding below will need to change if we switch to the new OpenGL |
2324 // model. Specifically it assumes a bind will succeed which is always true in | 2328 // model. Specifically it assumes a bind will succeed which is always true in |
2325 // the old model but possibly not true in the new model if another context has | 2329 // the old model but possibly not true in the new model if another context has |
2326 // deleted the resource. | 2330 // deleted the resource. |
2327 | 2331 |
2328 void GLES2Implementation::BindBufferHelper( | 2332 void GLES2Implementation::BindBufferHelper( |
2329 GLenum target, GLuint buffer_id) { | 2333 GLenum target, GLuint buffer_id) { |
2330 // TODO(gman): See note #1 above. | 2334 // TODO(gman): See note #1 above. |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2697 GLsizei n, const GLuint* samplers) { | 2701 GLsizei n, const GLuint* samplers) { |
2698 if (!GetIdHandler(id_namespaces::kSamplers)->FreeIds( | 2702 if (!GetIdHandler(id_namespaces::kSamplers)->FreeIds( |
2699 this, n, samplers, &GLES2Implementation::DeleteSamplersStub)) { | 2703 this, n, samplers, &GLES2Implementation::DeleteSamplersStub)) { |
2700 SetGLError( | 2704 SetGLError( |
2701 GL_INVALID_VALUE, | 2705 GL_INVALID_VALUE, |
2702 "glDeleteSamplers", "id not created by this context."); | 2706 "glDeleteSamplers", "id not created by this context."); |
2703 return; | 2707 return; |
2704 } | 2708 } |
2705 } | 2709 } |
2706 | 2710 |
| 2711 void GLES2Implementation::DeleteTransformFeedbacksStub( |
| 2712 GLsizei n, const GLuint* transformfeedbacks) { |
| 2713 helper_->DeleteTransformFeedbacksImmediate(n, transformfeedbacks); |
| 2714 } |
| 2715 |
| 2716 void GLES2Implementation::DeleteTransformFeedbacksHelper( |
| 2717 GLsizei n, const GLuint* transformfeedbacks) { |
| 2718 if (!GetIdHandler(id_namespaces::kTransformFeedbacks)->FreeIds( |
| 2719 this, n, transformfeedbacks, |
| 2720 &GLES2Implementation::DeleteTransformFeedbacksStub)) { |
| 2721 SetGLError( |
| 2722 GL_INVALID_VALUE, |
| 2723 "glDeleteTransformFeedbacks", "id not created by this context."); |
| 2724 return; |
| 2725 } |
| 2726 } |
| 2727 |
2707 void GLES2Implementation::DeleteValuebuffersCHROMIUMStub( | 2728 void GLES2Implementation::DeleteValuebuffersCHROMIUMStub( |
2708 GLsizei n, | 2729 GLsizei n, |
2709 const GLuint* valuebuffers) { | 2730 const GLuint* valuebuffers) { |
2710 helper_->DeleteValuebuffersCHROMIUMImmediate(n, valuebuffers); | 2731 helper_->DeleteValuebuffersCHROMIUMImmediate(n, valuebuffers); |
2711 } | 2732 } |
2712 | 2733 |
2713 void GLES2Implementation::DisableVertexAttribArray(GLuint index) { | 2734 void GLES2Implementation::DisableVertexAttribArray(GLuint index) { |
2714 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 2735 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
2715 GPU_CLIENT_LOG( | 2736 GPU_CLIENT_LOG( |
2716 "[" << GetLogPrefix() << "] glDisableVertexAttribArray(" << index << ")"); | 2737 "[" << GetLogPrefix() << "] glDisableVertexAttribArray(" << index << ")"); |
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4017 return false; | 4038 return false; |
4018 } | 4039 } |
4019 | 4040 |
4020 // Include the auto-generated part of this file. We split this because it means | 4041 // Include the auto-generated part of this file. We split this because it means |
4021 // we can easily edit the non-auto generated parts right here in this file | 4042 // we can easily edit the non-auto generated parts right here in this file |
4022 // instead of having to edit some template or the code generator. | 4043 // instead of having to edit some template or the code generator. |
4023 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 4044 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
4024 | 4045 |
4025 } // namespace gles2 | 4046 } // namespace gles2 |
4026 } // namespace gpu | 4047 } // namespace gpu |
OLD | NEW |