From: Corbin Simpson Date: Sat, 7 Mar 2009 21:26:48 +0000 (-0800) Subject: r300-gallium: Correct vertex format setup, cleanup regs and debugging. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2305642b2e8edcebdc727f1181f7dbfcc78e8028;p=mesa.git r300-gallium: Correct vertex format setup, cleanup regs and debugging. trivial/point no longer hardlocks. --- diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index f55093f41d6..da5f2058c50 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -160,7 +160,7 @@ void r300_emit_fb_state(struct r300_context* r300, struct r300_texture* tex; int i; - BEGIN_CS((5 * fb->nr_cbufs) + (fb->zsbuf ? 5 : 0) + 4); + BEGIN_CS((6 * fb->nr_cbufs) + (fb->zsbuf ? 5 : 0) + 4); for (i = 0; i < fb->nr_cbufs; i++) { tex = (struct r300_texture*)fb->cbufs[i]->texture; OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1); @@ -336,6 +336,11 @@ void r300_emit_dirty_state(struct r300_context* r300) r300->dirty_state &= ~R300_NEW_RASTERIZER; } + if (r300->dirty_state & R300_NEW_RS_BLOCK) { + r300_emit_rs_block_state(r300, r300->rs_block); + r300->dirty_state &= ~R300_NEW_RS_BLOCK; + } + if (r300->dirty_state & R300_NEW_SCISSOR) { r300_emit_scissor_state(r300, r300->scissor_state); r300->dirty_state &= ~R300_NEW_SCISSOR; diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index feb0faa13c9..7693f2c4339 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -161,6 +161,8 @@ static void r300_update_vertex_layout(struct r300_context* r300) r300->vertex_info.vap_prog_stream_cntl_ext[i >> 1] |= (R300_VAP_SWIZZLE_XYZW << (i & 1 ? 16 : 0)); } + /* Set the last vector. */ + i--; r300->vertex_info.vap_prog_stream_cntl[i >> 1] |= (R300_LAST_VEC << (i & 1 ? 16 : 0)); @@ -226,8 +228,6 @@ static void r300_update_rs_block(struct r300_context* r300) R500_RS_INST_COL_ADDR(fp_offset); fp_offset++; } - - rs->inst_count = MAX2(col_count, tex_count); } else { for (i = 0; i < vinfo->num_attribs; i++) { memory_pos = tab[vinfo->attrib[i].src_index] * 4; @@ -261,9 +261,6 @@ static void r300_update_rs_block(struct r300_context* r300) R300_RS_SEL_Q(R300_RS_SEL_K1); } - for (i = 0; i < 8; i++) - debug_printf("ip %d: 0x%x\n", i, rs->ip[i]); - for (i = 0; i < tex_count; i++) { rs->inst[i] |= R300_RS_INST_TEX_ID(i) | R300_RS_INST_TEX_CN_WRITE | R300_RS_INST_TEX_ADDR(fp_offset); @@ -275,17 +272,12 @@ static void r300_update_rs_block(struct r300_context* r300) R300_RS_INST_COL_ADDR(fp_offset); fp_offset++; } - - for (i = 0; i < 8; i++) - debug_printf("inst %d: 0x%x\n", i, rs->inst[i]); } rs->count = (tex_count * 4) | (col_count << R300_IC_COUNT_SHIFT) | R300_HIRES_EN; rs->inst_count = MAX2(MAX2(col_count - 1, tex_count - 1), 0); - - debug_printf("count: 0x%x, inst_count: 0x%x\n", rs->count, rs->inst_count); } void r300_update_derived_state(struct r300_context* r300) diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h index 8d8b74dfc1d..cd3a4313f76 100644 --- a/src/gallium/drivers/r300/r300_state_inlines.h +++ b/src/gallium/drivers/r300/r300_state_inlines.h @@ -348,16 +348,16 @@ static uint32_t translate_vertex_data_type(int type) { switch (type) { case EMIT_1F: case EMIT_1F_PSIZE: - return R300_DATA_TYPE_FLOAT_1 | R300_SIGNED; + return R300_DATA_TYPE_FLOAT_1; break; case EMIT_2F: - return R300_DATA_TYPE_FLOAT_2 | R300_SIGNED; + return R300_DATA_TYPE_FLOAT_2; break; case EMIT_3F: - return R300_DATA_TYPE_FLOAT_3 | R300_SIGNED; + return R300_DATA_TYPE_FLOAT_3; break; case EMIT_4F: - return R300_DATA_TYPE_FLOAT_4 | R300_SIGNED; + return R300_DATA_TYPE_FLOAT_4; break; case EMIT_4UB: return R300_DATA_TYPE_BYTE; diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c index e7ba06fa3c6..b607b98a024 100644 --- a/src/gallium/drivers/r300/r300_surface.c +++ b/src/gallium/drivers/r300/r300_surface.c @@ -72,7 +72,7 @@ static void r300_surface_fill(struct pipe_context* pipe, r300_emit_rs_block_state(r300, &r300_rs_block_clear_state); } - BEGIN_CS(99 + (caps->has_tcl ? 9 : 0)); + BEGIN_CS(97 + (caps->has_tcl ? 9 : 0)); /* Flush PVS. */ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); @@ -97,7 +97,6 @@ static void r300_surface_fill(struct pipe_context* pipe, OUT_CS_REG(R300_VAP_CNTL_STATUS, R300_VC_NO_SWAP | R300_VAP_TCL_BYPASS); } - OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, 0x0); /* XXX magic number not in r300_reg */ OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xAAAAAAAA); /* XXX point tex stuffing */