Module: vkd3d Branch: master Commit: df0a031ad8621d2bfbdebcfe7266bd56abfe73e6 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/df0a031ad8621d2bfbdebcfe7266bd...
Author: Zebediah Figura zfigura@codeweavers.com Date: Fri Jun 9 19:59:11 2023 -0500
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().
---
libs/vkd3d-shader/spirv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index cc0b63e8..a6700e66 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -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);