Object Rendered incorrectly in Vertex Select Edit Mode #58403

Closed
opened 2018-12-01 06:13:03 +01:00 by Nolan · 41 comments

system-info.txt

blenderBug.gif

In edit mode when selecting vertices, the object is drawn incorrectly (see GIF). Each triangle is drawn with a cyan to black gradient with an additive black to red gradient that seems to represent depth. It goes away when you rotate the object or switch to Edge or Face Select.

[system-info.txt](https://archive.blender.org/developer/F5775937/system-info.txt) ![blenderBug.gif](https://archive.blender.org/developer/F5775938/blenderBug.gif) In edit mode when selecting vertices, the object is drawn incorrectly (see GIF). Each triangle is drawn with a cyan to black gradient with an additive black to red gradient that seems to represent depth. It goes away when you rotate the object or switch to Edge or Face Select.
Author

Added subscriber: @nolan.lee.baker

Added subscriber: @nolan.lee.baker

#60680 was marked as duplicate of this issue

#60680 was marked as duplicate of this issue

#59795 was marked as duplicate of this issue

#59795 was marked as duplicate of this issue

#59076 was marked as duplicate of this issue

#59076 was marked as duplicate of this issue

#59852 was marked as duplicate of this issue

#59852 was marked as duplicate of this issue

#59247 was marked as duplicate of this issue

#59247 was marked as duplicate of this issue

Added subscriber: @ZedDB

Added subscriber: @ZedDB
Clément Foucault was assigned by Sebastian Parborg 2018-12-07 15:47:33 +01:00

Is this still a problem in newer blender betas?
If it still is, provide the output if you run blender with --debug-gpu and check also if --debug-gpu-force-workarounds solves anything

Is this still a problem in newer blender betas? If it still is, provide the output if you run blender with --debug-gpu and check also if --debug-gpu-force-workarounds solves anything
Author
Nolans-MacBook-Pro% ./blender28.app/Contents/MacOS/blender --debug-gpu
Read prefs: /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend
OpenGL debug callback is not available on Apple.
found bundled python: /Applications/blender28/blender28.app/Contents/Resources/2.80/python
Traceback (most recent call last):
  File "/Applications/blender28/blender28.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 377, in enable
    raise Exception(f"Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring")
Exception: Add-on 'io_scene_gltf2' has not been upgraded to 2.8, ignoring
GPUShader: linking error:
ERROR: Too many geometry shader invocations

GPUShader: linking error:
ERROR: Too many geometry shader invocations

GPUShader: linking error:
ERROR: Too many geometry shader invocations

GPUShader: linking error:
ERROR: Too many geometry shader invocations

GPUShader: linking error:
ERROR: Too many geometry shader invocations

GPUShader: linking error:
ERROR: Too many geometry shader invocations

GPUShader: linking error:
ERROR: Too many geometry shader invocations

GPUShader: linking error:
ERROR: Too many geometry shader invocations

GPUShader: linking error:
ERROR: Too many geometry shader invocations

GPUShader: linking error:
ERROR: Too many geometry shader invocations

GPUShader: linking error:
ERROR: Too many geometry shader invocations

GPUShader: linking error:
ERROR: Too many geometry shader invocations

Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'dataBuffer' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'dataBuffer' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'dataBuffer' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'dataBuffer' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'dataBuffer' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'dataBuffer' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'dataBuffer' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'dataBuffer' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
Warning: Pass : ?, Uniform 'edgeScale' not found!
Warning: Pass : ?, Uniform 'viewportSize' not found!
``` Nolans-MacBook-Pro% ./blender28.app/Contents/MacOS/blender --debug-gpu Read prefs: /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend OpenGL debug callback is not available on Apple. found bundled python: /Applications/blender28/blender28.app/Contents/Resources/2.80/python Traceback (most recent call last): File "/Applications/blender28/blender28.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 377, in enable raise Exception(f"Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring") Exception: Add-on 'io_scene_gltf2' has not been upgraded to 2.8, ignoring GPUShader: linking error: ERROR: Too many geometry shader invocations GPUShader: linking error: ERROR: Too many geometry shader invocations GPUShader: linking error: ERROR: Too many geometry shader invocations GPUShader: linking error: ERROR: Too many geometry shader invocations GPUShader: linking error: ERROR: Too many geometry shader invocations GPUShader: linking error: ERROR: Too many geometry shader invocations GPUShader: linking error: ERROR: Too many geometry shader invocations GPUShader: linking error: ERROR: Too many geometry shader invocations GPUShader: linking error: ERROR: Too many geometry shader invocations GPUShader: linking error: ERROR: Too many geometry shader invocations GPUShader: linking error: ERROR: Too many geometry shader invocations GPUShader: linking error: ERROR: Too many geometry shader invocations Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'dataBuffer' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'dataBuffer' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'dataBuffer' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'dataBuffer' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'dataBuffer' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'dataBuffer' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'dataBuffer' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'dataBuffer' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! Warning: Pass : ?, Uniform 'edgeScale' not found! Warning: Pass : ?, Uniform 'viewportSize' not found! ```
Author
Nolans-MacBook-Pro% ./blender28.app/Contents/MacOS/blender --debug-gpu-force-workarounds                         
Read prefs: /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend
found bundled python: /Applications/blender28/blender28.app/Contents/Resources/2.80/python
Traceback (most recent call last):
  File "/Applications/blender28/blender28.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 377, in enable
    raise Exception(f"Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring")
Exception: Add-on 'io_scene_gltf2' has not been upgraded to 2.8, ignoring
unknown argument, loading as file: --debug-gpu-force-workarounds
Error: Cannot read file '/Applications/blender28/--debug-gpu-force-workarounds': No such file or directory
Error: argument has no '.blend' file extension, not using as new file, exiting! /Applications/blender28/--debug-gpu-force-workarounds
Saved session recovery to '/tmp/quit.blend'

Blender quit
``` Nolans-MacBook-Pro% ./blender28.app/Contents/MacOS/blender --debug-gpu-force-workarounds Read prefs: /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend found bundled python: /Applications/blender28/blender28.app/Contents/Resources/2.80/python Traceback (most recent call last): File "/Applications/blender28/blender28.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 377, in enable raise Exception(f"Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring") Exception: Add-on 'io_scene_gltf2' has not been upgraded to 2.8, ignoring unknown argument, loading as file: --debug-gpu-force-workarounds Error: Cannot read file '/Applications/blender28/--debug-gpu-force-workarounds': No such file or directory Error: argument has no '.blend' file extension, not using as new file, exiting! /Applications/blender28/--debug-gpu-force-workarounds Saved session recovery to '/tmp/quit.blend' Blender quit ```
Author

Those outputs are with the December 4th build (blender-2.80.1b6a394d862-x86_64). Perhaps there's a newer build I'm unaware of, but that's the latest available at https://builder.blender.org/download/ . "--debug-gpu-force-workarounds" doesn't seem to work as an argument in that build.

Those outputs are with the December 4th build (blender-2.80.1b6a394d862-x86_64). Perhaps there's a newer build I'm unaware of, but that's the latest available at https://builder.blender.org/download/ . "--debug-gpu-force-workarounds" doesn't seem to work as an argument in that build.

Yep the build is too old for --debug-gpu-force-workarounds. But ERROR: Too many geometry shader invocations is concerning. Can you run using the option --debug so that I can see which shaders fail to compile?

Yep the build is too old for `--debug-gpu-force-workarounds`. But `ERROR: Too many geometry shader invocations` is concerning. Can you run using the option `--debug` so that I can see which shaders fail to compile?
Author
Nolans-MacBook-Pro% ./blender --debug
Switching to fully guarded memory allocator.
Blender 2.80 (sub 35)
Build: 2018-12-04 01:09:28 Darwin Release
argv[0] = ./blender
argv[1] = --debug
read file /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend
  Version 280 sub 35 date 2018-11-29 22:54 hash 63c06531707
Read prefs: /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend
read file 
  Version 280 sub 24 date unknown hash unknown
found bundled python: /Applications/blender28/blender28.app/Contents/Resources/2.80/python
Traceback (most recent call last):
  File "/Applications/blender28/blender28.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 377, in enable
    raise Exception(f"Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring")
Exception: Add-on 'io_scene_gltf2' has not been upgraded to 2.8, ignoring
GPUShader: linking error:
===== shader string 1 ====
 1  #define INFINITE 1000.0
 2  
 3  uniform mat4 ModelViewProjectionMatrix;
 4  
 5  uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57);
 6  uniform float lightDistance = 1e4;
 7  
 8  in vec3 pos;
 9  
