Mesa (master): gallivm: Allow to disable bri-linear filtering with GALLIVM_DEBUG= no_brilinear runtime option
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Sun Oct 10 17:48:12 UTC 2010
Module: Mesa
Branch: master
Commit: 48003f3567d2732cfab08186934c4261c0447c9c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=48003f3567d2732cfab08186934c4261c0447c9c
Author: José Fonseca <jfonseca at vmware.com>
Date: Sun Oct 10 18:47:24 2010 +0100
gallivm: Allow to disable bri-linear filtering with GALLIVM_DEBUG=no_brilinear runtime option
---
src/gallium/auxiliary/gallivm/lp_bld_debug.h | 11 ++++++-----
src/gallium/auxiliary/gallivm/lp_bld_init.c | 1 +
src/gallium/auxiliary/gallivm/lp_bld_sample.c | 7 +++----
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.h b/src/gallium/auxiliary/gallivm/lp_bld_debug.h
index 369c1bb..eb11dcd 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_debug.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.h
@@ -36,11 +36,12 @@
#include "util/u_string.h"
-#define GALLIVM_DEBUG_TGSI 0x1
-#define GALLIVM_DEBUG_IR 0x2
-#define GALLIVM_DEBUG_ASM 0x4
-#define GALLIVM_DEBUG_NO_OPT 0x8
-#define GALLIVM_DEBUG_PERF 0x10
+#define GALLIVM_DEBUG_TGSI (1 << 0)
+#define GALLIVM_DEBUG_IR (1 << 1)
+#define GALLIVM_DEBUG_ASM (1 << 2)
+#define GALLIVM_DEBUG_NO_OPT (1 << 3)
+#define GALLIVM_DEBUG_PERF (1 << 4)
+#define GALLIVM_DEBUG_NO_BRILINEAR (1 << 5)
#ifdef DEBUG
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index 761f33b..5598ca5 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -44,6 +44,7 @@ static const struct debug_named_value lp_bld_debug_flags[] = {
{ "asm", GALLIVM_DEBUG_ASM, NULL },
{ "nopt", GALLIVM_DEBUG_NO_OPT, NULL },
{ "perf", GALLIVM_DEBUG_PERF, NULL },
+ { "no_brilinear", GALLIVM_DEBUG_NO_BRILINEAR, NULL },
DEBUG_NAMED_VALUE_END
};
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
index 1a27a24..9d15a6f 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
@@ -47,8 +47,7 @@
/*
- * Bri-linear factor. Use zero or any other number less than one to force
- * tri-linear filtering.
+ * Bri-linear factor. Should be greater than one.
*/
#define BRILINEAR_FACTOR 2
@@ -464,7 +463,7 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
return;
}
if (mip_filter == PIPE_TEX_MIPFILTER_LINEAR &&
- BRILINEAR_FACTOR > 1.0) {
+ !(gallivm_debug & GALLIVM_DEBUG_NO_BRILINEAR)) {
lp_build_brilinear_rho(float_bld, rho, BRILINEAR_FACTOR,
out_lod_ipart, out_lod_fpart);
return;
@@ -507,7 +506,7 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
}
if (mip_filter == PIPE_TEX_MIPFILTER_LINEAR) {
- if (BRILINEAR_FACTOR > 1.0) {
+ if (!(gallivm_debug & GALLIVM_DEBUG_NO_BRILINEAR)) {
lp_build_brilinear_lod(float_bld, lod, BRILINEAR_FACTOR,
out_lod_ipart, out_lod_fpart);
}
More information about the mesa-commit
mailing list