When there are too many rectangles they are not drawn

Reproducer is here: https://github.com/egonelbre/expgio/blob/master/too-many-rects/main.go

My best guess it's hitting some buffer limit for GPU-s. I haven't done any extensive debugging.

Assigned to
11 months ago
28 days ago
No labels applied.

~adamseraj 10 months ago

Are you sure you did not draw the second above the first?

~egonelbre 10 months ago

I'm not sure what you mean by that.

~eliasnaur 10 months ago

It's a z-buffer overflow. gioui.org/commit/5286495 adds a panic a TODO for later.

~egonelbre 10 months ago

Any reason not to switch depth buffer to 24 bits for now?

64k seems reasonable, 16M less so.

~eliasnaur REPORTED FIXED 10 months ago

Found an easy workaround that didn't require 24 bit depth: gioui.org/commit/504664e.

~eliasnaur FIXED REPORTED 10 months ago

Nevermind, doesn't actually work.

~lrewega referenced this from #131 10 months ago

~lrewega 10 months ago

How do we feel about adding an Op to influence z-index? In some cases, the user (or widget or whatever) might know that there is no overlap and be able to skip out on z-index management (e.g. this would solve for the reproducer). It does feel leaky, though.

Alternatively, might there be some way to avoid incrementing the buffer if we can somehow track that the current path doesn't clip with anything else drawn at the current z-index?

Lastly, is there any reason we couldn't simply use ALWAYS for the depth test func and let last-writer-win?

~eliasnaur 10 months ago

An op is definitely too leaky.

I believe this issue is fundamentally fixed when tiled rendering ala Pathfinder is implemented.

I'm open to workarounds in the meantime, but note that the rendering this many rectangles is currently impractically slow.

~pierrec 29 days ago

I am running into this issue as well while drawing a very fine grid (lots of rectangles basically). I dont notice any slowdown up until it crashes.

~egonelbre 29 days ago

For grids, maybe supporting tiling an image would help... it probably could be used in other scenarios as well?

~eliasnaur 29 days ago

Out of curiosity, how does the compute renderer fare? Its general performance doesn't yet match the old renderer, but it doesn't have limits in the number of paths (except for GPU memory).

Use GIORENDERER=forcecompute to enable it.

~pierrec 29 days ago

I get the following error when trying to use the new renderer: gpu: no support for float render targets nor compute

My laptop is recent (with Intel Iris Plus Graphics 1536 Mo) so maybe I am missing something else?

~eliasnaur 28 days ago

Are you running on Linux? The compute renderer only supports Linux and Android right now.

~pierrec 28 days ago

OK, I have tried it on an old Linux laptop and it still crashes, this time with:

i965: Failed to submit batchbuffer: Input/output error

Note. the new renderer was noticeably slower (while going to fullscreen or zooming out to display more grids).

Register here or Log in to comment, or comment via email.