From: Mike Blumenkrantz Date: Wed, 8 Jul 2020 16:43:23 +0000 (-0400) Subject: nir: allow nir_lower_clip_halfz to run in geometry shaders X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8df1c43d24a73740ddd8702d480eded11287b3f;p=mesa.git 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 Part-of: --- diff --git a/src/compiler/nir/nir_lower_clip_halfz.c b/src/compiler/nir/nir_lower_clip_halfz.c index 13b7a5b8f1e..6db1910362f 100644 --- a/src/compiler/nir/nir_lower_clip_halfz.c +++ b/src/compiler/nir/nir_lower_clip_halfz.c @@ -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) {