From 325379096f54dde39171d1b8804e29a8003bb3c7 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 12 Aug 2016 02:33:41 +0200 Subject: gallium: change pipe_image_view::first_element/last_element -> offset/size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is required by OpenGL. Our hardware supports this. Example: Bind RGBA32F with offset = 4 bytes. Acked-by: Ilia Mirkin Acked-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_descriptors.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/gallium/drivers/radeonsi') diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c index a3e456410f9..0e026e957cd 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -600,17 +600,12 @@ static void si_mark_image_range_valid(const struct pipe_image_view *view) { struct r600_resource *res = (struct r600_resource *)view->resource; - const struct util_format_description *desc; - unsigned stride; assert(res && res->b.b.target == PIPE_BUFFER); - desc = util_format_description(view->format); - stride = desc->block.bits / 8; - util_range_add(&res->valid_buffer_range, - stride * (view->u.buf.first_element), - stride * (view->u.buf.last_element + 1)); + view->u.buf.offset, + view->u.buf.offset + view->u.buf.size); } static void si_set_shader_image(struct si_context *ctx, @@ -641,11 +636,8 @@ static void si_set_shader_image(struct si_context *ctx, si_make_buffer_descriptor(screen, res, view->format, - view->u.buf.first_element * - util_format_get_blocksize(view->format), - (view->u.buf.last_element - - view->u.buf.first_element + 1) * - util_format_get_blocksize(view->format), + view->u.buf.offset, + view->u.buf.size, descs->list + slot * 8); images->compressed_colortex_mask &= ~(1 << slot); } else { -- cgit v1.2.3