glsl2: Allow a fragment shader to not write a color.
authorEric Anholt <eric@anholt.net>
Wed, 30 Jun 2010 21:51:50 +0000 (14:51 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 30 Jun 2010 21:51:50 +0000 (14:51 -0700)
I can't find any text justifying this check, and it caused a
reasonable-looking shader in glsl-bug-22603 (which writes only
gl_FragDepth) to fail.

src/glsl/linker.cpp

index 11fccba378676c8bcda430a8fac6ef1888954805..5227d42e353e76866046d7f6d48db96c45778984 100644 (file)
@@ -232,12 +232,6 @@ validate_fragment_shader_executable(struct gl_shader_program *prog,
    frag_color.run(shader->ir);
    frag_data.run(shader->ir);
 
-   if (!frag_color.variable_found() && !frag_data.variable_found()) {
-      linker_error_printf(prog, "fragment shader does not write to "
-                         "`gl_FragColor' or `gl_FragData'\n");
-      return false;
-   }
-
    if (frag_color.variable_found() && frag_data.variable_found()) {
       linker_error_printf(prog,  "fragment shader writes to both "
                          "`gl_FragColor' and `gl_FragData'\n");