[PATCH vkd3d 1/7] vkd3d-shader: Apply 'Patch' decoration to builtin patch constant inputs.

Conor McCarthy cmccarthy at codeweavers.com
Wed Sep 22 23:55:41 CDT 2021


Prevents a crash in RADV due to an assertion failure when such inputs
are present.

Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
---
 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 f604b8ef..20744fe7 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -4542,6 +4542,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.32.0




More information about the wine-devel mailing list