radeonsi: get fs_write_all from tgsi_shader_info directly
authorMarek Olšák <marek.olsak@amd.com>
Tue, 30 Sep 2014 13:56:14 +0000 (15:56 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 4 Oct 2014 13:16:14 +0000 (15:16 +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.c

index 5c3efd4c5f57109d5967488178d2ea4ca8e22da3..e76b969df87653bd1969f2aae3d5a74c0a043dcb 100644 (file)
@@ -1438,11 +1438,6 @@ static void si_llvm_emit_fs_epilogue(struct lp_build_tgsi_context * bld_base)
 
                tgsi_parse_token(parse);
 
-               if (parse->FullToken.Token.Type == TGSI_TOKEN_TYPE_PROPERTY &&
-                   parse->FullToken.FullProperty.Property.PropertyName ==
-                   TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS)
-                       shader->fs_write_all = TRUE;
-
                if (parse->FullToken.Token.Type != TGSI_TOKEN_TYPE_DECLARATION)
                        continue;
 
@@ -1499,7 +1494,8 @@ static void si_llvm_emit_fs_epilogue(struct lp_build_tgsi_context * bld_base)
                                memcpy(last_args, args, sizeof(args));
 
                                /* Handle FS_COLOR0_WRITES_ALL_CBUFS. */
-                               if (shader->fs_write_all && shader->output[i].sid == 0 &&
+                               if (shader->selector->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0] &&
+                                    shader->output[i].sid == 0 &&
                                    si_shader_ctx->shader->key.ps.nr_cbufs > 1) {
                                        for (int c = 1; c < si_shader_ctx->shader->key.ps.nr_cbufs; c++) {
                                                si_llvm_init_export_args_load(bld_base,
index 8f5b4316cd6efa80b3a1ee809d499c015a52ec17..c6026bda6c33cd2499cca7855dea9df030c1f3ad 100644 (file)
@@ -124,11 +124,6 @@ struct si_shader_selector {
 
        /* PIPE_SHADER_[VERTEX|FRAGMENT|...] */
        unsigned        type;
-
-       /* 1 when the shader contains
-        * TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS, otherwise it's 0.
-        * Used to determine whether we need to include nr_cbufs in the key */
-       unsigned        fs_write_all;
 };
 
 union si_shader_key {
@@ -184,7 +179,6 @@ struct si_shader {
 
        unsigned                nparam;
        bool                    uses_instanceid;
-       bool                    fs_write_all;
        bool                    vs_out_misc_write;
        bool                    vs_out_point_size;
        bool                    vs_out_edgeflag;
index 0e2d6c4e6b5ead6077f706e30b3c15de65cc5b71..eb25606381111edf5feb30e8d58c86ed37b3b621 100644 (file)
@@ -2215,7 +2215,7 @@ static INLINE void si_shader_selector_key(struct pipe_context *ctx,
                        key->vs.gs_used_inputs = sctx->gs_shader->current->gs_used_inputs;
                }
        } else if (sel->type == PIPE_SHADER_FRAGMENT) {
-               if (sel->fs_write_all)
+               if (sel->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0])
                        key->ps.nr_cbufs = sctx->framebuffer.state.nr_cbufs;
                key->ps.export_16bpc = sctx->framebuffer.export_16bpc;
 
@@ -2312,9 +2312,6 @@ static void *si_create_shader_state(struct pipe_context *ctx,
        sel->so = state->stream_output;
        tgsi_scan_shader(state->tokens, &sel->info);
 
-       if (pipe_shader_type == PIPE_SHADER_FRAGMENT)
-               sel->fs_write_all = sel->info.color0_writes_all_cbufs;
-
        r = si_shader_select(ctx, sel);
        if (r) {
            free(sel);