Module: Mesa Branch: staging/22.2 Commit: 0b081167b2c10b9fc77735e586af9dc6f319e6d1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0b081167b2c10b9fc77735e586af9dc6f319e6d1
Author: Mike Blumenkrantz <[email protected]> Date: Wed Aug 31 15:37:31 2022 -0400 zink: don't emit illegal interpolation this is not valid for vertex inputs or fragment outputs cc: mesa-stable Reviewed-by: Erik Faye-Lund <[email protected]> Reviewed-by: Emma Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18365> (cherry picked from commit da1a3ed2ead1633b9ba7170b3e1fb4c08fa8dc2b) --- .pick_status.json | 2 +- src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d4cbbdfa5fb..53778f061c9 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -6133,7 +6133,7 @@ "description": "zink: don't emit illegal interpolation", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c index 1c7b4b4f686..aa2091a2fcf 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c +++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c @@ -553,6 +553,7 @@ emit_input(struct ntv_context *ctx, struct nir_variable *var) spirv_builder_emit_decoration(&ctx->builder, var_id, SpvDecorationCentroid); else if (var->data.sample) spirv_builder_emit_decoration(&ctx->builder, var_id, SpvDecorationSample); + emit_interpolation(ctx, var_id, var->data.interpolation); } else if (ctx->stage < MESA_SHADER_FRAGMENT) { switch (var->data.location) { HANDLE_EMIT_BUILTIN(POS, Position); @@ -582,8 +583,6 @@ emit_input(struct ntv_context *ctx, struct nir_variable *var) if (var->data.patch) spirv_builder_emit_decoration(&ctx->builder, var_id, SpvDecorationPatch); - emit_interpolation(ctx, var_id, var->data.interpolation); - _mesa_hash_table_insert(ctx->vars, var, (void *)(intptr_t)var_id); assert(ctx->num_entry_ifaces < ARRAY_SIZE(ctx->entry_ifaces)); @@ -631,6 +630,7 @@ emit_output(struct ntv_context *ctx, struct nir_variable *var) ctx->so_output_gl_types[idx] = var->type; ctx->so_output_types[idx] = var_type; } + emit_interpolation(ctx, var_id, var->data.interpolation); } else { if (var->data.location >= FRAG_RESULT_DATA0) { spirv_builder_emit_location(&ctx->builder, var_id, @@ -667,8 +667,6 @@ emit_output(struct ntv_context *ctx, struct nir_variable *var) spirv_builder_emit_component(&ctx->builder, var_id, var->data.location_frac); - emit_interpolation(ctx, var_id, var->data.interpolation); - if (var->data.patch) spirv_builder_emit_decoration(&ctx->builder, var_id, SpvDecorationPatch);
