mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader/ir: Transform clip/cull inputs/outputs into arrays.
Takes care of transforming clip/cull system values from the Direct3D convention of 2 4-component registers, into the SPIR-V/GLSL convention of 8-element scalar float arrays. This fixes SPIR-V validation errors in clip-cull-distance.shader_test, as well as segfaults on Mesa 25.1.1-arch1.2 if those shaders are executed regardless. We create indexable temporaries of the appropriate size, and replace accesses to clip/cull I/O signature elements with accesses to those temporaries. The existing clip/cull signature elements are then replaced with new scalar signature element arrays, and we copy the contents of those I/O signature elements to/from the corresponding temporaries at the start/end of the vsir program. It is worth pointing out that the current implementation assumes that every instance of the control point phase of a hull shader only writes to the output registers of its control point, given by vOutputControlPointID, and not to other control points. Shader compilation will fail if that constraint is violated.
This commit is contained in:
committed by
Henri Verbeet
parent
85b7b9c6b4
commit
0dabfdee63
Notes:
Henri Verbeet
2025-11-25 20:40:54 +01:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1816