0

Fix bugs in GLES* command handlers

If the command buffer is in an invalid state then we can't trust
the contents of the get buffer.

Bug: 340822365,40947303
Change-Id: I465d617e5056877fb464dd59df983a9e8d866b85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5542488
Commit-Queue: Brendon Tiszka <tiszka@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301529}
This commit is contained in:
Brendon Tiszka
2024-05-15 20:15:32 +00:00
committed by Chromium LUCI CQ
parent 4cdf778eea
commit 374789ab8f
3 changed files with 210 additions and 70 deletions

@ -2954,7 +2954,9 @@ class GETnHandler(TypeHandler):
result->SetNumResults(0);
helper_->%(func_name)s(%(arg_string)s,
GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(%(last_arg_name)s);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -4456,7 +4458,9 @@ TEST_P(%(test_name)s, %(name)sInvalidArgsBadSharedMemoryId) {
f.write(
" helper_->%s(%s, GetResultShmId(), result.offset());\n" %
(func.name, arg_string))
f.write(" WaitForCmd();\n")
f.write(" if (!WaitForCmd()) {\n")
f.write(" return %s; \n" % error_value)
f.write(" }\n")
f.write(" %s result_value = *result" % func.return_type)
if func.return_type == "GLboolean":
f.write(" != 0")

@ -603,7 +603,9 @@ GLenum GLES2Implementation::GetGLError() {
}
*result = GL_NO_ERROR;
helper_->GetError(GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_NO_ERROR;
}
GLenum error = *result;
if (error == GL_NO_ERROR) {
error = GetClientSideGLError();
@ -728,7 +730,9 @@ GLboolean GLES2Implementation::IsEnabled(GLenum cap) {
}
*result = 0;
helper_->IsEnabled(cap, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_FALSE;
}
state = (*result) != 0;
}
@ -749,7 +753,9 @@ GLboolean GLES2Implementation::IsEnablediOES(GLenum target, GLuint index) {
auto result = GetResultAs<Result>();
*result = 0;
helper_->IsEnablediOES(target, index, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_FALSE;
}
state = (*result) != 0;
}
@ -1368,7 +1374,9 @@ GLuint GLES2Implementation::GetMaxValueInBufferCHROMIUMHelper(GLuint buffer_id,
*result = 0;
helper_->GetMaxValueInBufferCHROMIUM(buffer_id, count, type, offset,
GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return 0;
}
return *result;
}
@ -1671,7 +1679,9 @@ void GLES2Implementation::GetVertexAttribPointerv(GLuint index,
result->SetNumResults(0);
helper_->GetVertexAttribPointerv(index, pname, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(ptr);
GPU_CLIENT_LOG_CODE_BLOCK(num_results = result->GetNumResults());
}
@ -1746,7 +1756,9 @@ GLint GLES2Implementation::GetAttribLocationHelper(GLuint program,
*result = -1;
helper_->GetAttribLocation(program, kResultBucketId, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return -1;
}
helper_->SetBucketSize(kResultBucketId, 0);
return *result;
}
@ -1774,7 +1786,9 @@ GLint GLES2Implementation::GetUniformLocationHelper(GLuint program,
*result = -1;
helper_->GetUniformLocation(program, kResultBucketId, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return -1;
}
helper_->SetBucketSize(kResultBucketId, 0);
return *result;
}
@ -1807,7 +1821,9 @@ bool GLES2Implementation::GetUniformIndicesHelper(GLuint program,
result->SetNumResults(0);
helper_->GetUniformIndices(program, kResultBucketId, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return false;
}
if (result->GetNumResults() != count) {
return false;
}
@ -1867,7 +1883,9 @@ GLint GLES2Implementation::GetFragDataIndexEXTHelper(GLuint program,
*result = -1;
helper_->GetFragDataIndexEXT(program, kResultBucketId, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return -1;
}
helper_->SetBucketSize(kResultBucketId, 0);
return *result;
}
@ -1896,7 +1914,9 @@ GLint GLES2Implementation::GetFragDataLocationHelper(GLuint program,
*result = -1;
helper_->GetFragDataLocation(program, kResultBucketId, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return -1;
}
helper_->SetBucketSize(kResultBucketId, 0);
return *result;
}
@ -1925,7 +1945,9 @@ GLuint GLES2Implementation::GetUniformBlockIndexHelper(GLuint program,
*result = GL_INVALID_INDEX;
helper_->GetUniformBlockIndex(program, kResultBucketId, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_INVALID_INDEX;
}
helper_->SetBucketSize(kResultBucketId, 0);
return *result;
}
@ -1970,7 +1992,9 @@ GLuint GLES2Implementation::GetProgramResourceIndexHelper(
*result = GL_INVALID_INDEX;
helper_->GetProgramResourceIndex(program, program_interface, kResultBucketId,
GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_INVALID_INDEX;
}
helper_->SetBucketSize(kResultBucketId, 0);
return *result;
}
@ -2015,7 +2039,9 @@ bool GLES2Implementation::GetProgramResourceNameHelper(GLuint program,
helper_->GetProgramResourceName(program, program_interface, index,
kResultBucketId, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return false;
}
success = !!*result;
}
if (success) {
@ -2074,7 +2100,9 @@ bool GLES2Implementation::GetProgramResourceivHelper(GLuint program,
helper_->GetProgramResourceiv(program, program_interface, index,
kResultBucketId, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return false;
}
if (length) {
*length = result->GetNumResults();
}
@ -2146,7 +2174,9 @@ GLint GLES2Implementation::GetProgramResourceLocationHelper(
helper_->GetProgramResourceLocation(program, program_interface,
kResultBucketId, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return -1;
}
helper_->SetBucketSize(kResultBucketId, 0);
return *result;
}
@ -4023,7 +4053,9 @@ bool GLES2Implementation::GetActiveAttribHelper(GLuint program,
result->success = false;
helper_->GetActiveAttrib(program, index, kResultBucketId, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return false;
}
bool success = !!result->success;
if (success) {
if (size) {
@ -4091,7 +4123,9 @@ bool GLES2Implementation::GetActiveUniformHelper(GLuint program,
result->success = false;
helper_->GetActiveUniform(program, index, kResultBucketId, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return false;
}
bool success = !!result->success;
if (success) {
if (size) {
@ -4158,7 +4192,9 @@ bool GLES2Implementation::GetActiveUniformBlockNameHelper(GLuint program,
*result = 0;
helper_->GetActiveUniformBlockName(program, index, kResultBucketId,
GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return false;
}
bool success = !!result;
if (success) {
// Note: this can invalidate |result|.
@ -4205,7 +4241,9 @@ bool GLES2Implementation::GetActiveUniformBlockivHelper(GLuint program,
result->SetNumResults(0);
helper_->GetActiveUniformBlockiv(program, index, pname, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return false;
}
if (result->GetNumResults() > 0) {
if (params) {
result->CopyResult(params);
@ -4262,7 +4300,9 @@ bool GLES2Implementation::GetActiveUniformsivHelper(GLuint program,
result->SetNumResults(0);
helper_->GetActiveUniformsiv(program, kResultBucketId, pname,
GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return false;
}
bool success = result->GetNumResults() == count;
if (success) {
if (params) {
@ -4338,7 +4378,9 @@ void GLES2Implementation::GetAttachedShaders(GLuint program,
transfer_buffer_->GetOffset(result),
checked_size);
int32_t token = helper_->InsertToken();
WaitForCmd();
if (!WaitForCmd()) {
return;
}
if (count) {
*count = result->GetNumResults();
}
@ -4380,7 +4422,9 @@ void GLES2Implementation::GetShaderPrecisionFormat(GLenum shadertype,
result->success = false;
helper_->GetShaderPrecisionFormat(shadertype, precisiontype,
GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
if (result->success)
static_state_.shader_precisions[key] = *result;
}
@ -4493,7 +4537,9 @@ bool GLES2Implementation::GetTransformFeedbackVaryingHelper(GLuint program,
result->success = false;
helper_->GetTransformFeedbackVarying(program, index, kResultBucketId,
GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return false;
}
if (result->success) {
if (size) {
*size = result->size;
@ -4561,7 +4607,9 @@ void GLES2Implementation::GetUniformfv(GLuint program,
}
result->SetNumResults(0);
helper_->GetUniformfv(program, location, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -4589,7 +4637,9 @@ void GLES2Implementation::GetUniformiv(GLuint program,
}
result->SetNumResults(0);
helper_->GetUniformiv(program, location, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -4618,7 +4668,9 @@ void GLES2Implementation::GetUniformuiv(GLuint program,
result->SetNumResults(0);
helper_->GetUniformuiv(program, location, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -4796,7 +4848,9 @@ GLboolean GLES2Implementation::ReadbackARGBImagePixelsINTERNAL(
dst_sk_color_type, dst_sk_alpha_type, shm_id, shm_offset,
color_space_offset, pixels_offset, mailbox_offset);
WaitForCmd();
if (!WaitForCmd()) {
return GL_FALSE;
}
if (!*readback_result) {
return GL_FALSE;
}
@ -4945,7 +4999,9 @@ void GLES2Implementation::ReadPixels(GLint xoffset,
helper_->ReadPixels(xoffset, y_index, width, num_rows, format, type,
buffer.shm_id(), buffer.offset(), GetResultShmId(),
result.offset(), false);
WaitForCmd();
if (!WaitForCmd()) {
break;
}
// If it was not marked as successful exit.
if (!result->success) {
break;
@ -5654,7 +5710,9 @@ void GLES2Implementation::GetVertexAttribfv(GLuint index,
}
result->SetNumResults(0);
helper_->GetVertexAttribfv(index, pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -5687,7 +5745,9 @@ void GLES2Implementation::GetVertexAttribiv(GLuint index,
}
result->SetNumResults(0);
helper_->GetVertexAttribiv(index, pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -5721,7 +5781,9 @@ void GLES2Implementation::GetVertexAttribIiv(GLuint index,
result->SetNumResults(0);
helper_->GetVertexAttribIiv(index, pname, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -5755,7 +5817,9 @@ void GLES2Implementation::GetVertexAttribIuiv(GLuint index,
result->SetNumResults(0);
helper_->GetVertexAttribIuiv(index, pname, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -5790,7 +5854,9 @@ GLboolean GLES2Implementation::EnableFeatureCHROMIUM(const char* feature) {
*result = 0;
helper_->EnableFeatureCHROMIUM(kResultBucketId, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return false;
}
helper_->SetBucketSize(kResultBucketId, 0);
GPU_CLIENT_LOG(" returned " << GLES2Util::GetStringBool(*result));
return *result != 0;
@ -5965,7 +6031,9 @@ void* GLES2Implementation::MapBufferRange(GLenum target,
GetResultShmId(), result.offset());
// TODO(zmo): For write only mode with MAP_INVALID_*_BIT, we should
// consider an early return without WaitForCmd(). crbug.com/465804.
WaitForCmd();
if (!WaitForCmd()) {
return nullptr;
}
if (*result) {
const GLbitfield kInvalidateBits =
GL_MAP_INVALIDATE_BUFFER_BIT | GL_MAP_INVALIDATE_RANGE_BIT;
@ -7208,7 +7276,9 @@ GLenum GLES2Implementation::ClientWaitSync(GLsync sync,
*result = GL_WAIT_FAILED;
helper_->ClientWaitSync(ToGLuint(sync), flags, timeout, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_WAIT_FAILED;
}
localResult = *result;
GPU_CLIENT_LOG("returned " << localResult);
}
@ -7286,7 +7356,9 @@ void GLES2Implementation::GetInternalformativ(GLenum target,
result->SetNumResults(0);
helper_->GetInternalformativ(target, format, pname, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);

@ -207,7 +207,9 @@ GLenum GLES2Implementation::CheckFramebufferStatus(GLenum target) {
}
*result = 0;
helper_->CheckFramebufferStatus(target, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_FRAMEBUFFER_UNSUPPORTED;
}
GLenum result_value = *result;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
@ -882,7 +884,9 @@ void GLES2Implementation::GetBooleanv(GLenum pname, GLboolean* params) {
}
result->SetNumResults(0);
helper_->GetBooleanv(pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -910,7 +914,9 @@ void GLES2Implementation::GetBooleani_v(GLenum pname,
}
result->SetNumResults(0);
helper_->GetBooleani_v(pname, index, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(data);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -939,7 +945,9 @@ void GLES2Implementation::GetBufferParameteri64v(GLenum target,
result->SetNumResults(0);
helper_->GetBufferParameteri64v(target, pname, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -969,7 +977,9 @@ void GLES2Implementation::GetBufferParameteriv(GLenum target,
result->SetNumResults(0);
helper_->GetBufferParameteriv(target, pname, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -994,7 +1004,9 @@ void GLES2Implementation::GetFloatv(GLenum pname, GLfloat* params) {
}
result->SetNumResults(0);
helper_->GetFloatv(pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1029,7 +1041,9 @@ void GLES2Implementation::GetFramebufferAttachmentParameteriv(GLenum target,
result->SetNumResults(0);
helper_->GetFramebufferAttachmentParameteriv(
target, attachment, pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1054,7 +1068,9 @@ void GLES2Implementation::GetInteger64v(GLenum pname, GLint64* params) {
}
result->SetNumResults(0);
helper_->GetInteger64v(pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1082,7 +1098,9 @@ void GLES2Implementation::GetIntegeri_v(GLenum pname,
}
result->SetNumResults(0);
helper_->GetIntegeri_v(pname, index, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(data);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1109,7 +1127,9 @@ void GLES2Implementation::GetInteger64i_v(GLenum pname,
}
result->SetNumResults(0);
helper_->GetInteger64i_v(pname, index, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(data);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1135,7 +1155,9 @@ void GLES2Implementation::GetIntegerv(GLenum pname, GLint* params) {
}
result->SetNumResults(0);
helper_->GetIntegerv(pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1163,7 +1185,9 @@ void GLES2Implementation::GetProgramiv(GLuint program,
}
result->SetNumResults(0);
helper_->GetProgramiv(program, pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1220,7 +1244,9 @@ void GLES2Implementation::GetRenderbufferParameteriv(GLenum target,
result->SetNumResults(0);
helper_->GetRenderbufferParameteriv(target, pname, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1249,7 +1275,9 @@ void GLES2Implementation::GetSamplerParameterfv(GLuint sampler,
result->SetNumResults(0);
helper_->GetSamplerParameterfv(sampler, pname, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1279,7 +1307,9 @@ void GLES2Implementation::GetSamplerParameteriv(GLuint sampler,
result->SetNumResults(0);
helper_->GetSamplerParameteriv(sampler, pname, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1307,7 +1337,9 @@ void GLES2Implementation::GetShaderiv(GLuint shader,
}
result->SetNumResults(0);
helper_->GetShaderiv(shader, pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1396,7 +1428,9 @@ void GLES2Implementation::GetSynciv(GLsync sync,
}
result->SetNumResults(0);
helper_->GetSynciv(ToGLuint(sync), pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(values);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1427,7 +1461,9 @@ void GLES2Implementation::GetTexParameterfv(GLenum target,
}
result->SetNumResults(0);
helper_->GetTexParameterfv(target, pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1456,7 +1492,9 @@ void GLES2Implementation::GetTexParameteriv(GLenum target,
}
result->SetNumResults(0);
helper_->GetTexParameteriv(target, pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -1541,7 +1579,9 @@ GLboolean GLES2Implementation::IsBuffer(GLuint buffer) {
}
*result = 0;
helper_->IsBuffer(buffer, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_FALSE;
}
GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
@ -1560,7 +1600,9 @@ GLboolean GLES2Implementation::IsFramebuffer(GLuint framebuffer) {
}
*result = 0;
helper_->IsFramebuffer(framebuffer, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_FALSE;
}
GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
@ -1578,7 +1620,9 @@ GLboolean GLES2Implementation::IsProgram(GLuint program) {
}
*result = 0;
helper_->IsProgram(program, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_FALSE;
}
GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
@ -1597,7 +1641,9 @@ GLboolean GLES2Implementation::IsRenderbuffer(GLuint renderbuffer) {
}
*result = 0;
helper_->IsRenderbuffer(renderbuffer, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_FALSE;
}
GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
@ -1615,7 +1661,9 @@ GLboolean GLES2Implementation::IsSampler(GLuint sampler) {
}
*result = 0;
helper_->IsSampler(sampler, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_FALSE;
}
GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
@ -1633,7 +1681,9 @@ GLboolean GLES2Implementation::IsShader(GLuint shader) {
}
*result = 0;
helper_->IsShader(shader, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_FALSE;
}
GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
@ -1651,7 +1701,9 @@ GLboolean GLES2Implementation::IsSync(GLsync sync) {
}
*result = 0;
helper_->IsSync(ToGLuint(sync), GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_FALSE;
}
GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
@ -1669,7 +1721,9 @@ GLboolean GLES2Implementation::IsTexture(GLuint texture) {
}
*result = 0;
helper_->IsTexture(texture, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_FALSE;
}
GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
@ -1689,7 +1743,9 @@ GLboolean GLES2Implementation::IsTransformFeedback(GLuint transformfeedback) {
*result = 0;
helper_->IsTransformFeedback(transformfeedback, GetResultShmId(),
result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_FALSE;
}
GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
@ -3093,7 +3149,9 @@ GLboolean GLES2Implementation::IsVertexArrayOES(GLuint array) {
}
*result = 0;
helper_->IsVertexArrayOES(array, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return GL_FALSE;
}
GLboolean result_value = *result != 0;
GPU_CLIENT_LOG("returned " << result_value);
CheckGLError();
@ -3187,7 +3245,9 @@ void GLES2Implementation::GetProgramInterfaceiv(GLuint program,
result->SetNumResults(0);
helper_->GetProgramInterfaceiv(program, program_interface, pname,
GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -3905,7 +3965,9 @@ void GLES2Implementation::GetFramebufferPixelLocalStorageParameterfvANGLE(
result->SetNumResults(0);
helper_->GetFramebufferPixelLocalStorageParameterfvANGLE(
plane, pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {
@ -3939,7 +4001,9 @@ void GLES2Implementation::GetFramebufferPixelLocalStorageParameterivANGLE(
result->SetNumResults(0);
helper_->GetFramebufferPixelLocalStorageParameterivANGLE(
plane, pname, GetResultShmId(), result.offset());
WaitForCmd();
if (!WaitForCmd()) {
return;
}
result->CopyResult(params);
GPU_CLIENT_LOG_CODE_BLOCK({
for (int32_t i = 0; i < result->GetNumResults(); ++i) {