View Full Version : Query number of outputs in GLSL frag shader?

05-06-2006, 06:47 PM
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.