aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_descriptors.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-08-12 02:33:41 +0200
committerMarek Olšák <[email protected]>2016-08-17 14:15:33 +0200
commit325379096f54dde39171d1b8804e29a8003bb3c7 (patch)
treea9a2dad63270175b9839edbd81af66c9d03a7eed /src/gallium/drivers/radeonsi/si_descriptors.c
parent7cd256ce7e4bad680bb77d033cf5dd662abab2dd (diff)
gallium: change pipe_image_view::first_element/last_element -> offset/size
This is required by OpenGL. Our hardware supports this. Example: Bind RGBA32F with offset = 4 bytes. Acked-by: Ilia Mirkin <[email protected]> Acked-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_descriptors.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_descriptors.c16
1 files changed, 4 insertions, 12 deletions
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 {