nir: allow nir_lower_clip_halfz to run in geometry shaders

the final output of gl_Position needs this transform, and geometry shaders
must write this value for stream 0 if rasterization is enabled

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5851>
This commit is contained in:
Mike Blumenkrantz
2020-07-08 12:43:23 -04:00
committed by Marge Bot
parent 3fe87a5836
commit b8df1c43d2

View File

@@ -56,7 +56,8 @@ lower_pos_write(nir_builder *b, struct nir_instr *instr)
void
nir_lower_clip_halfz(nir_shader *shader)
{
if (shader->info.stage != MESA_SHADER_VERTEX)
if (shader->info.stage != MESA_SHADER_VERTEX &&
shader->info.stage != MESA_SHADER_GEOMETRY)
return;
nir_foreach_function(function, shader) {