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

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

Issue 2317363005: Add basic GL functionality to the passthrough command buffer. (Closed)
Patch Set: Handle bind_generates_resource Created 4 years, 3 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_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 2c3350bad25be33e18fcd6eec968f967cddd4bc0..ea73c015b8af9b7c7a3c1977f8059dd493eb2b7c 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
@@ -12,10 +12,13 @@
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/common/mailbox.h"
+#include "gpu/command_buffer/service/client_service_map.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/image_manager.h"
#include "gpu/command_buffer/service/logger.h"
+#include "gpu/command_buffer/service/mailbox_manager.h"
+#include "gpu/command_buffer/service/texture_manager.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_image.h"
@@ -26,6 +29,31 @@ namespace gles2 {
class ContextGroup;
+struct PassthroughResources {
+ PassthroughResources();
+ ~PassthroughResources();
+
+ void Destroy(bool have_context);
+
+ // Mappings from client side IDs to service side IDs.
+ ClientServiceMap<GLuint, GLuint> texture_id_map;
+ ClientServiceMap<GLuint, GLuint> buffer_id_map;
+ ClientServiceMap<GLuint, GLuint> renderbuffer_id_map;
+ ClientServiceMap<GLuint, GLuint> sampler_id_map;
+ ClientServiceMap<GLuint, GLuint> program_id_map;
+ ClientServiceMap<GLuint, GLuint> shader_id_map;
+
+ static_assert(sizeof(uintptr_t) == sizeof(GLsync),
+ "GLsync not the same size as uintptr_t");
+ ClientServiceMap<GLuint, uintptr_t> sync_id_map;
+
+ // Mapping of client texture IDs to TexturePassthrough objects used to make
+ // sure all textures used by mailboxes are not deleted until all textures
+ // using the mailbox are deleted
+ std::unordered_map<GLuint, scoped_refptr<TexturePassthrough>>
+ texture_object_map;
+};
+
class GLES2DecoderPassthroughImpl : public GLES2Decoder {
public:
explicit GLES2DecoderPassthroughImpl(ContextGroup* group);
@@ -248,6 +276,31 @@ class GLES2DecoderPassthroughImpl : public GLES2Decoder {
scoped_refptr<ContextGroup> group_;
scoped_refptr<FeatureInfo> feature_info_;
+ // Callbacks
+ FenceSyncReleaseCallback fence_sync_release_callback_;
+ WaitFenceSyncCallback wait_fence_sync_callback_;
+
+ // Some objects may generate resources when they are bound even if they were
+ // not generated yet: texture, buffer, renderbuffer, framebuffer, transform
+ // feedback, vertex array
+ bool bind_generates_resource_;
+
+ // Mappings from client side IDs to service side IDs for shared objects
+ PassthroughResources* resources_;
+
+ // Mappings from client side IDs to service side IDs for per-context objects
+ ClientServiceMap<GLuint, GLuint> framebuffer_id_map_;
+ ClientServiceMap<GLuint, GLuint> transform_feedback_id_map_;
+ ClientServiceMap<GLuint, GLuint> query_id_map_;
+ ClientServiceMap<GLuint, GLuint> vertex_array_id_map_;
+
+ // Mailboxes
+ scoped_refptr<MailboxManager> mailbox_manager_;
+
+ // State tracking of currently bound 2D textures (client IDs)
+ size_t active_texture_unit_;
+ std::vector<GLuint> bound_textures_;
+
// Include the prototypes of all the doer functions from a separate header to
// keep this file clean.
#include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h"
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698