Commit 80212936 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Break apart stencil mask

parent 1f58c1b4
......@@ -102,24 +102,15 @@ enum mali_alt_func {
#define MALI_DEPTH_TEST (1 << 11)
/* Next flags to unknown2_4 */
#define MALI_STENCIL_TEST (1 << 16)
#define MALI_STENCIL_TEST (1 << 0)
/* What?! */
#define MALI_SAMPLE_ALPHA_TO_COVERAGE_NO_BLEND_SHADER (1 << 17)
#define MALI_SAMPLE_ALPHA_TO_COVERAGE_NO_BLEND_SHADER (1 << 1)
#define MALI_NO_DITHER (1 << 25)
#define MALI_DEPTH_RANGE_A (1 << 28)
#define MALI_DEPTH_RANGE_B (1 << 29)
#define MALI_NO_MSAA (1 << 30)
/* glStencilMask state plonked onto unknown2_4, a bit like glDepthFunc plonked
* onto unknown2_3 */
#define MALI_STENCIL_MASK_FRONT(f) (f << 0)
#define MALI_STENCIL_MASK_BACK(f) (f << 8)
#define MALI_GET_STENCIL_MASK_FRONT(f) (f & 0xFF)
#define MALI_GET_STENCIL_MASK_BACK(f) ((f >> 8) & 0xFF)
#define MALI_STENCIL_MASK_MASK 0xFFFF
#define MALI_NO_DITHER (1 << 9)
#define MALI_DEPTH_RANGE_A (1 << 12)
#define MALI_DEPTH_RANGE_B (1 << 13)
#define MALI_NO_MSAA (1 << 14)
/* Stencil test state is all encoded in a single u32, just with a lot of
* enums... */
......@@ -255,7 +246,9 @@ struct mali_fragment_core {
u16 alpha_coverage;
u16 unknown2_3;
u32 unknown2_4;
u8 stencil_mask_front;
u8 stencil_mask_back;
u16 unknown2_4;
struct mali_stencil_test stencil_front;
struct mali_stencil_test stencil_back;
......
......@@ -582,16 +582,10 @@ panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header *h,
panwrap_log_decoded_flags(u3_flag_info, unknown2_3);
panwrap_log_cont(",\n");
panwrap_log(".unknown2_4 = ");
/* TODO: Make less ugly */
panwrap_log_cont("MALI_STENCIL_MASK_FRONT(0x%02X) | MALI_STENCIL_MASK_BACK(0x%02X) | ",
MALI_GET_STENCIL_MASK_FRONT(unknown2_4),
MALI_GET_STENCIL_MASK_BACK(unknown2_4));
unknown2_4 &= ~MALI_STENCIL_MASK_MASK;
panwrap_prop("stencil_mask_front = 0x%02X", f->stencil_mask_front);
panwrap_prop("stencil_mask_back = 0x%02X", f->stencil_mask_back);
panwrap_log(".unknown2_4 = ");
panwrap_log_decoded_flags(u4_flag_info, unknown2_4);
panwrap_log_cont(",\n");
......
......@@ -563,7 +563,6 @@ static void emit_atoms(void *ptr) {
int job_no = job_count++;
int job_numbers[256] = { 0 };
//assert(args->nr_atoms < 256); /* XXX */
for (int i = 0; i < args->nr_atoms; i++) {
const struct mali_jd_atom_v2 *a = &atoms[i];
......@@ -586,7 +585,7 @@ static void emit_atoms(void *ptr) {
panwrap_indent++;
for (int j = 0; j < a->nr_ext_res; j++) {
/* Substitute in our framebuffer (TODO: what about other kinds of extres?) */
/* Substitute in our framebuffer */
panwrap_log("framebuffer_va | MALI_EXT_RES_ACCESS_EXCLUSIVE,\n");
}
......
......@@ -454,7 +454,9 @@ trans_default_shader_backend(struct panfrost_context *ctx)
struct mali_fragment_core shader = {
.alpha_coverage = ~MALI_ALPHA_COVERAGE(0.000000),
.unknown2_3 = MALI_DEPTH_FUNC(MALI_FUNC_ALWAYS) | 0x3010,
.unknown2_4 = MALI_STENCIL_MASK_FRONT(0xFF) | MALI_STENCIL_MASK_BACK(0xFF) | MALI_NO_MSAA | 0x4f00000,
.stencil_mask_front = 0xFF,
.stencil_mask_back = 0xFF,
.unknown2_4 = MALI_NO_MSAA | 0x4f0,
.stencil_front = {
.ref = 0,
.mask = 0xFF,
......
......@@ -115,6 +115,7 @@ int main(int argc, const char **argv)
gallium->draw_vbo(gallium, &info);
gallium->flush(gallium, NULL, PIPE_FLUSH_END_OF_FRAME);
sleep(1);
}
gallium->transfer_unmap(gallium, transfer);
......
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