Page MenuHome

Edge loops crashing blender (exeeding IMM_BUFFER_SIZE)
Closed, ResolvedPublic


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:

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)

  assert(bytes_needed <= IMM_BUFFER_SIZE);

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) lowered the priority of this task from 90 to Low.Aug 21 2019, 10:59 AM

Can confirm what @Jesse Yurkovich (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).Aug 21 2019, 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.