Page MenuHome

Edge loops crashing blender (exeeding IMM_BUFFER_SIZE)
Closed, ResolvedPublic

Description

Operating system: Windows 10
Graphics card: AMD R9 270

Broken: 2.80
Worked: (optional)

Adding edge loops to cylinder completely crashes after a certain point

Based on the default startup or an attached .blend file (as simple as possible).
Delete the underappreciated default cube
add cylinder
set subdivisions to 500 in the little f9 menu
add edge loops with Ctrl+R and scroll up to increase number until blender just dies.
look at your beautiful desktop

Could not test with the absolutely latest blender because isp is having troubles but some nice people on reddit say they can reproduce it

Attached video shows me demonstrating.

Reddit Thread that started this all: https://www.reddit.com/r/blender/comments/ct4o6o/nice/

Event Timeline

It looks like the vertex buffer limit has been exceeded which triggers an assert inside gpu_immediate.c (debug build)

Bumping to 6mb allows a 500 vertex cylinder to be edge-ring'd 500 times. The operator soft-max for cylinder creation and loop cut and slide are both 500 (gpu_immediate is used to draw the new edge-rings during the interactive portion of the operator while scrolling the mouse). The limit can still be exceeded if the user goes out of their way to exceed the cylinder max (e.g. a 2000 vert cylinder and then mouse-wheeling loop cuts again)

#if TRUST_NO_ONE
  assert(bytes_needed <= IMM_BUFFER_SIZE);
#endif

...
blender.exe!immBegin(GPUPrimType prim_type, unsigned int vertex_len) Line 215	C
blender.exe!EDBM_preselect_edgering_draw(EditMesh_PreSelEdgeRing * psel, const float[4] * matrix) Line 175	C
blender.exe!ringsel_draw(const bContext * UNUSED_C, ARegion * UNUSED_ar, void * arg) Line 105	C
blender.exe!ED_region_draw_cb_draw(const bContext * C, ARegion * ar, int type) Line 279	C
Philipp Oeser (lichtwerk) triaged this task as Confirmed, Low priority.

Can confirm what @Jesse Y (deadpin) said (thx investigating!)

Will raise awareness to @Clément Foucault (fclem) [not sure this should be handled more gracefully, but will put on low prio for now...]

Philipp Oeser (lichtwerk) renamed this task from Edge loops crashing blender to Edge loops crashing blender (exeeding IMM_BUFFER_SIZE).Wed, Aug 21, 10:59 AM

This should be fixed by issuing multiple draw commands if the number of verts is too high.

This is an easy fix for a newcomer so I would leave it to someone else.

@Clément Foucault (fclem) Is making IMM_BUFFER_SIZE stretchable, a better solution or not? I think it fixes this problem very easily with small amount code change.

@Huseyin Karakullukcu (imgeself) If codechange is minimal I think it's a good solution.