gallium: change pipe_sampler_view::first_element/last_element -> offset/size
[mesa.git] / src / mesa / state_tracker / st_cb_texture.c
index c2f5fdc031a5f7ce7f4355e3b10479e3cc74e7cd..62c2900aeb10210d341cfb8d8a6ca9a83a523f17 100644 (file)
@@ -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;