From 5ae5b38e96d35d4a661bd7dfca8ef530e93758ea Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 5 Mar 2022 15:49:43 -0500 Subject: [PATCH] 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 Part-of: (cherry picked from commit 53f1e57ee7a7a6f7906c34cf7b78a39873fd00c2) --- .pick_status.json | 2 +- src/panfrost/bifrost/bifrost_compile.c | 19 ++- src/panfrost/ci/panfrost-g52-fails.txt | 170 ------------------------- 3 files changed, 10 insertions(+), 181 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index eb59af34e63..b9a3541b926 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2416,7 +2416,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 35c0b1853c4..ccea825e23a 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -2617,6 +2617,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; @@ -2625,27 +2626,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 700e97578cb..a03ecf93cc5 100644 --- a/src/panfrost/ci/panfrost-g52-fails.txt +++ b/src/panfrost/ci/panfrost-g52-fails.txt @@ -85,8 +85,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 2@0.250000 mask_in_one,Fail @@ -127,10 +125,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 @@ -149,118 +143,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,Crash spec@arb_texture_float@multisample-formats 4 gl_arb_texture_float,Crash -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-float-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 @@ -387,18 +269,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 @@ -424,13 +294,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@compressedteximage gl_compressed_red_green_rgtc2_ext,Crash spec@ext_texture_compression_rgtc@compressedteximage gl_compressed_red_rgtc1_ext,Crash spec@ext_texture_compression_rgtc@compressedteximage gl_compressed_signed_red_green_rgtc2_ext,Crash @@ -569,47 +432,14 @@ spec@glsl-1.10@execution@varying-packing@simple vec3 separate,Fail spec@glsl-1.10@execution@varying-packing@simple vec4 array,Fail spec@glsl-1.10@execution@varying-packing@simple vec4 arrays_of_arrays,Fail spec@glsl-1.30@execution@clipping@clip-plane-transformation pos,Fail -spec@glsl-1.30@execution@texelfetch@fs-texelfetch-isampler1darray,Fail -spec@glsl-1.30@execution@texelfetch@fs-texelfetch-sampler1darray,Fail -spec@glsl-1.30@execution@texelfetch@fs-texelfetch-usampler1darray,Fail -spec@glsl-1.30@execution@texelfetchoffset@fs-texelfetch-isampler1darray,Fail -spec@glsl-1.30@execution@texelfetchoffset@fs-texelfetch-sampler1darray,Fail -spec@glsl-1.30@execution@texelfetchoffset@fs-texelfetch-usampler1darray,Fail -spec@glsl-1.30@execution@texelfetchoffset@vs-texelfetch-isampler1darray,Fail -spec@glsl-1.30@execution@texelfetchoffset@vs-texelfetch-sampler1darray,Fail -spec@glsl-1.30@execution@texelfetchoffset@vs-texelfetch-usampler1darray,Fail -spec@glsl-1.30@execution@texelfetch@vs-texelfetch-isampler1darray,Fail -spec@glsl-1.30@execution@texelfetch@vs-texelfetch-sampler1darray,Fail -spec@glsl-1.30@execution@texelfetch@vs-texelfetch-usampler1darray,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texture() 1darray,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texture() 1darrayshadow,Fail spec@glsl-1.30@execution@tex-miplevel-selection texture() 2drect,Crash spec@glsl-1.30@execution@tex-miplevel-selection texture() 2drectshadow,Crash -spec@glsl-1.30@execution@tex-miplevel-selection texture(bias) 1darray,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texture(bias) 1darrayshadow,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texture(bias) cubearray,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texture() cubearray,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texture() cubearrayshadow,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texturegrad 1darray,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texturegrad 1darrayshadow,Fail spec@glsl-1.30@execution@tex-miplevel-selection texturegrad 2drect,Crash spec@glsl-1.30@execution@tex-miplevel-selection texturegrad 2drectshadow,Crash -spec@glsl-1.30@execution@tex-miplevel-selection texturegrad cubearray,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texturegradoffset 1darray,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texturegradoffset 1darrayshadow,Fail spec@glsl-1.30@execution@tex-miplevel-selection texturegradoffset 2drect,Crash spec@glsl-1.30@execution@tex-miplevel-selection texturegradoffset 2drectshadow,Crash -spec@glsl-1.30@execution@tex-miplevel-selection texturelod 1darray,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texturelod 1darrayshadow,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texturelod cubearray,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texturelodoffset 1darray,Fail -spec@glsl-1.30@execution@tex-miplevel-selection texturelodoffset 1darrayshadow,Fail -spec@glsl-1.30@execution@tex-miplevel-selection textureoffset 1darray,Fail -spec@glsl-1.30@execution@tex-miplevel-selection textureoffset 1darrayshadow,Fail spec@glsl-1.30@execution@tex-miplevel-selection textureoffset 2drect,Crash spec@glsl-1.30@execution@tex-miplevel-selection textureoffset 2drectshadow,Crash -spec@glsl-1.30@execution@tex-miplevel-selection textureoffset(bias) 1darray,Fail -spec@glsl-1.30@execution@tex-miplevel-selection textureoffset(bias) 1darrayshadow,Fail spec@glsl-1.30@execution@tex-miplevel-selection textureproj 2drect,Crash spec@glsl-1.30@execution@tex-miplevel-selection textureproj 2drect_projvec4,Crash spec@glsl-1.30@execution@tex-miplevel-selection textureproj 2drectshadow,Crash