panfrost: Implement panfrost_set_shader_buffers callback
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 1 Aug 2019 17:31:35 +0000 (10:31 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 1 Aug 2019 21:32:08 +0000 (14:32 -0700)
Just copy over the passed SSBO for now.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_context.h

index a72432de23925d5b3845453e7ddb9e72b45fd54b..b37c95bcf5bb0946e5790a66986e8635066110b5 100644 (file)
@@ -2330,6 +2330,20 @@ panfrost_sampler_view_destroy(
         ralloc_free(view);
 }
 
+static void
+panfrost_set_shader_buffers(
+        struct pipe_context *pctx,
+        enum pipe_shader_type shader,
+        unsigned start, unsigned count,
+        const struct pipe_shader_buffer *buffers,
+        unsigned writable_bitmask)
+{
+        struct panfrost_context *ctx = pan_context(pctx);
+
+        util_set_shader_buffers_mask(ctx->ssbo[shader], &ctx->ssbo_mask[shader],
+                        buffers, start, count);
+}
+
 /* Hints that a framebuffer should use AFBC where possible */
 
 static void
@@ -2693,6 +2707,7 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
 
         gallium->set_vertex_buffers = panfrost_set_vertex_buffers;
         gallium->set_constant_buffer = panfrost_set_constant_buffer;
+        gallium->set_shader_buffers = panfrost_set_shader_buffers;
 
         gallium->set_stencil_ref = panfrost_set_stencil_ref;
 
index c294195b4b5b9ba7efc1f2a0d4116a5446170608..1b2689db3add9561d57cd38b68b6730de5e8ee99 100644 (file)
@@ -156,6 +156,9 @@ struct panfrost_context {
         struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS];
         uint32_t vb_mask;
 
+        struct pipe_shader_buffer ssbo[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_BUFFERS];
+        uint32_t ssbo_mask[PIPE_SHADER_TYPES];
+
         struct panfrost_sampler_state *samplers[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
         unsigned sampler_count[PIPE_SHADER_TYPES];