summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_link.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-01-07 18:22:56 -0700
committerBrian Paul <[email protected]>2009-01-07 18:22:56 -0700
commitd1860bcd0ade44a884ac1b7e0c5b2bef8ed6afcb (patch)
treee53deea378e2355d492018332cedd8ee5b39c1a7 /src/mesa/shader/slang/slang_link.c
parent95fa98d61a857448e690a0671b2e1e1d2873f0ec (diff)
glsl: check that the fragment shader does not write both gl_FragColor and gl_FragData[]
Diffstat (limited to 'src/mesa/shader/slang/slang_link.c')
-rw-r--r--src/mesa/shader/slang/slang_link.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 108d11c7df4..26f5d61e048 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -645,6 +645,17 @@ _slang_link(GLcontext *ctx,
}
}
+ /* check that gl_FragColor and gl_FragData are not both written to */
+ if (shProg->FragmentProgram) {
+ GLbitfield outputsWritten = shProg->FragmentProgram->Base.OutputsWritten;
+ if ((outputsWritten & ((1 << FRAG_RESULT_COLR))) &&
+ (outputsWritten >= (1 << FRAG_RESULT_DATA0))) {
+ link_error(shProg, "Fragment program cannot write both gl_FragColor"
+ " and gl_FragData[].\n");
+ return;
+ }
+ }
+
if (fragProg && shProg->FragmentProgram) {
/* Compute initial program's TexturesUsed info */