Closed aconstlink closed 1 year ago
Many detail work here. Need to distinguish a lot between shader stages. If transform feedback is used, the varying need to be prefixed by the interface blocks' name.
out interface_block_name
{
vec4 xyz ;
} output ;
output.xyz = ...
Need to be told to GL (glTransformFeedbackVaryings
) like so interface_block_name.xyz
and not output.xyz
in order to capture it. In HLSL and Dx this is handled by the binding so the name of the variables are irrelevant. The hlsl generator already works with hlsl input/output structs anyways...
The code generator needs to use interface blocks what was finally required by the geometry shader nsl issue (#327). This is mainly due to the fact that a geometry shader processes primitives and I found it more plausible to use the array version of the named interface block than making every varying an array.
So we have this
versus this
I find the second version very more pleasing and might be even required in certain situations ( I read in the books ).
Anyways, this also imposes other issues with streamout and passing the freaking position around... Very annoying.
In GLSL the position is passed around by
gl_Position
which is not very systematic. In HLSL this is handled by bindings which makes is easy to pass the position from shader stage to stage. Nsl also uses binding points and those binding points play well with HLSL but not with GLSL. So this need to be handled also.