diff options
author | Francisco Jerez <[email protected]> | 2010-03-18 14:13:36 +0100 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2010-03-18 15:02:36 +0100 |
commit | 1a812ab57a71d16e45ca44de7ae0570d2bd46674 (patch) | |
tree | ffadc077beccfc043366630e44b3aa4c342e9948 /src/mesa/drivers/dri/nouveau/nv10_state_tex.c | |
parent | d475eae50b15646efd83fa7f73ad7f2b40dd5206 (diff) |
dri/nouveau: Implement texture matrices.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nv10_state_tex.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv10_state_tex.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c index 02a5ca797ae..92148722af7 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c @@ -32,11 +32,36 @@ #include "nouveau_util.h" #include "nv10_driver.h" +#define TX_MATRIX(i) (NV10TCL_TX0_MATRIX(0) + 64 * (i)) + void nv10_emit_tex_gen(GLcontext *ctx, int emit) { } +void +nv10_emit_tex_mat(GLcontext *ctx, int emit) +{ + const int i = emit - NOUVEAU_STATE_TEX_MAT0; + struct nouveau_context *nctx = to_nouveau_context(ctx); + struct nouveau_channel *chan = context_chan(ctx); + struct nouveau_grobj *celsius = context_eng3d(ctx); + + if (nctx->fallback == HWTNL && + ((ctx->Texture._TexMatEnabled & 1 << i) || + ctx->Texture.Unit[i]._GenFlags)) { + BEGIN_RING(chan, celsius, NV10TCL_TX_MATRIX_ENABLE(i), 1); + OUT_RING(chan, 1); + + BEGIN_RING(chan, celsius, TX_MATRIX(i), 16); + OUT_RINGm(chan, ctx->TextureMatrixStack[i].Top->m); + + } else { + BEGIN_RING(chan, celsius, NV10TCL_TX_MATRIX_ENABLE(i), 1); + OUT_RING(chan, 0); + } +} + static uint32_t get_tex_format_pot(struct gl_texture_image *ti) { |