vkd3d-shader/spirv: Do not declare inputs with an empty used_mask.

This is motivated by SampleId, whose presence or absence determines whether a
fragment shader runs at sample frequency or not.

In HLSL, if SV_SampleIndex is declared but not used, this results in a signature
entry, but no dcl instruction (and a zero used mask in the signature entry).
Whether the shader will actually run at sample frequency is inconsistent. NVidia
does, AMD does not, and WARP does for d3d12 but not for d3d11.

Previously vkd3d-shader relied on the dcl instruction, thereby aligning with
AMD. This was changed by 66cb2815f0. This commit
restores the previous behaviour.
This commit is contained in:
Elizabeth Figura
2025-05-12 14:16:53 -05:00
committed by Henri Verbeet
parent 65e1ef047f
commit 8f6616993b
Notes: Henri Verbeet 2025-05-14 15:26:55 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1493

View File

@@ -5804,6 +5804,9 @@ static void spirv_compiler_emit_input(struct spirv_compiler *compiler,
if (compiler->shader_type == VKD3D_SHADER_TYPE_DOMAIN && reg_type != VKD3DSPR_PATCHCONST)
sysval = VKD3D_SHADER_SV_NONE;
if (!signature_element->used_mask)
return;
builtin = get_spirv_builtin_for_sysval(compiler, sysval);
array_sizes[0] = signature_element->register_count;