From 4e736b88f3bc706b065798bd2296748603070484 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 1 Aug 2019 10:31:35 -0700 Subject: [PATCH] panfrost: Implement panfrost_set_shader_buffers callback Just copy over the passed SSBO for now. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Eric Anholt --- src/gallium/drivers/panfrost/pan_context.c | 15 +++++++++++++++ src/gallium/drivers/panfrost/pan_context.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index a72432d..b37c95b 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 c294195..1b2689d 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]; -- 2.7.4