xref: /aosp_15_r20/external/mesa3d/src/amd/common/gfx10_format_table.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright © 2019 Advanced Micro Devices, Inc.
3  *
4  * SPDX-License-Identifier: MIT
5  */
6 
7 #ifndef GFX10_FORMAT_TABLE_H
8 #define GFX10_FORMAT_TABLE_H
9 
10 #include "util/format/u_formats.h"
11 #include "ac_gpu_info.h"
12 
13 #include <stdbool.h>
14 
15 struct gfx10_format {
16    unsigned img_format : 9;
17 
18    /* Various formats are only supported with workarounds for vertex fetch,
19     * and some 32_32_32 formats are supported natively, but only for buffers
20     * (possibly with some image support, actually, but no filtering). */
21    bool buffers_only : 1;
22 };
23 
24 extern const struct gfx10_format gfx10_format_table[PIPE_FORMAT_COUNT];
25 extern const struct gfx10_format gfx11_format_table[PIPE_FORMAT_COUNT];
26 
27 static inline
ac_get_gfx10_format_table(const enum amd_gfx_level gfx_level)28 const struct gfx10_format* ac_get_gfx10_format_table(const enum amd_gfx_level gfx_level)
29 {
30    if (gfx_level >= GFX11)
31       return gfx11_format_table;
32    else
33       return gfx10_format_table;
34 }
35 
36 #endif /* GFX10_FORMAT_TABLE_H */
37