mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 01:40:14 +01:00
glsl: only match gl_FragData and not gl_SecondaryFragDataEXT
There's special logic around finding gl_FragData. It latches onto any
array with FRAG_RESULT_DATA0. However gl_SecondaryFragDataEXT[], added
by GL_EXT_blend_func_extended, fits those parameters as well. The real
frag data array should have index 0 though, so we can use that to
distinguish them.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96617
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.1 11.2 12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 36ed1b695e)
This commit is contained in:
parent
8ac0a713f7
commit
abfed13bf4
1 changed files with 5 additions and 2 deletions
|
|
@ -88,7 +88,9 @@ public:
|
|||
if (!var || var->data.mode != this->mode || !var->type->is_array())
|
||||
return visit_continue;
|
||||
|
||||
if (this->find_frag_outputs && var->data.location == FRAG_RESULT_DATA0) {
|
||||
/* Only match gl_FragData[], not gl_SecondaryFragDataEXT[] */
|
||||
if (this->find_frag_outputs && var->data.location == FRAG_RESULT_DATA0 &&
|
||||
var->data.index == 0) {
|
||||
this->fragdata_array = var;
|
||||
|
||||
ir_constant *index = ir->array_index->as_constant();
|
||||
|
|
@ -143,7 +145,8 @@ public:
|
|||
if (var->data.mode != this->mode || !var->type->is_array())
|
||||
return visit_continue;
|
||||
|
||||
if (this->find_frag_outputs && var->data.location == FRAG_RESULT_DATA0) {
|
||||
if (this->find_frag_outputs && var->data.location == FRAG_RESULT_DATA0 &&
|
||||
var->data.index == 0) {
|
||||
/* This is a whole array dereference. */
|
||||
this->fragdata_usage |= (1 << var->type->array_size()) - 1;
|
||||
this->lower_fragdata_array = false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue