Module: Mesa
Branch: master
Commit: cc5860e40787b3afe36856674f028e830685271b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cc5860e40787b3afe36856674f028e830685271b

Author: Dave Airlie <airl...@redhat.com>
Date:   Wed Apr  8 10:00:27 2015 +1000

st/mesa: align cube map arrays layers

We create textures internally for texsubimage, and we use
the values from sub image to create a new texture, however
we don't align these to valid sizes, and cube map arrays
must have an array size aligned to 6.

This fixes texsubimage cube_map_array on CAYMAN at least,
(it was causing  GPU hang and bad values), it probably
also fixes it on radeonsi and evergreen.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89957
Tested-by: Tom Stellard <thomas.stell...@amd.com>
Cc: mesa-sta...@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.ol...@amd.com>
Signed-off-by: Dave Airlie <airl...@redhat.com>

---

 src/mesa/state_tracker/st_texture.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_texture.c 
b/src/mesa/state_tracker/st_texture.c
index ca7c83c..de4a6eb 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -177,7 +177,7 @@ st_gl_texture_dims_to_pipe_dims(GLenum texture,
       *widthOut = widthIn;
       *heightOut = heightIn;
       *depthOut = 1;
-      *layersOut = depthIn;
+      *layersOut = util_align_npot(depthIn, 6);
       break;
    default:
       assert(0 && "Unexpected texture in st_gl_texture_dims_to_pipe_dims()");

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to