When doing layered rendering the binning stage will prepare per-tile lists for each layer in the framebuffer, so we need to make sure we allocate enough space for them .
We also need to emit the NUMBER_OF_LAYERS packet. This is required even when the number of layers is only 1, otherwise the simulator detects buffer overflows in the tile_state BO during some CTS test cases involving layered FBOs.
When rendering, we need to emit commands for each layer of the framebuffer separately and make sure we address the correct layers for each one.
v2: fixed typo in comment (Alejandro)
74a59fdc6e8 v3d: support rendering to multi-layered framebuffers
src/gallium/drivers/v3d/v3d_context.h | 2 +
src/gallium/drivers/v3d/v3dx_draw.c | 19 ++-
src/gallium/drivers/v3d/v3dx_rcl.c | 235 ++++++++++++++++++----------------
3 files changed, 147 insertions(+), 109 deletions(-)