vkd3d-shader: Compute XfbOffset for the slot of the specified element.

Fixes NVIDIA HairWorks GPU crash on Metro Exodus, and test failures
in test_line_tessellation().
Based on a vkd3d-proton patch by Hans-Kristian Arntzen.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Conor McCarthy
2021-07-24 00:26:01 +10:00
committed by Alexandre Julliard
parent 8860c4d077
commit b01104e47d
2 changed files with 4 additions and 4 deletions

View File

@@ -4136,13 +4136,15 @@ static void vkd3d_dxbc_compiler_decorate_xfb_output(struct vkd3d_dxbc_compiler *
xfb_element = e;
break;
}
offset += 4 * e->component_count;
}
if (!xfb_element)
return;
for (i = 0; xfb_element != &xfb_info->elements[i]; ++i)
if (xfb_info->elements[i].output_slot == xfb_element->output_slot)
offset += 4 * xfb_info->elements[i].component_count;
if (xfb_element->component_index || xfb_element->component_count > component_count)
{
FIXME("Unhandled component range %u, %u.\n", xfb_element->component_index, xfb_element->component_count);