summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-08-01 10:31:35 -0700
committerAlyssa Rosenzweig <[email protected]>2019-08-01 14:32:08 -0700
commit4e736b88f3bc706b065798bd2296748603070484 (patch)
treedf30fd9a28d40921af2b656a6b2f9975bc82bf46 /src/gallium/drivers/panfrost
parent898a18ea89ff29d5eb6fb9c6f0ddeae5de8ba7a7 (diff)
panfrost: Implement panfrost_set_shader_buffers callback
Just copy over the passed SSBO for now. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c15
-rw-r--r--src/gallium/drivers/panfrost/pan_context.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index a72432de239..b37c95bcf5b 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -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;
diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h
index c294195b4b5..1b2689db3ad 100644
--- a/src/gallium/drivers/panfrost/pan_context.h
+++ b/src/gallium/drivers/panfrost/pan_context.h
@@ -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];