mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
ac,radeonsi: add helpers to print SPI_SHADER_COL/Z_FORMAT
This commit is contained in:
parent
316353fbb6
commit
190aabdf71
3 changed files with 54 additions and 0 deletions
|
|
@ -1558,3 +1558,49 @@ ac_print_spi_ps_input_vgpr_list(uint32_t spi_ps_input_ena, uint32_t spi_ps_input
|
|||
PRINT_PS_INPUT_VGPR(1, POS_FIXED_PT);
|
||||
#undef PRINT_PS_INPUT_VGPR
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_spi_shader_format(unsigned format)
|
||||
{
|
||||
switch (format) {
|
||||
#define PS_FORMAT(name) case V_028714_SPI_SHADER_##name: return #name;
|
||||
PS_FORMAT(ZERO)
|
||||
PS_FORMAT(32_R)
|
||||
PS_FORMAT(32_GR)
|
||||
PS_FORMAT(32_AR)
|
||||
PS_FORMAT(FP16_ABGR)
|
||||
PS_FORMAT(UNORM16_ABGR)
|
||||
PS_FORMAT(SNORM16_ABGR)
|
||||
PS_FORMAT(UINT16_ABGR)
|
||||
PS_FORMAT(SINT16_ABGR)
|
||||
PS_FORMAT(32_ABGR)
|
||||
#undef PS_FORMAT
|
||||
default:
|
||||
UNREACHABLE("invalid export format");
|
||||
}
|
||||
}
|
||||
|
||||
/* Print (example):
|
||||
* mrt0 = FP16_ABGR
|
||||
* mrt1 = 32_R
|
||||
*/
|
||||
void
|
||||
ac_print_spi_ps_shader_col_format(uint32_t spi_shader_col_format, FILE *f)
|
||||
{
|
||||
for (unsigned i = 0; i < 8; i++) {
|
||||
unsigned format = (spi_shader_col_format >> (i * 4)) & 0xf;
|
||||
|
||||
if (format)
|
||||
fprintf(f, " mrt%u = %s\n", i, get_spi_shader_format(format));
|
||||
}
|
||||
}
|
||||
|
||||
/* Print (example):
|
||||
* mrtz = 32_R
|
||||
*/
|
||||
void
|
||||
ac_print_spi_ps_shader_z_format(uint32_t spi_shader_z_format, FILE *f)
|
||||
{
|
||||
if (spi_shader_z_format)
|
||||
fprintf(f, " mrtz = %s\n", get_spi_shader_format(spi_shader_z_format));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -346,6 +346,9 @@ ac_ngg_compute_subgroup_info(enum amd_gfx_level gfx_level, mesa_shader_stage es_
|
|||
void
|
||||
ac_print_spi_ps_input_vgpr_list(uint32_t spi_ps_input_ena, uint32_t spi_ps_input_addr, FILE *f);
|
||||
|
||||
void ac_print_spi_ps_shader_col_format(uint32_t spi_shader_col_format, FILE *f);
|
||||
void ac_print_spi_ps_shader_z_format(uint32_t spi_shader_z_format, FILE *f);
|
||||
|
||||
static unsigned inline
|
||||
ac_shader_get_lds_alloc_granularity(enum amd_gfx_level gfx_level)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -495,6 +495,11 @@ static void si_shader_dump_stats(struct si_screen *sscreen, struct si_shader *sh
|
|||
"SPI_PS_INPUT_ENA = 0x%04x\n",
|
||||
conf->spi_ps_input_addr, conf->spi_ps_input_ena);
|
||||
ac_print_spi_ps_input_vgpr_list(conf->spi_ps_input_ena, conf->spi_ps_input_addr, file);
|
||||
|
||||
fprintf(file, "SPI_SHADER_Z_FORMAT = 0x%x\n", shader->info.spi_shader_z_format);
|
||||
ac_print_spi_ps_shader_z_format(shader->info.spi_shader_z_format, file);
|
||||
fprintf(file, "SPI_SHADER_COL_FORMAT = 0x%x\n", shader->info.spi_shader_col_format);
|
||||
ac_print_spi_ps_shader_col_format(shader->info.spi_shader_col_format, file);
|
||||
}
|
||||
|
||||
fprintf(file,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue