Transform Feedback Varyings - strange error occurs when I add more than 4

Hey all,

Running into an odd error when trying to set up a transform feedback particle system. I was running into issues where my vertex shader code simply wasn’t doing anything; after a little while of trying to debug, it seems like the issue might be in how I’m trying to load the transform feedback shader itself.

Not sure if it’s a bug or me just being dumb but as a simple test case

 std::vector<std::string> feedbackVaryings({
	"position",
	"phi",
	"theta",
	"a",
	"b"
});

gl::GlslProg::Format tfmt;
tfmt.vertex(app::loadAsset("simulation.glsl"));
tfmt.feedbackFormat(GL_SEPARATE_ATTRIBS);
tfmt.feedbackVaryings(feedbackVaryings);
gl::GlslProgRef shader = gl::GlslProg::create(tfmt); 

lets imagine simulation.glsl looks like this

layout (location = 0) in vec3 iPosition;
layout (location = 1) in float iPhi;			
layout (location = 2) in float iTheta;		


out vec3 position;
out float phi;
out float theta;
void main(){

	
	position = iPosition;
	phi = iPhi;
	theta = iTheta;


	position = vec3(0.);
}

Since “a” and “b” aren’t declared as varyings in the simulation.glsl, compilation should fail correct? Believe it or not, this still compiles for me and I can launch my app regardless.

At first I thought it was something in my app setup but after trying things in a fresh project, I’m seeing the same result (╯°□°)╯︵ ┻━┻

Strangely enough, if I take out “b” from my varyings vector, I get a compilation error as expected.

any ideas? Maybe something I forgot to do?

Many thanks!

Interesting discovery this morning - if I change GL_SEPARATE_ATTRIBS to GL_INTERLEAVED_ATTRIBS, then things work as expected; since “a” and “b” aren’t declared, shader compilation fails.

That being said I was looking to use GL_SEPARATE_ATTRIBS haha (╯°□°)╯︵ ┻━┻

Ah… after messing around a bit, I’m not 100% certain but I think the reason I’m having trouble is cause I actually do have a max of 4 varying values I can use when using GL_SEPARATE_ATTRIBS, I guess I’m too used to WebGL and was just logging the constant GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS vs using glGetIntegerv which returned very different values.

Anyways I guess my question is resolved.