if (dev->quirks & IS_BIFROST) {
struct mali_bifrost_properties_packed prop;
+ struct mali_preload_vertex_packed preload;
pan_pack(&prop, BIFROST_PROPERTIES, cfg) {
cfg.unknown = 0x800000; /* XXX */
cfg.uniform_buffer_count = panfrost_ubo_count(ctx, st);
}
- memcpy(&meta->bifrost_props, &prop, sizeof(prop));
+ /* TODO: True compute shaders */
+ pan_pack(&preload, PRELOAD_VERTEX, cfg) {
+ cfg.uniform_count = ss->uniform_count;
+ cfg.vertex_id = true;
+ cfg.instance_id = true;
+ }
- meta->bifrost2.preload_regs = 0xC0;
- meta->bifrost2.uniform_count = ss->uniform_count;
+ memcpy(&meta->bifrost_props, &prop, sizeof(prop));
+ memcpy(&meta->bifrost_preload, &preload, sizeof(preload));
} else {
struct mali_midgard_properties_packed prop;
if (dev->quirks & IS_BIFROST) {
struct mali_bifrost_properties_packed prop;
+ struct mali_preload_fragment_packed preload;
bool no_blend = true;
cfg.early_z_enable = !fs->can_discard && !fs->writes_depth && no_blend;
}
- memcpy(&fragmeta->bifrost_props, &prop, sizeof(prop));
-
- fragmeta->bifrost2.preload_regs = 0x1;
- SET_BIT(fragmeta->bifrost2.preload_regs, 0x10, fs->reads_frag_coord);
+ pan_pack(&preload, PRELOAD_FRAGMENT, cfg) {
+ cfg.uniform_count = fs->uniform_count;
+ cfg.fragment_position = fs->reads_frag_coord;
+ }
- fragmeta->bifrost2.uniform_count = fs->uniform_count;
+ memcpy(&fragmeta->bifrost_props, &prop, sizeof(prop));
+ memcpy(&fragmeta->bifrost_preload, &preload, sizeof(preload));
} else {
struct mali_midgard_properties_packed prop;
fragmeta->unknown2_3 |= MALI_DEPTH_FUNC(panfrost_translate_compare_func(
zsa->base.depth.enabled ? zsa->base.depth.func : PIPE_FUNC_ALWAYS));
- SET_BIT(fragmeta->unknown2_4, MALI_NO_DITHER,
- (dev->quirks & MIDGARD_SFBD) &&
- !ctx->blend->base.dither);
-
- SET_BIT(fragmeta->unknown2_4, 0x10, dev->quirks & MIDGARD_SFBD);
-
SET_BIT(fragmeta->unknown2_4, MALI_ALPHA_TO_COVERAGE,
ctx->blend->base.alpha_to_coverage);
* need to signal CAN_DISCARD for nontrivial blend modes (so
* we're able to read back the destination buffer) */
+ if (blend[0].no_colour)
+ return;
+
+ fragmeta->unknown2_4 |= MALI_SFBD_ENABLE;
+
+ SET_BIT(fragmeta->unknown2_4, MALI_SFBD_SRGB,
+ util_format_is_srgb(ctx->pipe_framebuffer.cbufs[0]->format));
+
SET_BIT(fragmeta->unknown2_3, MALI_HAS_BLEND_SHADER,
blend[0].is_shader);
SET_BIT(fragmeta->unknown2_3, MALI_CAN_DISCARD,
blend[0].load_dest);
+
+ SET_BIT(fragmeta->unknown2_4, MALI_NO_DITHER, !ctx->blend->base.dither);
} else if (!(dev->quirks & IS_BIFROST)) {
/* Bug where MRT-capable hw apparently reads the last blend
* shader from here instead of the usual location? */