summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_util.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-11-24 13:41:03 +0000
committerKeith Whitwell <[email protected]>2009-11-24 13:41:03 +0000
commitba1ca28cc62fed71c77902b95ae4ed36c6bf25f8 (patch)
tree084fbb1b23239140a2adbd76013be830e1ba6f26 /src/gallium/auxiliary/tgsi/tgsi_util.c
parent3c46bbee1bb4f107d68addae472cf7bbc0976653 (diff)
gallium: simplify tgsi tokens further
Drop anonymous 'Extended' fields, have every optional token named explicitly in its parent. Eg. there is now an Instruction.Label flag, etc. Drop destination modifiers and other functionality which cannot be generated by tgsi_ureg.c, which is now the primary way of creating shaders. Pull source modifiers into the source register token, drop the second negate flag. The source register token is now full - if we need to expand it, probably best to move all of the modifiers to a new token and have a single flag for it.
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_util.c')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_util.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_util.c b/src/gallium/auxiliary/tgsi/tgsi_util.c
index 4dee1be9e8c..3544011b472 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_util.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_util.c
@@ -111,10 +111,10 @@ tgsi_util_get_full_src_register_sign_mode(
{
unsigned sign_mode;
- if( reg->SrcRegisterExtMod.Absolute ) {
+ if( reg->SrcRegister.Absolute ) {
/* Consider only the post-abs negation. */
- if( reg->SrcRegisterExtMod.Negate ) {
+ if( reg->SrcRegister.Negate ) {
sign_mode = TGSI_UTIL_SIGN_SET;
}
else {
@@ -122,17 +122,7 @@ tgsi_util_get_full_src_register_sign_mode(
}
}
else {
- /* Accumulate the three negations. */
-
- unsigned negate;
-
- negate = reg->SrcRegister.Negate;
-
- if( reg->SrcRegisterExtMod.Negate ) {
- negate = !negate;
- }
-
- if( negate ) {
+ if( reg->SrcRegister.Negate ) {
sign_mode = TGSI_UTIL_SIGN_TOGGLE;
}
else {
@@ -152,26 +142,22 @@ tgsi_util_set_full_src_register_sign_mode(
{
case TGSI_UTIL_SIGN_CLEAR:
reg->SrcRegister.Negate = 0;
- reg->SrcRegisterExtMod.Absolute = 1;
- reg->SrcRegisterExtMod.Negate = 0;
+ reg->SrcRegister.Absolute = 1;
break;
case TGSI_UTIL_SIGN_SET:
- reg->SrcRegister.Negate = 0;
- reg->SrcRegisterExtMod.Absolute = 1;
- reg->SrcRegisterExtMod.Negate = 1;
+ reg->SrcRegister.Absolute = 1;
+ reg->SrcRegister.Negate = 1;
break;
case TGSI_UTIL_SIGN_TOGGLE:
reg->SrcRegister.Negate = 1;
- reg->SrcRegisterExtMod.Absolute = 0;
- reg->SrcRegisterExtMod.Negate = 0;
+ reg->SrcRegister.Absolute = 0;
break;
case TGSI_UTIL_SIGN_KEEP:
reg->SrcRegister.Negate = 0;
- reg->SrcRegisterExtMod.Absolute = 0;
- reg->SrcRegisterExtMod.Negate = 0;
+ reg->SrcRegister.Absolute = 0;
break;
default: