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:
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[],
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);