summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2013-08-21 20:35:51 +0200
committerRoland Scheidegger <sroland@vmware.com>2013-08-21 22:05:52 +0200
commit275d2efeed79f135bbcc512bcf2c0607f2f25cd1 (patch)
treed91b3b02ceb005bfd5bd5d61271e5f02d5399eaf /src/gallium/auxiliary/gallivm
parent21d8fa275966ed56be48648d1847c8ded92534bc (diff)
gallivm: add comment for bogus min/mag filter selection with nearest mip filter
Detected this hunting some other bug, not sure if it really needs fixing but it is definitely wrong. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample.c8
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c2
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c2
3 files changed, 10 insertions, 2 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;
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c
index da416aab87e..2573cec2d1b 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c
@@ -1611,7 +1611,7 @@ lp_build_sample_aos(struct lp_build_sample_context *bld,
LLVMValueRef minify;
/*
- * XXX this should to all lods into account, if some are min
+ * XXX this should take all lods into account, if some are min
* some max probably could hack up the coords/weights in the linear
* path with selects to work for nearest.
* If that's just two quads sitting next to each other it seems
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index 6d125872844..34ab414733c 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -1636,7 +1636,7 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
LLVMValueRef minify;
/*
- * XXX this should to all lods into account, if some are min
+ * XXX this should take all lods into account, if some are min
* some max probably could hack up the coords/weights in the linear
* path with selects to work for nearest.
* If that's just two quads sitting next to each other it seems