From bf3896adc445b5719397dda56e0607b8237c0c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Mon, 10 Jul 2017 15:33:34 +0200 Subject: [PATCH] libs/vkd3d-shader: Decorate shader inputs with Component decoration. Needed when multiple inputs are stored in a single register. --- libs/vkd3d-shader/spirv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 70b4f02e..3547c3c0 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -1615,8 +1615,8 @@ static uint32_t vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compi const struct vkd3d_shader_dst_param *dst, enum vkd3d_shader_input_sysval_semantic sysval) { enum vkd3d_component_type component_type = vkd3d_component_type_for_semantic(sysval); + unsigned int component_idx, component_count, input_component_count; struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; - unsigned int component_count, input_component_count; uint32_t val_id, input_id, var_id; struct vkd3d_symbol reg_symbol; SpvStorageClass storage_class; @@ -1635,9 +1635,16 @@ static uint32_t vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compi storage_class, component_type, input_component_count); vkd3d_spirv_add_iface_variable(builder, input_id); if (sysval) + { vkd3d_dxbc_compiler_decorate_sysval(compiler, input_id, sysval); + } else + { vkd3d_spirv_build_op_decorate1(builder, input_id, SpvDecorationLocation, dst->reg.idx[0].offset); + component_idx = vkd3d_write_mask_get_component_idx(dst->write_mask); + if (component_idx) + vkd3d_spirv_build_op_decorate1(builder, input_id, SpvDecorationComponent, component_idx); + } if (component_type != VKD3D_TYPE_FLOAT) {