vkd3d-shader/ir: Specifically search for SV_POSITION0 in vsir_program_insert_clip_planes().

This commit is contained in:
Henri Verbeet 2024-11-01 00:14:18 +01:00
parent 51c37735a9
commit 1b0248f31b
Notes: Henri Verbeet 2024-11-04 17:12:02 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1241

View File

@ -6079,13 +6079,16 @@ static enum vkd3d_result insert_clip_planes_before_ret(struct vsir_program *prog
}
static bool find_sysval_signature_idx(const struct shader_signature *signature,
enum vkd3d_shader_sysval_semantic sysval, uint32_t *idx)
enum vkd3d_shader_sysval_semantic sysval, unsigned int semantic_index, unsigned int *element_index)
{
const struct signature_element *e;
for (unsigned int i = 0; i < signature->element_count; ++i)
{
if (signature->elements[i].sysval_semantic == sysval)
e = &signature->elements[i];
if (e->sysval_semantic == sysval && e->semantic_index == semantic_index)
{
*idx = i;
*element_index = i;
return true;
}
}
@ -6148,7 +6151,7 @@ static enum vkd3d_result vsir_program_insert_clip_planes(struct vsir_program *pr
}
}
if (!find_sysval_signature_idx(signature, VKD3D_SHADER_SV_POSITION, &position_signature_idx))
if (!find_sysval_signature_idx(signature, VKD3D_SHADER_SV_POSITION, 0, &position_signature_idx))
{
vkd3d_shader_error(ctx->message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_MISSING_SEMANTIC,
"Shader does not write position.");