[Mesa-dev] [PATCH 16/30] r600: add support for early depth/stencil.
Dave Airlie
airlied at gmail.com
Thu Mar 31 07:03:45 UTC 2016
From: Dave Airlie <airlied at redhat.com>
This add support for the early depth/stencil property found
on image shaders.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/gallium/drivers/r600/evergreen_state.c | 3 +++
src/gallium/drivers/r600/evergreend.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index f7a2a8f..0f68499 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -3217,6 +3217,9 @@ void evergreen_update_ps_state(struct pipe_context *ctx, struct r600_pipe_shader
db_shader_control |= S_02880C_STENCIL_EXPORT_ENABLE(stencil_export);
db_shader_control |= S_02880C_MASK_EXPORT_ENABLE(mask_export);
+ if (shader->selector->info.properties[TGSI_PROPERTY_FS_EARLY_DEPTH_STENCIL])
+ db_shader_control |= S_02880C_DEPTH_BEFORE_SHADER(1);
+
switch (rshader->ps_conservative_z) {
default: /* fall through */
case TGSI_FS_DEPTH_LAYOUT_ANY:
diff --git a/src/gallium/drivers/r600/evergreend.h b/src/gallium/drivers/r600/evergreend.h
index 817ec69..8c78e87 100644
--- a/src/gallium/drivers/r600/evergreend.h
+++ b/src/gallium/drivers/r600/evergreend.h
@@ -848,6 +848,7 @@
#define V_02880C_EXPORT_DB_FOUR16 0x01
#define V_02880C_EXPORT_DB_TWO 0x02
#define S_02880C_ALPHA_TO_MASK_DISABLE(x) (((x) & 0x1) << 12)
+#define S_02880C_DEPTH_BEFORE_SHADER(x) (((x) & 0x1) << 15)
#define S_02880C_CONSERVATIVE_Z_EXPORT(x) (((x) & 0x03) << 16)
#define G_02880C_CONSERVATIVE_Z_EXPORT(x) (((x) >> 16) & 0x03)
#define C_02880C_CONSERVATIVE_Z_EXPORT 0xFFFCFFFF
--
2.5.0
More information about the mesa-dev
mailing list