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

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

Issue 226483003: Flag INV_OP during BeginQuery if id is not obtained from GenQueriesEXT. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments + nits. Created 6 years, 8 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 7575cb5fbc776f1d75c9e1cab53541b833f340ed..350ccd8e0059ac75cb6b8ab76753301b62c3f1f3 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -9466,7 +9466,7 @@ bool GLES2DecoderImpl::GenQueriesEXTHelper(
return false;
}
}
- // NOTE: We don't generate Query objects here. Only in BeginQueryEXT
+ query_manager_->GenQueries(n, client_ids);
return true;
}
@@ -9481,8 +9481,8 @@ void GLES2DecoderImpl::DeleteQueriesEXTHelper(
state_.current_queries.erase(it);
query->Destroy(true);
- query_manager_->RemoveQuery(client_ids[ii]);
}
+ query_manager_->RemoveQuery(client_ids[ii]);
}
}
@@ -9576,24 +9576,12 @@ error::Error GLES2DecoderImpl::HandleBeginQueryEXT(
QueryManager::Query* query = query_manager_->GetQuery(client_id);
if (!query) {
- // TODO(gman): Decide if we need this check.
- //
- // Checks id was made by glGenQueries
- //
- // From the POV of OpenGL ES 2.0 you need to call glGenQueriesEXT
- // for all Query ids but from the POV of the command buffer service maybe
- // you don't.
- //
- // The client can enforce this. I don't think the service cares.
- //
- // IdAllocatorInterface* id_allocator =
- // group_->GetIdAllocator(id_namespaces::kQueries);
- // if (!id_allocator->InUse(client_id)) {
- // LOCAL_SET_GL_ERROR(
- // GL_INVALID_OPERATION,
- // "glBeginQueryEXT", "id not made by glGenQueriesEXT");
- // return error::kNoError;
- // }
+ if (!query_manager_->IsValidQuery(client_id)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
+ "glBeginQueryEXT",
+ "id not made by glGenQueriesEXT");
+ return error::kNoError;
+ }
query = query_manager_->CreateQuery(
target, client_id, sync_shm_id, sync_shm_offset);
}
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('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