summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm/lp_bld_sample.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_sample.c')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
index d339abaea04..696855b1335 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
@@ -700,6 +700,14 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
if (mip_filter == PIPE_TEX_MIPFILTER_NONE ||
mip_filter == PIPE_TEX_MIPFILTER_NEAREST) {
+ /*
+ * XXX: this is not entirely correct, as out_lod_ipart is used
+ * both for mip level determination as well as mag/min switchover
+ * point (if different min/mag filters are used). In particular,
+ * lod values between [-0.5,0] (rho between [sqrt(2), 1.0]) will
+ * incorrectly use min filter instead of mag (the non-optimized
+ * calculation further down has exactly the same problem).
+ */
*out_lod_ipart = lp_build_ilog2(levelf_bld, rho);
*out_lod_fpart = levelf_bld->zero;
return;