Skip to content

etnaviv: tex_state: fix miplevel selection

Lucas Stach requested to merge lynxeye/mesa:etnaviv-texstate-miplevel into master

Older cores with state based texture handling currently fail the piglit tex-miplevel-selection when lodbias is enabled but mipmap filtering disabled and also when a GL_TEXTURE_BASE_LEVEL or GL_TEXTURE_MAX_LEVEL is set. On cores with NTE states the latter could probably be fixed by writing those values in NTE_SAMPLER_BASELOD, but as we don't have this option on cores without NTE, this patch just always computes a proper MIN/MAX lod value to write into TE_SAMPLER_LOD_CONFIG.

On GC7000 we already configure the BASELOD, as it's always part of the texture descriptor and the hardware seems to be clever enough to figure out the interaction between lodbias and mipmap filtering on its own, so the piglit test passes on this HW without any changes.

Merge request reports