r600: add support for early depth/stencil.
authorDave Airlie <airlied@redhat.com>
Thu, 31 Mar 2016 06:17:35 +0000 (16:17 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 2 Nov 2017 23:33:37 +0000 (09:33 +1000)
This add support for the early depth/stencil property found
on image shaders.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/evergreen_state.c

index 4ffc2684d561454637866cc5f85e19c2c8712f73..96eb35a9818955f3369ea81c7549d123dc58f9b2 100644 (file)
@@ -3159,6 +3159,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: