mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
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.