[Mesa-dev] [PATCH 5/5] i965/ivb: Flag RG32F quirk for texture gather regardless of swizzles

Kenneth Graunke kenneth at whitecape.org
Sat Oct 5 11:10:40 PDT 2013


On 10/05/2013 03:38 AM, Chris Forbes wrote:
> As of ARB_gpu_shader5, textureGather doesn't always read the
> post-swizzle RED channel -- so we can't just look at the red swizzle
> state.
> 
> Theoretically we could only flag the quirk if *some* green swizzle is in
> use, but that's probably more trouble than it's worth.
> 
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>  src/mesa/drivers/dri/i965/brw_wm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
> index 6ce58dd..ebf6b9c 100644
> --- a/src/mesa/drivers/dri/i965/brw_wm.c
> +++ b/src/mesa/drivers/dri/i965/brw_wm.c
> @@ -349,7 +349,7 @@ brw_populate_sampler_prog_key_data(struct gl_context *ctx,
>           /* gather4's channel select for green from RG32F is broken;
>            * requires a shader w/a on IVB; fixable with just SCS on HSW. */
>           if (brw->gen >= 7 && !brw->is_haswell && prog->UsesGather) {
> -            if (img->InternalFormat == GL_RG32F && GET_SWZ(t->_Swizzle, 0) == 1)
> +            if (img->InternalFormat == GL_RG32F)
>                 key->gather_channel_quirk_mask |= 1 << s;
>           }
>        }
> 

This makes sense to me.  Checking for RG32F is probably sufficient for
now.  We can always add the (.r || .g || .b || .a) check later if it
becomes an issue.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list