blend[c] = panfrost_get_blend_for_context(ctx, c, &shader_bo,
&shader_offset);
- /* If there is a blend shader, work registers are shared. XXX: opt */
+ /* If there is a blend shader, work registers are shared. We impose 8
+ * work registers as a limit for blend shaders. Should be lower XXX */
if (!(dev->quirks & IS_BIFROST)) {
for (unsigned c = 0; c < rt_count; ++c) {
- if (blend[c].is_shader)
- fragmeta->midgard1.work_count = 16;
+ if (blend[c].is_shader) {
+ fragmeta->midgard1.work_count =
+ MAX2(fragmeta->midgard1.work_count, 8);
+ }
}
}
allocate_registers(compiler_context *ctx, bool *spilled)
{
/* The number of vec4 work registers available depends on when the
- * uniforms start, so compute that first */
- int work_count = 16 - MAX2((ctx->uniform_cutoff - 8), 0);
+ * uniforms start and the shader stage. By ABI we limit blend shaders
+ * to 8 registers, should be lower XXX */
+ int work_count = ctx->is_blend ? 8 :
+ 16 - MAX2((ctx->uniform_cutoff - 8), 0);
/* No register allocation to do with no SSA */
unsigned spill_class,
unsigned *spill_count)
{
+ if (spill_class == REG_CLASS_WORK && ctx->is_blend)
+ unreachable("Blend shader spilling is currently unimplemented");
+
unsigned spill_index = ctx->temp_count;
/* We have a spill node, so check the class. Work registers