Mesa (master): zink: emit interpolation decorations for ntv outputs
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 9 21:24:44 UTC 2020
Module: Mesa
Branch: master
Commit: 98d07bd5a0ad384c33eb781dec891326db207660
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=98d07bd5a0ad384c33eb781dec891326db207660
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Mon Jun 8 09:55:19 2020 -0400
zink: emit interpolation decorations for ntv outputs
this matches up with nir internal states pre/post ntv
Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5384>
---
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
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 eecbca3e5dc..12f82b4e6e0 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
@@ -349,6 +349,23 @@ emit_output(struct ntv_context *ctx, struct nir_variable *var)
spirv_builder_emit_component(&ctx->builder, var_id,
var->data.location_frac);
+ switch (var->data.interpolation) {
+ case INTERP_MODE_NONE:
+ case INTERP_MODE_SMOOTH: /* XXX spirv doesn't seem to have anything for this */
+ break;
+ case INTERP_MODE_FLAT:
+ spirv_builder_emit_decoration(&ctx->builder, var_id, SpvDecorationFlat);
+ break;
+ case INTERP_MODE_EXPLICIT:
+ spirv_builder_emit_decoration(&ctx->builder, var_id, SpvDecorationExplicitInterpAMD);
+ break;
+ case INTERP_MODE_NOPERSPECTIVE:
+ spirv_builder_emit_decoration(&ctx->builder, var_id, SpvDecorationNoPerspective);
+ break;
+ default:
+ unreachable("unknown interpolation value");
+ }
+
_mesa_hash_table_insert(ctx->vars, var, (void *)(intptr_t)var_id);
assert(ctx->num_entry_ifaces < ARRAY_SIZE(ctx->entry_ifaces));
More information about the mesa-commit
mailing list