Closed aconstlink closed 1 year ago
gl_Position
is now used for all in
and out
interface blocks except for vertex shaders in
s because an in
interface block is not allowed there and it is also not replaced if transform feedback is used. Replacing the gl_in[].gl_Position
in the geometry shader should also do the trick if tessellation shaders are used.
This make some trouble because if streamout is activated, all interface block variables need to be written. Whereas if used in the rendering pipe,
gl_Position
need to be written anytime because the is too troublesome to check every time if the current stage is the last before raster. Also in the geometry shader if the output bound position is written,gl_Position
need to be written beforeEmitVertex
is called. So here also the generator needs to inject code every timeEmitVertex
is called but only if position is written.So if
gl_Position
is just written every time the output bound position variable is written, it makes code generation easier.The user defined type must be regarded because if only
gl_Position
is written, the next shader stage also need to read from it. To make things worse, geometry shader uses array so it is not onlygl_Position
butgl_in[].gl_Position
.