On Midgard, we need a "blend" shader even if blending is disabled, if the format
isn't blendable. This is inefficient. Bifrost solves this by decoupling the
format conversion from the blending, allowing opaque (unblended) output to any
format without a blend shader or fragment key.
Unfortunately, our blend code is from the Midgard era -- I wrote an early
version of nir_lower_blend when I was still in high school! -- so we've been
using blend shaders for opaque output even on Bifrost. Whoops!
In SuperTuxKart, reduces blend shader calls by 30%, translating to a 15%
reduction in i-cache misses.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17841>
return 0;
}
+ /* On Bifrost and newer, we can also use fixed-function for opaque
+ * output regardless of the format by configuring the appropriate
+ * conversion descriptor in the internal blend descriptor. (Midgard
+ * requires a blend shader even for this case.)
+ */
+ if (dev->arch >= 6 && info.opaque)
+ return 0;
+
/* Otherwise, we need to grab a shader */
struct pan_blend_state pan_blend = blend->pan;
unsigned nr_samples = surf->nr_samples ? : surf->texture->nr_samples;
const struct pan_blit_shader_data *blit_shader,
mali_ptr *blend_shaders)
{
+#if PAN_ARCH <= 5
if (!rt_count)
return;
pthread_mutex_unlock(&dev->blitter.shaders.lock);
blend_shaders[i] = blend_shader->address;
}
+#endif
}
static const struct pan_blit_shader_data *