This is more convenient for the Gallium driver and easier to test.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12152>
/* Converting equations to Mali style is expensive, do it at
* CSO create time instead of draw-time */
if (so->info[c].fixed_function) {
- pan_pack(&so->equation[c], BLEND_EQUATION, cfg)
- pan_blend_to_fixed_function_equation(equation, &cfg);
+ so->equation[c] = pan_pack_blend(equation);
}
}
out->color_mask = equation.color_mask;
}
+uint32_t
+pan_pack_blend(const struct pan_blend_equation equation)
+{
+ STATIC_ASSERT(sizeof(uint32_t) == MALI_BLEND_EQUATION_LENGTH);
+
+ uint32_t out = 0;
+
+ pan_pack(&out, BLEND_EQUATION, cfg) {
+ pan_blend_to_fixed_function_equation(equation, &cfg);
+ }
+
+ return out;
+}
+
static const char *
logicop_str(enum pipe_logicop logicop)
{
pan_blend_to_fixed_function_equation(const struct pan_blend_equation eq,
struct MALI_BLEND_EQUATION *equation);
+uint32_t
+pan_pack_blend(const struct pan_blend_equation equation);
+
nir_shader *
pan_blend_create_shader(const struct panfrost_device *dev,
const struct pan_blend_state *state,