Conor McCarthy : vkd3d-shader/spirv: Apply 'Patch' decorations to builtin patch constant inputs.

Alexandre Julliard julliard at winehq.org
Wed Nov 17 16:25:40 CST 2021


Module: vkd3d
Branch: master
Commit: 9a1f6c7daff0302bd77b18f5d68d34f120e81937
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=9a1f6c7daff0302bd77b18f5d68d34f120e81937

Author: Conor McCarthy <cmccarthy at codeweavers.com>
Date:   Wed Nov 17 13:05:58 2021 +0100

vkd3d-shader/spirv: Apply 'Patch' decorations to builtin patch constant inputs.

Prevents a crash in radv when such inputs are present.

Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 libs/vkd3d-shader/spirv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index 698c305..8827c43 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -4582,6 +4582,8 @@ static uint32_t vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compi
         if (builtin)
         {
             input_id = vkd3d_dxbc_compiler_emit_builtin_variable(compiler, builtin, storage_class, array_size);
+            if (reg->type == VKD3DSPR_PATCHCONST)
+                vkd3d_spirv_build_op_decorate(builder, input_id, SpvDecorationPatch, NULL, 0);
         }
         else
         {




More information about the wine-cvs mailing list