[PATCH 0/1] MR511: vkd3d-shader/ir: Do not merge signature elements which have different interpolation modes.
Regression in signature normalisation, however the old code was not correct either because it would apply the interpolation mode to all components. Found in an Assassin's Creed: Valhalla shader. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/511
From: Conor McCarthy <cmccarthy(a)codeweavers.com> Regression in signature normalisation, however the old code was not correct either because it would apply the interpolation mode to all components. Found in an Assassin's Creed: Valhalla shader. --- libs/vkd3d-shader/ir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index acdb660ea..710811c67 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -777,8 +777,9 @@ static bool shader_signature_merge(struct shader_signature *s, uint8_t range_map f = &elements[j]; /* Merge different components of the same register unless sysvals are different, - * or it will be relative-addressed. */ + * interpolation modes are different, or it will be relative-addressed. */ if (f->register_index != e->register_index || f->sysval_semantic != e->sysval_semantic + || f->interpolation_mode != e->interpolation_mode || range_map_get_register_count(range_map, f->register_index, f->mask) > 1) break; -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/511
I haven't reviewed in detail, but I can confirm it fixes the validation error on that shader. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/511#note_55187
This merge request was closed by Conor McCarthy. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/511
Went upstream with the release MR. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/511#note_55310
This is actually causing problems, because the interpolation for unused components is NONE, and this prevents it from being merged with a used component. Moreover, when I compile from HLSL, elements with different interpolation modes don't get put in the same register, so I'm confused about why this patch even helps. What does the offending Assassin's Creed shader look like? -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/511#note_56363
participants (4)
-
Conor McCarthy -
Conor McCarthy (@cmccarthy) -
Giovanni Mascellani (@giomasce) -
Zebediah Figura (@zfigura)