Module: Mesa
Branch: main
Commit: d7bc277726ad07214fb9ac04a81d37862f2c1d68
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d7bc277726ad07214fb9ac04a81d37862f2c1d68

Author: Jesse Natalie <[email protected]>
Date:   Thu Nov  9 10:16:08 2023 -0800

microsoft/compiler: Don't use 64-bit types for signature entries

HLSL can't declare these, and the DXIL accesses them as i32 anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>

---

 src/microsoft/compiler/dxil_enums.c     | 12 ++++++------
 src/microsoft/compiler/dxil_signature.c |  3 ++-
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/microsoft/compiler/dxil_enums.c 
b/src/microsoft/compiler/dxil_enums.c
index 8f522389d28..bb13edfe639 100644
--- a/src/microsoft/compiler/dxil_enums.c
+++ b/src/microsoft/compiler/dxil_enums.c
@@ -37,11 +37,11 @@ enum dxil_prog_sig_comp_type 
dxil_get_prog_sig_comp_type(const struct glsl_type
    case GLSL_TYPE_INT: return DXIL_PROG_SIG_COMP_TYPE_SINT32;
    case GLSL_TYPE_FLOAT: return DXIL_PROG_SIG_COMP_TYPE_FLOAT32;
    case GLSL_TYPE_FLOAT16: return DXIL_PROG_SIG_COMP_TYPE_FLOAT16;
-   case GLSL_TYPE_DOUBLE: return DXIL_PROG_SIG_COMP_TYPE_FLOAT64;
+   case GLSL_TYPE_DOUBLE: return DXIL_PROG_SIG_COMP_TYPE_UINT32;
    case GLSL_TYPE_UINT16: return DXIL_PROG_SIG_COMP_TYPE_UINT16;
    case GLSL_TYPE_INT16: return DXIL_PROG_SIG_COMP_TYPE_SINT16;
-   case GLSL_TYPE_UINT64: return DXIL_PROG_SIG_COMP_TYPE_UINT64;
-   case GLSL_TYPE_INT64: return DXIL_PROG_SIG_COMP_TYPE_SINT64;
+   case GLSL_TYPE_UINT64: return DXIL_PROG_SIG_COMP_TYPE_UINT32;
+   case GLSL_TYPE_INT64: return DXIL_PROG_SIG_COMP_TYPE_SINT32;
    case GLSL_TYPE_BOOL: return DXIL_PROG_SIG_COMP_TYPE_UINT32;
    case GLSL_TYPE_STRUCT: return DXIL_PROG_SIG_COMP_TYPE_UNKNOWN;
    default:
@@ -62,11 +62,11 @@ enum dxil_component_type dxil_get_comp_type(const struct 
glsl_type *type)
    case GLSL_TYPE_INT: return DXIL_COMP_TYPE_I32;
    case GLSL_TYPE_FLOAT: return DXIL_COMP_TYPE_F32;
    case GLSL_TYPE_FLOAT16: return DXIL_COMP_TYPE_F16;
-   case GLSL_TYPE_DOUBLE: return DXIL_COMP_TYPE_F64;
+   case GLSL_TYPE_DOUBLE: return DXIL_COMP_TYPE_U32;
    case GLSL_TYPE_UINT16: return DXIL_COMP_TYPE_U16;
    case GLSL_TYPE_INT16: return DXIL_COMP_TYPE_I16;
-   case GLSL_TYPE_UINT64: return DXIL_COMP_TYPE_U64;
-   case GLSL_TYPE_INT64: return DXIL_COMP_TYPE_I64;
+   case GLSL_TYPE_UINT64: return DXIL_COMP_TYPE_U32;
+   case GLSL_TYPE_INT64: return DXIL_COMP_TYPE_I32;
    case GLSL_TYPE_BOOL: return DXIL_COMP_TYPE_I1;
 
    default:
diff --git a/src/microsoft/compiler/dxil_signature.c 
b/src/microsoft/compiler/dxil_signature.c
index 260ca66f590..a9efcb1449d 100644
--- a/src/microsoft/compiler/dxil_signature.c
+++ b/src/microsoft/compiler/dxil_signature.c
@@ -61,7 +61,8 @@ get_interpolation(nir_variable *var)
    if (var->data.patch)
       return DXIL_INTERP_UNDEFINED;
 
-   if (glsl_type_is_integer(glsl_without_array_or_matrix(var->type)))
+   if (glsl_type_is_integer(glsl_without_array_or_matrix(var->type)) ||
+       glsl_type_is_64bit(glsl_without_array_or_matrix(var->type)))
       return DXIL_INTERP_CONSTANT;
 
    if (var->data.sample) {

Reply via email to