zink: add `needs_inlining` to `zink_shader`
authorantonino <antonino.maniscalco@collabora.com>
Tue, 21 Feb 2023 17:03:08 +0000 (18:03 +0100)
committerMarge Bot <emma+marge@anholt.net>
Wed, 29 Mar 2023 19:18:40 +0000 (19:18 +0000)
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

src/gallium/drivers/zink/zink_program.c
src/gallium/drivers/zink/zink_types.h

index 3dc6e62..ddea699 100644 (file)
@@ -1048,6 +1048,7 @@ zink_create_gfx_program(struct zink_context *ctx,
          prog->shaders[i] = stages[i];
          prog->stages_present |= BITFIELD_BIT(i);
          prog->optimal_keys &= !prog->shaders[i]->non_fs.is_generated;
+         prog->needs_inlining |= prog->shaders[i]->needs_inlining;
       }
    }
    if (stages[MESA_SHADER_TESS_EVAL] && !stages[MESA_SHADER_TESS_CTRL]) {
@@ -2294,6 +2295,7 @@ zink_set_primitive_emulation_keys(struct zink_context *ctx)
             }
 
             struct zink_shader *shader = zink_shader_create(screen, nir, NULL);
+            shader->needs_inlining = true;
             ctx->gfx_stages[prev_vertex_stage]->non_fs.generated_gs[ctx->gfx_pipeline_state.gfx_prim_mode][zink_prim_type] = shader;
             shader->non_fs.is_generated = true;
          }
@@ -2347,6 +2349,7 @@ zink_create_primitive_emulation_gs(struct zink_context *ctx)
             }
 
             struct zink_shader *shader = zink_shader_create(screen, nir, NULL);
+            shader->needs_inlining = true;
             ctx->gfx_stages[prev_vertex_stage]->non_fs.generated_gs[ctx->gfx_pipeline_state.gfx_prim_mode][zink_prim_type] = shader;
             shader->non_fs.is_generated = true;
          }
index e45d5e2..ff49bf2 100644 (file)
@@ -744,6 +744,7 @@ struct zink_shader {
    bool can_inline;
    bool has_uniforms;
    bool has_edgeflags;
+   bool needs_inlining;
    struct spirv_shader *spirv;
 
    struct {