[Mesa-dev] [PATCH 6/9] panfrost: Route outputs_written through the compiler

Alyssa Rosenzweig alyssa.rosenzweig at collabora.com
Fri Aug 9 20:00:49 UTC 2019


It's there in shader_info, but we need to access it from pan_context.c

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
---
 src/gallium/drivers/panfrost/pan_assemble.c | 6 +++++-
 src/gallium/drivers/panfrost/pan_compute.c  | 2 +-
 src/gallium/drivers/panfrost/pan_context.c  | 5 ++++-
 src/gallium/drivers/panfrost/pan_context.h  | 3 ++-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c
index 337f97bddbd..47f6c1e5312 100644
--- a/src/gallium/drivers/panfrost/pan_assemble.c
+++ b/src/gallium/drivers/panfrost/pan_assemble.c
@@ -41,7 +41,8 @@ panfrost_shader_compile(
                 enum pipe_shader_ir ir_type,
                 const void *ir,
                 gl_shader_stage stage,
-                struct panfrost_shader_state *state)
+                struct panfrost_shader_state *state,
+                uint64_t *outputs_written)
 {
         struct panfrost_screen *screen = pan_screen(ctx->base.screen);
         uint8_t *dst;
@@ -118,6 +119,9 @@ panfrost_shader_compile(
         state->reads_point_coord = false;
         state->helper_invocations = s->info.fs.needs_helper_invocations;
 
+        if (outputs_written)
+                *outputs_written = s->info.outputs_written;
+
         /* Separate as primary uniform count is truncated */
         state->uniform_count = program.uniform_count;
 
diff --git a/src/gallium/drivers/panfrost/pan_compute.c b/src/gallium/drivers/panfrost/pan_compute.c
index 43fef8d8cfa..3931ab2aeb7 100644
--- a/src/gallium/drivers/panfrost/pan_compute.c
+++ b/src/gallium/drivers/panfrost/pan_compute.c
@@ -53,7 +53,7 @@ panfrost_create_compute_state(
 
         panfrost_shader_compile(ctx, v->tripipe,
                         cso->ir_type, cso->prog,
-                        MESA_SHADER_COMPUTE, v);
+                        MESA_SHADER_COMPUTE, v, NULL);
 
 
 
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 2d7e417bb27..1a7e2db6737 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -2008,12 +2008,15 @@ panfrost_bind_shader_state(
         /* We finally have a variant, so compile it */
 
         if (!shader_state->compiled) {
+                uint64_t outputs_written = 0;
+
                 panfrost_shader_compile(ctx, shader_state->tripipe,
                               variants->base.type,
                               variants->base.type == PIPE_SHADER_IR_NIR ?
                                       variants->base.ir.nir :
                                       variants->base.tokens,
-                                        tgsi_processor_to_shader_stage(type), shader_state);
+                                        tgsi_processor_to_shader_stage(type), shader_state,
+                                        &outputs_written);
 
                 shader_state->compiled = true;
         }
diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h
index 24c54fe3467..66cab8736bd 100644
--- a/src/gallium/drivers/panfrost/pan_context.h
+++ b/src/gallium/drivers/panfrost/pan_context.h
@@ -330,7 +330,8 @@ panfrost_shader_compile(
                 enum pipe_shader_ir ir_type,
                 const void *ir,
                 gl_shader_stage stage,
-                struct panfrost_shader_state *state);
+                struct panfrost_shader_state *state,
+                uint64_t *outputs_written);
 
 void
 panfrost_pack_work_groups_compute(
-- 
2.20.1



More information about the mesa-dev mailing list