Mesa (master): freedreno/a6xx: Force gl_Layer to 0 when necessary

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 7 08:37:26 UTC 2020


Module: Mesa
Branch: master
Commit: 846f4f95dd8b0e514592074aa18d797afe914463
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=846f4f95dd8b0e514592074aa18d797afe914463

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Fri Jul  3 12:04:03 2020 +0200

freedreno/a6xx: Force gl_Layer to 0 when necessary

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5732>

---

 src/gallium/drivers/freedreno/a6xx/fd6_draw.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c
index d221009726e..05a68294ab4 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c
@@ -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),



More information about the mesa-commit mailing list