From: Corbin Simpson Date: Sat, 16 May 2009 15:47:36 +0000 (-0700) Subject: r300-gallium: Various cleanups leftover from before. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=13131adbf1beb3e4222ce16c32ac7910a4a5331b;p=mesa.git r300-gallium: Various cleanups leftover from before. BEGIN/END_CS pair, a few asserts, and a slightly more correct VTE setup. --- diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index cd5c38a0c7d..3beb1b8c3f6 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -163,6 +163,7 @@ void r300_emit_fb_state(struct r300_context* r300, BEGIN_CS((8 * fb->nr_cbufs) + (fb->zsbuf ? 8 : 0) + 4); for (i = 0; i < fb->nr_cbufs; i++) { tex = (struct r300_texture*)fb->cbufs[i]->texture; + assert(tex && tex->buffer && "cbuf is marked, but NULL!"); pixpitch = tex->stride / tex->tex.block.size; OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1); @@ -177,7 +178,8 @@ void r300_emit_fb_state(struct r300_context* r300, if (fb->zsbuf) { tex = (struct r300_texture*)fb->zsbuf->texture; - pixpitch = (tex->stride / tex->tex.block.size); + assert(tex && tex->buffer && "zsbuf is marked, but NULL!"); + pixpitch = tex->stride / tex->tex.block.size; OUT_CS_REG_SEQ(R300_ZB_DEPTHOFFSET, 1); OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); @@ -473,7 +475,7 @@ void r300_emit_dirty_state(struct r300_context* r300) /* ...textures... */ for (i = 0; i < r300->texture_count; i++) { tex = r300->textures[i]; - assert(tex && tex->buffer && "zsbuf is marked, but NULL!"); + assert(tex && tex->buffer && "texture is marked, but NULL!"); r300->winsys->add_buffer(r300->winsys, tex->buffer, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0); } diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 2118f7706fc..49b93a420b1 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -562,7 +562,7 @@ static void r300_set_viewport_state(struct pipe_context* pipe, if (r300_screen(r300->context.screen)->caps->has_tcl) { /* Do the transform in HW. */ - r300->viewport_state->vte_control = R300_VTX_W0_FMT; + r300->viewport_state->vte_control = R300_VTX_XY_FMT | R300_VTX_Z_FMT; if (state->scale[0] != 1.0f) { assert(state->scale[0] != 0.0f); diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index 00eb4ebe7c9..17b42504d44 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -264,6 +264,7 @@ static void r300_surface_copy(struct pipe_context* pipe, r300_emit_rs_block_state(r300, &r300_rs_block_copy_state); } + BEGIN_CS(28); /* VAP stream control, mapping from input memory to PVS/RS memory */ if (caps->has_tcl) { OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, @@ -313,6 +314,8 @@ static void r300_surface_copy(struct pipe_context* pipe, OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, 0xA); + END_CS; + r300->dirty_hw++; }