Commit 531eb805 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Proceed with the stencil test

parent 01a214f8
......@@ -124,8 +124,8 @@ struct mali_shader_meta {
/* Like clear_color, these fields appear to always be duplicated */
u32 stencil_0;
u32 stencil_1;
u32 stencil_front;
u32 stencil_back;
u32 unknown2_7;
u32 unknown2_8;
......
......@@ -333,6 +333,22 @@ panwrap_replay_shader_address(const char *name, mali_ptr ptr)
return shader_ptr;
}
static void
panwrap_replay_stencil(const char *name, u32 raw)
{
uint8_t ref = raw & 0xFF;
uint8_t mask = (raw >> 8) & 0xFF;
uint8_t func = (raw >> 16) & 0x7;
uint8_t f1 = (raw >> 19) & 0x7;
uint8_t f2 = (raw >> 22) & 0x7;
uint8_t f3 = (raw >> 25) & 0x7;
const char *func_str = panwrap_stencil_func_name(func);
panwrap_prop("stencil_%s = MAKE_STENCIL_TEST(%s, 0x%02X, %d) /* %d,%d,%d */", name, func_str, mask, ref, f1, f2, f3);
}
static int
panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header *h,
const struct panwrap_mapped_memory *mem,
......@@ -389,20 +405,11 @@ panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header *h,
panwrap_log_decoded_flags(u4_flag_info, s->unknown2_4);
panwrap_log_cont(",\n");
if (s->stencil_0 != s->stencil_1) {
panwrap_msg("Stencil fields are not equal, not decoding");
panwrap_prop("stencil_0 = 0x%" PRIx32, s->stencil_0);
panwrap_prop("stencil_1 = 0x%" PRIx32, s->stencil_1);
} else if (s->stencil_0) {
uint8_t ref = s->stencil_0 & 0xFF;
uint8_t mask = (s->stencil_0 >> 8) & 0xFF;
uint8_t func = s->stencil_0 >> 16;
if (s->stencil_front)
panwrap_replay_stencil("front", s->stencil_front);
const char *func_str = panwrap_stencil_func_name(func);
panwrap_prop("stencil_0 = MAKE_STENCIL_TEST(%s, 0x%02X, %d)", func_str, mask, ref);
panwrap_prop("stencil_1 = MAKE_STENCIL_TEST(%s, 0x%02X, %d)", func_str, mask, ref);
}
if (s->stencil_back)
panwrap_replay_stencil("back", s->stencil_back);
panwrap_prop("unknown2_7 = 0x%" PRIx32, s->unknown2_7);
panwrap_prop("unknown2_8 = 0x%" PRIx32, s->unknown2_8);
......
......@@ -303,8 +303,8 @@ void main(void) {
.unknown2_2 = 0x0,
.unknown2_3 = MALI_HAS_MSAA | 0x3710ffff,
.unknown2_4 = /*MALI_NO_MSAA | */0x6f0ffff,
.stencil_0 = MAKE_STENCIL_TEST(MALI_STENCIL_ALWAYS, 0xFF, 0),
.stencil_1 = MAKE_STENCIL_TEST(MALI_STENCIL_ALWAYS, 0xFF, 0),
.stencil_front = MAKE_STENCIL_TEST(MALI_STENCIL_ALWAYS, 0xFF, 0),
.stencil_back = MAKE_STENCIL_TEST(MALI_STENCIL_ALWAYS, 0xFF, 0),
.unknown2_7 = 0x0,
.unknown2_8 = 0x0,
.blend_equation = 0xf0122122,
......
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