Commit 0ad180d2 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Write blend headers from notes

parent 65bcd849
......@@ -153,17 +153,64 @@ struct mali_stencil_test {
#define MALI_MASK_B (1 << 2)
#define MALI_MASK_A (1 << 3)
enum mali_nondominant_mode {
MALI_BLEND_NON_MIRROR = 0,
MALI_BLEND_NDM_ZERO = 1
};
enum mali_dominant_blend {
MALI_BLEND_DOM_SOURCE = 0,
MALI_BLEND_DOM_DESTINATION = 1
};
enum mali_dominant_factor {
MALI_DOMINANT_UNK0 = 0,
MALI_DOMINANT_ZERO = 1,
MALI_DOMINANT_SRC_COLOUR = 2,
MALI_DOMINANT_DEST_COLOUR = 3,
MALI_DOMINANT_UNK4 = 4,
MALI_DOMINANT_SRC_ALPHA = 5,
MALI_DOMINANT_DEST_ALPHA = 6,
MALI_DOMINANT_UNK7 = 7,
};
enum mali_blend_modifier {
MALI_BLEND_MOD_UNK0 = 0,
MALI_BLEND_MOD_NORMAL = 1,
MALI_BLEND_MOD_SOURCE_ONE = 2,
MALI_BLEND_MOD_DEST_ONE = 3,
};
struct mali_blend_mode {
enum mali_blend_modifier clip_modifier : 2;
unsigned unused_0 : 1;
unsigned negate_source : 1;
enum mali_dominant_blend dominant : 1;
enum mali_nondominant_mode nondominant_mode : 1;
unsigned unused_1 : 1;
unsigned negate_dest : 1;
enum mali_dominant_factor dominant_factor : 3;
unsigned complement_dominant : 1;
} __attribute__((packed));
struct mali_blend_equation {
unsigned unknown : 28;
/* Of type mali_blend_mode */
unsigned rgb_mode : 12;
unsigned alpha_mode : 12;
unsigned zero1 : 4;
/* Corresponds to MALI_MASK_* above and glColorMask arguments */
unsigned color_mask : 4;
/* Probably doesn't actually exist, but keeps the union with mali_ptr
* from spilling and masking zero trips and other ugliness */
unsigned zero : 32;
};
unsigned padding : 32;
} __attribute__((packed));
/* Alpha coverage is encoded as 4-bits (from a clampf), with inversion
* literally performing a bitwise invert. This function produces slightly wrong
......
......@@ -454,13 +454,14 @@ panwrap_replay_blend_equation(const u32 *raw)
{
const struct mali_blend_equation *blend = (struct mali_blend_equation *) raw;
if (blend->zero)
panwrap_msg("Blend zero tripped: %X\n", blend->zero);
if (blend->zero1 || blend->padding)
panwrap_msg("Blend zero tripped: %X, %X\n", blend->zero1, blend->padding);
panwrap_log(".blend_equation = {\n");
panwrap_indent++;
panwrap_prop("unknown = 0x%X", blend->unknown);
panwrap_prop("rgb_mode = 0x%X", blend->rgb_mode);
panwrap_prop("alpha_mode = 0x%X", blend->alpha_mode);
panwrap_log(".color_mask = ");
panwrap_log_decoded_flags(mask_flag_info, blend->color_mask);
......
......@@ -310,7 +310,8 @@ trans_default_shader_backend(struct panfrost_context *ctx)
.unknown2_7 = 0x0,
.unknown2_8 = 0x0,
.blend_equation = {
.unknown = 0x122122,
.rgb_mode = 0x122,
.alpha_mode = 0x122,
.color_mask = MALI_MASK_R | MALI_MASK_G | MALI_MASK_B | MALI_MASK_A,
},
};
......
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