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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 936183002: Add glWaitSync to GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sync
Patch Set: rebase 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 f530974de0582ed0aa9ea9b7ede3ed8020854a5e..6b254e0966bb8ad2de4ee746bf53e6f7cb3dc269 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -12087,6 +12087,24 @@ error::Error GLES2DecoderImpl::HandleClientWaitSync(
return error::kNoError;
}
+error::Error GLES2DecoderImpl::HandleWaitSync(
+ uint32_t immediate_data_size, const void* cmd_data) {
+ if (!unsafe_es3_apis_enabled())
+ return error::kUnknownCommand;
+ const gles2::cmds::WaitSync& c =
+ *static_cast<const gles2::cmds::WaitSync*>(cmd_data);
+ GLuint sync = static_cast<GLuint>(c.sync);
+ GLbitfield flags = static_cast<GLbitfield>(c.flags);
+ GLuint64 timeout = GLES2Util::MapTwoUint32ToUint64(c.timeout_0, c.timeout_1);
+ GLsync service_sync = 0;
+ if (!group_->GetSyncServiceId(sync, &service_sync)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "WaitSync", "invalid sync");
+ return error::kNoError;
+ }
+ glWaitSync(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