[Mesa-dev] [PATCH] u_blitter: add missing sampler_state->normalized_coords = 1 (how can this be?!?)

Luca Barbieri luca at luca-barbieri.com
Tue Apr 13 21:33:05 PDT 2010


It's using normalized texcoords, but not setting it in the sampler state.

How can this possibly work with r300g though?
Am I missing something?

Perhaps r300g compensates with another bug that causes it to ignore the
request to use unnormalized texcoords?
---
 src/gallium/auxiliary/util/u_blitter.c  |    1 +
 src/gallium/drivers/nvfx/nv40_fragtex.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index 104cbf7..ba599e1 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -168,6 +168,7 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe)
    sampler_state->wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
    sampler_state->wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
    sampler_state->wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
+   sampler_state->normalized_coords = 1;
    /* The sampler state objects which sample from a specified mipmap level
     * are created on-demand. */
 
diff --git a/src/gallium/drivers/nvfx/nv40_fragtex.c b/src/gallium/drivers/nvfx/nv40_fragtex.c
index 289070e..69bc00b 100644
--- a/src/gallium/drivers/nvfx/nv40_fragtex.c
+++ b/src/gallium/drivers/nvfx/nv40_fragtex.c
@@ -125,7 +125,7 @@ nv40_fragtex_set(struct nvfx_context *nvfx, int unit)
 
 	txf  = ps->fmt;
 	txf |= tf->format | 0x8000;
-	txf |= ((pt->last_level + 1) << NV40TCL_TEX_FORMAT_MIPMAP_COUNT_SHIFT);
+	txf |= ((pt->last_level  + 1) << NV40TCL_TEX_FORMAT_MIPMAP_COUNT_SHIFT);
 
 	if (1) /* XXX */
 		txf |= NV34TCL_TX_FORMAT_NO_BORDER;
-- 
1.7.0.1.147.g6d84b



More information about the mesa-dev mailing list