10  out VertexData {
11  	vec3 pos;           /* local position */
12  	vec4 frontPosition; /* final ndc position */
13  	vec4 backPosition;
14  } vData;
15  
16  void main()
17  {
18  	vData.pos = pos;
19  	vData.frontPosition = ModelViewProjectionMatrix * vec4(pos, 1.0);
20  	vData.backPosition  = ModelViewProjectionMatrix * vec4(pos + lightDirection * lightDistance, 1.0);
21  }
ERROR: Too many geometry shader invocations

GPUShader: linking error:
===== shader string 1 ====
 1  #extension GL_ARB_gpu_shader5 : enable
 2  
 3  #ifdef GL_ARB_gpu_shader5
 4  #define USE_INVOC_EXT
 5  #endif
 6  
 7  #ifdef DOUBLE_MANIFOLD
 8  #  ifdef USE_INVOC_EXT
 9  #    define invoc_len 2
10  #  else
11  #    define vert_len 8
12  #  endif
13  #else
14  #  ifdef USE_INVOC_EXT
15  #    define invoc_len 1
16  #  else
17  #    define vert_len 4
18  #  endif
19  #endif
20  
21  #ifdef USE_INVOC_EXT
22  layout(lines_adjacency, invocations = invoc_len) in;
23  layout(triangle_strip, max_vertices = 4) out;
24  #else
25  layout(lines_adjacency) in;
26  layout(triangle_strip, max_vertices = vert_len) out;
27  #endif
28  
29  uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57);
30  
31  in VertexData {
32  	vec3 pos;           /* local position */
33  	vec4 frontPosition; /* final ndc position */
34  	vec4 backPosition;
35  } vData[];
36  
37  #define DEGENERATE_THRESHOLD 1e-12
38  
39  #define len_sqr(a) dot(a, a)
40  
41  void extrude_edge(bool invert)
42  {
43  	/* Reverse order if backfacing the light. */
44  	ivec2 idx = (invert) ? ivec2(1, 2) : ivec2(2, 1);
45  	gl_Position = vData[idx.x].frontPosition; EmitVertex();
46  	gl_Position = vData[idx.y].frontPosition; EmitVertex();
47  	gl_Position = vData[idx.x].backPosition; EmitVertex();
48  	gl_Position = vData[idx.y].backPosition; EmitVertex();
49  	EndPrimitive();
50  }
51  
52  void main()
53  {
54  	vec3 v10 = vData[0].pos - vData[1].pos;
55  	vec3 v12 = vData[2].pos - vData[1].pos;
56  	vec3 v13 = vData[3].pos - vData[1].pos;
57  
58  #ifdef DEGENERATE_THRESHOLD
59  	vec3 v20 = vData[0].pos - vData[2].pos;
60  	vec3 v23 = vData[3].pos - vData[2].pos;
61  
62  	vec4 edges_lensqr = vec4(len_sqr(v10), len_sqr(v13), len_sqr(v20), len_sqr(v23));
63  	bvec4 degen_edges = lessThan(edges_lensqr, vec4(DEGENERATE_THRESHOLD));
64  
65  	/* Both triangles are degenerate, abort. */
66  	if (any(degen_edges.xz) && any(degen_edges.yw))
67  		return;
68  #endif
69  
70  	vec3 n1 = cross(v12, v10);
71  	vec3 n2 = cross(v13, v12);
72  	vec2 facing = vec2(dot(n1, lightDirection),
73  	                   dot(n2, lightDirection));
74  
75  	/* WATCH: maybe unpredictable in some cases. */
76  	bool is_manifold = any(notEqual(vData[0].pos, vData[3].pos));
77  
78  	bvec2 backface = greaterThan(facing, vec2(0.0));
79  
80  #ifdef DEGENERATE_THRESHOLD
81  #  ifndef DOUBLE_MANIFOLD
82  	/* If the mesh is known to be manifold and we don't use double count,
83  	 * only create an quad if the we encounter a facing geom. */
84  	if ((any(degen_edges.xz) && backface.y) ||
85  		(any(degen_edges.yw) && backface.x))
86  		return;
87  #  endif
88  
89  	/* If one of the 2 triangles is degenerate, replace edge by a non-manifold one. */
90  	backface.x = (any(degen_edges.xz)) ? !backface.y : backface.x;
91  	backface.y = (any(degen_edges.yw)) ? !backface.x : backface.y;
92  	is_manifold = (any(degen_edges)) ? false : is_manifold;
93  #endif
94  
95  	/* If both faces face the same direction it's not an outline edge. */
96  	if (backface.x == backface.y)
97  		return;
98  
99  #ifdef USE_INVOC_EXT
100  	if (gl_InvocationID == 0) {
101  		extrude_edge(backface.x);
102  	}
103  	else if (is_manifold) {
104  #  ifdef DOUBLE_MANIFOLD
105  		/* Increment/Decrement twice for manifold edges. */
106  		extrude_edge(backface.x);
107  #  endif
108  	}
109  #else
110  	extrude_edge(backface.x);
111  	if (is_manifold) {
112  #  ifdef DOUBLE_MANIFOLD
113  		/* Increment/Decrement twice for manifold edges. */
114  		extrude_edge(backface.x);
115  #  endif
116  	}
117  #endif
118  }
ERROR: Too many geometry shader invocations

GPUShader: linking error:
===== shader string 1 ====
 1  
 2  void main()
 3  {
 4  	// no color output, only depth (line below is implicit)
 5  	// gl_FragDepth = gl_FragCoord.z;
 6  }
ERROR: Too many geometry shader invocations

GPUShader: linking error:
===== shader string 1 ====
 1  #define INFINITE 1000.0
 2  
 3  uniform mat4 ModelViewProjectionMatrix;
 4  
 5  uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57);
 6  uniform float lightDistance = 1e4;
 7  
 8  in vec3 pos;
 9  
10  out VertexData {
11  	vec3 pos;           /* local position */
12  	vec4 frontPosition; /* final ndc position */
13  	vec4 backPosition;
14  } vData;
15  
16  void main()
17  {
18  	vData.pos = pos;
19  	vData.frontPosition = ModelViewProjectionMatrix * vec4(pos, 1.0);
20  	vData.backPosition  = ModelViewProjectionMatrix * vec4(pos + lightDirection * lightDistance, 1.0);
21  }
ERROR: Too many geometry shader invocations

