From ebf69f2c508e2cb6df1437ef0e31cbc8b808824d Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 28 Feb 2011 22:10:04 +0100 Subject: r300g: disable HiZ permanently if the the depth function is inverted Instead of temporarily. The HiZ function (something like a depth function) is a property of a HiZ buffer and can only be changed during HiZ clears. --- src/gallium/drivers/r300/r300_context.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers/r300/r300_context.h') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index e18f876fc2..33d1390b07 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -102,7 +102,6 @@ struct r300_dsa_state { }; struct r300_hyperz_state { - int current_func; /* -1 after a clear before first op */ int flush; /* This is actually a command buffer with named dwords. */ uint32_t cb_flush_begin; @@ -414,6 +413,21 @@ struct r300_vertex_element_state { struct r300_vertex_stream_state vertex_stream; }; +enum r300_hiz_func { + HIZ_FUNC_NONE, + + /* The function, when determined, is set in stone + * until the next HiZ clear. */ + + /* MAX is written to the HiZ buffer. + * Used for LESS, LEQUAL. */ + HIZ_FUNC_MAX, + + /* MIN is written to the HiZ buffer. + * Used for GREATER, GEQUAL. */ + HIZ_FUNC_MIN, +}; + struct r300_context { /* Parent class */ struct pipe_context context; @@ -559,6 +573,8 @@ struct r300_context { struct pipe_surface *locked_zbuffer; /* Whether HIZ is enabled. */ boolean hiz_in_use; + /* HiZ function. Can be either MIN or MAX. */ + enum r300_hiz_func hiz_func; void *dsa_decompress_zmask; -- cgit v1.2.3