From 34c6edb0291f13ee155020d9e84a0236a5614007 Mon Sep 17 00:00:00 2001 From: GKraats Date: Sun, 17 Nov 2024 20:53:29 +0100 Subject: [PATCH] i915g: fix glClearColor using a 1 byte color format Unscissored glClearColor is using i915_fill_blit(). Clearing can be done with the 1 byte formats GL_ALPHA, GL_LUMINANCE or GL_INTENSITY. Routine i915_fill_blit() is called with a rgba-mask containing 1 byte, but it is handling this as a 2-byte color. This fix adds the needed 1 byte setup to both i915_fill_blit() and i915_copy_blit(). It solves 1 piglit-test concerning arb_clear_texture-base-formats and 15 tests concerning fbo-clear-formats. No regression is shown at other piglit-tests. Cc: mesa-stable Signed-off-by: GKraats (cherry picked from commit bed66430abfbd4b5d28830b6c69acef999f46cbc) Conflicts: src/gallium/drivers/i915/ci/i915-g33-fails.txt Part-of: --- .pick_status.json | 2 +- .../drivers/i915/ci/i915-g33-fails.txt | 34 +------------------ src/gallium/drivers/i915/i915_blit.c | 6 ++++ 3 files changed, 8 insertions(+), 34 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index b3c19559952..da6396df6b8 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1634,7 +1634,7 @@ "description": "i915g: fix glClearColor using a 1 byte color format", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/i915/ci/i915-g33-fails.txt b/src/gallium/drivers/i915/ci/i915-g33-fails.txt index 4e8b17133f3..03f3b495a34 100644 --- a/src/gallium/drivers/i915/ci/i915-g33-fails.txt +++ b/src/gallium/drivers/i915/ci/i915-g33-fails.txt @@ -61,34 +61,12 @@ dEQP-GLES2.functional.shaders.struct.uniform.nested_struct_array_dynamic_index_f dEQP-GLES2.functional.shaders.struct.uniform.equal_fragment,Fail dEQP-GLES2.functional.shaders.struct.uniform.not_equal_fragment,Fail -# https://gitlab.freedesktop.org/mesa/mesa/-/issues/4982 -# -Y face renders incorrectly (black instead of texture contents) -dEQP-GLES2.functional.texture.filtering.cube.linear_linear_clamp_l8_pot,Fail -dEQP-GLES2.functional.texture.filtering.cube.linear_linear_mirror_l8_pot,Fail -dEQP-GLES2.functional.texture.filtering.cube.linear_linear_repeat_l8_pot,Fail -dEQP-GLES2.functional.texture.filtering.cube.linear_mipmap_linear_nearest_repeat_l8,Fail -dEQP-GLES2.functional.texture.filtering.cube.linear_mipmap_nearest_nearest_repeat_l8,Fail -dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_clamp_l8_pot,Fail -dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_mirror_l8_pot,Fail -dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_repeat_l8_pot,Fail -dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_clamp_l8_pot,Fail -dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_mirror_l8_pot,Fail -dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_repeat_l8_pot,Fail -dEQP-GLES2.functional.texture.filtering.cube.nearest_mipmap_linear_nearest_repeat_l8,Fail -dEQP-GLES2.functional.texture.filtering.cube.nearest_mipmap_nearest_nearest_repeat_l8,Fail -dEQP-GLES2.functional.texture.filtering.cube.nearest_nearest_clamp_l8_pot,Fail -dEQP-GLES2.functional.texture.filtering.cube.nearest_nearest_mirror_l8_pot,Fail -dEQP-GLES2.functional.texture.filtering.cube.nearest_nearest_repeat_l8_pot,Fail -dEQP-GLES2.functional.texture.size.cube.128x128_l8_mipmap,Fail -dEQP-GLES2.functional.texture.size.cube.64x64_l8_mipmap,Fail - # https://gitlab.freedesktop.org/mesa/mesa/-/issues/4982 # Minor errors on all faces, perhaps around filtering's texel selection? dEQP-GLES2.functional.texture.size.cube.15x15_l8,Fail dEQP-GLES2.functional.texture.size.cube.15x15_rgb888,Fail dEQP-GLES2.functional.texture.size.cube.15x15_rgba4444,Fail dEQP-GLES2.functional.texture.size.cube.15x15_rgba8888,Fail -dEQP-GLES2.functional.texture.size.cube.16x16_l8_mipmap,Fail # Texel differences in the middle of the texture? dEQP-GLES2.functional.texture.wrap.clamp_clamp_nearest_npot_etc1,Fail @@ -329,6 +307,7 @@ spec@!opengl 2.1@polygon-stipple-fs,Fail spec@arb_arrays_of_arrays@execution@glsl-arrays-copy-size-mismatch,Fail spec@arb_depth_texture@depth-level-clamp,Fail + spec@arb_depth_texture@fbo-clear-formats,Fail spec@arb_depth_texture@fbo-clear-formats@GL_DEPTH_COMPONENT,Fail spec@arb_depth_texture@fbo-clear-formats@GL_DEPTH_COMPONENT16,Fail @@ -529,17 +508,6 @@ spec@ext_framebuffer_object@fbo-blending-formats@GL_RGB10,Fail spec@ext_framebuffer_object@fbo-blending-formats@GL_RGB4,Fail spec@ext_framebuffer_object@fbo-blending-formats@GL_RGB5,Fail -spec@ext_framebuffer_object@fbo-clear-formats,Fail -spec@ext_framebuffer_object@fbo-clear-formats@GL_INTENSITY,Fail -spec@ext_framebuffer_object@fbo-clear-formats@GL_INTENSITY12,Fail -spec@ext_framebuffer_object@fbo-clear-formats@GL_INTENSITY16,Fail -spec@ext_framebuffer_object@fbo-clear-formats@GL_INTENSITY4,Fail -spec@ext_framebuffer_object@fbo-clear-formats@GL_INTENSITY8,Fail -spec@ext_framebuffer_object@fbo-clear-formats@GL_LUMINANCE,Fail -spec@ext_framebuffer_object@fbo-clear-formats@GL_LUMINANCE12,Fail -spec@ext_framebuffer_object@fbo-clear-formats@GL_LUMINANCE16,Fail -spec@ext_framebuffer_object@fbo-clear-formats@GL_LUMINANCE4,Fail -spec@ext_framebuffer_object@fbo-clear-formats@GL_LUMINANCE8,Fail spec@ext_framebuffer_object@fbo-colormask-formats,Fail spec@ext_framebuffer_object@fbo-colormask-formats@GL_ALPHA,Fail spec@ext_framebuffer_object@fbo-colormask-formats@GL_ALPHA12,Fail diff --git a/src/gallium/drivers/i915/i915_blit.c b/src/gallium/drivers/i915/i915_blit.c index 313c4620be9..6926ae4464d 100644 --- a/src/gallium/drivers/i915/i915_blit.c +++ b/src/gallium/drivers/i915/i915_blit.c @@ -44,6 +44,9 @@ i915_fill_blit(struct i915_context *i915, unsigned cpp, unsigned rgba_mask, switch (cpp) { case 1: + BR13 = (((int)dst_pitch) & 0xffff) | (0xF0 << 16); + CMD = XY_COLOR_BLT_CMD; + break; case 2: case 3: BR13 = (((int)dst_pitch) & 0xffff) | (0xF0 << 16) | (1 << 24); @@ -99,6 +102,9 @@ i915_copy_blit(struct i915_context *i915, unsigned cpp, switch (cpp) { case 1: + BR13 = (((int)dst_pitch) & 0xffff) | (0xCC << 16); + CMD = XY_SRC_COPY_BLT_CMD; + break; case 2: case 3: BR13 = (((int)dst_pitch) & 0xffff) | (0xCC << 16) | (1 << 24);