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

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

Issue 2886253003: Make sure to only call valid GL query functions when processing queries. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
index 35a84dc733f3a6be544fe31c5cbc00e89ce41f5f..5535b4f3d16963b900ebe8f1603e275a51e34e8b 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
@@ -764,7 +764,7 @@ bool GLES2DecoderPassthroughImpl::IsEmulatedQueryTarget(GLenum target) const {
error::Error GLES2DecoderPassthroughImpl::ProcessQueries(bool did_finish) {
while (!pending_queries_.empty()) {
const PendingQuery& query = pending_queries_.front();
- GLint result_available = GL_FALSE;
+ GLuint result_available = GL_FALSE;
GLuint64 result = 0;
switch (query.target) {
case GL_COMMANDS_ISSUED_CHROMIUM:
@@ -795,11 +795,18 @@ error::Error GLES2DecoderPassthroughImpl::ProcessQueries(bool did_finish) {
if (did_finish) {
result_available = GL_TRUE;
} else {
- glGetQueryObjectiv(query.service_id, GL_QUERY_RESULT_AVAILABLE,
- &result_available);
+ glGetQueryObjectuiv(query.service_id, GL_QUERY_RESULT_AVAILABLE,
+ &result_available);
}
if (result_available == GL_TRUE) {
- glGetQueryObjectui64v(query.service_id, GL_QUERY_RESULT, &result);
+ if (feature_info_->feature_flags().ext_disjoint_timer_query) {
+ glGetQueryObjectui64v(query.service_id, GL_QUERY_RESULT, &result);
+ } else {
+ GLuint temp_result = 0;
+ glGetQueryObjectuiv(query.service_id, GL_QUERY_RESULT,
+ &temp_result);
+ result = temp_result;
+ }
}
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698