asahi: Manually format some parts of the code

clang-format will mangle these.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20434>
This commit is contained in:
Alyssa Rosenzweig
2022-12-26 09:45:48 -05:00
committed by Marge Bot
parent de0fcd08d3
commit c1f175c9fa
11 changed files with 22 additions and 0 deletions

View File

@@ -36,6 +36,7 @@
/* Alignment for shader programs. I'm not sure what the optimal value is. */
#define AGX_CODE_ALIGN 0x100
/* clang-format off */
static const struct debug_named_value agx_debug_options[] = {
{"msgs", AGX_DBG_MSGS, "Print debug messages"},
{"shaders", AGX_DBG_SHADERS, "Dump shaders in NIR and AIR"},
@@ -46,6 +47,7 @@ static const struct debug_named_value agx_debug_options[] = {
{"noopt", AGX_DBG_NOOPT, "Disable backend optimizations"},
DEBUG_NAMED_VALUE_END
};
/* clang-format on */
DEBUG_GET_ONCE_FLAGS_OPTION(agx_debug, "AGX_MESA_DEBUG", agx_debug_options, 0)

View File

@@ -38,6 +38,7 @@
extern "C" {
#endif
/* clang-format off */
enum agx_dbg {
AGX_DBG_MSGS = BITFIELD_BIT(0),
AGX_DBG_SHADERS = BITFIELD_BIT(1),
@@ -47,6 +48,7 @@ enum agx_dbg {
AGX_DBG_NOVALIDATE = BITFIELD_BIT(5),
AGX_DBG_NOOPT = BITFIELD_BIT(6),
};
/* clang-format on */
extern int agx_debug;

View File

@@ -63,6 +63,7 @@ ail_min_mip_below(unsigned x, unsigned y)
static inline struct ail_tile
ail_get_max_tile_size(unsigned blocksize_B)
{
/* clang-format off */
switch (blocksize_B) {
case 1: return (struct ail_tile) { 128, 128 };
case 2: return (struct ail_tile) { 128, 64 };
@@ -71,6 +72,7 @@ ail_get_max_tile_size(unsigned blocksize_B)
case 16: return (struct ail_tile) { 32, 32 };
default: unreachable("Invalid blocksize");
}
/* clang-format on */
}
/*

View File

@@ -17,6 +17,7 @@ struct sizetest {
uint32_t size;
};
/* clang-format off */
/* Sort: `sort -t"," -k1,1 -k2,5n | uniq` */
static struct sizetest comptests[] = {
{ PIPE_FORMAT_R16G16B16A16_UNORM, 16, 16, 1, 1, 0x880 },
@@ -14309,6 +14310,7 @@ static struct sizetest comptests[] = {
{ PIPE_FORMAT_Z32_FLOAT, 4097, 4097, 2, 1, 0x8808000 },
{ PIPE_FORMAT_Z32_FLOAT, 4097, 4097, 2, 13, 0xb97d600 },
};
/* clang-format on */
TEST(CompTwiddled, SizeTests)
{

View File

@@ -35,6 +35,7 @@ struct miptest {
uint32_t offsets[16];
};
/* clang-format off */
static struct miptest miptests[] = {
{
PIPE_FORMAT_R8G8B8A8_UNORM,
@@ -1256,6 +1257,7 @@ static struct miptest miptests[] = {
}
},
};
/* clang-format on */
TEST(Miptree, Tests2D)
{

View File

@@ -17,6 +17,7 @@ struct sizetest {
uint32_t size;
};
/* clang-format off */
/* Sort: `sort -t"," -k1,1 -k2,5n | uniq` */
static struct sizetest sizetests[] = {
{ PIPE_FORMAT_R8_UNORM, 1, 1, 1, 1, 0x80 },
@@ -4746,6 +4747,7 @@ static struct sizetest sizetests[] = {
{ PIPE_FORMAT_Z32_FLOAT, 4097, 15, 2, 1, 0x100000 },
{ PIPE_FORMAT_Z32_FLOAT, 4097, 15, 2, 13, 0x158000 },
};
/* clang-format on */
TEST(UncompTwiddled, SizeTests)
{

View File

@@ -37,6 +37,7 @@
.internal = (enum pipe_format) AGX_INTERNAL_FORMAT_ ## internal_fmt,\
}
/* clang-format off */
const struct agx_pixel_format_entry agx_pixel_format[PIPE_FORMAT_COUNT] = {
AGX_FMT(R8_UNORM, R8, UNORM, T, U8NORM),
AGX_FMT(R8G8_UNORM, R8G8, UNORM, T, U8NORM),
@@ -193,3 +194,4 @@ const struct agx_pixel_format_entry agx_pixel_format[PIPE_FORMAT_COUNT] = {
AGX_FMT(BPTC_RGBA_UNORM, BC7, UNORM, F, _),
AGX_FMT(BPTC_SRGBA, BC7, UNORM, F, _),
};
/* clang-format on */

View File

@@ -18,11 +18,13 @@
static struct agx_tile_size
agx_select_tile_size(unsigned bytes_per_pixel)
{
/* clang-format off */
struct agx_tile_size sizes[] = {
{ 32, 32 },
{ 32, 16 },
{ 16, 16 }
};
/* clang-format on */
for (unsigned i = 0; i < ARRAY_SIZE(sizes); ++i) {
struct agx_tile_size size = sizes[i];

View File

@@ -16,6 +16,7 @@ struct test {
uint32_t total_size;
};
/* clang-format off */
struct test tests[] = {
{
"Simple test",
@@ -129,6 +130,7 @@ struct test tests[] = {
8192
}
};
/* clang-format on */
TEST(Tilebuffer, Layouts)
{

View File

@@ -74,6 +74,7 @@
#define DRM_FORMAT_MOD_APPLE_TWIDDLED_COMPRESSED (3)
#endif
/* clang-format off */
static const struct debug_named_value agx_debug_options[] = {
{"trace", AGX_DBG_TRACE, "Trace the command stream"},
{"deqp", AGX_DBG_DEQP, "Hacks for dEQP"},
@@ -86,6 +87,7 @@ static const struct debug_named_value agx_debug_options[] = {
{"nocompress",AGX_DBG_NOCOMPRESS,"Disable lossless compression"},
DEBUG_NAMED_VALUE_END
};
/* clang-format on */
uint64_t agx_best_modifiers[] = {
DRM_FORMAT_MOD_APPLE_TWIDDLED_COMPRESSED,

View File

@@ -1721,12 +1721,14 @@ agx_batch_init_state(struct agx_batch *batch)
.varying_word_2 = true,
});
/* clang-format off */
agx_ppp_push(&ppp, W_CLAMP, cfg) cfg.w_clamp = 1e-10;
agx_ppp_push(&ppp, VARYING_1, cfg);
agx_ppp_push(&ppp, CULL_2, cfg);
agx_ppp_push(&ppp, FRAGMENT_OCCLUSION_QUERY_2, cfg);
agx_ppp_push(&ppp, OUTPUT_UNKNOWN, cfg);
agx_ppp_push(&ppp, VARYING_2, cfg);
/* clang-format on */
agx_ppp_fini(&out, &ppp);
batch->encoder_current = out;