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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 52a9c4351b47185261d76eba400f20aec9bb0b41..5ba2fd0a6904c6c5c18d3736a6f8203d61268ba4 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -12055,6 +12055,41 @@ error::Error GLES2DecoderImpl::HandleUniformBlockBinding(
return error::kNoError;
}
+error::Error GLES2DecoderImpl::HandleClientWaitSync(
+ uint32_t immediate_data_size, const void* cmd_data) {
+ if (!unsafe_es3_apis_enabled())
+ return error::kUnknownCommand;
+ const gles2::cmds::ClientWaitSync& c =
+ *static_cast<const gles2::cmds::ClientWaitSync*>(cmd_data);
+ GLuint sync = static_cast<GLuint>(c.sync);
+ GLbitfield flags = static_cast<GLbitfield>(c.flags);
+ GLuint64Union mapping;
+ mapping.param32[0] = c.timeout_0;
+ mapping.param32[1] = c.timeout_1;
+ GLuint64 timeout = mapping.param64;
+ if (timeout != 0) {
+ // In Chromium we only allow |timeout| to be 0.
piman 2015/02/18 16:22:07 We should allow it here, and check this in the web
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "ClientWaitSync", "timeout not 0");
+ return error::kNoError;
+ }
+ typedef cmds::ClientWaitSync::Result Result;
+ Result* result_dst = GetSharedMemoryAs<Result*>(
+ c.result_shm_id, c.result_shm_offset, sizeof(*result_dst));
+ if (!result_dst) {
+ return error::kOutOfBounds;
+ }
+ if (*result_dst != GL_WAIT_FAILED) {
+ return error::kInvalidArguments;
+ }
+ GLsync service_sync = 0;
+ if (!group_->GetSyncServiceId(sync, &service_sync)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "ClientWaitSync", "invalid sync");
+ return error::kNoError;
+ }
+ *result_dst = glClientWaitSync(service_sync, flags, timeout);
+ return error::kNoError;
+}
+
void GLES2DecoderImpl::OnTextureRefDetachedFromFramebuffer(
TextureRef* texture_ref) {
Texture* texture = texture_ref->texture();
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_ids_autogen.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698