diff options
author | Sergii Romantsov <[email protected]> | 2019-07-12 16:46:45 +0300 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2019-08-02 14:25:34 +0000 |
commit | a86eccfb78092493b3999849db62613838951756 (patch) | |
tree | e60b52b727da577c4ea5578baf65384e2f60583f /src/mesa | |
parent | e8110e51c6f5ca369100b4771eaaa4e5cbe9e0df (diff) |
i965/clear: clear_value better precision
Test-case with depth-clear 0.5 and format
MESA_FORMAT_Z24_UNORM_X8_UINT fails due inconsistent
clear-value of 0.4999997.
Maybe its better to improve?
CC: Jason Ekstrand <[email protected]>
Fixes: 0ae9ce0f29ea (i965/clear: Quantize the depth clear value based on the format)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111113
Signed-off-by: Sergii Romantsov <[email protected]>
Signed-off-by: Danylo Piliaiev <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_clear.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_clear.c b/src/mesa/drivers/dri/i965/brw_clear.c index 30e09861491..1508171da10 100644 --- a/src/mesa/drivers/dri/i965/brw_clear.c +++ b/src/mesa/drivers/dri/i965/brw_clear.c @@ -167,7 +167,7 @@ brw_fast_clear_depth(struct gl_context *ctx) */ float clear_value = mt->format == MESA_FORMAT_Z_FLOAT32 ? ctx->Depth.Clear : - (unsigned)(ctx->Depth.Clear * fb->_DepthMax) / (float)fb->_DepthMax; + _mesa_lroundeven(ctx->Depth.Clear * fb->_DepthMax) / (float)(fb->_DepthMax); const uint32_t num_layers = depth_att->Layered ? depth_irb->layer_count : 1; |