From a8930e63028b52420b24e238263db50fa8ca2c30 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Sun, 21 Nov 2021 03:18:25 -0500 Subject: [PATCH] nir/lower_clip: replace bogus comment about gl_ClipDistance reading in GL gl_ClipDistance most definitely can be read in fragment shaders since GLSL 1.30. This is also accessible in ES with EXT_clip_cull_distance. Signed-off-by: Ilia Mirkin Reviewed-by: Emma Anholt Part-of: --- src/compiler/nir/nir_lower_clip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/nir/nir_lower_clip.c b/src/compiler/nir/nir_lower_clip.c index bb0543df4ca..9bb167eeaa6 100644 --- a/src/compiler/nir/nir_lower_clip.c +++ b/src/compiler/nir/nir_lower_clip.c @@ -491,9 +491,9 @@ nir_lower_clip_fs(nir_shader *shader, unsigned ucp_enables, if (!ucp_enables) return false; - /* Fragment shaders can't read gl_ClipDistance[] in OpenGL so it will not - * have the variable defined, but Vulkan allows this, in which case the - * SPIR-V compiler would have already added it as a compact array. + /* No hard reason to require use_clipdist_arr to work with + * frag-shader-based gl_ClipDistance, except that the only user that does + * not enable this does not support GL 3.0 (or EXT_clip_cull_distance). */ if (!fs_has_clip_dist_input_var(shader, in, &ucp_enables)) create_clipdist_vars(shader, in, ucp_enables, false, use_clipdist_array);