aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2020-02-04 11:12:25 +0100
committerMarge Bot <[email protected]>2020-02-10 11:01:47 +0000
commite365f83740f1faa0e4d022da7b9aea9ae6dacbda (patch)
tree39c058868f97c4ca442fcb183d5c05e6176c4dc9 /src/gallium
parent8736ffae2eda9de1ac49200ef399170b428b9f8c (diff)
zink: emit blend-target index
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3689>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c1
-rw-r--r--src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c7
-rw-r--r--src/gallium/drivers/zink/nir_to_spirv/spirv_builder.h3
3 files changed, 11 insertions, 0 deletions
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 455bb562a47..fa2c7b0bf94 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
@@ -331,6 +331,7 @@ emit_output(struct ntv_context *ctx, struct nir_variable *var)
switch (var->data.location) {
case FRAG_RESULT_COLOR:
spirv_builder_emit_location(&ctx->builder, var_id, 0);
+ spirv_builder_emit_index(&ctx->builder, var_id, var->data.index);
break;
case FRAG_RESULT_DEPTH:
diff --git a/src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c b/src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c
index bdb8b8a1179..9fb447611f3 100644
--- a/src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c
+++ b/src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c
@@ -222,6 +222,13 @@ spirv_builder_emit_array_stride(struct spirv_builder *b, SpvId target,
emit_decoration(b, target, SpvDecorationArrayStride, args, ARRAY_SIZE(args));
}
+void
+spirv_builder_emit_index(struct spirv_builder *b, SpvId target, int index)
+{
+ uint32_t args[] = { index };
+ emit_decoration(b, target, SpvDecorationIndex, args, ARRAY_SIZE(args));
+}
+
static void
emit_member_decoration(struct spirv_builder *b, SpvId target, uint32_t member,
SpvDecoration decoration, const uint32_t extra_operands[],
diff --git a/src/gallium/drivers/zink/nir_to_spirv/spirv_builder.h b/src/gallium/drivers/zink/nir_to_spirv/spirv_builder.h
index bd19e74822c..d0843b8ff79 100644
--- a/src/gallium/drivers/zink/nir_to_spirv/spirv_builder.h
+++ b/src/gallium/drivers/zink/nir_to_spirv/spirv_builder.h
@@ -94,6 +94,9 @@ spirv_builder_emit_builtin(struct spirv_builder *b, SpvId target,
SpvBuiltIn builtin);
void
+spirv_builder_emit_index(struct spirv_builder *b, SpvId target, int index);
+
+void
spirv_builder_emit_descriptor_set(struct spirv_builder *b, SpvId target,
uint32_t descriptor_set);