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>
This commit is contained in:
Filip Gawin 2023-03-27 13:44:46 +02:00 committed by Marge Bot
parent 5d8f0c570e
commit fa6ecd0032
2 changed files with 0 additions and 15 deletions

View file

@ -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
fast_color_clear@fcc-write-after-clear,Fail
@ -19,8 +18,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

View file

@ -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