PDA

View Full Version : fragment shader hanging



driver
09-18-2013, 08:22 AM
Hi

I have a simple fragment shader that outputs color values green and red.

layout(location = 0, index = 0) out vec4 Color0;
layout(location = 1, index = 0) out vec4 Color1;

Color0=vec4(0.0,0.0,1.0,1.0);
Color1=vec4(1.0,0.0,0.0,1.0);

However, when I build my visual studio solution it seems to hang on such a simple fragment shader. I am not sure how to debug this any better since this is the simplest possible scenerio.

carsten neumann
09-18-2013, 10:11 AM
That does not make sense to me. Visual Studio compiles your application code not your shaders (those are compiled at runtime by the OpenGL implementation, aka the graphics driver). What you posted is also not a complete fragment shader, it does not contain a function with signature
void main(void){ } Are you checking for OpenGL errors with glGetError or KHR_debug (http://www.opengl.org/registry/specs/KHR/debug.txt) and do you check if your shaders compile and link successfully?