radeonsi/gfx9: set NUM_RECORDS correctly
authorMarek Olšák <marek.olsak@amd.com>
Wed, 1 Feb 2017 01:16:46 +0000 (02:16 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 30 Mar 2017 12:44:33 +0000 (14:44 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_state.c

index 71b511c958d74ab693a8602d3c2e923d3dd2d7cd..d9c0408be14699b9f197fa50dcc982caae754b16 100644 (file)
@@ -1007,7 +1007,7 @@ bool si_upload_vertex_buffer_descriptors(struct si_context *sctx)
                desc[1] = S_008F04_BASE_ADDRESS_HI(va >> 32) |
                          S_008F04_STRIDE(vb->stride);
 
-               if (sctx->b.chip_class <= CIK && vb->stride) {
+               if (sctx->b.chip_class != VI && vb->stride) {
                        /* Round up by rounding down and adding 1 */
                        desc[2] = (vb->buffer->width0 - offset -
                                   velems->format_size[i]) /
index 5ecbac8b2763981d8a6fb5014154c2bae8a1db9c..575dd6c380f865b055318dd507a49d759772e02f 100644 (file)
@@ -3079,7 +3079,7 @@ static LLVMValueRef get_buffer_size(
                LLVMBuildExtractElement(builder, descriptor,
                                        lp_build_const_int32(gallivm, 2), "");
 
-       if (ctx->screen->b.chip_class >= VI) {
+       if (ctx->screen->b.chip_class == VI) {
                /* On VI, the descriptor contains the size in bytes,
                 * but TXQ must return the size in elements.
                 * The stride is always non-zero for resources using TXQ.
index affd7875d56b48dfd3d47004cb8277d047663c93..ae5aac0e4657b65857d004829ecd0bc7fbb879e6 100644 (file)
@@ -2764,7 +2764,7 @@ si_make_buffer_descriptor(struct si_screen *screen, struct r600_resource *buf,
        num_records = size / stride;
        num_records = MIN2(num_records, (buf->b.b.width0 - offset) / stride);
 
-       if (screen->b.chip_class >= VI)
+       if (screen->b.chip_class == VI)
                num_records *= stride;
 
        state[4] = 0;