Fix: Workbench: Shadows

Broken shadows after c0c3565714
GPU_ARB_gpu_shader5 is never defined,
since gl_InvocationID is always available.
This commit is contained in:
Miguel Pozo
2024-02-12 18:34:12 +01:00
parent 7b8c438715
commit 7821cf068c
2 changed files with 2 additions and 25 deletions

View File

@@ -2,10 +2,6 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_ARB_gpu_shader5
# define USE_INVOC_EXT
#endif
vec4 get_pos(int v, bool backface)
{
return (backface) ? vData[v].backPosition : vData[v].frontPosition;
@@ -54,12 +50,7 @@ void main()
#endif
if (!is_manifold || !backface) {
#ifdef USE_INVOC_EXT
bool do_front = (gl_InvocationID & 1) == 0;
emit_cap(do_front, invert);
#else
emit_cap(true, invert);
emit_cap(false, invert);
#endif
}
}

View File

@@ -2,10 +2,6 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_ARB_gpu_shader5
# define USE_INVOC_EXT
#endif
#define DEGENERATE_TRIS_WORKAROUND
#define DEGENERATE_TRIS_AREA_THRESHOLD 4e-17
@@ -74,23 +70,13 @@ void main()
return;
}
#ifdef USE_INVOC_EXT
if (gl_InvocationID == 0) {
extrude_edge(backface.x);
}
else if (is_manifold) {
# ifdef DOUBLE_MANIFOLD
#ifdef DOUBLE_MANIFOLD
/* Increment/Decrement twice for manifold edges. */
extrude_edge(backface.x);
# endif
}
#else
extrude_edge(backface.x);
if (is_manifold) {
# ifdef DOUBLE_MANIFOLD
/* Increment/Decrement twice for manifold edges. */
extrude_edge(backface.x);
# endif
}
#endif
}
}