vkd3d-shader/spirv: Retrieve input sysvals from the signature for geometry shaders as well.

This only affects clip and cull distances. The HLSL compiler emits these using
dcl_input, but the previous shader (vertex or TES) will write them as a SPIRV
builtin, and hence we want to read this as a SPIRV builtin as well.

This fixes validation errors in Wine's test_clip_distance().
This commit is contained in:
Zebediah Figura 2023-06-09 19:59:11 -05:00 committed by Alexandre Julliard
parent d856be0519
commit df0a031ad8
Notes: Alexandre Julliard 2023-06-12 23:10:32 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/231

View File

@ -4479,7 +4479,8 @@ static uint32_t spirv_compiler_emit_input(struct spirv_compiler *compiler,
element_idx = shader_register_get_io_indices(reg, array_sizes);
signature_element = &shader_signature->elements[element_idx];
if (compiler->shader_type == VKD3D_SHADER_TYPE_HULL && !sysval && signature_element->sysval_semantic)
if ((compiler->shader_type == VKD3D_SHADER_TYPE_HULL || compiler->shader_type == VKD3D_SHADER_TYPE_GEOMETRY)
&& !sysval && signature_element->sysval_semantic)
sysval = vkd3d_siv_from_sysval(signature_element->sysval_semantic);
builtin = get_spirv_builtin_for_sysval(compiler, sysval);