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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 894373004: Add glGetActiveUniformBlockiv to GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win bots 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/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 07b369097631c526e4a6a00f03920e5d18ff87d8..f200d2734ae39f7df7b82edde1cf9654274848dc 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -2363,7 +2363,7 @@ void GLES2Implementation::GetActiveUniformBlockName(
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetActiveUniformBlockName("
<< program << ", " << index << ", " << bufsize << ", "
<< static_cast<const void*>(length) << ", "
- << static_cast<const void*>(name) << ", ");
+ << static_cast<const void*>(name) << ")");
if (bufsize < 0) {
SetGLError(GL_INVALID_VALUE, "glGetActiveUniformBlockName", "bufsize < 0");
return;
@@ -2380,6 +2380,52 @@ void GLES2Implementation::GetActiveUniformBlockName(
CheckGLError();
}
+bool GLES2Implementation::GetActiveUniformBlockivHelper(
+ GLuint program, GLuint index, GLenum pname, GLint* params) {
+ typedef cmds::GetActiveUniformBlockiv::Result Result;
+ Result* result = GetResultAs<Result*>();
+ if (!result) {
+ return false;
+ }
+ result->SetNumResults(0);
+ helper_->GetActiveUniformBlockiv(
+ program, index, pname, GetResultShmId(), GetResultShmOffset());
+ WaitForCmd();
+ if (result->GetNumResults() > 0) {
+ if (params) {
+ result->CopyResult(params);
+ }
+ GPU_CLIENT_LOG_CODE_BLOCK({
+ for (int32_t i = 0; i < result->GetNumResults(); ++i) {
+ GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
+ }
+ });
+ return true;
+ }
+ return false;
+}
+
+void GLES2Implementation::GetActiveUniformBlockiv(
+ GLuint program, GLuint index, GLenum pname, GLint* params) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetActiveUniformBlockiv("
+ << program << ", " << index << ", "
+ << GLES2Util::GetStringProgramParameter(pname) << ", "
+ << static_cast<const void*>(params) << ")");
+ TRACE_EVENT0("gpu", "GLES2::GetActiveUniformBlockiv");
+ bool success =
+ share_group_->program_info_manager()->GetActiveUniformBlockiv(
+ this, program, index, pname, params);
+ if (success) {
+ if (params) {
+ // TODO(zmo): For GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, there will
+ // be more than one value returned in params.
+ GPU_CLIENT_LOG(" params: " << params[0]);
+ }
+ }
+ CheckGLError();
+}
+
void GLES2Implementation::GetAttachedShaders(
GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | gpu/command_buffer/client/gles2_implementation_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698