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
a month ago
29 days ago
No labels applied.

~adamseraj 30 days ago

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

~egonelbre 30 days ago

I'm not sure what you mean by that.

~eliasnaur 30 days ago

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

~egonelbre 30 days ago

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

64k seems reasonable, 16M less so.

~eliasnaur REPORTED FIXED 30 days ago

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

~eliasnaur FIXED REPORTED 30 days ago

Nevermind, doesn't actually work.

~lrewega referenced this from #131 29 days ago

~lrewega 29 days 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 29 days 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.

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