fs_visitor::gather_channel(ir_texture *ir, int sampler)
{
int swiz = GET_SWZ(c->key.tex.swizzles[sampler], 0 /* red */);
+ if (c->key.tex.gather_channel_quirk_mask & (1<<sampler))
+ return 2; /* gather4 sampler is broken for green channel on RG32F --
+ * we must ask for blue instead.
+ */
switch (swiz) {
case SWIZZLE_X: return 0;
case SWIZZLE_Y: return 1;
vec4_visitor::gather_channel(ir_texture *ir, int sampler)
{
int swiz = GET_SWZ(key->tex.swizzles[sampler], 0 /* red */);
+ if (key->tex.gather_channel_quirk_mask & (1<<sampler))
+ return 2; /* gather4 sampler is broken for green channel on RG32F --
+ * we must ask for blue instead.
+ */
switch (swiz) {
case SWIZZLE_X: return 0;
case SWIZZLE_Y: return 1;
#include "brw_context.h"
#include "brw_wm.h"
#include "brw_state.h"
+#include "main/enums.h"
#include "main/formats.h"
#include "main/fbobject.h"
#include "main/samplerobj.h"
old_key->yuvtex_mask, key->yuvtex_mask);
found |= key_debug(brw, "GL_MESA_ycbcr UV swapping\n",
old_key->yuvtex_swap_mask, key->yuvtex_swap_mask);
+ found |= key_debug(brw, "gather channel quirk on any texture unit",
+ old_key->gather_channel_quirk_mask, key->gather_channel_quirk_mask);
return found;
}
if (sampler->WrapR == GL_CLAMP)
key->gl_clamp_mask[2] |= 1 << s;
}
+
+ /* gather4's channel select for green from RG32F is broken */
+ if (brw->gen >= 7 && prog->UsesGather) {
+ if (img->InternalFormat == GL_RG32F && GET_SWZ(t->_Swizzle, 0) == 1)
+ key->gather_channel_quirk_mask |= 1 << s;
+ }
}
}
}