GPUShader: linking error:
===== shader string 1 ====
 1  #extension GL_ARB_gpu_shader5 : enable
 2  
 3  #ifdef GL_ARB_gpu_shader5
 4  #define USE_INVOC_EXT
 5  #endif
 6  
 7  #ifdef DOUBLE_MANIFOLD
 8  #  ifdef USE_INVOC_EXT
 9  #    define invoc_len 2
10  #  else
11  #    define vert_len 8
12  #  endif
13  #else
14  #  ifdef USE_INVOC_EXT
15  #    define invoc_len 1
16  #  else
17  #    define vert_len 4
18  #  endif
19  #endif
20  
21  #ifdef USE_INVOC_EXT
22  layout(lines_adjacency, invocations = invoc_len) in;
23  layout(triangle_strip, max_vertices = 4) out;
24  #else
25  layout(lines_adjacency) in;
26  layout(triangle_strip, max_vertices = vert_len) out;
27  #endif
28  
29  uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57);
30  
31  in VertexData {
32  	vec3 pos;           /* local position */
33  	vec4 frontPosition; /* final ndc position */
34  	vec4 backPosition;
35  } vData[];
36  
37  #define DEGENERATE_THRESHOLD 1e-12
38  
39  #define len_sqr(a) dot(a, a)
40  
41  void extrude_edge(bool invert)
42  {
43  	/* Reverse order if backfacing the light. */
44  	ivec2 idx = (invert) ? ivec2(1, 2) : ivec2(2, 1);
45  	gl_Position = vData[idx.x].frontPosition; EmitVertex();
46  	gl_Position = vData[idx.y].frontPosition; EmitVertex();
47  	gl_Position = vData[idx.x].backPosition; EmitVertex();
48  	gl_Position = vData[idx.y].backPosition; EmitVertex();
49  	EndPrimitive();
50  }
51  
52  void main()
53  {
54  	vec3 v10 = vData[0].pos - vData[1].pos;
55  	vec3 v12 = vData[2].pos - vData[1].pos;
56  	vec3 v13 = vData[3].pos - vData[1].pos;
57  
58  #ifdef DEGENERATE_THRESHOLD
59  	vec3 v20 = vData[0].pos - vData[2].pos;
60  	vec3 v23 = vData[3].pos - vData[2].pos;
61  
62  	vec4 edges_lensqr = vec4(len_sqr(v10), len_sqr(v13), len_sqr(v20), len_sqr(v23));
63  	bvec4 degen_edges = lessThan(edges_lensqr, vec4(DEGENERATE_THRESHOLD));
64  
65  	/* Both triangles are degenerate, abort. */
66  	if (any(degen_edges.xz) && any(degen_edges.yw))
67  		return;
68  #endif
69  
70  	vec3 n1 = cross(v12, v10);
71  	vec3 n2 = cross(v13, v12);
72  	vec2 facing = vec2(dot(n1, lightDirection),
73  	                   dot(n2, lightDirection));
74  
75  	/* WATCH: maybe unpredictable in some cases. */
76  	bool is_manifold = any(notEqual(vData[0].pos, vData[3].pos));
77  
78  	bvec2 backface = greaterThan(facing, vec2(0.0));
79  
80  #ifdef DEGENERATE_THRESHOLD
81  #  ifndef DOUBLE_MANIFOLD
82  	/* If the mesh is known to be manifold and we don't use double count,
83  	 * only create an quad if the we encounter a facing geom. */
84  	if ((any(degen_edges.xz) && backface.y) ||
85  		(any(degen_edges.yw) && backface.x))
86  		return;
87  #  endif
88  
89  	/* If one of the 2 triangles is degenerate, replace edge by a non-manifold one. */
90  	backface.x = (any(degen_edges.xz)) ? !backface.y : backface.x;
91  	backface.y = (any(degen_edges.yw)) ? !backface.x : backface.y;
92  	is_manifold = (any(degen_edges)) ? false : is_manifold;
93  #endif
94  
95  	/* If both faces face the same direction it's not an outline edge. */
96  	if (backface.x == backface.y)
97  		return;
98  
99  #ifdef USE_INVOC_EXT
100  	if (gl_InvocationID == 0) {
101  		extrude_edge(backface.x);
102  	}
103  	else if (is_manifold) {
104  #  ifdef DOUBLE_MANIFOLD
105  		/* Increment/Decrement twice for manifold edges. */
106  		extrude_edge(backface.x);
107  #  endif
108  	}
109  #else
110  	extrude_edge(backface.x);
111  	if (is_manifold) {
112  #  ifdef DOUBLE_MANIFOLD
113  		/* Increment/Decrement twice for manifold edges. */
114  		extrude_edge(backface.x);
115  #  endif
116  	}
117  #endif
118  }
ERROR: Too many geometry shader invocations

GPUShader: linking error:
===== shader string 1 ====
 1  
 2  void main()
 3  {
 4  	// no color output, only depth (line below is implicit)
 5  	// gl_FragDepth = gl_FragCoord.z;
 6  }
ERROR: Too many geometry shader invocations

GPUShader: linking error:
===== shader string 1 ====
 1  #define INFINITE 1000.0
 2  
 3  uniform mat4 ModelViewProjectionMatrix;
 4  
 5  uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57);
 6  uniform float lightDistance = 1e4;
 7  
 8  in vec3 pos;
 9  
10  out VertexData {
11  	vec3 pos;           /* local position */
12  	vec4 frontPosition; /* final ndc position */
13  	vec4 backPosition;
14  } vData;
15  
16  void main()
17  {
18  	vData.pos = pos;
19  	vData.frontPosition = ModelViewProjectionMatrix * vec4(pos, 1.0);
20  	vData.backPosition  = ModelViewProjectionMatrix * vec4(pos + lightDirection * lightDistance, 1.0);
21  }
ERROR: Too many geometry shader invocations

GPUShader: linking error:
===== shader string 1 ====
 1  #extension GL_ARB_gpu_shader5 : enable
 2  
 3  #ifdef GL_ARB_gpu_shader5
 4  #define USE_INVOC_EXT
 5  #endif
 6  
 7  #ifdef DOUBLE_MANIFOLD
 8  #  ifdef USE_INVOC_EXT
 9  #    define invoc_len 2
