I am currently trying to get pixel information back out of the GPU so it can be processed/saved/fed back through the loop.
To do this, I am attempting to implement transform feedback. I am encountering issues splitting up the GPU's pipeline. This separation of the vertex and fragment shader programs means also separating the compilation and shader program creation. In implementing this, the compiler is giving me catch-22 feedback in which it tells me that if I separate the shaders, then I need to redeclare certain builtin per-vertex variables such as gl_Position.
ERROR: Built-in variable 'gl_Position' must be redeclared before use,
with separate shader objects.
But when I do that it tells me that I'm not allowed to redeclare builtin variables:
highp vec4 gl_Position;
ERROR: 0:1: Regular non-array variable 'gl_Position' may not be redeclared.
I tried redefining gl_PerVertex as in examples I’ve found, but it fails to recognize that gl_PerVertex is a built-in thing:
// Below ins, outs, and uniforms in the vertex shader:
out gl_PerVertex
{
vec4 gl_Position;
float gl_PointSize;
float gl_ClipDistance[];
};
ERROR: 0:1: Identifier name 'gl_PerVertex' cannot start with 'gl_'
Does anyone know specifically which variable(s) to redeclare in the vertex shader for iOS to effectively redeclare gl_Position? Or was something wrong in either of the two things that I already tried?