summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_info.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2013-02-16 02:26:14 +0100
committerRoland Scheidegger <sroland@vmware.com>2013-02-16 02:40:51 +0100
commitcb2e6782945d5ea6cc26f3f47d6ee04f48caf529 (patch)
tree232a8598df99d646ba9239ab14c88f7a2e1285a8 /src/gallium/auxiliary/tgsi/tgsi_info.c
parentc25ae5d27b114e23d5734f846002df1a05759658 (diff)
downloadexternal_mesa3d-cb2e6782945d5ea6cc26f3f47d6ee04f48caf529.zip
external_mesa3d-cb2e6782945d5ea6cc26f3f47d6ee04f48caf529.tar.gz
external_mesa3d-cb2e6782945d5ea6cc26f3f47d6ee04f48caf529.tar.bz2
gallivm/tgsi: fix src modifier fetching with non-float types.
Need to take the type into account. Also, if we want to allow mov's with modifiers we need to pick a type (assume float). v2: don't allow all modifiers on all type, in particular don't allow absolute on non-float types and don't allow negate on unsigned. Also treat UADD as signed (despite the name) since it is used for handling both signed and unsigned integer arguments and otherwise modifiers don't work. Also add tgsi docs clarifying this. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_info.c')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_info.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c
index f289ebc..9c6fdfc 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_info.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_info.c
@@ -277,9 +277,9 @@ tgsi_opcode_infer_src_type( uint opcode )
case TGSI_OPCODE_AND:
case TGSI_OPCODE_OR:
case TGSI_OPCODE_XOR:
+ /* XXX some src args may be signed for SAD ? */
case TGSI_OPCODE_SAD:
case TGSI_OPCODE_U2F:
- case TGSI_OPCODE_UADD:
case TGSI_OPCODE_UDIV:
case TGSI_OPCODE_UMOD:
case TGSI_OPCODE_UMAD:
@@ -310,6 +310,8 @@ tgsi_opcode_infer_src_type( uint opcode )
case TGSI_OPCODE_IABS:
case TGSI_OPCODE_ISSG:
case TGSI_OPCODE_UARL:
+ /* UADD is both signed and unsigned require signed for working modifiers */
+ case TGSI_OPCODE_UADD:
return TGSI_TYPE_SIGNED;
default:
return TGSI_TYPE_FLOAT;
@@ -331,7 +333,6 @@ tgsi_opcode_infer_dst_type( uint opcode )
case TGSI_OPCODE_OR:
case TGSI_OPCODE_XOR:
case TGSI_OPCODE_SAD:
- case TGSI_OPCODE_UADD:
case TGSI_OPCODE_UDIV:
case TGSI_OPCODE_UMOD:
case TGSI_OPCODE_UMAD:
@@ -362,6 +363,7 @@ tgsi_opcode_infer_dst_type( uint opcode )
case TGSI_OPCODE_ARR:
case TGSI_OPCODE_IABS:
case TGSI_OPCODE_ISSG:
+ case TGSI_OPCODE_UADD:
return TGSI_TYPE_SIGNED;
default:
return TGSI_TYPE_FLOAT;