10  #  else
11  #    define vert_len 6
12  #  endif
13  #else
14  #  ifdef USE_INVOC_EXT
15  #    define invoc_len 2
16  #  else
17  #    define vert_len 6
18  #  endif
19  #endif
20  
21  #ifdef USE_INVOC_EXT
22  layout(triangles, invocations = invoc_len) in;
23  layout(triangle_strip, max_vertices = 3) out;
24  #else
25  layout(triangles) in;
26  layout(triangle_strip, max_vertices = vert_len) out;
27  #endif
28  
29  uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57);
30  
31  in VertexData {
32  	vec3 pos;           /* local position */
33  	vec4 frontPosition; /* final ndc position */
34  	vec4 backPosition;
35  } vData[];
36  
37  vec4 get_pos(int v, bool backface)
38  {
39  	return (backface) ? vData[v].backPosition : vData[v].frontPosition;
40  }
41  
42  void emit_cap(const bool front, bool reversed)
43  {
44  	if (front) {
45  		gl_Position = vData[0].frontPosition; EmitVertex();
46  		gl_Position = vData[reversed ? 2 : 1].frontPosition; EmitVertex();
47  		gl_Position = vData[reversed ? 1 : 2].frontPosition; EmitVertex();
48  	}
49  	else {
50  		gl_Position = vData[0].backPosition; EmitVertex();
51  		gl_Position = vData[reversed ? 1 : 2].backPosition; EmitVertex();
52  		gl_Position = vData[reversed ? 2 : 1].backPosition; EmitVertex();
53  	}
54  	EndPrimitive();
55  }
56  
57  void main()
58  {
59  	vec3 v10 = vData[0].pos - vData[1].pos;
60  	vec3 v12 = vData[2].pos - vData[1].pos;
61  
62  	vec3 n = cross(v12, v10);
63  	float facing = dot(n, lightDirection);
64  
65  	bool backface = facing > 0.0;
66  
67  #ifdef DOUBLE_MANIFOLD
68  	/* In case of non manifold geom, we only increase/decrease
69  	 * the stencil buffer by one but do every faces as they were facing the light. */
70  	bool invert = backface;
71  #else
72  	const bool invert = false;
73  	if (!backface) {
74  #endif
75  #ifdef USE_INVOC_EXT
76  		bool do_front = (gl_InvocationID & 1) == 0;
77  		emit_cap(do_front, invert);
78  #else
79  		emit_cap(true, invert);
80  		emit_cap(false, invert);
81  #endif
82  #ifndef DOUBLE_MANIFOLD
83  	}
84  #endif
85  }
ERROR: Too many geometry shader invocations

GPUShader: linking error:
===== shader string 1 ====
 1  
 2  void main()
 3  {
 4  	// no color output, only depth (line below is implicit)
 5  	// gl_FragDepth = gl_FragCoord.z;
 6  }
ERROR: Too many geometry shader invocations

GPUShader: linking error:
===== shader string 1 ====
 1  #define INFINITE 1000.0
 2  
 3  uniform mat4 ModelViewProjectionMatrix;
 4  
 5  uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57);
 6  uniform float lightDistance = 1e4;
 7  
 8  in vec3 pos;
 9  
10  out VertexData {
11  	vec3 pos;           /* local position */
12  	vec4 frontPosition; /* final ndc position */
13  	vec4 backPosition;
14  } vData;
15  
16  void main()
17  {
18  	vData.pos = pos;
19  	vData.frontPosition = ModelViewProjectionMatrix * vec4(pos, 1.0);
20  	vData.backPosition  = ModelViewProjectionMatrix * vec4(pos + lightDirection * lightDistance, 1.0);
21  }
ERROR: Too many geometry shader invocations

GPUShader: linking error:
===== shader string 1 ====
 1  #extension GL_ARB_gpu_shader5 : enable
 2  
 3  #ifdef GL_ARB_gpu_shader5
 4  #define USE_INVOC_EXT
 5  #endif
 6  
 7  #ifdef DOUBLE_MANIFOLD
 8  #  ifdef USE_INVOC_EXT
 9  #    define invoc_len 2
10  #  else
11  #    define vert_len 6
12  #  endif
13  #else
14  #  ifdef USE_INVOC_EXT
15  #    define invoc_len 2
16  #  else
17  #    define vert_len 6
18  #  endif
19  #endif
20  
21  #ifdef USE_INVOC_EXT
22  layout(triangles, invocations = invoc_len) in;
23  layout(triangle_strip, max_vertices = 3) out;
24  #else
25  layout(triangles) in;
26  layout(triangle_strip, max_vertices = vert_len) out;
27  #endif
28  
29  uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57);
30  
31  in VertexData {
32  	vec3 pos;           /* local position */
33  	vec4 frontPosition; /* final ndc position */
34  	vec4 backPosition;
35  } vData[];
36  
37  vec4 get_pos(int v, bool backface)
38  {
39  	return (backface) ? vData[v].backPosition : vData[v].frontPosition;
40  }
41  
42  void emit_cap(const bool front, bool reversed)
43  {
44  	if (front) {
45  		gl_Position = vData[0].frontPosition; EmitVertex();
46  		gl_Position = vData[reversed ? 2 : 1].frontPosition; EmitVertex();
47  		gl_Position = vData[reversed ? 1 : 2].frontPosition; EmitVertex();
48  	}
49  	else {
50  		gl_Position = vData[0].backPosition; EmitVertex();
51  		gl_Position = vData[reversed ? 1 : 2].backPosition; EmitVertex();
52  		gl_Position = vData[reversed ? 2 : 1].backPosition; EmitVertex();
53  	}
54  	EndPrimitive();
55  }
56  
57  void main()
58  {
59  	vec3 v10 = vData[0].pos - vData[1].pos;
60  	vec3 v12 = vData[2].pos - vData[1].pos;
61  
62  	vec3 n = cross(v12, v10);
63  	float facing = dot(n, lightDirection);
64  
65  	bool backface = facing > 0.0;
66  
67  #ifdef DOUBLE_MANIFOLD
68  	/* In case of non manifold geom, we only increase/decrease
69  	 * the stencil buffer by one but do every faces as they were facing the light. */
70  	bool invert = backface;
71  #else
72  	const bool invert = false;
73  	if (!backface) {
74  #endif
75  #ifdef USE_INVOC_EXT
76  		bool do_front = (gl_InvocationID & 1) == 0;
77  		emit_cap(do_front, invert);
78  #else
79  		emit_cap(true, invert);
80  		emit_cap(false, invert);
81  #endif
82  #ifndef DOUBLE_MANIFOLD
83  	}
84  #endif
85  }
ERROR: Too many geometry shader invocations

GPUShader: linking error:
===== shader string 1 ====
 1  
 2  void main()
 3  {
 4  	// no color output, only depth (line below is implicit)
 5  	// gl_FragDepth = gl_FragCoord.z;
 6  }
ERROR: Too many geometry shader invocations

