One of the features of geometry shaders is the ability to render to
different layers by assigning to the gl_Layer (Layer in SPIR-V)
builtin.
While have already plumbed the layer regid to the geometry shader,
we also need to GRAS_LAYER_CNTL to actually use layered rendering.
In addition, gmem does not support layered rendering, so we need to
force sysmem.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4436>
bool has_linear_mipmapped_store = false;
const struct tu_render_pass *pass = cmd->state.pass;
+ /* Layered rendering requires sysmem. */
+ if (fb->layers > 1)
+ return true;
+
/* Iterate over all the places we call tu6_emit_store_attachment() */
for (unsigned i = 0; i < pass->subpass_count; i++) {
const struct tu_subpass *subpass = &pass->subpasses[i];
.rt5 = mrt_comp[5],
.rt6 = mrt_comp[6],
.rt7 = mrt_comp[7]));
+
+ // XXX: We probably can't hardcode LAYER_CNTL_TYPE.
+ tu_cs_emit_regs(cs,
+ A6XX_GRAS_LAYER_CNTL(.layered = fb->layers > 1,
+ .type = LAYER_2D_ARRAY));
}
static void
{
tu_cs_emit_pkt4(cs, REG_A6XX_GRAS_UNKNOWN_8001, 1);
tu_cs_emit(cs, 0x0);
- tu_cs_emit_pkt4(cs, REG_A6XX_GRAS_LAYER_CNTL, 1);
- tu_cs_emit(cs, 0x0);
}
static void