radeonsi: Fix calculation of number of records in buffer resource.
authorMichel Dänzer <michel.daenzer@amd.com>
Wed, 12 Sep 2012 10:59:49 +0000 (12:59 +0200)
committerMichel Dänzer <michel@daenzer.net>
Wed, 12 Sep 2012 11:23:09 +0000 (13:23 +0200)
The value was too small by 1 in some cases (non-first of several vertex
elements interleaved in a single buffer).

Fixes intermittent incorrect geometry in many apps, e.g. piglit
spec/EXT_texture_snorm/fbo-generatemipmap-formats.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/radeonsi/si_state_draw.c

index c71ad43db24849bcf1ce1b545efa3f4f8e91a5fb..0cb8b7180e45b190b5835e93be4d1e753331fd9c 100644 (file)
@@ -455,7 +455,7 @@ static void si_vertex_buffer_update(struct r600_context *rctx)
                si_pm4_sh_data_add(pm4, va & 0xFFFFFFFF);
                si_pm4_sh_data_add(pm4, (S_008F04_BASE_ADDRESS_HI(va >> 32) |
                                         S_008F04_STRIDE(vb->stride)));
-               si_pm4_sh_data_add(pm4, (vb->buffer->width0 - offset) /
+               si_pm4_sh_data_add(pm4, (vb->buffer->width0 - vb->buffer_offset) /
                                         MAX2(vb->stride, 1));
                si_pm4_sh_data_add(pm4, rctx->vertex_elements->rsrc_word3[i]);