r200: fix cube maps for non-mm path

drm cmd checker rightfully fell over any cube emit
This commit is contained in:
Roland Scheidegger 2009-06-19 22:32:06 +02:00
parent e90d6a3cbf
commit ffae82da4c

View file

@ -617,6 +617,30 @@ static void tex_emit_cs(GLcontext *ctx, struct radeon_state_atom *atom)
static void cube_emit(GLcontext *ctx, struct radeon_state_atom *atom)
{
r200ContextPtr r200 = R200_CONTEXT(ctx);
BATCH_LOCALS(&r200->radeon);
uint32_t dwords = 3;
int i = atom->idx, j;
radeonTexObj *t = r200->state.texture.unit[i].texobj;
radeon_mipmap_level *lvl;
BEGIN_BATCH_NO_AUTOSTATE(dwords + (3 * 5));
/* XXX that size won't really match with image_override... */
OUT_BATCH_TABLE(atom->cmd, 2);
if (t && !t->image_override) {
lvl = &t->mt->levels[0];
OUT_BATCH_TABLE((atom->cmd + 2), 1);
for (j = 1; j <= 5; j++) {
OUT_BATCH_RELOC(lvl->faces[j].offset, t->mt->bo, lvl->faces[j].offset,
RADEON_GEM_DOMAIN_VRAM, 0, 0);
}
}
END_BATCH();
}
static void cube_emit_cs(GLcontext *ctx, struct radeon_state_atom *atom)
{
r200ContextPtr r200 = R200_CONTEXT(ctx);
BATCH_LOCALS(&r200->radeon);
@ -752,7 +776,10 @@ void r200InitState( r200ContextPtr rmesa )
ALLOC_STATE( cube[4], tex_cube, CUBE_STATE_SIZE, "CUBE/tex-4", 4 );
ALLOC_STATE( cube[5], tex_cube, CUBE_STATE_SIZE, "CUBE/tex-5", 5 );
for (i = 0; i < 5; i++)
rmesa->hw.cube[i].emit = cube_emit;
if (rmesa->radeon.radeonScreen->kernel_mm)
rmesa->hw.cube[i].emit = cube_emit_cs;
else
rmesa->hw.cube[i].emit = cube_emit;
}
else {
ALLOC_STATE( cube[0], never, CUBE_STATE_SIZE, "CUBE/tex-0", 0 );