From 3fc4ccde2daeb10e7081f4994e8f28f33883ff9d Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 20 Oct 2021 08:36:22 -0400 Subject: [PATCH] mesa: Require MRT support for GL3/ES3 OpenGL 3.0 requires the driver can draw to 8 simultaneous render targets. Similarly, OpenGL ES 3.0 requires the driver can draw to 4 simultaneous render targets. Fix the version computation logic to take this into account. On Mali T720, we support ~all features of OpenGL ES 3.1 except we only support a single render target. Mali T720 should advertise OpenGL 2.1 and OpenGL ES 2.0 only. With the previous logic, it incorrectly advertised OpenGL ES 3.1. v2: Lie about the minimum for GL 3.0 to make freedreno a3xx happy. Add Emma's reviewed-by. v3: Update the Mali T720 CI expectations. There are tests that pass on GLES3 but not GLES2. Unclear if these are dEQP bugs or Mesa bugs, lima hits the same issues. Add them to the known fails Note to mesa-stable maintainers: this downgrades the OpenGL version advertised on Mali T720. As such, this patch should apply to the unreleased 21.3 (Eric) but should NOT be backported to any released Mesa versions (21.2 or older should NOT have this patch). This is a bit of a compromise; Emma agreed with this plan on IRC. Reported-by: Tomeu Vizoso Signed-off-by: Alyssa Rosenzweig Reviewed-by: Emma Anholt [v2] Reviewed-by: Ilia Mirkin [v2] Cc: 21.3 mesa-stable Part-of: (cherry picked from commit 861a35b3bc8779c5eb1d825a99151dd5e8c023ac) --- .pick_status.json | 2 +- src/mesa/main/version.c | 9 ++++++++- src/panfrost/ci/deqp-panfrost-t720.toml | 2 +- src/panfrost/ci/panfrost-t720-fails.txt | 26 +++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 71ba078dbea..100b80f817f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4270,7 +4270,7 @@ "description": "mesa: Require MRT support for GL3/ES3", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 3b37b135184..33465e2efda 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -273,8 +273,14 @@ compute_version(const struct gl_extensions *extensions, const bool ver_2_1 = (ver_2_0 && extensions->EXT_pixel_buffer_object && extensions->EXT_texture_sRGB); + /* We lie about the minimum number of color attachments. Strictly, OpenGL + * 3.0 requires 8, whereas OpenGL ES requires 4. OpenGL ES 3.0 class + * hardware may only support 4 render targets. Advertise non-conformant + * OpenGL 3.0 anyway. Affects freedreno on a3xx + */ const bool ver_3_0 = (ver_2_1 && consts->GLSLVersion >= 130 && + consts->MaxColorAttachments >= 4 && (consts->MaxSamples >= 4 || consts->FakeSWMSAA) && (api == API_OPENGL_CORE || extensions->ARB_color_buffer_float) && @@ -539,7 +545,8 @@ compute_version_es2(const struct gl_extensions *extensions, (extensions->NV_primitive_restart || consts->PrimitiveRestartFixedIndex) && extensions->OES_depth_texture_cube_map && - extensions->EXT_texture_type_2_10_10_10_REV); + extensions->EXT_texture_type_2_10_10_10_REV && + consts->MaxColorAttachments >= 4); const bool es31_compute_shader = consts->MaxComputeWorkGroupInvocations >= 128 && consts->Program[MESA_SHADER_COMPUTE].MaxShaderStorageBlocks && diff --git a/src/panfrost/ci/deqp-panfrost-t720.toml b/src/panfrost/ci/deqp-panfrost-t720.toml index f42c06284b0..5bb962f282f 100644 --- a/src/panfrost/ci/deqp-panfrost-t720.toml +++ b/src/panfrost/ci/deqp-panfrost-t720.toml @@ -7,5 +7,5 @@ deqp_args = [ "--deqp-surface-type=pbuffer", "--deqp-visibility=hidden", "--deqp-gl-config-name=rgba8888d24s8ms0", ] -version_check = "GL ES .*git" +version_check = "GL ES 2.0.*git" renderer_check = "Mali-T720" diff --git a/src/panfrost/ci/panfrost-t720-fails.txt b/src/panfrost/ci/panfrost-t720-fails.txt index fce4eb729fd..01722524f43 100644 --- a/src/panfrost/ci/panfrost-t720-fails.txt +++ b/src/panfrost/ci/panfrost-t720-fails.txt @@ -18,3 +18,29 @@ dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.62,Fail dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.73,Fail dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.81,Fail dEQP-GLES2.functional.fragment_ops.random.43,Fail +dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb_half_float_oes,Fail +dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgba_half_float_oes,Fail +dEQP-GLES2.functional.multisampled_render_to_texture.readpixels,Fail +dEQP-GLES2.functional.shaders.texture_functions.vertex.texturecubelod,Fail +dEQP-GLES2.functional.texture.mipmap.cube.basic.linear_linear,Fail +dEQP-GLES2.functional.texture.mipmap.cube.basic.linear_nearest,Fail +dEQP-GLES2.functional.texture.mipmap.cube.bias.linear_linear,Fail +dEQP-GLES2.functional.texture.mipmap.cube.bias.linear_nearest,Fail +dEQP-GLES2.functional.texture.mipmap.cube.projected.linear_linear,Fail +dEQP-GLES2.functional.texture.mipmap.cube.projected.linear_nearest,Fail +dEQP-GLES2.functional.texture.vertex.cube.filtering.linear_mipmap_linear_linear_clamp,Fail +dEQP-GLES2.functional.texture.vertex.cube.filtering.linear_mipmap_linear_linear_mirror,Fail +dEQP-GLES2.functional.texture.vertex.cube.filtering.linear_mipmap_linear_nearest_clamp,Fail +dEQP-GLES2.functional.texture.vertex.cube.filtering.linear_mipmap_linear_nearest_mirror,Fail +dEQP-GLES2.functional.texture.vertex.cube.filtering.nearest_mipmap_linear_linear_clamp,Fail +dEQP-GLES2.functional.texture.vertex.cube.filtering.nearest_mipmap_linear_linear_mirror,Fail +dEQP-GLES2.functional.texture.vertex.cube.filtering.nearest_mipmap_linear_linear_repeat,Fail +dEQP-GLES2.functional.texture.vertex.cube.filtering.nearest_mipmap_nearest_linear_clamp,Fail +dEQP-GLES2.functional.texture.vertex.cube.filtering.nearest_mipmap_nearest_linear_mirror,Fail +dEQP-GLES2.functional.texture.vertex.cube.filtering.nearest_mipmap_nearest_linear_repeat,Fail +dEQP-GLES2.functional.texture.vertex.cube.wrap.clamp_clamp,Fail +dEQP-GLES2.functional.texture.vertex.cube.wrap.clamp_mirror,Fail +dEQP-GLES2.functional.texture.vertex.cube.wrap.clamp_repeat,Fail +dEQP-GLES2.functional.texture.vertex.cube.wrap.mirror_clamp,Fail +dEQP-GLES2.functional.texture.vertex.cube.wrap.mirror_mirror,Fail +dEQP-GLES2.functional.texture.vertex.cube.wrap.mirror_repeat,Fail