Module: Mesa Branch: staging/22.0 Commit: 663dbf34ac578c72a429ba1c94b2f01be61062da URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=663dbf34ac578c72a429ba1c94b2f01be61062da
Author: Alyssa Rosenzweig <[email protected]> Date: Sat Mar 5 15:49:43 2022 -0500 pan/bi: Handle non-2D arrays Handle arrays generically by using the last component of the coordinate source as the array index. That works for both 2D arrays and cube arrays, fixing cube arrays. Cube arrays were already handled correctly in core Panfrost code. This code path is not tested in dEQP-GLES31 without exposing OES_cube_map_array, which depends on OES_geometry_shader, which we don't have. Yet we do expose PIPE_CAP_CUBE_ARRAY, so ARB_cube_map_array is exposed. Disabling PIPE_CAP_CUBE_ARRAY would be an easy band-aid fix, but it's easy enough to handle correctly. dEQP-GLES31 passes with a hack enabling OES_cube_map_array [without geometry shaders]. Also fixes 1D arrays on Bifrost for the same reasons. Fixes: 70d6c5675d6 ("pan/bi: Emit TEXC with builder") Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15254> (cherry picked from commit 53f1e57ee7a7a6f7906c34cf7b78a39873fd00c2) --- .pick_status.json | 2 +- src/panfrost/bifrost/bifrost_compile.c | 19 ++-- src/panfrost/ci/panfrost-g52-fails.txt | 169 --------------------------------- 3 files changed, 10 insertions(+), 180 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index a2659aa857e..809323a8ce1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -319,7 +319,7 @@ "description": "pan/bi: Handle non-2D arrays", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "70d6c5675d68103aeb72983a100418da15dd2bc9" }, diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 903ea1b82de..5f0cf9bff76 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -2670,6 +2670,7 @@ bi_emit_texc(bi_builder *b, nir_tex_instr *instr) for (unsigned i = 0; i < instr->num_srcs; ++i) { bi_index index = bi_src_index(&instr->src[i].src); unsigned sz = nir_src_bit_size(instr->src[i].src); + unsigned components = nir_src_num_components(instr->src[i].src); ASSERTED nir_alu_type base = nir_tex_instr_src_type(instr, i); nir_alu_type T = base | sz; @@ -2678,27 +2679,25 @@ bi_emit_texc(bi_builder *b, nir_tex_instr *instr) if (instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE) { cx = bi_emit_texc_cube_coord(b, index, &cy); } else { - unsigned components = nir_src_num_components(instr->src[i].src); - /* Copy XY (for 2D+) or XX (for 1D) */ cx = index; cy = bi_word(index, MIN2(1, components - 1)); assert(components >= 1 && components <= 3); - if (components < 3) { - /* nothing to do */ - } else if (desc.array) { - /* 2D array */ - dregs[BIFROST_TEX_DREG_ARRAY] = - bi_emit_texc_array_index(b, - bi_word(index, 2), T); - } else { + if (components == 3 && !desc.array) { /* 3D */ dregs[BIFROST_TEX_DREG_Z_COORD] = bi_word(index, 2); } } + + if (desc.array) { + dregs[BIFROST_TEX_DREG_ARRAY] = + bi_emit_texc_array_index(b, + bi_word(index, components - 1), T); + } + break; case nir_tex_src_lod: diff --git a/src/panfrost/ci/panfrost-g52-fails.txt b/src/panfrost/ci/panfrost-g52-fails.txt index aa8408239fa..60df76e709f 100644 --- a/src/panfrost/ci/panfrost-g52-fails.txt +++ b/src/panfrost/ci/panfrost-g52-fails.txt @@ -75,8 +75,6 @@ spec@arb_get_program_binary@restore-sso-program,Fail spec@arb_pixel_buffer_object@fbo-pbo-readpixels-small,Fail spec@arb_pixel_buffer_object@fbo-pbo-readpixels-small@GL_DEPTH32F_STENCIL8-GL_DEPTH_STENCIL,Fail spec@arb_pixel_buffer_object@fbo-pbo-readpixels-small@GL_DEPTH32F_STENCIL8-GL_STENCIL_INDEX,Fail -spec@arb_pixel_buffer_object@texsubimage array pbo,Fail -spec@arb_pixel_buffer_object@texsubimage cube_map_array pbo,Fail spec@arb_point_sprite@arb_point_sprite-checkerboard,Fail spec@arb_point_sprite@arb_point_sprite-mipmap,Fail spec@arb_sample_shading@samplemask [email protected] mask_in_one,Fail @@ -117,10 +115,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@arb_texture_cube_map_array-cubemap,Fail -spec@arb_texture_cube_map_array@arb_texture_cube_map_array-cubemap-lod,Fail -spec@arb_texture_cube_map_array@arb_texture_cube_map_array-fbo-cubemap-array,Fail -spec@arb_texture_cube_map_array@texsubimage cube_map_array,Fail 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 @@ -139,117 +133,6 @@ spec@arb_texture_float@fbo-generatemipmap-formats@GL_INTENSITY16F_ARB,Fail spec@arb_texture_float@fbo-generatemipmap-formats@GL_INTENSITY16F_ARB NPOT,Fail spec@arb_texture_float@multisample-formats 2 gl_arb_texture_float,Fail spec@arb_texture_float@multisample-formats 4 gl_arb_texture_float,Fail -spec@arb_texture_gather@texturegather@fs-rgba-alpha-float-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-alpha-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-alpha-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-alpha-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-blue-float-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-blue-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-blue-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-blue-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-green-float-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-green-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-green-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-green-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-none-float-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-none-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-none-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-none-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-red-float-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-red-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-red-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgba-red-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-blue-float-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-blue-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-blue-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-blue-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-green-float-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-green-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-green-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-green-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-none-float-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-none-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-none-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-none-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-red-float-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-red-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-red-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rgb-red-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rg-green-float-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rg-green-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rg-green-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rg-green-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rg-none-float-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rg-none-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rg-none-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rg-none-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rg-red-float-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rg-red-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rg-red-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-rg-red-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-r-none-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-r-none-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-r-none-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-r-red-float-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-r-red-int-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-r-red-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@fs-r-red-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-alpha-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-alpha-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-alpha-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-alpha-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-blue-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-blue-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-blue-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-blue-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-green-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-green-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-green-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-green-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-none-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-none-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-none-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-none-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-red-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-red-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-red-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgba-red-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-blue-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-blue-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-blue-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-blue-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-green-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-green-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-green-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-green-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-none-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-none-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-none-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-none-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-red-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-red-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-red-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rgb-red-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rg-green-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rg-green-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rg-green-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rg-green-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rg-none-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rg-none-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rg-none-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rg-none-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rg-red-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rg-red-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rg-red-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-rg-red-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-r-none-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-r-none-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-r-none-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-r-none-unorm-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-r-red-float-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-r-red-int-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-r-red-uint-cubearray,Fail -spec@arb_texture_gather@texturegather@vs-r-red-unorm-cubearray,Fail spec@arb_texture_multisample@arb_texture_multisample-dsa-texelfetch,Fail spec@arb_texture_multisample@arb_texture_multisample-dsa-texelfetch@Texture type: GL_R16I,Fail spec@arb_texture_multisample@arb_texture_multisample-dsa-texelfetch@Texture type: GL_R16_SNORM,Fail @@ -366,18 +249,6 @@ spec@ext_framebuffer_object@fbo-colormask-formats@GL_LUMINANCE,Fail spec@ext_framebuffer_object@fbo-fast-clear,Fail spec@ext_framebuffer_object@getteximage-formats init-by-clear-and-render,Fail spec@ext_framebuffer_object@getteximage-formats init-by-rendering,Fail -spec@ext_gpu_shader4@execution@texelfetch@fs-texelfetch-isampler1darray,Fail -spec@ext_gpu_shader4@execution@texelfetch@fs-texelfetch-sampler1darray,Fail -spec@ext_gpu_shader4@execution@texelfetch@fs-texelfetch-usampler1darray,Fail -spec@ext_gpu_shader4@execution@texelfetchoffset@fs-texelfetch-isampler1darray,Fail -spec@ext_gpu_shader4@execution@texelfetchoffset@fs-texelfetch-sampler1darray,Fail -spec@ext_gpu_shader4@execution@texelfetchoffset@fs-texelfetch-usampler1darray,Fail -spec@ext_gpu_shader4@execution@texelfetchoffset@vs-texelfetch-isampler1darray,Fail -spec@ext_gpu_shader4@execution@texelfetchoffset@vs-texelfetch-sampler1darray,Fail -spec@ext_gpu_shader4@execution@texelfetchoffset@vs-texelfetch-usampler1darray,Fail -spec@ext_gpu_shader4@execution@texelfetch@vs-texelfetch-isampler1darray,Fail -spec@ext_gpu_shader4@execution@texelfetch@vs-texelfetch-sampler1darray,Fail -spec@ext_gpu_shader4@execution@texelfetch@vs-texelfetch-usampler1darray,Fail spec@ext_image_dma_buf_import@ext_image_dma_buf_import-export,Crash spec@ext_image_dma_buf_import@ext_image_dma_buf_import-invalid_attributes,Crash spec@ext_image_dma_buf_import@ext_image_dma_buf_import-invalid_hints,Crash @@ -403,13 +274,6 @@ spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yuv420,Crash spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yuyv,Crash spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yvu420,Crash spec@ext_image_dma_buf_import@ext_image_dma_buf_import-unsupported_format,Crash -spec@ext_texture_array@array-texture,Fail -spec@ext_texture_array@copyteximage 1d_array,Fail -spec@ext_texture_array@copyteximage 1d_array samples=2,Fail -spec@ext_texture_array@copyteximage 1d_array samples=4,Fail -spec@ext_texture_array@fbo-generatemipmap-array,Fail -spec@ext_texture_array@fbo-generatemipmap-array rgb9_e5,Fail -spec@ext_texture_array@texsubimage array,Fail spec@ext_texture_compression_rgtc@rgtc-teximage-01,Fail spec@ext_texture_compression_rgtc@rgtc-teximage-02,Fail spec@ext_texture_srgb@fbo-fast-clear,Fail @@ -542,47 +406,14 @@ [email protected]@execution@varying-packing@simple vec3 separate,Fail [email protected]@execution@varying-packing@simple vec4 array,Fail [email protected]@execution@varying-packing@simple vec4 arrays_of_arrays,Fail [email protected]@execution@clipping@clip-plane-transformation pos,Fail [email protected]@execution@texelfetch@fs-texelfetch-isampler1darray,Fail [email protected]@execution@texelfetch@fs-texelfetch-sampler1darray,Fail [email protected]@execution@texelfetch@fs-texelfetch-usampler1darray,Fail [email protected]@execution@texelfetchoffset@fs-texelfetch-isampler1darray,Fail [email protected]@execution@texelfetchoffset@fs-texelfetch-sampler1darray,Fail [email protected]@execution@texelfetchoffset@fs-texelfetch-usampler1darray,Fail [email protected]@execution@texelfetchoffset@vs-texelfetch-isampler1darray,Fail [email protected]@execution@texelfetchoffset@vs-texelfetch-sampler1darray,Fail [email protected]@execution@texelfetchoffset@vs-texelfetch-usampler1darray,Fail [email protected]@execution@texelfetch@vs-texelfetch-isampler1darray,Fail [email protected]@execution@texelfetch@vs-texelfetch-sampler1darray,Fail [email protected]@execution@texelfetch@vs-texelfetch-usampler1darray,Fail [email protected]@execution@tex-miplevel-selection texture() 1darray,Fail [email protected]@execution@tex-miplevel-selection texture() 1darrayshadow,Fail [email protected]@execution@tex-miplevel-selection texture() 2drect,Crash [email protected]@execution@tex-miplevel-selection texture() 2drectshadow,Crash [email protected]@execution@tex-miplevel-selection texture(bias) 1darray,Fail [email protected]@execution@tex-miplevel-selection texture(bias) 1darrayshadow,Fail [email protected]@execution@tex-miplevel-selection texture(bias) cubearray,Fail [email protected]@execution@tex-miplevel-selection texture() cubearray,Fail [email protected]@execution@tex-miplevel-selection texture() cubearrayshadow,Fail [email protected]@execution@tex-miplevel-selection texturegrad 1darray,Fail [email protected]@execution@tex-miplevel-selection texturegrad 1darrayshadow,Fail [email protected]@execution@tex-miplevel-selection texturegrad 2drect,Crash [email protected]@execution@tex-miplevel-selection texturegrad 2drectshadow,Crash [email protected]@execution@tex-miplevel-selection texturegrad cubearray,Fail [email protected]@execution@tex-miplevel-selection texturegradoffset 1darray,Fail [email protected]@execution@tex-miplevel-selection texturegradoffset 1darrayshadow,Fail [email protected]@execution@tex-miplevel-selection texturegradoffset 2drect,Crash [email protected]@execution@tex-miplevel-selection texturegradoffset 2drectshadow,Crash [email protected]@execution@tex-miplevel-selection texturelod 1darray,Fail [email protected]@execution@tex-miplevel-selection texturelod 1darrayshadow,Fail [email protected]@execution@tex-miplevel-selection texturelod cubearray,Fail [email protected]@execution@tex-miplevel-selection texturelodoffset 1darray,Fail [email protected]@execution@tex-miplevel-selection texturelodoffset 1darrayshadow,Fail [email protected]@execution@tex-miplevel-selection textureoffset 1darray,Fail [email protected]@execution@tex-miplevel-selection textureoffset 1darrayshadow,Fail [email protected]@execution@tex-miplevel-selection textureoffset 2drect,Crash [email protected]@execution@tex-miplevel-selection textureoffset 2drectshadow,Crash [email protected]@execution@tex-miplevel-selection textureoffset(bias) 1darray,Fail [email protected]@execution@tex-miplevel-selection textureoffset(bias) 1darrayshadow,Fail [email protected]@execution@tex-miplevel-selection textureproj 2drect,Crash [email protected]@execution@tex-miplevel-selection textureproj 2drect_projvec4,Crash [email protected]@execution@tex-miplevel-selection textureproj 2drectshadow,Crash
