mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
agx: Add agx_internal_format_supports_mask helper
Not all formats can be masked, add a query to check which can be. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>
This commit is contained in:
parent
5e031867fe
commit
3084e6e689
1 changed files with 18 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#ifndef AGX_INTERNAL_FORMATS_H
|
||||
#define AGX_INTERNAL_FORMATS_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue