glsl: Don't consider read-only fragment outputs to be written to.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 20 Jul 2016 03:29:55 +0000 (20:29 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 24 Aug 2016 20:28:31 +0000 (13:28 -0700)
Since they cannot be written.  This prevents adding fragment outputs
to the OutputsWritten set that are only read from via the
gl_LastFragData array but never written to.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/ir_set_program_inouts.cpp

index 060bea8dd8efbfb5f2383d4957b4fd2b2e497c8d..a6475b519e4a84a7dad346f3b86aec73a6ae07bc 100644 (file)
@@ -137,7 +137,7 @@ mark(struct gl_program *prog, ir_variable *var, int offset, int len,
          assert(var->data.mode == ir_var_shader_out);
          if (is_patch_generic)
             prog->PatchOutputsWritten |= bitfield;
-         else
+         else if (!var->data.read_only)
             prog->OutputsWritten |= bitfield;
       }
    }