| 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 <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 9722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9733 error::Error GLES2DecoderImpl::HandleGetActiveUniformBlockiv( | 9733 error::Error GLES2DecoderImpl::HandleGetActiveUniformBlockiv( |
| 9734 uint32 immediate_data_size, const void* cmd_data) { | 9734 uint32 immediate_data_size, const void* cmd_data) { |
| 9735 if (!unsafe_es3_apis_enabled()) | 9735 if (!unsafe_es3_apis_enabled()) |
| 9736 return error::kUnknownCommand; | 9736 return error::kUnknownCommand; |
| 9737 const gles2::cmds::GetActiveUniformBlockiv& c = | 9737 const gles2::cmds::GetActiveUniformBlockiv& c = |
| 9738 *static_cast<const gles2::cmds::GetActiveUniformBlockiv*>(cmd_data); | 9738 *static_cast<const gles2::cmds::GetActiveUniformBlockiv*>(cmd_data); |
| 9739 GLuint program_id = c.program; | 9739 GLuint program_id = c.program; |
| 9740 GLuint index = static_cast<GLuint>(c.index); | 9740 GLuint index = static_cast<GLuint>(c.index); |
| 9741 GLenum pname = static_cast<GLenum>(c.pname); | 9741 GLenum pname = static_cast<GLenum>(c.pname); |
| 9742 Program* program = GetProgramInfoNotShader( | 9742 Program* program = GetProgramInfoNotShader( |
| 9743 program_id, "glGetActiveUniform"); | 9743 program_id, "glGetActiveUniformBlockiv"); |
| 9744 if (!program) { | 9744 if (!program) { |
| 9745 return error::kNoError; | 9745 return error::kNoError; |
| 9746 } | 9746 } |
| 9747 GLuint service_id = program->service_id(); | 9747 GLuint service_id = program->service_id(); |
| 9748 GLint link_status = GL_FALSE; | 9748 GLint link_status = GL_FALSE; |
| 9749 glGetProgramiv(service_id, GL_LINK_STATUS, &link_status); | 9749 glGetProgramiv(service_id, GL_LINK_STATUS, &link_status); |
| 9750 if (link_status != GL_TRUE) { | 9750 if (link_status != GL_TRUE) { |
| 9751 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, | 9751 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, |
| 9752 "glGetActiveActiveUniformBlockiv", "program not linked"); | 9752 "glGetActiveActiveUniformBlockiv", "program not linked"); |
| 9753 return error::kNoError; | 9753 return error::kNoError; |
| (...skipping 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11822 error::Error GLES2DecoderImpl::HandleWaitAllAsyncTexImage2DCHROMIUM( | 11822 error::Error GLES2DecoderImpl::HandleWaitAllAsyncTexImage2DCHROMIUM( |
| 11823 uint32 immediate_data_size, | 11823 uint32 immediate_data_size, |
| 11824 const void* data) { | 11824 const void* data) { |
| 11825 TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandleWaitAsyncTexImage2DCHROMIUM"); | 11825 TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandleWaitAsyncTexImage2DCHROMIUM"); |
| 11826 | 11826 |
| 11827 GetAsyncPixelTransferManager()->WaitAllAsyncTexImage2D(); | 11827 GetAsyncPixelTransferManager()->WaitAllAsyncTexImage2D(); |
| 11828 ProcessFinishedAsyncTransfers(); | 11828 ProcessFinishedAsyncTransfers(); |
| 11829 return error::kNoError; | 11829 return error::kNoError; |
| 11830 } | 11830 } |
| 11831 | 11831 |
| 11832 error::Error GLES2DecoderImpl::HandleUniformBlockBinding( |
| 11833 uint32_t immediate_data_size, const void* cmd_data) { |
| 11834 if (!unsafe_es3_apis_enabled()) |
| 11835 return error::kUnknownCommand; |
| 11836 const gles2::cmds::UniformBlockBinding& c = |
| 11837 *static_cast<const gles2::cmds::UniformBlockBinding*>(cmd_data); |
| 11838 GLuint client_id = c.program; |
| 11839 GLuint index = static_cast<GLuint>(c.index); |
| 11840 GLuint binding = static_cast<GLuint>(c.binding); |
| 11841 Program* program = GetProgramInfoNotShader( |
| 11842 client_id, "glUniformBlockBinding"); |
| 11843 if (!program) { |
| 11844 return error::kNoError; |
| 11845 } |
| 11846 GLuint service_id = program->service_id(); |
| 11847 glUniformBlockBinding(service_id, index, binding); |
| 11848 return error::kNoError; |
| 11849 } |
| 11850 |
| 11832 void GLES2DecoderImpl::OnTextureRefDetachedFromFramebuffer( | 11851 void GLES2DecoderImpl::OnTextureRefDetachedFromFramebuffer( |
| 11833 TextureRef* texture_ref) { | 11852 TextureRef* texture_ref) { |
| 11834 Texture* texture = texture_ref->texture(); | 11853 Texture* texture = texture_ref->texture(); |
| 11835 DoDidUseTexImageIfNeeded(texture, texture->target()); | 11854 DoDidUseTexImageIfNeeded(texture, texture->target()); |
| 11836 } | 11855 } |
| 11837 | 11856 |
| 11838 void GLES2DecoderImpl::OnContextLostError() { | 11857 void GLES2DecoderImpl::OnContextLostError() { |
| 11839 group_->LoseContexts(GL_UNKNOWN_CONTEXT_RESET_ARB); | 11858 group_->LoseContexts(GL_UNKNOWN_CONTEXT_RESET_ARB); |
| 11840 } | 11859 } |
| 11841 | 11860 |
| 11842 void GLES2DecoderImpl::OnOutOfMemoryError() { | 11861 void GLES2DecoderImpl::OnOutOfMemoryError() { |
| 11843 if (lose_context_when_out_of_memory_) { | 11862 if (lose_context_when_out_of_memory_) { |
| 11844 group_->LoseContexts(GL_UNKNOWN_CONTEXT_RESET_ARB); | 11863 group_->LoseContexts(GL_UNKNOWN_CONTEXT_RESET_ARB); |
| 11845 } | 11864 } |
| 11846 } | 11865 } |
| 11847 | 11866 |
| 11848 // Include the auto-generated part of this file. We split this because it means | 11867 // Include the auto-generated part of this file. We split this because it means |
| 11849 // we can easily edit the non-auto generated parts right here in this file | 11868 // we can easily edit the non-auto generated parts right here in this file |
| 11850 // instead of having to edit some template or the code generator. | 11869 // instead of having to edit some template or the code generator. |
| 11851 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11870 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 11852 | 11871 |
| 11853 } // namespace gles2 | 11872 } // namespace gles2 |
| 11854 } // namespace gpu | 11873 } // namespace gpu |
| OLD | NEW |