From 665c29f0be5f23057e0800e3ed2ac309418b0a5f Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Mon, 16 Sep 2024 16:11:40 +0200 Subject: [PATCH] vkd3d-shader/tpf: Allow I/O index ranges to not intersect a signature element for a given register. The current TPF validator enforces that for each register involved in a DCL_INDEX_RANGE instruction there must be a signature element for that register and the DCL_INDEX_RANGE write mask. This is an excessively strong request, and causes some shaders from The Falconeer to be invalidly rejected. The excessively strong check was needed to avoid triggering a bug in the I/O normaliser. Since that bug is now solved, the check can be relaxed. --- libs/vkd3d-shader/tpf.c | 3 ++- tests/hlsl/tessellation.shader_test | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d-shader/tpf.c b/libs/vkd3d-shader/tpf.c index 82302aac..d41f1c65 100644 --- a/libs/vkd3d-shader/tpf.c +++ b/libs/vkd3d-shader/tpf.c @@ -1051,7 +1051,8 @@ static void shader_sm4_read_dcl_index_range(struct vkd3d_shader_instruction *ins register_idx, register_count, write_mask, e->sysval_semantic); return; } - if ((io_masks[register_idx + i] & write_mask) != write_mask) + if ((io_masks[register_idx + i] & write_mask) != write_mask + && (io_masks[register_idx + i] & write_mask) != 0) { WARN("No matching declaration for index range base %u, count %u, mask %#x.\n", register_idx, register_count, write_mask); diff --git a/tests/hlsl/tessellation.shader_test b/tests/hlsl/tessellation.shader_test index f34bf703..774b1d70 100644 --- a/tests/hlsl/tessellation.shader_test +++ b/tests/hlsl/tessellation.shader_test @@ -303,5 +303,5 @@ void main(patch_constant_data input, } [test] -todo draw 3 control point patch list 3 -todo(mvk) probe (0, 0, 640, 480) rgba(0.0, 1.0, 0.0, 1.0) +if(!llvmpipe) todo(glsl | msl | mvk & vulkan) draw 3 control point patch list 3 +if(!llvmpipe) todo(mvk) probe (0, 0, 640, 480) rgba(0.0, 1.0, 0.0, 1.0)