diff options
author | Marek Olšák <[email protected]> | 2017-04-02 14:30:16 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-05-10 19:00:16 +0200 |
commit | c24c3b94ed29ecd99b1101c74c6c4606f9b5580e (patch) | |
tree | 81f6966bc59a68d9867693c65d35fae9bb1d9819 /src/gallium/drivers/radeonsi | |
parent | fe437882ea2d60e91c244cc95beb4b79c615af49 (diff) |
gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytes
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_descriptors.c | 16 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 12 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c index fc94e43f921..8d3454194dd 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -1008,11 +1008,11 @@ static void si_vertex_buffers_begin_new_cs(struct si_context *sctx) if (vb >= ARRAY_SIZE(sctx->vertex_buffer)) continue; - if (!sctx->vertex_buffer[vb].buffer) + if (!sctx->vertex_buffer[vb].buffer.resource) continue; radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx, - (struct r600_resource*)sctx->vertex_buffer[vb].buffer, + (struct r600_resource*)sctx->vertex_buffer[vb].buffer.resource, RADEON_USAGE_READ, RADEON_PRIO_VERTEX_BUFFER); } @@ -1071,7 +1071,7 @@ bool si_upload_vertex_buffer_descriptors(struct si_context *sctx) uint32_t *desc = &ptr[i*4]; vb = &sctx->vertex_buffer[vbo_index]; - rbuffer = (struct r600_resource*)vb->buffer; + rbuffer = (struct r600_resource*)vb->buffer.resource; if (!rbuffer) { memset(desc, 0, 16); continue; @@ -1087,18 +1087,18 @@ bool si_upload_vertex_buffer_descriptors(struct si_context *sctx) if (sctx->b.chip_class != VI && vb->stride) { /* Round up by rounding down and adding 1 */ - desc[2] = (vb->buffer->width0 - offset - + desc[2] = (vb->buffer.resource->width0 - offset - velems->format_size[i]) / vb->stride + 1; } else { - desc[2] = vb->buffer->width0 - offset; + desc[2] = vb->buffer.resource->width0 - offset; } desc[3] = velems->rsrc_word3[i]; if (first_vb_use_mask & (1 << i)) { radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx, - (struct r600_resource*)vb->buffer, + (struct r600_resource*)vb->buffer.resource, RADEON_USAGE_READ, RADEON_PRIO_VERTEX_BUFFER); } } @@ -1658,10 +1658,10 @@ static void si_invalidate_buffer(struct pipe_context *ctx, struct pipe_resource if (vb >= ARRAY_SIZE(sctx->vertex_buffer)) continue; - if (!sctx->vertex_buffer[vb].buffer) + if (!sctx->vertex_buffer[vb].buffer.resource) continue; - if (sctx->vertex_buffer[vb].buffer == buf) { + if (sctx->vertex_buffer[vb].buffer.resource == buf) { sctx->vertex_buffers_dirty = true; break; } diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 9d5804c380a..86de578e64a 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -3845,7 +3845,7 @@ static void si_set_vertex_buffers(struct pipe_context *ctx, const struct pipe_vertex_buffer *src = buffers + i; struct pipe_vertex_buffer *dsti = dst + i; - if (unlikely(src->user_buffer)) { + if (unlikely(src->is_user_buffer)) { /* Zero-stride attribs only. */ assert(src->stride == 0); @@ -3856,14 +3856,14 @@ static void si_set_vertex_buffers(struct pipe_context *ctx, * Use const_uploader to upload into VRAM directly. */ u_upload_data(sctx->b.b.const_uploader, 0, 32, 32, - src->user_buffer, + src->buffer.user, &dsti->buffer_offset, - &dsti->buffer); + &dsti->buffer.resource); dsti->stride = 0; } else { - struct pipe_resource *buf = src->buffer; + struct pipe_resource *buf = src->buffer.resource; - pipe_resource_reference(&dsti->buffer, buf); + pipe_resource_reference(&dsti->buffer.resource, buf); dsti->buffer_offset = src->buffer_offset; dsti->stride = src->stride; r600_context_add_resource_size(ctx, buf); @@ -3873,7 +3873,7 @@ static void si_set_vertex_buffers(struct pipe_context *ctx, } } else { for (i = 0; i < count; i++) { - pipe_resource_reference(&dst[i].buffer, NULL); + pipe_resource_reference(&dst[i].buffer.resource, NULL); } } sctx->vertex_buffers_dirty = true; |