diff options
author | Marek Olšák <[email protected]> | 2016-08-12 02:33:41 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-08-17 14:15:33 +0200 |
commit | 325379096f54dde39171d1b8804e29a8003bb3c7 (patch) | |
tree | a9a2dad63270175b9839edbd81af66c9d03a7eed /src/gallium/drivers/softpipe | |
parent | 7cd256ce7e4bad680bb77d033cf5dd662abab2dd (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/softpipe')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_image.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/drivers/softpipe/sp_image.c b/src/gallium/drivers/softpipe/sp_image.c index 0be11cb8640..d5547e294ab 100644 --- a/src/gallium/drivers/softpipe/sp_image.c +++ b/src/gallium/drivers/softpipe/sp_image.c @@ -39,7 +39,7 @@ get_image_offset(const struct softpipe_resource *spr, int base_layer = 0; if (spr->base.target == PIPE_BUFFER) - return iview->u.buf.first_element * util_format_get_blocksize(format); + return iview->u.buf.offset; if (spr->base.target == PIPE_TEXTURE_1D_ARRAY || spr->base.target == PIPE_TEXTURE_2D_ARRAY || @@ -153,7 +153,7 @@ get_dimensions(const struct pipe_image_view *iview, unsigned *depth) { if (tgsi_tex_instr == TGSI_TEXTURE_BUFFER) { - *width = iview->u.buf.last_element - iview->u.buf.first_element + 1; + *width = iview->u.buf.size / util_format_get_blocksize(pformat); *height = 1; *depth = 1; /* @@ -752,7 +752,7 @@ sp_tgsi_get_dims(const struct tgsi_image *image, return; if (params->tgsi_tex_instr == TGSI_TEXTURE_BUFFER) { - dims[0] = iview->u.buf.last_element - iview->u.buf.first_element + 1; + dims[0] = iview->u.buf.size / util_format_get_blocksize(iview->format); dims[1] = dims[2] = dims[3] = 0; return; } |