mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/tpf: Do not uninvert used masks for domain shader patch constants.
This commit is contained in:
parent
8876030590
commit
cabf9996f9
Notes:
Alexandre Julliard
2023-12-11 23:20:06 +01:00
Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/464
@ -431,10 +431,6 @@ static int shader_parse_signature(const struct vkd3d_shader_dxbc_section_desc *s
|
||||
case TAG_OSG5:
|
||||
if (e[i].sysval_semantic == VKD3D_SHADER_SV_NONE)
|
||||
e[i].sysval_semantic = map_fragment_output_sysval(e[i].semantic_name);
|
||||
/* Fall through. */
|
||||
case TAG_PCSG:
|
||||
case TAG_PSG1:
|
||||
e[i].used_mask = e[i].mask & ~e[i].used_mask;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2544,6 +2544,16 @@ static bool shader_sm4_init(struct vkd3d_shader_sm4_parser *sm4, const uint32_t
|
||||
return true;
|
||||
}
|
||||
|
||||
static void uninvert_used_masks(struct shader_signature *signature)
|
||||
{
|
||||
for (unsigned int i = 0; i < signature->element_count; ++i)
|
||||
{
|
||||
struct signature_element *e = &signature->elements[i];
|
||||
|
||||
e->used_mask = e->mask & ~e->used_mask;
|
||||
}
|
||||
}
|
||||
|
||||
static bool shader_sm4_parser_validate_signature(struct vkd3d_shader_sm4_parser *sm4,
|
||||
const struct shader_signature *signature, unsigned int *masks, const char *name)
|
||||
{
|
||||
@ -2639,6 +2649,12 @@ int vkd3d_shader_sm4_parser_create(const struct vkd3d_shader_compile_info *compi
|
||||
return VKD3D_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
/* DXBC stores used masks inverted for output signatures, for some reason.
|
||||
* We return them un-inverted. */
|
||||
uninvert_used_masks(&shader_desc->output_signature);
|
||||
if (sm4->p.shader_version.type == VKD3D_SHADER_TYPE_HULL)
|
||||
uninvert_used_masks(&shader_desc->patch_constant_signature);
|
||||
|
||||
if (!shader_sm4_parser_validate_signature(sm4, &shader_desc->input_signature,
|
||||
sm4->input_register_masks, "Input")
|
||||
|| !shader_sm4_parser_validate_signature(sm4, &shader_desc->output_signature,
|
||||
|
Loading…
x
Reference in New Issue
Block a user