panfrost/midgard: Use unsigned blend patch offset
[mesa.git] / src / gallium / auxiliary / tgsi / tgsi_info.c
index 4aa658785cfedd80aa48827d41378b22d9beb160..37e16cca4281e0d058018327d8a63b2370bf65ac 100644 (file)
@@ -150,9 +150,8 @@ tgsi_opcode_infer_type(enum tgsi_opcode opcode)
    case TGSI_OPCODE_UBFE:
    case TGSI_OPCODE_BFI:
    case TGSI_OPCODE_BREV:
-   case TGSI_OPCODE_POPC:
-   case TGSI_OPCODE_LSB:
-   case TGSI_OPCODE_UMSB:
+   case TGSI_OPCODE_IMG2HND:
+   case TGSI_OPCODE_SAMP2HND:
       return TGSI_TYPE_UNSIGNED;
    case TGSI_OPCODE_ARL:
    case TGSI_OPCODE_ARR:
@@ -186,6 +185,9 @@ tgsi_opcode_infer_type(enum tgsi_opcode opcode)
    case TGSI_OPCODE_U64SGE:
    case TGSI_OPCODE_I64SLT:
    case TGSI_OPCODE_I64SGE:
+   case TGSI_OPCODE_LSB:
+   case TGSI_OPCODE_POPC:
+   case TGSI_OPCODE_UMSB:
       return TGSI_TYPE_SIGNED;
    case TGSI_OPCODE_DADD:
    case TGSI_OPCODE_DABS:
@@ -252,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:
@@ -267,6 +281,7 @@ tgsi_opcode_infer_src_type(enum tgsi_opcode opcode, uint src_idx)
    case TGSI_OPCODE_UP2H:
    case TGSI_OPCODE_U2I64:
    case TGSI_OPCODE_MEMBAR:
+   case TGSI_OPCODE_UMSB:
       return TGSI_TYPE_UNSIGNED;
    case TGSI_OPCODE_IMUL_HI:
    case TGSI_OPCODE_I2F: