[PATCH vkd3d 1/6] vkd3d-shader/spirv: Apply 'Patch' decorations to builtin patch constant inputs.

Henri Verbeet hverbeet at codeweavers.com
Wed Nov 17 06:05:58 CST 2021


From: Conor McCarthy <cmccarthy at codeweavers.com>

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>
---
This is triggered by the tests in patch 3/6 and 4/6 in this series.

 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 698c3054..8827c431 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
         {
-- 
2.20.1




More information about the wine-devel mailing list