summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilip Gawin <filip.gawin@zoho.com>2023-03-27 13:44:46 +0200
committerDylan Baker <dylan.c.baker@intel.com>2023-04-04 13:06:03 -0700
commit6ca17e3a72f89820495cb88846ef8ae67c4ea3b3 (patch)
treeb0dcc91c006896470dea4a1ee89c0f6021e33bbf
parent9191fa44ce5191345be4b5d32b9dc88745b9b3e7 (diff)
downloadmesa-6ca17e3a72f89820495cb88846ef8ae67c4ea3b3.tar.gz
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 <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22137> (cherry picked from commit fa6ecd00327774541b55286ff9dd99d8e50f57eb)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt3
-rw-r--r--src/gallium/drivers/crocus/crocus_clear.c12
3 files changed, 1 insertions, 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 3.2@gl-3.2-adj-prims cull-back pv-first,Fail
spec@!opengl 3.2@gl-3.2-adj-prims cull-front pv-first,Fail
spec@!opengl 3.2@gl-3.2-adj-prims 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