diff --git a/src/panfrost/ci/panfrost-g52-fails.txt b/src/panfrost/ci/panfrost-g52-fails.txt index 9929c8f7648..26abce0591a 100644 --- a/src/panfrost/ci/panfrost-g52-fails.txt +++ b/src/panfrost/ci/panfrost-g52-fails.txt @@ -86,8 +86,6 @@ spec@arb_texture_rg@fbo-blending-formats,Fail spec@arb_texture_rg@fbo-blending-formats@GL_R8,Fail spec@arb_texture_rg@fbo-blending-formats@GL_RG8,Fail spec@arb_texture_rg@fbo-blending-formats@GL_RG,Fail -spec@arb_texture_view@sampling-2d-array-as-cubemap-array,Crash -spec@arb_texture_view@sampling-2d-array-as-cubemap,Crash spec@arb_transform_feedback_instanced@draw-auto instanced,Fail spec@arb_uniform_buffer_object@rendering-dsa-offset,Fail spec@arb_uniform_buffer_object@rendering-offset,Fail @@ -306,7 +304,6 @@ spec@khr_texture_compression_astc@sliced-3d-miptree-gl hdr,Fail spec@khr_texture_compression_astc@sliced-3d-miptree-gl hdr@HDR Profile,Fail spec@khr_texture_compression_astc@sliced-3d-miptree-gl srgb-fp,Fail spec@khr_texture_compression_astc@sliced-3d-miptree-gl srgb-fp@sRGB decode full precision,Fail -spec@oes_texture_view@sampling-2d-array-as-cubemap,Crash spec@!opengl 1.0@gl-1.0-edgeflag-const,Fail spec@!opengl 1.0@gl-1.0-edgeflag,Fail spec@!opengl 1.0@gl-1.0-edgeflag-quads,Fail diff --git a/src/panfrost/ci/panfrost-g52-skips.txt b/src/panfrost/ci/panfrost-g52-skips.txt index d8429e34397..7b03613ee6e 100644 --- a/src/panfrost/ci/panfrost-g52-skips.txt +++ b/src/panfrost/ci/panfrost-g52-skips.txt @@ -47,8 +47,6 @@ spec@arb_texture_rectangle@tex-miplevel-selection gl2:texture() 2drectshadow spec@arb_texture_rectangle@tex-miplevel-selection gl2:textureproj 2drect spec@arb_texture_rectangle@tex-miplevel-selection gl2:textureproj 2drect_projvec4 spec@arb_texture_rectangle@tex-miplevel-selection gl2:textureproj 2drectshadow -spec@arb_texture_view@sampling-2d-array-as-cubemap-array -spec@arb_texture_view@sampling-2d-array-as-cubemap spec@ext_transform_feedback@immediate-reuse-index-buffer spec@ext_transform_feedback@immediate-reuse-uniform-buffer spec@glsl-1.30@execution@tex-miplevel-selection texture() 2drect @@ -71,6 +69,5 @@ spec@glsl-1.30@execution@tex-miplevel-selection textureprojgradoffset 2drectshad spec@glsl-1.30@execution@tex-miplevel-selection textureprojoffset 2drect spec@glsl-1.30@execution@tex-miplevel-selection textureprojoffset 2drect_projvec4 spec@glsl-1.30@execution@tex-miplevel-selection textureprojoffset 2drectshadow -spec@oes_texture_view@sampling-2d-array-as-cubemap spec@!opengl 1.0@rasterpos spec@!opengl es 3.0@gles-3.0-transform-feedback-uniform-buffer-object diff --git a/src/panfrost/ci/panfrost-g57-fails.txt b/src/panfrost/ci/panfrost-g57-fails.txt index 4abeee8040d..36a00792891 100644 --- a/src/panfrost/ci/panfrost-g57-fails.txt +++ b/src/panfrost/ci/panfrost-g57-fails.txt @@ -122,8 +122,8 @@ spec@arb_texture_rg@fbo-blending-formats,Fail spec@arb_texture_rg@fbo-blending-formats@GL_R8,Fail spec@arb_texture_rg@fbo-blending-formats@GL_RG8,Fail spec@arb_texture_rg@fbo-blending-formats@GL_RG,Fail -spec@arb_texture_view@sampling-2d-array-as-cubemap-array,Crash -spec@arb_texture_view@sampling-2d-array-as-cubemap,Crash +spec@arb_texture_view@sampling-2d-array-as-cubemap-array,Fail +spec@arb_texture_view@sampling-2d-array-as-cubemap,Fail spec@arb_transform_feedback_instanced@draw-auto instanced,Fail spec@arb_uniform_buffer_object@rendering-dsa-offset,Fail spec@arb_uniform_buffer_object@rendering-offset,Fail @@ -452,7 +452,7 @@ spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGBA32I/Destinat spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGBA32UI/Destination: GL_RGBA32UI,Fail spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGBA8/Destination: GL_RGBA8,Fail spec@nv_copy_image@nv_copy_image-formats --samples=4@Source: GL_RGBA8_SNORM/Destination: GL_RGBA8_SNORM,Fail -spec@oes_texture_view@sampling-2d-array-as-cubemap,Crash +spec@oes_texture_view@sampling-2d-array-as-cubemap,Fail spec@!opengl 1.0@gl-1.0-edgeflag-const,Fail spec@!opengl 1.0@gl-1.0-edgeflag,Fail spec@!opengl 1.0@gl-1.0-edgeflag-quads,Fail diff --git a/src/panfrost/ci/panfrost-g57-skips.txt b/src/panfrost/ci/panfrost-g57-skips.txt index 9ec1cad238a..80d1e524952 100644 --- a/src/panfrost/ci/panfrost-g57-skips.txt +++ b/src/panfrost/ci/panfrost-g57-skips.txt @@ -37,8 +37,6 @@ spec@arb_texture_rectangle@tex-miplevel-selection gl2:texture() 2drectshadow spec@arb_texture_rectangle@tex-miplevel-selection gl2:textureproj 2drect spec@arb_texture_rectangle@tex-miplevel-selection gl2:textureproj 2drect_projvec4 spec@arb_texture_rectangle@tex-miplevel-selection gl2:textureproj 2drectshadow -spec@arb_texture_view@sampling-2d-array-as-cubemap-array -spec@arb_texture_view@sampling-2d-array-as-cubemap spec@ext_transform_feedback@immediate-reuse-index-buffer spec@ext_transform_feedback@immediate-reuse-uniform-buffer spec@glsl-1.30@execution@tex-miplevel-selection texture() 2drect @@ -61,6 +59,5 @@ spec@glsl-1.30@execution@tex-miplevel-selection textureprojgradoffset 2drectshad spec@glsl-1.30@execution@tex-miplevel-selection textureprojoffset 2drect spec@glsl-1.30@execution@tex-miplevel-selection textureprojoffset 2drect_projvec4 spec@glsl-1.30@execution@tex-miplevel-selection textureprojoffset 2drectshadow -spec@oes_texture_view@sampling-2d-array-as-cubemap spec@!opengl 1.0@rasterpos spec@!opengl es 3.0@gles-3.0-transform-feedback-uniform-buffer-object diff --git a/src/panfrost/lib/pan_texture.c b/src/panfrost/lib/pan_texture.c index 2e0f5eaa27e..8f4f4e817cd 100644 --- a/src/panfrost/lib/pan_texture.c +++ b/src/panfrost/lib/pan_texture.c @@ -127,23 +127,6 @@ panfrost_compression_tag(const struct util_format_description *desc, return 0; } -/* Cubemaps have 6 faces as "layers" in between each actual layer. We - * need to fix this up. TODO: logic wrong in the asserted out cases ... - * can they happen, perhaps from cubemap arrays? */ - -static void -panfrost_adjust_cube_dimensions(unsigned *first_face, unsigned *last_face, - unsigned *first_layer, unsigned *last_layer) -{ - *first_face = *first_layer % 6; - *last_face = *last_layer % 6; - *first_layer /= 6; - *last_layer /= 6; - - assert((*first_layer == *last_layer) || - (*first_face == 0 && *last_face == 5)); -} - /* Following the texture descriptor is a number of descriptors. How many? */ static unsigned @@ -208,17 +191,16 @@ panfrost_get_surface_strides(const struct pan_image_layout *layout, unsigned l, static mali_ptr panfrost_get_surface_pointer(const struct pan_image_layout *layout, enum mali_texture_dimension dim, mali_ptr base, - unsigned l, unsigned w, unsigned f, unsigned s) + unsigned l, unsigned i, unsigned s) { - unsigned face_mult = dim == MALI_TEXTURE_DIMENSION_CUBE ? 6 : 1; unsigned offset; if (layout->dim == MALI_TEXTURE_DIMENSION_3D) { - assert(!f && !s); + assert(!s); offset = - layout->slices[l].offset + (w * panfrost_get_layer_stride(layout, l)); + layout->slices[l].offset + i * panfrost_get_layer_stride(layout, l); } else { - offset = panfrost_texture_offset(layout, l, (w * face_mult) + f, s); + offset = panfrost_texture_offset(layout, l, i, s); } return base + offset; @@ -457,7 +439,7 @@ panfrost_emit_plane(const struct pan_image_layout *layout, static void panfrost_emit_surface(const struct pan_image_view *iview, unsigned level, - unsigned layer, unsigned face, unsigned sample, + unsigned index, unsigned sample, enum pipe_format format, void **payload) { ASSERTED const struct util_format_description *desc = @@ -497,7 +479,7 @@ panfrost_emit_surface(const struct pan_image_view *iview, unsigned level, panfrost_compression_tag(desc, layouts[i]->dim, layouts[i]->modifier); plane_ptrs[i] = panfrost_get_surface_pointer( - layouts[i], iview->dim, base | tag, level, layer, face, sample); + layouts[i], iview->dim, base | tag, level, index, sample); panfrost_get_surface_strides(layouts[i], level, &row_strides[i], &surface_strides[i]); } @@ -552,37 +534,37 @@ panfrost_emit_texture_payload(const struct pan_image_view *iview, * into a single plane descriptor. */ - unsigned first_layer = iview->first_layer, last_layer = iview->last_layer; - unsigned first_face = 0, last_face = 0; - - if (iview->dim == MALI_TEXTURE_DIMENSION_CUBE) { - panfrost_adjust_cube_dimensions(&first_face, &last_face, &first_layer, - &last_layer); - } - #if PAN_ARCH >= 7 /* V7 and later treats faces as extra layers */ - for (int layer = first_layer; layer <= last_layer; ++layer) { - for (int face = first_face; face <= last_face; ++face) { - for (int sample = 0; sample < nr_samples; ++sample) { - for (int level = iview->first_level; level <= iview->last_level; ++level) { - panfrost_emit_surface(iview, level, layer, face, sample, - format, &payload); - } + for (int layer = iview->first_layer; layer <= iview->last_layer; ++layer) { + for (int sample = 0; sample < nr_samples; ++sample) { + for (int level = iview->first_level; level <= iview->last_level; ++level) { + panfrost_emit_surface(iview, level, layer, sample, + format, &payload); } } } #else + unsigned first_layer = iview->first_layer, last_layer = iview->last_layer; + unsigned face_count = 1; + + if (iview->dim == MALI_TEXTURE_DIMENSION_CUBE) { + first_layer /= 6; + last_layer /= 6; + face_count = 6; + } + /* V6 and earlier has a different memory-layout */ for (int layer = first_layer; layer <= last_layer; ++layer) { for (int level = iview->first_level; level <= iview->last_level; ++level) { /* order of face and sample doesn't matter; we can only have multiple * of one or the other (no support for multisampled cubemaps) */ - for (int face = first_face; face <= last_face; ++face) { - for (int sample = 0; sample < nr_samples; ++sample) - panfrost_emit_surface(iview, level, layer, face, sample, - format, &payload); + for (int face = 0; face < face_count; ++face) { + for (int sample = 0; sample < nr_samples; ++sample) { + panfrost_emit_surface(iview, level, (face_count * layer) + face, + sample, format, &payload); + } } } } @@ -662,9 +644,11 @@ GENX(panfrost_new_texture)(const struct pan_image_view *iview, void *out, unsigned array_size = iview->last_layer - iview->first_layer + 1; + /* If this is a cubemap, we expect the number of layers to be a multiple + * of 6. + */ if (iview->dim == MALI_TEXTURE_DIMENSION_CUBE) { - assert(iview->first_layer % 6 == 0); - assert(iview->last_layer % 6 == 5); + assert(array_size % 6 == 0); array_size /= 6; }