mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 11:38:05 +02:00
r300: rework texture offset emission.
This commit is contained in:
parent
3a6dd3ebb3
commit
2f9189d538
1 changed files with 13 additions and 7 deletions
|
|
@ -179,27 +179,33 @@ static void emit_tex_offsets(GLcontext *ctx, struct radeon_state_atom * atom)
|
|||
if (r300->radeon.radeonScreen->kernel_mm && notexture) {
|
||||
return;
|
||||
}
|
||||
BEGIN_BATCH_NO_AUTOSTATE(4 * numtmus);
|
||||
for(i = 0; i < numtmus; ++i) {
|
||||
radeonTexObj *t = r300->hw.textures[i];
|
||||
OUT_BATCH_REGSEQ(R300_TX_OFFSET_0 + (i * 4), 1);
|
||||
if (t && !t->image_override) {
|
||||
BEGIN_BATCH_NO_AUTOSTATE(4);
|
||||
OUT_BATCH_REGSEQ(R300_TX_OFFSET_0 + (i * 4), 1);
|
||||
OUT_BATCH_RELOC(t->tile_bits, t->mt->bo, 0,
|
||||
RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0);
|
||||
END_BATCH();
|
||||
} else if (!t) {
|
||||
OUT_BATCH(r300->radeon.radeonScreen->texOffset[0]);
|
||||
/* Texture unit hasn't a texture bound nothings to do */
|
||||
} else { /* override cases */
|
||||
if (t->bo) {
|
||||
BEGIN_BATCH_NO_AUTOSTATE(4);
|
||||
OUT_BATCH_REGSEQ(R300_TX_OFFSET_0 + (i * 4), 1);
|
||||
OUT_BATCH_RELOC(t->tile_bits, t->bo, 0,
|
||||
RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0);
|
||||
END_BATCH();
|
||||
} else if (!r300->radeon.radeonScreen->kernel_mm) {
|
||||
BEGIN_BATCH_NO_AUTOSTATE(2);
|
||||
OUT_BATCH_REGSEQ(R300_TX_OFFSET_0 + (i * 4), 1);
|
||||
OUT_BATCH(t->override_offset);
|
||||
}
|
||||
else
|
||||
OUT_BATCH(r300->radeon.radeonScreen->texOffset[0]);
|
||||
END_BATCH();
|
||||
} else {
|
||||
/* Texture unit hasn't a texture bound nothings to do */
|
||||
}
|
||||
}
|
||||
}
|
||||
END_BATCH();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue