diff options
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_state.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_state_common.c | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 76115207d6f..3d1a19d04f4 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -613,8 +613,8 @@ texture_buffer_sampler_view(struct r600_context *rctx, unsigned swizzle_res; unsigned char swizzle[4]; const struct util_format_description *desc; - unsigned offset = view->base.u.buf.first_element * stride; - unsigned size = (view->base.u.buf.last_element - view->base.u.buf.first_element + 1) * stride; + unsigned offset = view->base.u.buf.offset; + unsigned size = view->base.u.buf.size; swizzle[0] = view->base.swizzle_r; swizzle[1] = view->base.swizzle_g; diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 046573f5170..62b1c2c282a 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -631,8 +631,8 @@ texture_buffer_sampler_view(struct r600_pipe_sampler_view *view, struct r600_texture *tmp = (struct r600_texture*)view->base.texture; int stride = util_format_get_blocksize(view->base.format); unsigned format, num_format, format_comp, endian; - uint64_t offset = view->base.u.buf.first_element * stride; - unsigned size = (view->base.u.buf.last_element - view->base.u.buf.first_element + 1) * stride; + uint64_t offset = view->base.u.buf.offset; + unsigned size = view->base.u.buf.size; r600_vertex_data_type(view->base.format, &format, &num_format, &format_comp, diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 11ef9259b23..9008a4a71ac 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -2831,8 +2831,7 @@ static void r600_invalidate_buffer(struct pipe_context *ctx, struct pipe_resourc /* Texture buffer objects - update the virtual addresses in descriptors. */ LIST_FOR_EACH_ENTRY(view, &rctx->b.texture_buffers, list) { if (view->base.texture == &rbuffer->b.b) { - unsigned stride = util_format_get_blocksize(view->base.format); - uint64_t offset = (uint64_t)view->base.u.buf.first_element * stride; + uint64_t offset = view->base.u.buf.offset; uint64_t va = rbuffer->gpu_address + offset; view->tex_resource_words[0] = va; |