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

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: 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 6c3a5bdc37440d15795ece11cbfa8e58cbfb17ad..d9a47aacaad6b9ab2ab6c7b3a1da67c28e57efcd 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
@@ -241,6 +241,13 @@ class GLES2DecoderPassthroughImpl : public GLES2Decoder {
private:
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_;
@@ -303,6 +310,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_;
piman 2016/11/18 19:32:09 nit: any reason to use the service id to index her
Geoff Lang 2016/11/21 18:12:16 I found it needed the same number of lookups becau
+
+ // 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