``` Nolans-MacBook-Pro% ./blender --debug Switching to fully guarded memory allocator. Blender 2.80 (sub 35) Build: 2018-12-04 01:09:28 Darwin Release argv[0] = ./blender argv[1] = --debug read file /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend Version 280 sub 35 date 2018-11-29 22:54 hash 63c06531707 Read prefs: /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend read file Version 280 sub 24 date unknown hash unknown found bundled python: /Applications/blender28/blender28.app/Contents/Resources/2.80/python Traceback (most recent call last): File "/Applications/blender28/blender28.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 377, in enable raise Exception(f"Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring") Exception: Add-on 'io_scene_gltf2' has not been upgraded to 2.8, ignoring GPUShader: linking error: ===== shader string 1 ==== 1 #define INFINITE 1000.0 2 3 uniform mat4 ModelViewProjectionMatrix; 4 5 uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57); 6 uniform float lightDistance = 1e4; 7 8 in vec3 pos; 9 10 out VertexData { 11 vec3 pos; /* local position */ 12 vec4 frontPosition; /* final ndc position */ 13 vec4 backPosition; 14 } vData; 15 16 void main() 17 { 18 vData.pos = pos; 19 vData.frontPosition = ModelViewProjectionMatrix * vec4(pos, 1.0); 20 vData.backPosition = ModelViewProjectionMatrix * vec4(pos + lightDirection * lightDistance, 1.0); 21 } ERROR: Too many geometry shader invocations GPUShader: linking error: ===== shader string 1 ==== 1 #extension GL_ARB_gpu_shader5 : enable 2 3 #ifdef GL_ARB_gpu_shader5 4 #define USE_INVOC_EXT 5 #endif 6 7 #ifdef DOUBLE_MANIFOLD 8 # ifdef USE_INVOC_EXT 9 # define invoc_len 2 10 # else 11 # define vert_len 8 12 # endif 13 #else 14 # ifdef USE_INVOC_EXT 15 # define invoc_len 1 16 # else 17 # define vert_len 4 18 # endif 19 #endif 20 21 #ifdef USE_INVOC_EXT 22 layout(lines_adjacency, invocations = invoc_len) in; 23 layout(triangle_strip, max_vertices = 4) out; 24 #else 25 layout(lines_adjacency) in; 26 layout(triangle_strip, max_vertices = vert_len) out; 27 #endif 28 29 uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57); 30 31 in VertexData { 32 vec3 pos; /* local position */ 33 vec4 frontPosition; /* final ndc position */ 34 vec4 backPosition; 35 } vData[]; 36 37 #define DEGENERATE_THRESHOLD 1e-12 38 39 #define len_sqr(a) dot(a, a) 40 41 void extrude_edge(bool invert) 42 { 43 /* Reverse order if backfacing the light. */ 44 ivec2 idx = (invert) ? ivec2(1, 2) : ivec2(2, 1); 45 gl_Position = vData[idx.x].frontPosition; EmitVertex(); 46 gl_Position = vData[idx.y].frontPosition; EmitVertex(); 47 gl_Position = vData[idx.x].backPosition; EmitVertex(); 48 gl_Position = vData[idx.y].backPosition; EmitVertex(); 49 EndPrimitive(); 50 } 51 52 void main() 53 { 54 vec3 v10 = vData[0].pos - vData[1].pos; 55 vec3 v12 = vData[2].pos - vData[1].pos; 56 vec3 v13 = vData[3].pos - vData[1].pos; 57 58 #ifdef DEGENERATE_THRESHOLD 59 vec3 v20 = vData[0].pos - vData[2].pos; 60 vec3 v23 = vData[3].pos - vData[2].pos; 61 62 vec4 edges_lensqr = vec4(len_sqr(v10), len_sqr(v13), len_sqr(v20), len_sqr(v23)); 63 bvec4 degen_edges = lessThan(edges_lensqr, vec4(DEGENERATE_THRESHOLD)); 64 65 /* Both triangles are degenerate, abort. */ 66 if (any(degen_edges.xz) && any(degen_edges.yw)) 67 return; 68 #endif 69 70 vec3 n1 = cross(v12, v10); 71 vec3 n2 = cross(v13, v12); 72 vec2 facing = vec2(dot(n1, lightDirection), 73 dot(n2, lightDirection)); 74 75 /* WATCH: maybe unpredictable in some cases. */ 76 bool is_manifold = any(notEqual(vData[0].pos, vData[3].pos)); 77 78 bvec2 backface = greaterThan(facing, vec2(0.0)); 79 80 #ifdef DEGENERATE_THRESHOLD 81 # ifndef DOUBLE_MANIFOLD 82 /* If the mesh is known to be manifold and we don't use double count, 83 * only create an quad if the we encounter a facing geom. */ 84 if ((any(degen_edges.xz) && backface.y) || 85 (any(degen_edges.yw) && backface.x)) 86 return; 87 # endif 88 89 /* If one of the 2 triangles is degenerate, replace edge by a non-manifold one. */ 90 backface.x = (any(degen_edges.xz)) ? !backface.y : backface.x; 91 backface.y = (any(degen_edges.yw)) ? !backface.x : backface.y; 92 is_manifold = (any(degen_edges)) ? false : is_manifold; 93 #endif 94 95 /* If both faces face the same direction it's not an outline edge. */ 96 if (backface.x == backface.y) 97 return; 98 99 #ifdef USE_INVOC_EXT 100 if (gl_InvocationID == 0) { 101 extrude_edge(backface.x); 102 } 103 else if (is_manifold) { 104 # ifdef DOUBLE_MANIFOLD 105 /* Increment/Decrement twice for manifold edges. */ 106 extrude_edge(backface.x); 107 # endif 108 } 109 #else 110 extrude_edge(backface.x); 111 if (is_manifold) { 112 # ifdef DOUBLE_MANIFOLD 113 /* Increment/Decrement twice for manifold edges. */ 114 extrude_edge(backface.x); 115 # endif 116 } 117 #endif 118 } ERROR: Too many geometry shader invocations GPUShader: linking error: ===== shader string 1 ==== 1 2 void main() 3 { 4 // no color output, only depth (line below is implicit) 5 // gl_FragDepth = gl_FragCoord.z; 6 } ERROR: Too many geometry shader invocations GPUShader: linking error: ===== shader string 1 ==== 1 #define INFINITE 1000.0 2 3 uniform mat4 ModelViewProjectionMatrix; 4 5 uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57); 6 uniform float lightDistance = 1e4; 7 8 in vec3 pos; 9 10 out VertexData { 11 vec3 pos; /* local position */ 12 vec4 frontPosition; /* final ndc position */ 13 vec4 backPosition; 14 } vData; 15 16 void main() 17 { 18 vData.pos = pos; 19 vData.frontPosition = ModelViewProjectionMatrix * vec4(pos, 1.0); 20 vData.backPosition = ModelViewProjectionMatrix * vec4(pos + lightDirection * lightDistance, 1.0); 21 } ERROR: Too many geometry shader invocations GPUShader: linking error: ===== shader string 1 ==== 1 #extension GL_ARB_gpu_shader5 : enable 2 3 #ifdef GL_ARB_gpu_shader5 4 #define USE_INVOC_EXT 5 #endif 6 7 #ifdef DOUBLE_MANIFOLD 8 # ifdef USE_INVOC_EXT 9 # define invoc_len 2 10 # else 11 # define vert_len 8 12 # endif 13 #else 14 # ifdef USE_INVOC_EXT 15 # define invoc_len 1 16 # else 17 # define vert_len 4 18 # endif 19 #endif 20 21 #ifdef USE_INVOC_EXT 22 layout(lines_adjacency, invocations = invoc_len) in; 23 layout(triangle_strip, max_vertices = 4) out; 24 #else 25 layout(lines_adjacency) in; 26 layout(triangle_strip, max_vertices = vert_len) out; 27 #endif 28 29 uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57); 30 31 in VertexData { 32 vec3 pos; /* local position */ 33 vec4 frontPosition; /* final ndc position */ 34 vec4 backPosition; 35 } vData[]; 36 37 #define DEGENERATE_THRESHOLD 1e-12 38 39 #define len_sqr(a) dot(a, a) 40 41 void extrude_edge(bool invert) 42 { 43 /* Reverse order if backfacing the light. */ 44 ivec2 idx = (invert) ? ivec2(1, 2) : ivec2(2, 1); 45 gl_Position = vData[idx.x].frontPosition; EmitVertex(); 46 gl_Position = vData[idx.y].frontPosition; EmitVertex(); 47 gl_Position = vData[idx.x].backPosition; EmitVertex(); 48 gl_Position = vData[idx.y].backPosition; EmitVertex(); 49 EndPrimitive(); 50 } 51 52 void main() 53 { 54 vec3 v10 = vData[0].pos - vData[1].pos; 55 vec3 v12 = vData[2].pos - vData[1].pos; 56 vec3 v13 = vData[3].pos - vData[1].pos; 57 58 #ifdef DEGENERATE_THRESHOLD 59 vec3 v20 = vData[0].pos - vData[2].pos; 60 vec3 v23 = vData[3].pos - vData[2].pos; 61 62 vec4 edges_lensqr = vec4(len_sqr(v10), len_sqr(v13), len_sqr(v20), len_sqr(v23)); 63 bvec4 degen_edges = lessThan(edges_lensqr, vec4(DEGENERATE_THRESHOLD)); 64 65 /* Both triangles are degenerate, abort. */ 66 if (any(degen_edges.xz) && any(degen_edges.yw)) 67 return; 68 #endif 69 70 vec3 n1 = cross(v12, v10); 71 vec3 n2 = cross(v13, v12); 72 vec2 facing = vec2(dot(n1, lightDirection), 73 dot(n2, lightDirection)); 74 75 /* WATCH: maybe unpredictable in some cases. */ 76 bool is_manifold = any(notEqual(vData[0].pos, vData[3].pos)); 77 78 bvec2 backface = greaterThan(facing, vec2(0.0)); 79 80 #ifdef DEGENERATE_THRESHOLD 81 # ifndef DOUBLE_MANIFOLD 82 /* If the mesh is known to be manifold and we don't use double count, 83 * only create an quad if the we encounter a facing geom. */ 84 if ((any(degen_edges.xz) && backface.y) || 85 (any(degen_edges.yw) && backface.x)) 86 return; 87 # endif 88 89 /* If one of the 2 triangles is degenerate, replace edge by a non-manifold one. */ 90 backface.x = (any(degen_edges.xz)) ? !backface.y : backface.x; 91 backface.y = (any(degen_edges.yw)) ? !backface.x : backface.y; 92 is_manifold = (any(degen_edges)) ? false : is_manifold; 93 #endif 94 95 /* If both faces face the same direction it's not an outline edge. */ 96 if (backface.x == backface.y) 97 return; 98 99 #ifdef USE_INVOC_EXT 100 if (gl_InvocationID == 0) { 101 extrude_edge(backface.x); 102 } 103 else if (is_manifold) { 104 # ifdef DOUBLE_MANIFOLD 105 /* Increment/Decrement twice for manifold edges. */ 106 extrude_edge(backface.x); 107 # endif 108 } 109 #else 110 extrude_edge(backface.x); 111 if (is_manifold) { 112 # ifdef DOUBLE_MANIFOLD 113 /* Increment/Decrement twice for manifold edges. */ 114 extrude_edge(backface.x); 115 # endif 116 } 117 #endif 118 } ERROR: Too many geometry shader invocations GPUShader: linking error: ===== shader string 1 ==== 1 2 void main() 3 { 4 // no color output, only depth (line below is implicit) 5 // gl_FragDepth = gl_FragCoord.z; 6 } ERROR: Too many geometry shader invocations GPUShader: linking error: ===== shader string 1 ==== 1 #define INFINITE 1000.0 2 3 uniform mat4 ModelViewProjectionMatrix; 4 5 uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57); 6 uniform float lightDistance = 1e4; 7 8 in vec3 pos; 9 10 out VertexData { 11 vec3 pos; /* local position */ 12 vec4 frontPosition; /* final ndc position */ 13 vec4 backPosition; 14 } vData; 15 16 void main() 17 { 18 vData.pos = pos; 19 vData.frontPosition = ModelViewProjectionMatrix * vec4(pos, 1.0); 20 vData.backPosition = ModelViewProjectionMatrix * vec4(pos + lightDirection * lightDistance, 1.0); 21 } ERROR: Too many geometry shader invocations GPUShader: linking error: ===== shader string 1 ==== 1 #extension GL_ARB_gpu_shader5 : enable 2 3 #ifdef GL_ARB_gpu_shader5 4 #define USE_INVOC_EXT 5 #endif 6 7 #ifdef DOUBLE_MANIFOLD 8 # ifdef USE_INVOC_EXT 9 # define invoc_len 2 10 # else 11 # define vert_len 6 12 # endif 13 #else 14 # ifdef USE_INVOC_EXT 15 # define invoc_len 2 16 # else 17 # define vert_len 6 18 # endif 19 #endif 20 21 #ifdef USE_INVOC_EXT 22 layout(triangles, invocations = invoc_len) in; 23 layout(triangle_strip, max_vertices = 3) out; 24 #else 25 layout(triangles) in; 26 layout(triangle_strip, max_vertices = vert_len) out; 27 #endif 28 29 uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57); 30 31 in VertexData { 32 vec3 pos; /* local position */ 33 vec4 frontPosition; /* final ndc position */ 34 vec4 backPosition; 35 } vData[]; 36 37 vec4 get_pos(int v, bool backface) 38 { 39 return (backface) ? vData[v].backPosition : vData[v].frontPosition; 40 } 41 42 void emit_cap(const bool front, bool reversed) 43 { 44 if (front) { 45 gl_Position = vData[0].frontPosition; EmitVertex(); 46 gl_Position = vData[reversed ? 2 : 1].frontPosition; EmitVertex(); 47 gl_Position = vData[reversed ? 1 : 2].frontPosition; EmitVertex(); 48 } 49 else { 50 gl_Position = vData[0].backPosition; EmitVertex(); 51 gl_Position = vData[reversed ? 1 : 2].backPosition; EmitVertex(); 52 gl_Position = vData[reversed ? 2 : 1].backPosition; EmitVertex(); 53 } 54 EndPrimitive(); 55 } 56 57 void main() 58 { 59 vec3 v10 = vData[0].pos - vData[1].pos; 60 vec3 v12 = vData[2].pos - vData[1].pos; 61 62 vec3 n = cross(v12, v10); 63 float facing = dot(n, lightDirection); 64 65 bool backface = facing > 0.0; 66 67 #ifdef DOUBLE_MANIFOLD 68 /* In case of non manifold geom, we only increase/decrease 69 * the stencil buffer by one but do every faces as they were facing the light. */ 70 bool invert = backface; 71 #else 72 const bool invert = false; 73 if (!backface) { 74 #endif 75 #ifdef USE_INVOC_EXT 76 bool do_front = (gl_InvocationID & 1) == 0; 77 emit_cap(do_front, invert); 78 #else 79 emit_cap(true, invert); 80 emit_cap(false, invert); 81 #endif 82 #ifndef DOUBLE_MANIFOLD 83 } 84 #endif 85 } ERROR: Too many geometry shader invocations GPUShader: linking error: ===== shader string 1 ==== 1 2 void main() 3 { 4 // no color output, only depth (line below is implicit) 5 // gl_FragDepth = gl_FragCoord.z; 6 } ERROR: Too many geometry shader invocations GPUShader: linking error: ===== shader string 1 ==== 1 #define INFINITE 1000.0 2 3 uniform mat4 ModelViewProjectionMatrix; 4 5 uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57); 6 uniform float lightDistance = 1e4; 7 8 in vec3 pos; 9 10 out VertexData { 11 vec3 pos; /* local position */ 12 vec4 frontPosition; /* final ndc position */ 13 vec4 backPosition; 14 } vData; 15 16 void main() 17 { 18 vData.pos = pos; 19 vData.frontPosition = ModelViewProjectionMatrix * vec4(pos, 1.0); 20 vData.backPosition = ModelViewProjectionMatrix * vec4(pos + lightDirection * lightDistance, 1.0); 21 } ERROR: Too many geometry shader invocations GPUShader: linking error: ===== shader string 1 ==== 1 #extension GL_ARB_gpu_shader5 : enable 2 3 #ifdef GL_ARB_gpu_shader5 4 #define USE_INVOC_EXT 5 #endif 6 7 #ifdef DOUBLE_MANIFOLD 8 # ifdef USE_INVOC_EXT 9 # define invoc_len 2 10 # else 11 # define vert_len 6 12 # endif 13 #else 14 # ifdef USE_INVOC_EXT 15 # define invoc_len 2 16 # else 17 # define vert_len 6 18 # endif 19 #endif 20 21 #ifdef USE_INVOC_EXT 22 layout(triangles, invocations = invoc_len) in; 23 layout(triangle_strip, max_vertices = 3) out; 24 #else 25 layout(triangles) in; 26 layout(triangle_strip, max_vertices = vert_len) out; 27 #endif 28 29 uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57); 30 31 in VertexData { 32 vec3 pos; /* local position */ 33 vec4 frontPosition; /* final ndc position */ 34 vec4 backPosition; 35 } vData[]; 36 37 vec4 get_pos(int v, bool backface) 38 { 39 return (backface) ? vData[v].backPosition : vData[v].frontPosition; 40 } 41 42 void emit_cap(const bool front, bool reversed) 43 { 44 if (front) { 45 gl_Position = vData[0].frontPosition; EmitVertex(); 46 gl_Position = vData[reversed ? 2 : 1].frontPosition; EmitVertex(); 47 gl_Position = vData[reversed ? 1 : 2].frontPosition; EmitVertex(); 48 } 49 else { 50 gl_Position = vData[0].backPosition; EmitVertex(); 51 gl_Position = vData[reversed ? 1 : 2].backPosition; EmitVertex(); 52 gl_Position = vData[reversed ? 2 : 1].backPosition; EmitVertex(); 53 } 54 EndPrimitive(); 55 } 56 57 void main() 58 { 59 vec3 v10 = vData[0].pos - vData[1].pos; 60 vec3 v12 = vData[2].pos - vData[1].pos; 61 62 vec3 n = cross(v12, v10); 63 float facing = dot(n, lightDirection); 64 65 bool backface = facing > 0.0; 66 67 #ifdef DOUBLE_MANIFOLD 68 /* In case of non manifold geom, we only increase/decrease 69 * the stencil buffer by one but do every faces as they were facing the light. */ 70 bool invert = backface; 71 #else 72 const bool invert = false; 73 if (!backface) { 74 #endif 75 #ifdef USE_INVOC_EXT 76 bool do_front = (gl_InvocationID & 1) == 0; 77 emit_cap(do_front, invert); 78 #else 79 emit_cap(true, invert); 80 emit_cap(false, invert); 81 #endif 82 #ifndef DOUBLE_MANIFOLD 83 } 84 #endif 85 } ERROR: Too many geometry shader invocations GPUShader: linking error: ===== shader string 1 ==== 1 2 void main() 3 { 4 // no color output, only depth (line below is implicit) 5 // gl_FragDepth = gl_FragCoord.z; 6 } ERROR: Too many geometry shader invocations ```
Author

