[Mesa-dev] [PATCH] st/mesa: align cube map arrays layers

Dave Airlie airlied at gmail.com
Tue Apr 7 17:02:50 PDT 2015


From: Dave Airlie <airlied at redhat.com>

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.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/mesa/state_tracker/st_texture.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index ca7c83c..5c9a09c 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -177,6 +177,8 @@ st_gl_texture_dims_to_pipe_dims(GLenum texture,
       *widthOut = widthIn;
       *heightOut = heightIn;
       *depthOut = 1;
+      if (depthIn % 6)
+         depthIn = util_align_npot(depthIn, 6);
       *layersOut = depthIn;
       break;
    default:
-- 
2.1.0



More information about the mesa-dev mailing list