summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc5
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-09-28 10:39:07 -0700
committerEric Anholt <[email protected]>2017-10-10 11:42:05 -0700
commite20c82c55087344fb7caec4cc9df0a13489a2f2d (patch)
tree338681937f574502e2f5a474c161ec812380b9af /src/gallium/drivers/vc5
parent732a3a72cb8b5c78e95eee47572701b3f6055c19 (diff)
braodcom/vc5: Fix incorrect early Z writes in discard shaders.
Fixes glsl-fs-discard-02.
Diffstat (limited to 'src/gallium/drivers/vc5')
-rw-r--r--src/gallium/drivers/vc5/vc5_draw.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc5/vc5_draw.c b/src/gallium/drivers/vc5/vc5_draw.c
index f764f41ce15..555e822a719 100644
--- a/src/gallium/drivers/vc5/vc5_draw.c
+++ b/src/gallium/drivers/vc5/vc5_draw.c
@@ -187,8 +187,13 @@ vc5_emit_gl_shader_state(struct vc5_context *vc5,
(info->mode == PIPE_PRIM_POINTS &&
vc5->rasterizer->base.point_size_per_vertex);
+ /* Must be set if the shader modifies Z, discards, or modifies
+ * the sample mask. For any of these cases, the fragment
+ * shader needs to write the Z value (even just discards).
+ */
shader.fragment_shader_does_z_writes =
- vc5->prog.fs->prog_data.fs->writes_z;
+ (vc5->prog.fs->prog_data.fs->writes_z ||
+ vc5->prog.fs->prog_data.fs->discard);
shader.number_of_varyings_in_fragment_shader =
vc5->prog.fs->prog_data.base->num_inputs;