[Mesa-dev] [PATCH 2/2] i965/gen: Don't conflate base miplevel in sampler state

Kenneth Graunke kenneth at whitecape.org
Thu Aug 27 23:24:26 PDT 2015


On Thursday, August 27, 2015 11:50:52 AM Ben Widawsky wrote:
> Gen9 changes the meaning of this to coarse LOD quality mode. Although that's a
> desirable thing to be setting, it doesn't match the gen8 behavior and this was
> unintentional.
> 
> This doesn't fix, or regress anything on SKL (AFAICT).
> 
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
> ---
>  src/mesa/drivers/dri/i965/brw_sampler_state.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_sampler_state.c b/src/mesa/drivers/dri/i965/brw_sampler_state.c
> index 2021bb3..b1e339b 100644
> --- a/src/mesa/drivers/dri/i965/brw_sampler_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_sampler_state.c
> @@ -94,11 +94,13 @@ brw_emit_sampler_state(struct brw_context *brw,
>                         uint32_t border_color_offset)
>  {
>     ss[0] = BRW_SAMPLER_LOD_PRECLAMP_ENABLE |
> -           SET_FIELD(base_level, BRW_SAMPLER_BASE_MIPLEVEL) |
>             SET_FIELD(mip_filter, BRW_SAMPLER_MIP_FILTER) |
>             SET_FIELD(mag_filter, BRW_SAMPLER_MAG_FILTER) |
>             SET_FIELD(min_filter, BRW_SAMPLER_MIN_FILTER);
>  
> +   if (brw->gen < 9)
> +      SET_FIELD(base_level, BRW_SAMPLER_BASE_MIPLEVEL);
> +

This is broken - SET_FIELD just produces a shifted/masked value.
You have to actually or it into ss[0] for it to have any effect.

That said, it appears that we pass 0 for base_level in all callers.

How about a patch that removes the base_level function parameter
altogether, as well as the SET_FIELD line?

>     ss[2] = border_color_offset;
>     if (brw->gen < 6) {
>        ss[2] += brw->batch.bo->offset64; /* reloc */
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150827/cab76fae/attachment.sig>


More information about the mesa-dev mailing list