/* info.load presented as a bitfield for draw call hot paths */
unsigned load_dest_mask : PIPE_MAX_COLOR_BUFS;
+
+ /* info.enabled presented as a bitfield for draw call hot paths */
+ unsigned enabled_mask : PIPE_MAX_COLOR_BUFS;
};
mali_ptr panfrost_get_blend(struct panfrost_batch *batch, unsigned rt,
* from reading it directly, or from failing to write it
*/
unsigned rt_mask = ctx->fb_rt_mask;
- uint64_t rt_written = (fs->info.outputs_written >> FRAG_RESULT_DATA0);
+ uint64_t rt_written = (fs->info.outputs_written >> FRAG_RESULT_DATA0) &
+ ctx->blend->enabled_mask;
bool blend_reads_dest = (ctx->blend->load_dest_mask & rt_mask);
bool alpha_to_coverage = ctx->blend->base.alpha_to_coverage;
if (so->info[c].load_dest)
so->load_dest_mask |= BITFIELD_BIT(c);
+ /* Bifrost needs to know if any render target loads its
+ * destination in the hot draw path, so precompute this */
+ if (so->info[c].enabled)
+ so->enabled_mask |= BITFIELD_BIT(c);
+
/* Converting equations to Mali style is expensive, do it at
* CSO create time instead of draw-time */
if (so->info[c].fixed_function) {