panfrost: Route outputs_written through the compiler
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 7 Aug 2019 17:26:12 +0000 (10:26 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 13 Aug 2019 16:43:17 +0000 (09:43 -0700)
It's there in shader_info, but we need to access it from pan_context.c

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
src/gallium/drivers/panfrost/pan_assemble.c
src/gallium/drivers/panfrost/pan_compute.c
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_context.h

index 337f97bddbd69c4a74c628f0ab885f9e74e3aae1..47f6c1e5312d8e80aef05cba1cd5fe2a50e560a0 100644 (file)
@@ -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;
 
index 5ca63c15929d306361863f2676b716cd5f2d58a8..d0b2e132295c631e69c7f927a1fb0ee6d9ae5101 100644 (file)
@@ -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);
 
 
 
index e6cbd057818672f42e8f922c67c493d249d1f0a1..79995fa11c7248a52a744b16b396c4ab0f8f6438 100644 (file)
@@ -2118,12 +2118,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;
         }
index 3eac35023ce5fe9dd4c00351ba488447090546e4..cf9b93d68c51e41e06bfac78981f1a55befc7d82 100644 (file)
@@ -333,7 +333,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(