summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-03-26 12:01:07 -0400
committerAlex Deucher <alexdeucher@gmail.com>2009-03-26 12:01:07 -0400
commit24dbd3f93c640f819a9f5029f5a49e41ab875bd4 (patch)
treea49a29c79f7f5facb38f386dba1c641fcc26269c
parent076e4e3ac1c81086aecb4e70dd30fd5d26ec7bc8 (diff)
R6xx/R7xx: clean up logic in EXA Comp PS setup
-rw-r--r--src/r600_exa.c64
1 files changed, 25 insertions, 39 deletions
diff --git a/src/r600_exa.c b/src/r600_exa.c
index 4f486ed0..a5b4fba5 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -1351,22 +1351,6 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
int mask_a, mask_r, mask_g, mask_b;
/* setup pixel shader */
- if (PICT_FORMAT_RGB(pSrcPicture->format) == 0) {
- src_r = SQ_SEL_0;
- src_g = SQ_SEL_0;
- src_b = SQ_SEL_0;
- } else {
- src_r = SQ_SEL_X;
- src_g = SQ_SEL_Y;
- src_b = SQ_SEL_Z;
- }
-
- if (PICT_FORMAT_A(pSrcPicture->format) == 0) {
- src_a = SQ_SEL_1;
- } else {
- src_a = SQ_SEL_W;
- }
-
if (pMaskPicture->componentAlpha) {
if (R600BlendOp[op].src_alpha) {
if (PICT_FORMAT_A(pSrcPicture->format) == 0) {
@@ -1380,16 +1364,6 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
src_b = SQ_SEL_W;
src_a = SQ_SEL_W;
}
-
- mask_r = SQ_SEL_X;
- mask_g = SQ_SEL_Y;
- mask_b = SQ_SEL_Z;
-
- if (PICT_FORMAT_A(pMaskPicture->format) == 0) {
- mask_a = SQ_SEL_1;
- } else {
- mask_a = SQ_SEL_W;
- }
} else {
src_r = SQ_SEL_X;
src_g = SQ_SEL_Y;
@@ -1400,30 +1374,42 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
} else {
src_a = SQ_SEL_W;
}
+ }
+ mask_r = SQ_SEL_X;
+ mask_g = SQ_SEL_Y;
+ mask_b = SQ_SEL_Z;
- mask_r = SQ_SEL_X;
- mask_g = SQ_SEL_Y;
- mask_b = SQ_SEL_Z;
-
- if (PICT_FORMAT_A(pMaskPicture->format) == 0) {
- mask_a = SQ_SEL_1;
- } else {
- mask_a = SQ_SEL_W;
- }
+ if (PICT_FORMAT_A(pMaskPicture->format) == 0) {
+ mask_a = SQ_SEL_1;
+ } else {
+ mask_a = SQ_SEL_W;
}
} else {
+ if (PICT_FORMAT_RGB(pSrcPicture->format) == 0) {
+ src_r = SQ_SEL_0;
+ src_g = SQ_SEL_0;
+ src_b = SQ_SEL_0;
+ } else {
+ src_r = SQ_SEL_X;
+ src_g = SQ_SEL_Y;
+ src_b = SQ_SEL_Z;
+ }
+
+ if (PICT_FORMAT_A(pSrcPicture->format) == 0) {
+ src_a = SQ_SEL_1;
+ } else {
+ src_a = SQ_SEL_W;
+ }
+
if (PICT_FORMAT_A(pMaskPicture->format) == 0) {
mask_r = SQ_SEL_1;
mask_g = SQ_SEL_1;
mask_b = SQ_SEL_1;
+ mask_a = SQ_SEL_1;
} else {
mask_r = SQ_SEL_W;
mask_g = SQ_SEL_W;
mask_b = SQ_SEL_W;
- }
- if (PICT_FORMAT_A(pMaskPicture->format) == 0) {
- mask_a = SQ_SEL_1;
- } else {
mask_a = SQ_SEL_W;
}
}