zink: emit blend-target index
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 4 Feb 2020 10:12:25 +0000 (11:12 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 10 Feb 2020 11:01:47 +0000 (11:01 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3689>

src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c
src/gallium/drivers/zink/nir_to_spirv/spirv_builder.h

index 455bb562a4792a9e79586f0e614fde9f04850f3e..fa2c7b0bf94d509c401481255ea4fda0c2e2f4f9 100644 (file)
@@ -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:
index bdb8b8a1179e7a63211b12fbc6ddf4874bb5d4f6..9fb447611f3c4f7cf652239448a41ddf582bc780 100644 (file)
@@ -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[],
index bd19e74822c27362080e82e2358e6ce691df2ff7..d0843b8ff7985849f71dc51b3b12db2bd3b715e6 100644 (file)
@@ -93,6 +93,9 @@ void
 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);