compiler/types: Add 64-bit image types

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7509>
diff --git a/src/compiler/builtin_type_macros.h b/src/compiler/builtin_type_macros.h
index 75be74b..97b18d6 100644
--- a/src/compiler/builtin_type_macros.h
+++ b/src/compiler/builtin_type_macros.h
@@ -166,6 +166,28 @@
 DECL_TYPE(uimageCubeArray, GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY,       GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE,   0, 1, GLSL_TYPE_UINT)
 DECL_TYPE(uimage2DMS,      GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE,       GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS,     0, 0, GLSL_TYPE_UINT)
 DECL_TYPE(uimage2DMSArray, GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS,     0, 1, GLSL_TYPE_UINT)
+DECL_TYPE(i64image1D,        GL_INT_IMAGE_1D,                          GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D,     0, 0, GLSL_TYPE_INT64)
+DECL_TYPE(i64image2D,        GL_INT_IMAGE_2D,                          GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D,     0, 0, GLSL_TYPE_INT64)
+DECL_TYPE(i64image3D,        GL_INT_IMAGE_3D,                          GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_3D,     0, 0, GLSL_TYPE_INT64)
+DECL_TYPE(i64image2DRect,    GL_INT_IMAGE_2D_RECT,                     GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_RECT,   0, 0, GLSL_TYPE_INT64)
+DECL_TYPE(i64imageCube,      GL_INT_IMAGE_CUBE,                        GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE,   0, 0, GLSL_TYPE_INT64)
+DECL_TYPE(i64imageBuffer,    GL_INT_IMAGE_BUFFER,                      GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_BUF,    0, 0, GLSL_TYPE_INT64)
+DECL_TYPE(i64image1DArray,   GL_INT_IMAGE_1D_ARRAY,                    GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D,     0, 1, GLSL_TYPE_INT64)
+DECL_TYPE(i64image2DArray,   GL_INT_IMAGE_2D_ARRAY,                    GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D,     0, 1, GLSL_TYPE_INT64)
+DECL_TYPE(i64imageCubeArray, GL_INT_IMAGE_CUBE_MAP_ARRAY,              GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE,   0, 1, GLSL_TYPE_INT64)
+DECL_TYPE(i64image2DMS,      GL_INT_IMAGE_2D_MULTISAMPLE,              GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS,     0, 0, GLSL_TYPE_INT64)
+DECL_TYPE(i64image2DMSArray, GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY,        GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS,     0, 1, GLSL_TYPE_INT64)
+DECL_TYPE(u64image1D,        GL_UNSIGNED_INT_IMAGE_1D,                 GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D,     0, 0, GLSL_TYPE_UINT64)
+DECL_TYPE(u64image2D,        GL_UNSIGNED_INT_IMAGE_2D,                 GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D,     0, 0, GLSL_TYPE_UINT64)
+DECL_TYPE(u64image3D,        GL_UNSIGNED_INT_IMAGE_3D,                 GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_3D,     0, 0, GLSL_TYPE_UINT64)
+DECL_TYPE(u64image2DRect,    GL_UNSIGNED_INT_IMAGE_2D_RECT,            GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_RECT,   0, 0, GLSL_TYPE_UINT64)
+DECL_TYPE(u64imageCube,      GL_UNSIGNED_INT_IMAGE_CUBE,               GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE,   0, 0, GLSL_TYPE_UINT64)
+DECL_TYPE(u64imageBuffer,    GL_UNSIGNED_INT_IMAGE_BUFFER,             GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_BUF,    0, 0, GLSL_TYPE_UINT64)
+DECL_TYPE(u64image1DArray,   GL_UNSIGNED_INT_IMAGE_1D_ARRAY,           GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_1D,     0, 1, GLSL_TYPE_UINT64)
+DECL_TYPE(u64image2DArray,   GL_UNSIGNED_INT_IMAGE_2D_ARRAY,           GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_2D,     0, 1, GLSL_TYPE_UINT64)
+DECL_TYPE(u64imageCubeArray, GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY,     GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_CUBE,   0, 1, GLSL_TYPE_UINT64)
+DECL_TYPE(u64image2DMS,      GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE,     GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS,     0, 0, GLSL_TYPE_UINT64)
+DECL_TYPE(u64image2DMSArray, GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_MS,     0, 1, GLSL_TYPE_UINT64)
 
 /* OpenCL image types */
 DECL_TYPE(vbuffer, GL_IMAGE_BUFFER, GLSL_TYPE_IMAGE, GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_VOID)
diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index a475579..5f2efcd 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -1034,6 +1034,60 @@
       case GLSL_SAMPLER_DIM_EXTERNAL:
          return error_type;
       }
+   case GLSL_TYPE_INT64:
+      switch (dim) {
+      case GLSL_SAMPLER_DIM_1D:
+         return (array ? i64image1DArray_type : i64image1D_type);
+      case GLSL_SAMPLER_DIM_2D:
+         return (array ? i64image2DArray_type : i64image2D_type);
+      case GLSL_SAMPLER_DIM_3D:
+         if (array)
+            return error_type;
+         return i64image3D_type;
+      case GLSL_SAMPLER_DIM_CUBE:
+         return (array ? i64imageCubeArray_type : i64imageCube_type);
+      case GLSL_SAMPLER_DIM_RECT:
+         if (array)
+            return error_type;
+         return i64image2DRect_type;
+      case GLSL_SAMPLER_DIM_BUF:
+         if (array)
+            return error_type;
+         return i64imageBuffer_type;
+      case GLSL_SAMPLER_DIM_MS:
+         return (array ? i64image2DMSArray_type : i64image2DMS_type);
+      case GLSL_SAMPLER_DIM_SUBPASS:
+      case GLSL_SAMPLER_DIM_SUBPASS_MS:
+      case GLSL_SAMPLER_DIM_EXTERNAL:
+         return error_type;
+      }
+   case GLSL_TYPE_UINT64:
+      switch (dim) {
+      case GLSL_SAMPLER_DIM_1D:
+         return (array ? u64image1DArray_type : u64image1D_type);
+      case GLSL_SAMPLER_DIM_2D:
+         return (array ? u64image2DArray_type : u64image2D_type);
+      case GLSL_SAMPLER_DIM_3D:
+         if (array)
+            return error_type;
+         return u64image3D_type;
+      case GLSL_SAMPLER_DIM_CUBE:
+         return (array ? u64imageCubeArray_type : u64imageCube_type);
+      case GLSL_SAMPLER_DIM_RECT:
+         if (array)
+            return error_type;
+         return u64image2DRect_type;
+      case GLSL_SAMPLER_DIM_BUF:
+         if (array)
+            return error_type;
+         return u64imageBuffer_type;
+      case GLSL_SAMPLER_DIM_MS:
+         return (array ? u64image2DMSArray_type : u64image2DMS_type);
+      case GLSL_SAMPLER_DIM_SUBPASS:
+      case GLSL_SAMPLER_DIM_SUBPASS_MS:
+      case GLSL_SAMPLER_DIM_EXTERNAL:
+         return error_type;
+      }
    case GLSL_TYPE_VOID:
       switch (dim) {
       case GLSL_SAMPLER_DIM_1D: