nv30: set mipmap min/max lod accordingly
authorPatrice Mandin <pmandin@caramail.com>
Thu, 14 Aug 2008 15:24:06 +0000 (17:24 +0200)
committerPatrice Mandin <pmandin@caramail.com>
Thu, 14 Aug 2008 15:24:06 +0000 (17:24 +0200)
src/gallium/drivers/nv30/nv30_state.c

index 77b0c9e08b07a2e482bd668bb429bc83f4526f20..eceb5353152a78559ea618288270a3ab7af04c21 100644 (file)
@@ -199,10 +199,10 @@ nv30_sampler_state_create(struct pipe_context *pipe,
                ps->filt |= (int)(cso->lod_bias * 256.0) & 0x1fff;
 
                limit = CLAMP(cso->max_lod, 0.0, 15.0);
-               ps->en |= (int)(limit * 256.0) << 7;
+               ps->en |= (int)(limit) << 14 /*NV34TCL_TX_ENABLE_MIPMAP_MAX_LOD_SHIFT*/;
 
                limit = CLAMP(cso->min_lod, 0.0, 15.0);
-               ps->en |= (int)(limit * 256.0) << 19;
+               ps->en |= (int)(limit) << 26 /*NV34TCL_TX_ENABLE_MIPMAP_MIN_LOD_SHIFT*/;
        }
 
        if (cso->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) {