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 12037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12048 Program* program = GetProgramInfoNotShader( | 12048 Program* program = GetProgramInfoNotShader( |
12049 client_id, "glUniformBlockBinding"); | 12049 client_id, "glUniformBlockBinding"); |
12050 if (!program) { | 12050 if (!program) { |
12051 return error::kNoError; | 12051 return error::kNoError; |
12052 } | 12052 } |
12053 GLuint service_id = program->service_id(); | 12053 GLuint service_id = program->service_id(); |
12054 glUniformBlockBinding(service_id, index, binding); | 12054 glUniformBlockBinding(service_id, index, binding); |
12055 return error::kNoError; | 12055 return error::kNoError; |
12056 } | 12056 } |
12057 | 12057 |
| 12058 error::Error GLES2DecoderImpl::HandleClientWaitSync( |
| 12059 uint32_t immediate_data_size, const void* cmd_data) { |
| 12060 if (!unsafe_es3_apis_enabled()) |
| 12061 return error::kUnknownCommand; |
| 12062 const gles2::cmds::ClientWaitSync& c = |
| 12063 *static_cast<const gles2::cmds::ClientWaitSync*>(cmd_data); |
| 12064 GLuint sync = static_cast<GLuint>(c.sync); |
| 12065 GLbitfield flags = static_cast<GLbitfield>(c.flags); |
| 12066 GLuint64 timeout = GLES2Util::MapTwoUint32ToUint64(c.timeout_0, c.timeout_1); |
| 12067 typedef cmds::ClientWaitSync::Result Result; |
| 12068 Result* result_dst = GetSharedMemoryAs<Result*>( |
| 12069 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); |
| 12070 if (!result_dst) { |
| 12071 return error::kOutOfBounds; |
| 12072 } |
| 12073 if (*result_dst != GL_WAIT_FAILED) { |
| 12074 return error::kInvalidArguments; |
| 12075 } |
| 12076 GLsync service_sync = 0; |
| 12077 if (!group_->GetSyncServiceId(sync, &service_sync)) { |
| 12078 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "ClientWaitSync", "invalid sync"); |
| 12079 return error::kNoError; |
| 12080 } |
| 12081 *result_dst = glClientWaitSync(service_sync, flags, timeout); |
| 12082 return error::kNoError; |
| 12083 } |
| 12084 |
12058 void GLES2DecoderImpl::OnTextureRefDetachedFromFramebuffer( | 12085 void GLES2DecoderImpl::OnTextureRefDetachedFromFramebuffer( |
12059 TextureRef* texture_ref) { | 12086 TextureRef* texture_ref) { |
12060 Texture* texture = texture_ref->texture(); | 12087 Texture* texture = texture_ref->texture(); |
12061 DoDidUseTexImageIfNeeded(texture, texture->target()); | 12088 DoDidUseTexImageIfNeeded(texture, texture->target()); |
12062 } | 12089 } |
12063 | 12090 |
12064 void GLES2DecoderImpl::OnContextLostError() { | 12091 void GLES2DecoderImpl::OnContextLostError() { |
12065 group_->LoseContexts(GL_UNKNOWN_CONTEXT_RESET_ARB); | 12092 group_->LoseContexts(GL_UNKNOWN_CONTEXT_RESET_ARB); |
12066 } | 12093 } |
12067 | 12094 |
12068 void GLES2DecoderImpl::OnOutOfMemoryError() { | 12095 void GLES2DecoderImpl::OnOutOfMemoryError() { |
12069 if (lose_context_when_out_of_memory_) { | 12096 if (lose_context_when_out_of_memory_) { |
12070 group_->LoseContexts(GL_UNKNOWN_CONTEXT_RESET_ARB); | 12097 group_->LoseContexts(GL_UNKNOWN_CONTEXT_RESET_ARB); |
12071 } | 12098 } |
12072 } | 12099 } |
12073 | 12100 |
12074 // Include the auto-generated part of this file. We split this because it means | 12101 // Include the auto-generated part of this file. We split this because it means |
12075 // we can easily edit the non-auto generated parts right here in this file | 12102 // we can easily edit the non-auto generated parts right here in this file |
12076 // instead of having to edit some template or the code generator. | 12103 // instead of having to edit some template or the code generator. |
12077 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 12104 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
12078 | 12105 |
12079 } // namespace gles2 | 12106 } // namespace gles2 |
12080 } // namespace gpu | 12107 } // namespace gpu |
OLD | NEW |