freedreno/a6xx: Force gl_Layer to 0 when necessary
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 3 Jul 2020 10:04:03 +0000 (12:04 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 7 Jul 2020 08:10:47 +0000 (08:10 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5732>

src/gallium/drivers/freedreno/a6xx/fd6_draw.c

index d221009726e88964a59f09a53017ceb9c6316e87..05a68294ab4ed0f2e3f0fc696c1c5671bdffc793 100644 (file)
@@ -143,6 +143,7 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
              unsigned index_offset)
 {
        struct fd6_context *fd6_ctx = fd6_context(ctx);
+       struct ir3_shader *gs = ctx->prog.gs;
        struct fd6_emit emit = {
                .ctx = ctx,
                .vtx  = &ctx->vtx,
@@ -164,6 +165,7 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
                                .fsaturate_s = fd6_ctx->fsaturate_s,
                                .fsaturate_t = fd6_ctx->fsaturate_t,
                                .fsaturate_r = fd6_ctx->fsaturate_r,
+                               .layer_zero = !gs || !(gs->nir->info.outputs_written & VARYING_BIT_LAYER),
                                .vsamples = ctx->tex[PIPE_SHADER_VERTEX].samples,
                                .fsamples = ctx->tex[PIPE_SHADER_FRAGMENT].samples,
                                .sample_shading = (ctx->min_samples > 1),