Commit 41d3af04 authored by Connor Abbott's avatar Connor Abbott

Merge branch 'varying-qualifier' into 'master'

midgard: load_varying parameters

See merge request !10
parents e0fadd36 196e6659
......@@ -753,13 +753,36 @@ static void print_mask(uint32_t mask)
}
}
static void print_varying_parameters(midgard_load_store_word* word)
{
if (word->is_varying) {
/* If a varying, there are qualifiers */
if (word->flat)
printf(".flat");
if (word->interpolation != midgard_interp_default) {
if (word->interpolation == midgard_interp_centroid)
printf(".centroid");
else
printf(".interp%d", word->interpolation);
}
} else if (word->flat || word->interpolation) {
printf(" /* is_varying not set but varying metadata attached */");
}
if (word->unknown0_1 || word->unknown0_2)
printf(" /* zero tripped, %d %d */ ", word->unknown0_1, word->unknown0_2);
}
static void print_load_store_instr(uint64_t data,
unsigned tabs)
{
midgard_load_store_word* word = (midgard_load_store_word *) &data;
ogt_asm_print_tabs(tabs);
print_ld_st_opcode(word->op);
print_varying_parameters(word);
printf(" r%d", word->reg);
print_mask(word->mask);
......
......@@ -233,6 +233,12 @@ typedef enum
midgard_op_store_vary_32 = 0xD4
} midgard_load_store_op;
typedef enum
{
midgard_interp_centroid = 1,
midgard_interp_default = 2
} midgard_interpolation;
typedef struct
__attribute__((__packed__))
{
......@@ -240,7 +246,17 @@ __attribute__((__packed__))
unsigned reg : 5;
unsigned mask : 4;
unsigned swizzle : 8;
unsigned unknown : 26;
unsigned unknown : 16;
unsigned unknown0_1 : 4; /* Always zero */
/* Varying qualifiers, zero if not a varying */
unsigned flat : 1;
unsigned is_varying : 1; /* Always one for varying, but maybe something else? */
midgard_interpolation interpolation : 2;
unsigned unknown0_2 : 2; /* Always zero */
unsigned address : 9;
} midgard_load_store_word;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment