r600g: remove the dual_src_blend flag from the shader key
authorMarek Olšák <maraeo@gmail.com>
Fri, 5 Oct 2012 01:00:38 +0000 (03:00 +0200)
committerMarek Olšák <maraeo@gmail.com>
Tue, 9 Oct 2012 22:16:35 +0000 (00:16 +0200)
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_shader.c
src/gallium/drivers/r600/r600_state_common.c

index 449c785421fb3d43a19ff67d0397a4bb45465e58..95f9ea15e8340ed2326e66a476191735be00ef6c 100644 (file)
@@ -268,7 +268,6 @@ struct r600_pipe_shader_selector {
 struct r600_shader_key {
        unsigned color_two_side:1;
        unsigned alpha_to_one:1;
-       unsigned dual_src_blend:1;
        unsigned nr_cbufs:4;
 };
 
index daa508234486caf462543287d47efc29c937251f..0b45d4f6e019d1ba1f9d973a91ef5a1570b5c22a 100644 (file)
@@ -1612,7 +1612,7 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen,
                case TGSI_PROCESSOR_FRAGMENT:
                        if (shader->output[i].name == TGSI_SEMANTIC_COLOR) {
                                /* never export more colors than the number of CBs */
-                               if (next_pixel_base && next_pixel_base >= key.nr_cbufs + key.dual_src_blend) {
+                               if (next_pixel_base && next_pixel_base >= key.nr_cbufs) {
                                        /* skip export */
                                        j--;
                                        continue;
index 5ba043087f8fa12bd8170c10b07090144ef814b4..c28f2f13c06503204353fe89c9ef22db9bbdc15b 100644 (file)
@@ -747,8 +747,10 @@ static INLINE struct r600_shader_key r600_shader_selector_key(struct pipe_contex
                key.alpha_to_one = rctx->alpha_to_one &&
                                   rctx->multisample_enable &&
                                   !rctx->framebuffer.cb0_is_integer;
-               key.dual_src_blend = rctx->dual_src_blend;
                key.nr_cbufs = rctx->framebuffer.state.nr_cbufs;
+               /* Dual-source blending only makes sense with nr_cbufs == 1. */
+               if (key.nr_cbufs == 1 && rctx->dual_src_blend)
+                       key.nr_cbufs = 2;
        }
        return key;
 }