OSDN Git Service

tgsi: denote which load/store/atomic channels are unsigned
authorDave Airlie <airlied@redhat.com>
Wed, 26 Jun 2019 05:45:50 +0000 (15:45 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 7 Jul 2019 06:23:54 +0000 (16:23 +1000)
llvmpipe will need this info.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/tgsi/tgsi_info.c

index d249b95..37e16cc 100644 (file)
@@ -254,6 +254,18 @@ tgsi_opcode_infer_src_type(enum tgsi_opcode opcode, uint src_idx)
        (opcode == TGSI_OPCODE_DLDEXP || opcode == TGSI_OPCODE_LDEXP))
       return TGSI_TYPE_SIGNED;
 
+   if (src_idx == 1 &&
+       (opcode == TGSI_OPCODE_LOAD))
+      return TGSI_TYPE_UNSIGNED;
+
+   if (src_idx == 0 &&
+       (opcode == TGSI_OPCODE_STORE))
+      return TGSI_TYPE_UNSIGNED;
+
+   if (src_idx == 1 &&
+       opcode >= TGSI_OPCODE_ATOMUADD && opcode <= TGSI_OPCODE_ATOMIMAX)
+      return TGSI_TYPE_UNSIGNED;
+
    switch (opcode) {
    case TGSI_OPCODE_UIF:
    case TGSI_OPCODE_TXF: