Module: Mesa Branch: staging/23.0 Commit: 6ca17e3a72f89820495cb88846ef8ae67c4ea3b3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6ca17e3a72f89820495cb88846ef8ae67c4ea3b3
Author: Filip Gawin <[email protected]> Date: Mon Mar 27 13:44:46 2023 +0200 crocus: don't quantize the clear value Helps with: spec@!opengl 1.0@depth-clear-precision-check@depth32f_stencil8,UnexpectedPass spec@!opengl 3.0@clearbuffer-bug,UnexpectedPass Cc: mesa-stable Reviewed-by: Emma Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22137> (cherry picked from commit fa6ecd00327774541b55286ff9dd99d8e50f57eb) --- .pick_status.json | 2 +- src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt | 3 --- src/gallium/drivers/crocus/crocus_clear.c | 12 ------------ 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index b53f8ad47f5..3c3bf87cb2f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3685,7 +3685,7 @@ "description": "crocus: don't quantize the clear value", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt b/src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt index 6fe84b7a223..0ae7e02b7ed 100644 --- a/src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt +++ b/src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt @@ -1,7 +1,6 @@ spec@!opengl 1.0@depth-clear-precision-check,Fail spec@!opengl 1.0@depth-clear-precision-check@depth16,Fail spec@!opengl 1.0@depth-clear-precision-check@depth32,Fail -spec@!opengl 1.0@depth-clear-precision-check@depth32f_stencil8,Fail # frontbuffer reading failures? spec@!opengl 1.1@read-front,Fail @@ -29,8 +28,6 @@ spec@!opengl 1.1@linestipple@Factor 3x,Fail spec@!opengl 1.1@linestipple@Line loop,Fail spec@!opengl 1.1@linestipple@Line strip,Fail -spec@!opengl 3.0@clearbuffer-bug,Fail - spec@!opengl [email protected] cull-back pv-first,Fail spec@!opengl [email protected] cull-front pv-first,Fail spec@!opengl [email protected] line cull-back pv-first,Fail diff --git a/src/gallium/drivers/crocus/crocus_clear.c b/src/gallium/drivers/crocus/crocus_clear.c index 9ce65e914c2..dab78ca94fb 100644 --- a/src/gallium/drivers/crocus/crocus_clear.c +++ b/src/gallium/drivers/crocus/crocus_clear.c @@ -454,20 +454,8 @@ fast_clear_depth(struct crocus_context *ice, const struct pipe_box *box, float depth) { - struct pipe_resource *p_res = (void *) res; struct crocus_batch *batch = &ice->batches[CROCUS_BATCH_RENDER]; - /* Quantize the clear value to what can be stored in the actual depth - * buffer. This makes the following check more accurate because it now - * checks if the actual depth bits will match. It also prevents us from - * getting a too-accurate depth value during depth testing or when sampling - * with HiZ enabled. - */ - const unsigned nbits = p_res->format == PIPE_FORMAT_Z16_UNORM ? 16 : 24; - const uint32_t depth_max = (1 << nbits) - 1; - depth = p_res->format == PIPE_FORMAT_Z32_FLOAT ? depth : - (unsigned)(depth * depth_max) / (float)depth_max; - bool update_clear_depth = false; /* If we're clearing to a new clear value, then we need to resolve any clear
