Skip to content

gallium,mesa/st: Add PIPE_CONTEXT_NO_LOD_BIAS flag

Alyssa Rosenzweig requested to merge alyssa/mesa:mesa/no-lod-bias into main

While desktop GL supports sampler LOD bias, GLES does not. To support the GL use case, all Gallium drivers are expected to handle sampler LOD bias. However, this may require shader code to implement (lowering tex to txb, txl to fadd+txl) and cost resources to push the LOD bias constants into the shader. The issue is compounded with something like Dolphin's GLES renderer, which does this LOD bias emulation itself -- meaning that LOD bias is lowered twice when using Dolphin with GLES! As such, this commit adds a context flag for frontends to communicate that they will never use sampler LOD bias, allowing the driver to omit the lowering as a GLES fast path (or, for Dolphin, for performance parity between GLES and GL).

This will be used on Asahi. It could also be used to optimize a path on Mali-T720 supported in Panfrost, though I don't intend to write that patch.

Merge request reports