Module: Mesa
Branch: master
Commit: 8a5b885c94a6f61e2cf97afb5f4aa6cd24fe33bb
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8a5b885c94a6f61e2cf97afb5f4aa6cd24fe33bb

Author: Boris Brezillon <[email protected]>
Date:   Thu Oct  8 10:49:12 2020 +0200

panfrost: Allocate blit_blend with ralloc()

This way we can use blend states as memory context which will help
simplify the blend shader creation/destruction logic.

Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7066>

---

 src/gallium/drivers/panfrost/pan_context.c | 3 ++-
 src/gallium/drivers/panfrost/pan_context.h | 2 +-
 src/gallium/drivers/panfrost/pan_job.c     | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c 
b/src/gallium/drivers/panfrost/pan_context.c
index 8185640cd84..06afce010fa 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1608,8 +1608,9 @@ panfrost_create_context(struct pipe_screen *screen, void 
*priv, unsigned flags)
         panfrost_batch_init(ctx);
 
         if (!(dev->quirks & IS_BIFROST)) {
+                ctx->blit_blend = rzalloc(ctx, struct panfrost_blend_state);
                 for (unsigned c = 0; c < PIPE_MAX_COLOR_BUFS; ++c)
-                        ctx->blit_blend.rt[c].shaders = 
_mesa_hash_table_u64_create(ctx);
+                        ctx->blit_blend->rt[c].shaders = 
_mesa_hash_table_u64_create(ctx);
         }
 
         /* By default mask everything on */
diff --git a/src/gallium/drivers/panfrost/pan_context.h 
b/src/gallium/drivers/panfrost/pan_context.h
index 50fddffaaf2..130989f50a0 100644
--- a/src/gallium/drivers/panfrost/pan_context.h
+++ b/src/gallium/drivers/panfrost/pan_context.h
@@ -178,7 +178,7 @@ struct panfrost_context {
         unsigned sample_mask;
         unsigned min_samples;
 
-        struct panfrost_blend_state blit_blend;
+        struct panfrost_blend_state *blit_blend;
 };
 
 /* Corresponds to the CSO */
diff --git a/src/gallium/drivers/panfrost/pan_job.c 
b/src/gallium/drivers/panfrost/pan_job.c
index 57abaa2d0d3..d07b358f2eb 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -854,7 +854,8 @@ panfrost_load_surface(struct panfrost_batch *batch, struct 
pipe_surface *surf, u
 
         if (loc >= FRAG_RESULT_DATA0 && 
!panfrost_can_fixed_blend(rsrc->base.format)) {
                 struct panfrost_blend_shader *b =
-                        panfrost_get_blend_shader(batch->ctx, 
&batch->ctx->blit_blend, rsrc->base.format, loc - FRAG_RESULT_DATA0);
+                        panfrost_get_blend_shader(batch->ctx, 
batch->ctx->blit_blend,
+                                                  rsrc->base.format, loc - 
FRAG_RESULT_DATA0);
 
                 struct panfrost_bo *bo = panfrost_batch_create_bo(batch, 
b->size,
                    PAN_BO_EXECUTE,

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to