Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 932963003: Add glClientWaitSync to GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make flags non-static in the command Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 GLuint64Union mapping(c.timeout_0, c.timeout_1);
12067 GLuint64 timeout = mapping.param64;
12068 typedef cmds::ClientWaitSync::Result Result;
12069 Result* result_dst = GetSharedMemoryAs<Result*>(
12070 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst));
12071 if (!result_dst) {
12072 return error::kOutOfBounds;
12073 }
12074 if (*result_dst != GL_WAIT_FAILED) {
12075 return error::kInvalidArguments;
12076 }
12077 GLsync service_sync = 0;
12078 if (!group_->GetSyncServiceId(sync, &service_sync)) {
12079 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "ClientWaitSync", "invalid sync");
12080 return error::kNoError;
12081 }
12082 *result_dst = glClientWaitSync(service_sync, flags, timeout);
12083 return error::kNoError;
12084 }
12085
12058 void GLES2DecoderImpl::OnTextureRefDetachedFromFramebuffer( 12086 void GLES2DecoderImpl::OnTextureRefDetachedFromFramebuffer(
12059 TextureRef* texture_ref) { 12087 TextureRef* texture_ref) {
12060 Texture* texture = texture_ref->texture(); 12088 Texture* texture = texture_ref->texture();
12061 DoDidUseTexImageIfNeeded(texture, texture->target()); 12089 DoDidUseTexImageIfNeeded(texture, texture->target());
12062 } 12090 }
12063 12091
12064 void GLES2DecoderImpl::OnContextLostError() { 12092 void GLES2DecoderImpl::OnContextLostError() {
12065 group_->LoseContexts(GL_UNKNOWN_CONTEXT_RESET_ARB); 12093 group_->LoseContexts(GL_UNKNOWN_CONTEXT_RESET_ARB);
12066 } 12094 }
12067 12095
12068 void GLES2DecoderImpl::OnOutOfMemoryError() { 12096 void GLES2DecoderImpl::OnOutOfMemoryError() {
12069 if (lose_context_when_out_of_memory_) { 12097 if (lose_context_when_out_of_memory_) {
12070 group_->LoseContexts(GL_UNKNOWN_CONTEXT_RESET_ARB); 12098 group_->LoseContexts(GL_UNKNOWN_CONTEXT_RESET_ARB);
12071 } 12099 }
12072 } 12100 }
12073 12101
12074 // Include the auto-generated part of this file. We split this because it means 12102 // 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 12103 // 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. 12104 // instead of having to edit some template or the code generator.
12077 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 12105 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
12078 12106
12079 } // namespace gles2 12107 } // namespace gles2
12080 } // namespace gpu 12108 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698