From: Connor Abbott Date: Fri, 3 Jul 2020 10:03:00 +0000 (+0200) Subject: tu: Force gl_Layer to 0 when necessary X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f69c3849b8c397f48a8d6f22d1991ae927a31657;p=mesa.git tu: Force gl_Layer to 0 when necessary In particular this will help us implement input attachments correctly with layered rendering. Part-of: --- diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c index 965aa34209f..4a21a1514ee 100644 --- a/src/freedreno/vulkan/tu_pipeline.c +++ b/src/freedreno/vulkan/tu_pipeline.c @@ -1977,6 +1977,10 @@ tu_pipeline_builder_compile_shaders(struct tu_pipeline_builder *builder, builder->shaders[stage] = shader; } + struct tu_shader *gs = builder->shaders[MESA_SHADER_GEOMETRY]; + key.layer_zero = + !gs || !(gs->ir3_shader->nir->info.outputs_written & VARYING_SLOT_LAYER); + pipeline->tess.patch_type = key.tessellation; for (gl_shader_stage stage = MESA_SHADER_VERTEX;