Building from source now. I'll report back when it's done.

Building from source now. I'll report back when it's done.
Author
Nolans-MacBook-Pro% ./blender --debug-gpu-force-workarounds
Read prefs: /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend

GPU: Bypassing workaround detection.
GPU: OpenGL indentification strings
GPU: vendor: Intel Inc.
GPU: renderer: Intel HD Graphics 3000 OpenGL Engine
GPU: version: 3.3 INTEL-10.4.14

found bundled python: /Users/nbaker/Projects/build_darwin/bin/blender.app/Contents/Resources/2.80/python
Traceback (most recent call last):
  File "/Users/nbaker/Projects/build_darwin/bin/blender.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 377, in enable
    raise Exception(f"Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring")
Exception: Add-on 'io_scene_gltf2' has not been upgraded to 2.8, ignoring
GPUShader: linking error:
ERROR: Too many geometry shader invocations

GPUShader: linking error:
ERROR: Too many geometry shader invocations

GPUShader: linking error:
ERROR: Too many geometry shader invocations

``` Nolans-MacBook-Pro% ./blender --debug-gpu-force-workarounds Read prefs: /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend GPU: Bypassing workaround detection. GPU: OpenGL indentification strings GPU: vendor: Intel Inc. GPU: renderer: Intel HD Graphics 3000 OpenGL Engine GPU: version: 3.3 INTEL-10.4.14 found bundled python: /Users/nbaker/Projects/build_darwin/bin/blender.app/Contents/Resources/2.80/python Traceback (most recent call last): File "/Users/nbaker/Projects/build_darwin/bin/blender.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 377, in enable raise Exception(f"Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring") Exception: Add-on 'io_scene_gltf2' has not been upgraded to 2.8, ignoring GPUShader: linking error: ERROR: Too many geometry shader invocations GPUShader: linking error: ERROR: Too many geometry shader invocations GPUShader: linking error: ERROR: Too many geometry shader invocations ```
Author

