Query number of outputs in GLSL frag shader?

I’m working on a GPGPU project that makes heavy use of MRT in fragment shaders through gl_FragData. I was wondering if there was a way to query a program object after compilation and linking to determine the number of buffers the program writes to, similar to glGetProgram(…) + glGetActiveUniform(…)? At present, I do a simple text search of the GLSL source code and look for gl_FragData, but this method fails if there is a block of commented-out code that contains gl_FragData and I don’t really want to write more code to strip out the comments.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.