Mesa (master): nvfx: set magic bit to round NPOT mipmap sizes down and not up

Luca Barbieri lb at kemper.freedesktop.org
Fri Sep 3 17:17:36 PDT 2010


Module: Mesa
Branch: master
Commit: fa82ad84fbe2be2bbfe9de7cda3e901a069ae16c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fa82ad84fbe2be2bbfe9de7cda3e901a069ae16c

Author: Luca Barbieri <luca at luca-barbieri.com>
Date:   Sat Sep  4 02:05:14 2010 +0200

nvfx: set magic bit to round NPOT mipmap sizes down and not up

Does any API even use rounding-up?

---

 src/gallium/drivers/nouveau/nouveau_class.h |    3 +++
 src/gallium/drivers/nvfx/nvfx_screen.c      |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_class.h b/src/gallium/drivers/nouveau/nouveau_class.h
index 20941f3..3c2248b 100644
--- a/src/gallium/drivers/nouveau/nouveau_class.h
+++ b/src/gallium/drivers/nouveau/nouveau_class.h
@@ -6877,6 +6877,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define   NV40TCL_COLOR_LOGIC_OP_SET							0x0000150f
 #define  NV40TCL_DEPTH_RANGE_NEAR							0x00000394
 #define  NV40TCL_DEPTH_RANGE_FAR							0x00000398
+#define  NV40TCL_MIPMAP_ROUNDING							0x000003b0
+#define  NV40TCL_MIPMAP_ROUNDING_UP							0x00000000
+#define  NV40TCL_MIPMAP_ROUNDING_DOWN							0x00100000
 #define  NV40TCL_LINE_WIDTH								0x000003b8
 #define  NV40TCL_LINE_SMOOTH_ENABLE							0x000003bc
 #define  NV40TCL_UNK03C0(x)								(0x000003c0+((x)*4))
diff --git a/src/gallium/drivers/nvfx/nvfx_screen.c b/src/gallium/drivers/nvfx/nvfx_screen.c
index e6ba7bc..b5b7a34 100644
--- a/src/gallium/drivers/nvfx/nvfx_screen.c
+++ b/src/gallium/drivers/nvfx/nvfx_screen.c
@@ -328,6 +328,9 @@ static void nv40_screen_init(struct nvfx_screen *screen)
 	OUT_RING(chan, 0x00d30000);
 	OUT_RING(chan, RING_3D(0x1e94, 1));
 	OUT_RING(chan, 0x00000001);
+
+	OUT_RING(chan, RING_3D(NV40TCL_MIPMAP_ROUNDING, 1));
+	OUT_RING(chan, NV40TCL_MIPMAP_ROUNDING_DOWN);
 }
 
 static unsigned



More information about the mesa-commit mailing list