From: Józef Kucia jkucia@codeweavers.com
In domain shaders, inputs are declared with dcl_input without semantic.
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- include/vkd3d_shader.h | 1 + libs/vkd3d-shader/spirv.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+)
diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h index e803237c1f29..679abfee4061 100644 --- a/include/vkd3d_shader.h +++ b/include/vkd3d_shader.h @@ -424,6 +424,7 @@ enum vkd3d_component_type
enum vkd3d_sysval_semantic { + VKD3D_SV_NONE = 0, VKD3D_SV_POSITION = 1, VKD3D_SV_CLIP_DISTANCE = 2, VKD3D_SV_CULL_DISTANCE = 3, diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 8f9fff7f89ca..3db8e3db07dc 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -129,6 +129,20 @@ static const void *vkd3d_find_struct_(const struct vkd3d_struct *chain, return NULL; }
+static enum vkd3d_shader_input_sysval_semantic vkd3d_siv_from_sysval(enum vkd3d_sysval_semantic sysval) +{ + switch (sysval) + { + case VKD3D_SV_NONE: + return VKD3D_SIV_NONE; + case VKD3D_SV_POSITION: + return VKD3D_SIV_POSITION; + default: + FIXME("Unhandled sysval %#x.\n", sysval); + return VKD3D_SIV_NONE; + } +} + #define VKD3D_SPIRV_VERSION 0x00010000 #define VKD3D_SPIRV_GENERATOR_ID 18 #define VKD3D_SPIRV_GENERATOR_VERSION 1 @@ -3396,6 +3410,9 @@ static uint32_t vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compi return 0; }
+ if (!sysval && signature_element->sysval_semantic) + sysval = vkd3d_siv_from_sysval(signature_element->sysval_semantic); + builtin = get_spirv_builtin_for_sysval(compiler, sysval);
component_idx = vkd3d_write_mask_get_component_idx(dst->write_mask);