nvc0: shift address with blocksize for image buffers
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sat, 9 Apr 2016 18:15:13 +0000 (20:15 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 26 Apr 2016 17:47:49 +0000 (19:47 +0200)
This fixes a bunch of dEQP image buffers related tests.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nvc0/nvc0_tex.c

index 9fddc75cb3f3628509b4c0d765cc738ec0da6e6d..efeb4e387c13f99471a1c5fcd4ece75656a63c1e 100644 (file)
@@ -859,6 +859,10 @@ nve4_set_surface_info(struct nouveau_pushbuf *push,
 #endif
 
    if (res->base.target == PIPE_BUFFER) {
+      unsigned blocksize = util_format_get_blocksize(view->format);
+
+      address += view->u.buf.first_element * blocksize;
+
       info[0]  = address >> 8;
       info[2]  = width - 1;
       info[2] |= (0xff & nve4_su_format_aux_map[view->format]) << 22;