summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_texture.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
commit7cd256ce7e4bad680bb77d033cf5dd662abab2dd (patch)
tree3b4a190876c076129e01792f0e3f4a087a820988 /src/mesa/state_tracker/st_cb_texture.c
parent1ac23a9359556091b12ed1345737084e3a2f6ae3 (diff)
gallium: change pipe_sampler_view::first_element/last_element -> offset/size
This is required by OpenGL. Our hardware supports this. Example: Bind RGBA32F with offset = 4 bytes. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97305 Acked-by: Ilia Mirkin <[email protected]> Acked-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_cb_texture.c')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index c2f5fdc031a..62c2900aeb1 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1163,8 +1163,9 @@ try_pbo_upload_common(struct gl_context *ctx,
memset(&templ, 0, sizeof(templ));
templ.target = PIPE_BUFFER;
templ.format = src_format;
- templ.u.buf.first_element = addr->first_element;
- templ.u.buf.last_element = addr->last_element;
+ templ.u.buf.offset = addr->first_element * addr->bytes_per_pixel;
+ templ.u.buf.size = (addr->last_element - addr->first_element + 1) *
+ addr->bytes_per_pixel;
templ.swizzle_r = PIPE_SWIZZLE_X;
templ.swizzle_g = PIPE_SWIZZLE_Y;
templ.swizzle_b = PIPE_SWIZZLE_Z;