summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2014-02-07 13:56:27 -0800
committerKenneth Graunke <kenneth@whitecape.org>2014-02-07 19:36:14 -0800
commit8e0a0e4d30be142235c2b2439fe82935b8c67888 (patch)
treeabc829310e886e64d7d782435658c993da6087a7 /src
parent882e98e5e6e63787d0eac572c461605e69fc1589 (diff)
downloadexternal_mesa3d-8e0a0e4d30be142235c2b2439fe82935b8c67888.zip
external_mesa3d-8e0a0e4d30be142235c2b2439fe82935b8c67888.tar.gz
external_mesa3d-8e0a0e4d30be142235c2b2439fe82935b8c67888.tar.bz2
i965: Fix fast depth clear values on Broadwell.
Broadwell's 3DSTATE_CLEAR_PARAMS packet expects a floating point value regardless of format. This means we need to stop converting it to UNORM. Storing the value as float would make sense, but since we already have a uint32_t field, this patch continues shoehorning it into that. In a sense, this makes mt->depth_clear_value the DWord you emit in the packet, rather than the clear value itself. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_clear.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_clear.c b/src/mesa/drivers/dri/i965/brw_clear.c
index 953e9ba..523fca2 100644
--- a/src/mesa/drivers/dri/i965/brw_clear.c
+++ b/src/mesa/drivers/dri/i965/brw_clear.c
@@ -160,7 +160,10 @@ brw_fast_clear_depth(struct gl_context *ctx)
/* FALLTHROUGH */
default:
- depth_clear_value = fb->_DepthMax * ctx->Depth.Clear;
+ if (brw->gen >= 8)
+ depth_clear_value = float_as_int(ctx->Depth.Clear);
+ else
+ depth_clear_value = fb->_DepthMax * ctx->Depth.Clear;
break;
}