pan/bi: Pretty-print clause types in disassembler
Also note that type=1 is for load_vary. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4242>
This commit is contained in:
parent
42af9f47c8
commit
d797822d31
|
@ -26,6 +26,23 @@
|
|||
|
||||
#include "bi_print.h"
|
||||
|
||||
const char *
|
||||
bi_clause_type_name(enum bifrost_clause_type T)
|
||||
{
|
||||
switch (T) {
|
||||
case BIFROST_CLAUSE_NONE: return "";
|
||||
case BIFROST_CLAUSE_LOAD_VARY: return "load_vary";
|
||||
case BIFROST_CLAUSE_UBO: return "ubo";
|
||||
case BIFROST_CLAUSE_TEX: return "tex";
|
||||
case BIFROST_CLAUSE_SSBO_LOAD: return "load";
|
||||
case BIFROST_CLAUSE_SSBO_STORE: return "store";
|
||||
case BIFROST_CLAUSE_BLEND: return "blend";
|
||||
case BIFROST_CLAUSE_ATEST: return "atest";
|
||||
case BIFROST_CLAUSE_64BIT: return "64";
|
||||
default: return "??";
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
bi_output_mod_name(enum bifrost_outmod mod)
|
||||
{
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "bifrost.h"
|
||||
#include "compiler.h"
|
||||
|
||||
const char * bi_clause_type_name(enum bifrost_clause_type T);
|
||||
const char * bi_output_mod_name(enum bifrost_outmod mod);
|
||||
const char * bi_minmax_mode_name(enum bifrost_minmax_mode mod);
|
||||
const char * bi_round_mode_name(enum bifrost_roundmode mod);
|
||||
|
|
|
@ -29,6 +29,18 @@
|
|||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
enum bifrost_clause_type {
|
||||
BIFROST_CLAUSE_NONE = 0,
|
||||
BIFROST_CLAUSE_LOAD_VARY = 1,
|
||||
BIFROST_CLAUSE_UBO = 2,
|
||||
BIFROST_CLAUSE_TEX = 3,
|
||||
BIFROST_CLAUSE_SSBO_LOAD = 5,
|
||||
BIFROST_CLAUSE_SSBO_STORE = 6,
|
||||
BIFROST_CLAUSE_BLEND = 9,
|
||||
BIFROST_CLAUSE_ATEST = 13,
|
||||
BIFROST_CLAUSE_64BIT = 15
|
||||
};
|
||||
|
||||
struct bifrost_header {
|
||||
unsigned unk0 : 7;
|
||||
// If true, convert any infinite result of any floating-point operation to
|
||||
|
@ -66,9 +78,9 @@ struct bifrost_header {
|
|||
unsigned datareg : 6;
|
||||
unsigned scoreboard_deps: 8;
|
||||
unsigned scoreboard_index: 3;
|
||||
unsigned clause_type: 4;
|
||||
enum bifrost_clause_type clause_type: 4;
|
||||
unsigned unk3 : 1; // part of clauseType?
|
||||
unsigned next_clause_type: 4;
|
||||
enum bifrost_clause_type next_clause_type: 4;
|
||||
unsigned unk4 : 1; // part of nextClauseType?
|
||||
} __attribute__((packed));
|
||||
|
||||
|
|
|
@ -136,8 +136,15 @@ bool dump_clause(FILE *fp, uint32_t *words, unsigned *size, unsigned offset, boo
|
|||
|
||||
void dump_header(FILE *fp, struct bifrost_header header, bool verbose)
|
||||
{
|
||||
fprintf(fp, "id(%du) ", header.scoreboard_index);
|
||||
|
||||
if (header.clause_type != 0) {
|
||||
fprintf(fp, "id(%du) ", header.scoreboard_index);
|
||||
const char *name = bi_clause_type_name(header.clause_type);
|
||||
|
||||
if (name[0] == '?')
|
||||
fprintf(fp, "unk%u ", header.clause_type);
|
||||
else
|
||||
fprintf(fp, "%s ", name);
|
||||
}
|
||||
|
||||
if (header.scoreboard_deps != 0) {
|
||||
|
|
Loading…
Reference in New Issue