diff --git a/src/asahi/compiler/agx_internal_formats.h b/src/asahi/compiler/agx_internal_formats.h index 03240f057c9..9232243d22a 100644 --- a/src/asahi/compiler/agx_internal_formats.h +++ b/src/asahi/compiler/agx_internal_formats.h @@ -6,6 +6,7 @@ #ifndef AGX_INTERNAL_FORMATS_H #define AGX_INTERNAL_FORMATS_H +#include #include "util/format/u_formats.h" /* Define aliases for the subset formats that are accessible in the ISA. These @@ -27,4 +28,21 @@ enum agx_internal_formats { AGX_INTERNAL_FORMAT_RGB9E5 = PIPE_FORMAT_R9G9B9E5_FLOAT }; +/* + * The architecture load/store instructions support masking, but packed formats + * are not compatible with masking. Check if a format is packed. + */ +static inline bool +agx_internal_format_supports_mask(enum agx_internal_formats format) +{ + switch (format) { + case AGX_INTERNAL_FORMAT_RGB10A2: + case AGX_INTERNAL_FORMAT_RG11B10F: + case AGX_INTERNAL_FORMAT_RGB9E5: + return false; + default: + return true; + } +} + #endif