mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 17:50:11 +01:00
glsl: check that the fragment shader does not write both gl_FragColor and gl_FragData[]
This commit is contained in:
parent
5727ed130e
commit
f8a4ad1aee
1 changed files with 11 additions and 0 deletions
|
|
@ -644,6 +644,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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue