Chase Walden
Chase Walden

Reputation: 1302

GLSL: Count of fragment shader 'out's

I am trying to write a class that handles glsl and automatically gathers the number of:

I know how to get the count of the first 2 using openGL's api but I cannot find a method for the third. If there is a way using openGL, I would prefer to use that. Otherwise I'll use a grep-like method to scan the frag program and return the data.

Upvotes: 2

Views: 285

Answers (1)

Alex I
Alex I

Reputation: 20307

I think you want glGetProgramInterfaceiv(). Something like this:

GLint numActiveOutputs = 0;
glGetProgramInterfaceiv(prog, GL_PROGRAM_OUTPUT​, GL_ACTIVE_RESOURCES​, &numActiveOutputs );

Upvotes: 4

Related Questions