panfrost: Handle txs of cube arrays
authorAlyssa Rosenzweig <alyssa@collabora.com>
Sat, 5 Mar 2022 21:27:56 +0000 (16:27 -0500)
committerMarge Bot <emma+marge@anholt.net>
Sat, 12 Mar 2022 17:34:01 +0000 (17:34 +0000)
We need to divide the array length by 6 to match what OpenGL expects.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15254>

src/gallium/drivers/panfrost/pan_cmdstream.c
src/panfrost/ci/panfrost-g52-fails.txt

index b6e6237..6471bd0 100644 (file)
@@ -777,8 +777,18 @@ static void panfrost_upload_txs_sysval(struct panfrost_batch *batch,
                 uniform->i[2] = u_minify(tex->texture->depth0,
                                          tex->u.tex.first_level);
 
-        if (is_array)
-                uniform->i[dim] = tex->texture->array_size;
+        if (is_array) {
+                unsigned size = tex->texture->array_size;
+
+                /* Internally, we store the number of 2D images (faces * array
+                 * size). Externally, we report the array size in terms of
+                 * complete cubes. So divide by the # of faces per cube.
+                 */
+                if (tex->target == PIPE_TEXTURE_CUBE_ARRAY)
+                        size /= 6;
+
+                uniform->i[dim] = size;
+        }
 }
 
 static void panfrost_upload_image_size_sysval(struct panfrost_batch *batch,
index 5898cd6..07be170 100644 (file)
@@ -113,14 +113,6 @@ spec@arb_shading_language_420pack@active sampler conflict,Crash
 spec@arb_texture_buffer_object@formats (fs- arb),Crash
 spec@arb_texture_buffer_object@formats (vs- arb),Crash
 spec@arb_texture_buffer_object@render-no-bo,Crash
-spec@arb_texture_cube_map_array@texturesize@fs-texturesize-isamplercubearray,Fail
-spec@arb_texture_cube_map_array@texturesize@fs-texturesize-samplercubearray,Fail
-spec@arb_texture_cube_map_array@texturesize@fs-texturesize-samplercubearrayshadow,Fail
-spec@arb_texture_cube_map_array@texturesize@fs-texturesize-usamplercubearray,Fail
-spec@arb_texture_cube_map_array@texturesize@vs-texturesize-isamplercubearray,Fail
-spec@arb_texture_cube_map_array@texturesize@vs-texturesize-samplercubearray,Fail
-spec@arb_texture_cube_map_array@texturesize@vs-texturesize-samplercubearrayshadow,Fail
-spec@arb_texture_cube_map_array@texturesize@vs-texturesize-usamplercubearray,Fail
 spec@arb_texture_float@arb_texture_float-texture-float-formats,Fail
 spec@arb_texture_float@fbo-alphatest-formats,Crash
 spec@arb_texture_float@fbo-blending-formats,Crash