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

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

Issue 2502423003: Implement basic query functionality in the passthrough command buffer. (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc » ('j') | 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.h
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
index ba64f064f9acb416f8f6f40e475bcf5985458861..05c70693791ff5d76091a2f23ca4bed1378b4f61 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
@@ -280,6 +280,13 @@ class GLES2DecoderPassthroughImpl : public GLES2Decoder {
void BuildExtensionsString();
+ void InsertError(GLenum error, const std::string& message);
+ GLenum PopError();
+ bool FlushErrors();
+
+ bool IsEmulatedQueryTarget(GLenum target) const;
+ error::Error ProcessQueries(bool did_finish);
+
int commands_to_process_;
DebugMarkerManager debug_marker_manager_;
@@ -342,6 +349,33 @@ class GLES2DecoderPassthroughImpl : public GLES2Decoder {
size_t active_texture_unit_;
std::vector<GLuint> bound_textures_;
+ // Track the service-id to type of all queries for validation
+ struct QueryInfo {
+ GLenum type = GL_NONE;
+ };
+ std::unordered_map<GLuint, QueryInfo> query_info_map_;
+
+ // All queries that are waiting for their results to be ready
+ struct PendingQuery {
+ GLenum target = GL_NONE;
+ GLuint service_id = 0;
+
+ int32_t shm_id = 0;
+ uint32_t shm_offset = 0;
+ base::subtle::Atomic32 submit_count = 0;
+ };
+ std::deque<PendingQuery> pending_queries_;
+
+ // Currently active queries
+ struct ActiveQuery {
+ GLuint service_id = 0;
+ int32_t shm_id = 0;
+ uint32_t shm_offset = 0;
+ };
+ std::unordered_map<GLenum, ActiveQuery> active_queries_;
+
+ std::set<GLenum> errors_;
+
std::vector<std::string> emulated_extensions_;
std::string extension_string_;
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698