Skip to content

mesa/st, zink: force nearest-filtering for FP32 / integer textures

Erik Faye-Lund requested to merge kusma/mesa:zink-fp32-force-nearest into main

OpenGL 3.0 requires ARB_texture_float, which technically speaking requires linear-filtering support for FP32 textures. However, because a lot of early implementations just ignore this and does nearest filtering instead due to lack of hardware features for this, this functionality was never added to the OpenGL CTS.

The result is that FP32 is a feature that is required on paper, but is unreliable to be used by applications in practice. This is mostly fine; for most filterable use-cases (e.g colors), FP16 is fine and saves a bunch of bandwidth, and for cases where you really need the extra bits (depth-reads etc), filtering is usually not what's wanted.

This MR fixes things up a bit for Zink, for two reasons:

  1. We forward the filtering modes verbatim from the sampler state. That's incorrect for integer textures, when the force_integer_tex_nearest DRI-conf is in use.
  2. We always report PIPE_CAP_TEXTURE_FLOAT_LINEAR as supported, even when linear filtering isn't. This makes us do the wrong thing for FP32, similar to for integer textures.
Edited by Erik Faye-Lund

Merge request reports