From 8c6cb15200c18afa3a81a07df7ff2fc5c5b699e6 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 5 Mar 2022 16:27:56 -0500 Subject: [PATCH] panfrost: Handle txs of cube arrays We need to divide the array length by 6 to match what OpenGL expects. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 14 ++++++++++++-- src/panfrost/ci/panfrost-g52-fails.txt | 8 -------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index b6e623729ff..6471bd04a5b 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -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, diff --git a/src/panfrost/ci/panfrost-g52-fails.txt b/src/panfrost/ci/panfrost-g52-fails.txt index 5898cd61fb0..07be170f72e 100644 --- a/src/panfrost/ci/panfrost-g52-fails.txt +++ b/src/panfrost/ci/panfrost-g52-fails.txt @@ -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