Makes emitting shaders from fx.c easier, and brings parsing failures
upfront.
Non-effect target profiles don't perform any type checks on
ConstructGSWithSO(), nor use shader objects in any way, but they do
check if the argument count is correct.
So we create a GeometryShader object with NULL decl and profile when
targeting non-effect profiles, so our type checks still work and
implicit conversions aren't attempted.
The Metal runner could in principle support this feature using
MTLSamplerDescriptor.reductionMode, but that requires macOS 26.0/Tahoe,
which is newer than my current setup.
Much like e.g. commits a686fa7750 and
93d2bb2d5d.
Direct3D 12 doesn't guarantee any implicit barriers after UAV clears,
but unfortunately missing these is often easy to go unnoticed.
Arrays are allowed for clip/cull distance semantics. Their maximum size
is 2 since that's the maximum amount of registers allowed for clip/cull
distances.
Indirect addressing of these arrays is allowed on shader model 6.
These tests are introduced after the transformation of clip/cull
input/outputs into arrays in vsir since otherwise they segfault.
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.