Still no dice even with "--debug-gpu-force-workarounds". Getting myself familiar with the codebase. I'll do my best to debug.

Still no dice even with "--debug-gpu-force-workarounds". Getting myself familiar with the codebase. I'll do my best to debug.

Ha! you are building from source! perfect. Can you test P866 and tell me if it fixes the error?

EDIT: Also prefer adding output log as attachement file instead of copy/pasting them.

Ha! you are building from source! perfect. Can you test [P866](https://archive.blender.org/developer/P866.txt) and tell me if it fixes the error? EDIT: Also prefer adding output log as attachement file instead of copy/pasting them.
Author

patchApplied.txt

Negative. Problem persists. The attached log shows all of the steps I took in applying the patch and building as well as the output from running it with the --debug flag turned on.

[patchApplied.txt](https://archive.blender.org/developer/F5902074/patchApplied.txt) Negative. Problem persists. The attached log shows all of the steps I took in applying the patch and building as well as the output from running it with the --debug flag turned on.

@nolan.lee.baker Can you try commenting all ocurences of #define USE_INVOC_EXT?

@nolan.lee.baker Can you try commenting all ocurences of `#define USE_INVOC_EXT`?
Author

Still no dice.

Still no dice.
Author

All of the "ERROR: Too many geometry shader invocations" messages are gone though:

Nolans-MacBook-Pro% /Users/nbaker/Projects/build_darwin/bin/blender.app/Contents/MacOS/blender --debug
Switching to fully guarded memory allocator.
Blender 2.80 (sub 36)
Build: 2018-12-10 16:56:14 Darwin Release
argv[0] = /Users/nbaker/Projects/build_darwin/bin/blender.app/Contents/MacOS/blender
argv[1] = --debug
read file /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend
  Version 280 sub 35 date 2018-11-29 22:54 hash 63c06531707
Read prefs: /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend
read file 
  Version 280 sub 24 date unknown hash unknown
found bundled python: /Users/nbaker/Projects/build_darwin/bin/blender.app/Contents/Resources/2.80/python
Traceback (most recent call last):
  File "/Users/nbaker/Projects/build_darwin/bin/blender.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 377, in enable
    raise Exception(f"Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring")
Exception: Add-on 'io_scene_gltf2' has not been upgraded to 2.8, ignoring

All of the "ERROR: Too many geometry shader invocations" messages are gone though: ``` Nolans-MacBook-Pro% /Users/nbaker/Projects/build_darwin/bin/blender.app/Contents/MacOS/blender --debug Switching to fully guarded memory allocator. Blender 2.80 (sub 36) Build: 2018-12-10 16:56:14 Darwin Release argv[0] = /Users/nbaker/Projects/build_darwin/bin/blender.app/Contents/MacOS/blender argv[1] = --debug read file /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend Version 280 sub 35 date 2018-11-29 22:54 hash 63c06531707 Read prefs: /Users/nbaker/Library/Application Support/Blender/2.80/config/userpref.blend read file Version 280 sub 24 date unknown hash unknown found bundled python: /Users/nbaker/Projects/build_darwin/bin/blender.app/Contents/Resources/2.80/python Traceback (most recent call last): File "/Users/nbaker/Projects/build_darwin/bin/blender.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 377, in enable raise Exception(f"Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring") Exception: Add-on 'io_scene_gltf2' has not been upgraded to 2.8, ignoring ```

Ok so the error message are gone !

Now for the actual issue: Can you try to apply P867?

Also did you try updating your driver?

Ok so the error message are gone ! Now for the actual issue: Can you try to apply [P867](https://archive.blender.org/developer/P867.txt)? Also did you try updating your driver?
Author

P867output.txt

My drivers are as up to date as they will ever be. Apple end-of-lifed my MacBook a few months ago since it's not Metal compatible card (Intel HD Graphics 3000 512 MB). All I get now are security patches.

Perhaps you could talk me through what you're thinking the issue might be. I've written my fair share of C and GLSL, so I'm sure I can be more useful once I'm somewhat familiar with this codebase.

[P867output.txt](https://archive.blender.org/developer/F5917662/P867output.txt) My drivers are as up to date as they will ever be. Apple end-of-lifed my MacBook a few months ago since it's not Metal compatible card (Intel HD Graphics 3000 512 MB). All I get now are security patches. Perhaps you could talk me through what you're thinking the issue might be. I've written my fair share of C and GLSL, so I'm sure I can be more useful once I'm somewhat familiar with this codebase.

I'm thinking it's an alignment problem. Or somehting unrelated in the shader (we had this issue with other drivers).

You may want to edit the 3 files edited by the patch.

But you did not tell me if the patch did anything.

I'm thinking it's an alignment problem. Or somehting unrelated in the shader (we had this issue with other drivers). You may want to edit the 3 files edited by the patch. But you did not tell me if the patch did anything.
Author

My apologies. The patch has caused no change in behaviour.

My apologies. The patch has caused no change in behaviour.

You may also try to see what does the loose edges shader do.

Just extrude a vertex in edit mode and see if the edge is displayed correctly.

The actual shader that is buggy is combining:

  • edit_mesh_overlay_vert.glsl
  • edit_mesh_overlay_geom_tri.glsl
  • edit_mesh_overlay_frag.glsl

With the following defines:
VERTEX_FACING
VERTEX_SELECTION
EDGE_FIX

You may also try to see what does the loose edges shader do. Just extrude a vertex in edit mode and see if the edge is displayed correctly. The actual shader that is buggy is combining: * edit_mesh_overlay_vert.glsl * edit_mesh_overlay_geom_tri.glsl * edit_mesh_overlay_frag.glsl With the following defines: VERTEX_FACING VERTEX_SELECTION EDGE_FIX
Author

Woo! Making some form of progress:

progress.gif

Commenting out the line 199 - BLI_dynstr_append(ds, "#define VERTEX_FACING\n"); - in edit_mesh_mode.c makes it bearable to edit verts again.

Still poking around. I'll report back when I understand what's going on a little more.

Woo! Making some form of progress: ![progress.gif](https://archive.blender.org/developer/F5923800/progress.gif) Commenting out the line 199 - `BLI_dynstr_append(ds, "#define VERTEX_FACING\n");` - in `edit_mesh_mode.c` makes it bearable to edit verts again. Still poking around. I'll report back when I understand what's going on a little more.
Author

I've narrowed it down to line 147 in edit_mesh_overlay_frag.glsl.

Commenting out the following seems to fix it:
FragColor.rgb = mix(colorEditMeshMiddle.rgb, FragColor.rgb, 1.0 - abs(facing) * 0.4);

From the looks of it, colorEditMeshMiddle is where the broken colors is coming from.

I've narrowed it down to line 147 in `edit_mesh_overlay_frag.glsl`. Commenting out the following seems to fix it: `FragColor.rgb = mix(colorEditMeshMiddle.rgb, FragColor.rgb, 1.0 - abs(facing) * 0.4);` From the looks of it, `colorEditMeshMiddle` is where the broken colors is coming from.

I think it's the use of the "facing" attribute. If you comment this line it gets optimized out.

I think it's the use of the "facing" attribute. If you comment this line it gets optimized out.
Author

Yep, you're right. When I change it to just FragColor.rgb = colorEditMeshMiddle.rgb;, it's just a darker grey color.

Yep, you're right. When I change it to just `FragColor.rgb = colorEditMeshMiddle.rgb;`, it's just a darker grey color.

See if reordering attrib or adding padding to some of the vec3 (changing them to vec4) does fix this.

See if reordering attrib or adding padding to some of the vec3 (changing them to vec4) does fix this.

Added subscribers: @PedroMiranda, @JacquesLucke, @fclem

Added subscribers: @PedroMiranda, @JacquesLucke, @fclem

Captura de Tela 2018-12-12 às 22.14.44 (2).png
Sorry. I'm not a coder. But this appears to be part of the same problem.
In object mode / wireframe, we really suppose to see the triangles, as in the attached png?
Gets really complicated with more complex meshes...

thx again.
Pedro

![Captura de Tela 2018-12-12 às 22.14.44 (2).png](https://archive.blender.org/developer/F5935898/Captura_de_Tela_2018-12-12_a_s_22.14.44__2_.png) Sorry. I'm not a coder. But this appears to be part of the same problem. In object mode / wireframe, we really suppose to see the triangles, as in the attached png? Gets really complicated with more complex meshes... thx again. Pedro

Added subscriber: @Tupac-3

Added subscriber: @Tupac-3

Added subscriber: @rmuller

Added subscriber: @rmuller

@nolan.lee.baker Did you manage to find a fix?

@PedroMiranda No this is not normal but this is unrelated to the edit mode problem so you might want to open a new bug report if this still happens.

@nolan.lee.baker Did you manage to find a fix? @PedroMiranda No this is not normal but this is unrelated to the edit mode problem so you might want to open a new bug report if this still happens.

Added subscribers: @robin.vanee, @GavinScott

Added subscribers: @robin.vanee, @GavinScott

Added subscriber: @blenderhighschool

Added subscriber: @blenderhighschool

SOLVED!
The buggy colors in vertex mode disappeared on the 02-06-2019 release - Hash: 8c87af7440. The OSX also released a security update 2019-001.

SOLVED! The buggy colors in vertex mode disappeared on the 02-06-2019 release - Hash: 8c87af74409a. The OSX also released a security update 2019-001.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Yes we changed how the wires are drawn.

Yes we changed how the wires are drawn.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#58403
No description provided.