radeonsi: set KILL_ENABLE during shader compilation, remove uses_kill flag
authorMarek Olšák <marek.olsak@amd.com>
Fri, 19 Sep 2014 15:07:07 +0000 (17:07 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 24 Sep 2014 12:48:02 +0000 (14:48 +0200)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_state_draw.c

index 19dc9ca6d73aa378d5b416f8bf20f41b18b02cde..5893531f8165fd9c907cbbd07946a8f5809df51e 100644 (file)
@@ -774,6 +774,8 @@ static void si_alpha_test(struct lp_build_tgsi_context *bld_base,
                                LLVMVoidTypeInContext(gallivm->context),
                                NULL, 0, 0);
        }
+
+       si_shader_ctx->shader->db_shader_control |= S_02880C_KILL_ENABLE(1);
 }
 
 static void si_llvm_emit_clipvertex(struct lp_build_tgsi_context * bld_base,
@@ -2751,7 +2753,9 @@ int si_pipe_shader_create(
 
        tgsi_scan_shader(sel->tokens, &shader_info);
 
-       shader->shader.uses_kill = shader_info.uses_kill;
+       if (shader_info.uses_kill)
+               shader->db_shader_control |= S_02880C_KILL_ENABLE(1);
+
        shader->shader.uses_instanceid = shader_info.uses_instanceid;
        bld_base->info = &shader_info;
        bld_base->emit_fetch_funcs[TGSI_FILE_CONSTANT] = fetch_constant;
index e07d872f84c4cf25c241c4344eebe966c173c133..559e4e2e302cdb9babaf2b84bf6d3cba1bc4152b 100644 (file)
@@ -142,7 +142,6 @@ struct si_shader {
        unsigned                gs_max_out_vertices;
 
        unsigned                nparam;
-       bool                    uses_kill;
        bool                    uses_instanceid;
        bool                    fs_write_all;
        bool                    vs_out_misc_write;
index 37dc40b19b32f9e29cf38c6170adab9ae2494c1f..28e92fced0de23eef5edafae5da0dfce6f6a7125 100644 (file)
@@ -266,9 +266,6 @@ static void si_pipe_shader_ps(struct pipe_context *ctx, struct si_pipe_shader *s
 
        db_shader_control |= shader->db_shader_control;
 
-       if (shader->shader.uses_kill || shader->key.ps.alpha_func != PIPE_FUNC_ALWAYS)
-               db_shader_control |= S_02880C_KILL_ENABLE(1);
-
        spi_ps_in_control = S_0286D8_NUM_INTERP(shader->shader.nparam) |
                S_0286D8_BC_OPTIMIZE_DISABLE(1);