diff --git a/.pick_status.json b/.pick_status.json index 4a340f78c3b..c2f370897a2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1794,7 +1794,7 @@ "description": "pan/bi: Lower ffract in bifrost_nir_algebraic on v11+", "nominated": true, "nomination_type": 4, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/panfrost/ci/panfrost-g720-fails.txt b/src/panfrost/ci/panfrost-g720-fails.txt index b53fd5d6293..28d2692414a 100644 --- a/src/panfrost/ci/panfrost-g720-fails.txt +++ b/src/panfrost/ci/panfrost-g720-fails.txt @@ -5,7 +5,3 @@ spec@ext_image_dma_buf_import@ext_image_dma_buf_import-refcount-multithread,Cras dEQP-VK.pipeline.fast_linked_library.misc.interpolate_at_sample_no_sample_shading,Crash dEQP-VK.glsl.loops.special.do_while_dynamic_iterations.dowhile_trap_vertex,Crash - -# Seems to be a precision issues because of floor fp16 being dropped since v11 (and the conversion done as a result) -dEQP-GLES3.functional.shaders.builtin_functions.common.fract.vec2_lowp_vertex,Fail -dEQP-GLES31.functional.shaders.builtin_functions.common.fract.vec2_lowp_compute,Fail diff --git a/src/panfrost/ci/panfrost-g725-fails.txt b/src/panfrost/ci/panfrost-g725-fails.txt index 1f197a9a466..88cbc5231b5 100644 --- a/src/panfrost/ci/panfrost-g725-fails.txt +++ b/src/panfrost/ci/panfrost-g725-fails.txt @@ -3,7 +3,3 @@ spec@ext_image_dma_buf_import@ext_image_dma_buf_import-refcount-multithread,Cras # CTS bug, tries to use vkCmdSetPatchControlPointsEXT when we don't have that dEQP-VK.pipeline.fast_linked_library.misc.interpolate_at_sample_no_sample_shading,Crash - -# Seems to be a precision issues because of floor fp16 being dropped since v11 (and the conversion done as a result) -dEQP-GLES3.functional.shaders.builtin_functions.common.fract.vec2_lowp_vertex,Fail -dEQP-GLES31.functional.shaders.builtin_functions.common.fract.vec2_lowp_compute,Fail diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index d5b8737e658..c120d80e814 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -5025,6 +5025,7 @@ bi_lower_bit_size(const nir_instr *instr, void *data) case nir_op_fround_even: case nir_op_fceil: case nir_op_ffloor: + case nir_op_ffract: case nir_op_ftrunc: case nir_op_frexp_sig: case nir_op_frexp_exp: diff --git a/src/panfrost/compiler/bifrost_compile.h b/src/panfrost/compiler/bifrost_compile.h index beebf91e425..8830b759cfb 100644 --- a/src/panfrost/compiler/bifrost_compile.h +++ b/src/panfrost/compiler/bifrost_compile.h @@ -94,7 +94,7 @@ void bifrost_compile_shader_nir(nir_shader *nir, .lower_flrp16 = true, \ .lower_flrp32 = true, \ .lower_flrp64 = true, \ - .lower_ffract = true, \ + .lower_ffract = arch < 11, \ .lower_fmod = true, \ .lower_fdiv = true, \ .lower_isign = true, \ diff --git a/src/panfrost/compiler/bifrost_nir_algebraic.py b/src/panfrost/compiler/bifrost_nir_algebraic.py index 1d38ad43c2a..3fab360ec48 100644 --- a/src/panfrost/compiler/bifrost_nir_algebraic.py +++ b/src/panfrost/compiler/bifrost_nir_algebraic.py @@ -100,6 +100,10 @@ algebraic_late = [ # On v11+, F16_TO_S32/F16_TO_U32 is gone but we still have F32_TO_S32/F32_TO_U32 (('f2i32', 'a@16'), ('f2i32', ('f2f32', a)), 'gpu_arch >= 11'), (('f2u32', 'a@16'), ('f2u32', ('f2f32', a)), 'gpu_arch >= 11'), + + # On v11+, because FROUND.v2f16 is gone we end up with precision issues. + # We lower ffract here instead to ensure lower_bit_size has been performed. + (('ffract', a), ('fadd', a, ('fneg', ('ffloor', a))), 'gpu_arch >= 11'), ] # On v11+, ICMP_OR.v4u8 was removed