unsigned rt_count = batch->key.nr_cbufs;
struct bifrost_blend_rt *brts = rts;
- struct midgard_blend_rt *mrts = rts;
/* Disable blending for depth-only on Bifrost */
brts[0].unk2 = 0x3;
for (unsigned i = 0; i < rt_count; ++i) {
- unsigned flags = 0;
+ struct mali_blend_flags_packed flags = {};
pan_pack(&flags, BLEND_FLAGS, cfg) {
if (blend[i].no_colour) {
}
if (dev->quirks & IS_BIFROST) {
- brts[i].flags = flags;
+ brts[i].flags = flags.opaque[0];
if (blend[i].is_shader) {
/* The blend shader's address needs to be at
brts[i].shader_type = fs->blend_types[i];
}
} else {
- memcpy(&mrts[i].flags, &flags, sizeof(flags));
-
- if (blend[i].is_shader) {
- mrts[i].blend.shader = blend[i].shader.gpu | blend[i].shader.first_tag;
- } else {
- mrts[i].blend.equation = blend[i].equation.equation;
- mrts[i].blend.constant = blend[i].equation.constant;
+ pan_pack(rts, MIDGARD_BLEND_OPAQUE, cfg) {
+ cfg.flags = flags;
+
+ if (blend[i].is_shader) {
+ cfg.shader = blend[i].shader.gpu | blend[i].shader.first_tag;
+ } else {
+ cfg.equation = blend[i].equation.equation.opaque[0];
+ cfg.constant = blend[i].equation.constant;
+ }
}
+
+ rts += MALI_MIDGARD_BLEND_LENGTH;
}
}
}
<field name="Dither disable" size="1" start="11" type="bool" default="false"/>
</struct>
+ <struct name="Midgard Blend" size="4" with_opaque="true">
+ <field name="Flags" size="32" start="0:0" type="Blend Flags"/>
+ <field name="Equation" size="32" start="2:0" type="uint"/> <!-- XXX -->
+ <field name="Constant" size="32" start="3:0" type="float"/>
+ <field name="Shader" size="64" start="2:0" type="address"/>
+ </struct>
+
<struct name="Midgard Sampler">
<field name="Magnify Nearest" size="1" start="0" type="bool" default="true"/>
<field name="Minify Nearest" size="1" start="1" type="bool" default="true"/>