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
3 months ago
3 months ago
No labels applied.

~adamseraj 3 months ago

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

~egonelbre 3 months ago

I'm not sure what you mean by that.

~eliasnaur 3 months ago

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

~egonelbre 3 months ago

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

64k seems reasonable, 16M less so.

~eliasnaur REPORTED FIXED 3 months ago

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

~eliasnaur FIXED REPORTED 3 months ago

Nevermind, doesn't actually work.

~lrewega referenced this from #131 3 months ago

~lrewega 3 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 3 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.

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