unsigned srgb_cntl = 0;
unsigned i;
+ bool layered = false;
+ unsigned type = 0;
+
for (i = 0; i < pfb->nr_cbufs; i++) {
enum a6xx_color_fmt format = 0;
enum a3xx_color_swap swap = WZYX;
else
tile_mode = rsc->tile_mode;
- debug_assert(psurf->u.tex.first_layer == psurf->u.tex.last_layer);
+ if (psurf->u.tex.first_layer < psurf->u.tex.last_layer) {
+ layered = true;
+ if (psurf->texture->target == PIPE_TEXTURE_2D_ARRAY && psurf->texture->nr_samples > 0)
+ type = MULTISAMPLE_ARRAY;
+ else if (psurf->texture->target == PIPE_TEXTURE_2D_ARRAY)
+ type = ARRAY;
+ else if (psurf->texture->target == PIPE_TEXTURE_CUBE)
+ type = CUBEMAP;
+ else if (psurf->texture->target == PIPE_TEXTURE_3D)
+ type = ARRAY;
+
+ stride /= pfb->samples;
+ }
+
debug_assert((offset + slice->size0) <= fd_bo_size(rsc->bo));
OUT_PKT4(ring, REG_A6XX_RB_MRT_BUF_INFO(i), 6);
A6XX_SP_FS_RENDER_COMPONENTS_RT5(mrt_comp[5]) |
A6XX_SP_FS_RENDER_COMPONENTS_RT6(mrt_comp[6]) |
A6XX_SP_FS_RENDER_COMPONENTS_RT7(mrt_comp[7]));
+
+ OUT_PKT4(ring, REG_A6XX_GRAS_LAYER_CNTL, 1);
+ OUT_RING(ring, COND(layered, A6XX_GRAS_LAYER_CNTL_LAYERED |
+ A6XX_GRAS_LAYER_CNTL_TYPE(type)));
}
static void
uint32_t offset, ubwc_offset;
bool ubwc_enabled;
+ debug_assert(psurf->u.tex.first_layer == psurf->u.tex.last_layer);
+
/* separate stencil case: */
if (stencil) {
rsc = rsc->stencil;
OUT_RING(ring, 0x80);
OUT_PKT4(ring, REG_A6XX_GRAS_UNKNOWN_8001, 1);
OUT_RING(ring, 0x0);
- OUT_PKT4(ring, REG_A6XX_GRAS_LAYER_CNTL, 1);
- OUT_RING(ring, 0x0);
OUT_PKT4(ring, REG_A6XX_GRAS_SU_CNTL, 1);
OUT_RING(ring, so->gras_su_cntl);
}
}
+ /* Layered rendering always needs bypass. */
+ for (unsigned i = 0; i < pfb->nr_cbufs; i++) {
+ struct pipe_surface *psurf = pfb->cbufs[i];
+ if (!psurf)
+ continue;
+ if (psurf->u.tex.first_layer < psurf->u.tex.last_layer)
+ sysmem = true;
+ }
+
fd_reset_wfi(batch);
ctx->stats.batch_total++;
psurf->u.buf.first_element = surf_tmpl->u.buf.first_element;
psurf->u.buf.last_element = surf_tmpl->u.buf.last_element;
} else {
- debug_assert(surf_tmpl->u.tex.first_layer == surf_tmpl->u.tex.last_layer);
psurf->u.tex.level = level;
psurf->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
psurf->u.tex.last_layer = surf_tmpl->u.tex.last_layer;