summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_blit.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2011-03-01 01:46:10 +0100
committerMarek Olšák <maraeo@gmail.com>2011-03-01 01:46:27 +0100
commit790c73140939fb60c1b702215bb6afa09f401a8e (patch)
tree09f24392a994aa33edb1e6d5360a1e270c9424bf /src/gallium/drivers/r300/r300_blit.c
parent4609be44106274fa88cfdf935257dfbe51cb6039 (diff)
downloadexternal_mesa3d-790c73140939fb60c1b702215bb6afa09f401a8e.zip
external_mesa3d-790c73140939fb60c1b702215bb6afa09f401a8e.tar.gz
external_mesa3d-790c73140939fb60c1b702215bb6afa09f401a8e.tar.bz2
r300g: set the correct HiZ clear value
Diffstat (limited to 'src/gallium/drivers/r300/r300_blit.c')
-rw-r--r--src/gallium/drivers/r300/r300_blit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c
index fd8ef44..8c13ac5 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -141,6 +141,13 @@ static uint32_t r300_depth_clear_value(enum pipe_format format,
}
}
+static uint32_t r300_hiz_clear_value(double depth)
+{
+ uint32_t r = (uint32_t)(CLAMP(depth, 0, 1) * 255.5);
+ assert(r <= 255);
+ return r | (r << 8) | (r << 16) | (r << 24);
+}
+
/* Clear currently bound buffers. */
static void r300_clear(struct pipe_context* pipe,
unsigned buffers,
@@ -214,6 +221,7 @@ static void r300_clear(struct pipe_context* pipe,
}
if (r300_hiz_clear_allowed(r300)) {
+ r300->hiz_clear_value = r300_hiz_clear_value(depth);
r300_mark_atom_dirty(r300, &r300->hiz_clear);
}
}