[Mesa-dev] [PATCH 04/14] r600g: remove the dual_src_blend flag from the shader key
Marek Olšák
maraeo at gmail.com
Sun Oct 7 11:08:06 PDT 2012
---
src/gallium/drivers/r600/r600_pipe.h | 1 -
src/gallium/drivers/r600/r600_shader.c | 2 +-
src/gallium/drivers/r600/r600_state_common.c | 4 +++-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index 449c785..95f9ea1 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -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;
};
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index bf4877a..f4f2889 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -1600,7 +1600,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;
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 5ba0430..c28f2f1 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -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;
}
--
1.7.9.5
More information about the mesa-dev
mailing list