radeonsi: Only scan pixel shaders for TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS
authorMichel Dänzer <michel.daenzer@amd.com>
Thu, 19 Dec 2013 02:36:52 +0000 (11:36 +0900)
committerMichel Dänzer <michel@daenzer.net>
Fri, 20 Dec 2013 09:51:09 +0000 (18:51 +0900)
It's not relevant for other shader types.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_state.c

index 5274effbb682a04cc1f2bbc38418bc9996173117..8705d16d6ca7eb56c12cb9b98a26b29d2a7acbb1 100644 (file)
@@ -2246,14 +2246,17 @@ static void *si_create_shader_state(struct pipe_context *ctx,
 {
        struct si_pipe_shader_selector *sel = CALLOC_STRUCT(si_pipe_shader_selector);
        int r;
-       struct tgsi_shader_info info;
-
-       tgsi_scan_shader(state->tokens, &info);
 
        sel->type = pipe_shader_type;
        sel->tokens = tgsi_dup_tokens(state->tokens);
        sel->so = state->stream_output;
-       sel->fs_write_all = info.color0_writes_all_cbufs;
+
+       if (pipe_shader_type == PIPE_SHADER_FRAGMENT) {
+               struct tgsi_shader_info info;
+
+               tgsi_scan_shader(state->tokens, &info);
+               sel->fs_write_all = info.color0_writes_all_cbufs;
+       }
 
        r = si_shader_select(ctx, sel, NULL);
        if (r) {