I was thinking about a coarse-grained tiling scheme to early reject large areas. I don’t think it makes sense to try to be more fine-grained than that on CPU.
-
-
Agreed. Then it's actually not too far from the tile based region we use in gecko for invalidation, although it is used to split the drawing commands into visible parts rather than provide occlusion information to a command without splitting it. It'd be fun to try the latter.
1 reply 0 retweets 0 likes -
Replying to @nicalsilva @eddyb_r and
Well… sort of? No browser (outside of Gecko/Servo with WR) currently paints opaque primitives in dirty areas front to back. They all give up a ton of perf because of this.
1 reply 0 retweets 0 likes -
IIRC, Gecko paints back to front but has code to exclude occluded parts (that only considers opaque rectangular occluders). I wouldn't be surprised that we can do better than this.
1 reply 0 retweets 0 likes -
Replying to @nicalsilva @eddyb_r and
Oh, interesting. I was thinking about just having a 1-bit array of tiles and using SIMD to quickly set them and check for occlusion. (Actually when I prototyped this, SIMD wasn’t even really necessary.)
1 reply 0 retweets 0 likes -
Replying to @pcwalton @nicalsilva and
Like, if you have 16x16 tiles at 4K, that’s 4 64-bit words per scanline. That fits in one YMM register, so for rectangular regions you load one pattern, do just one test, and bitwise or for update.
1 reply 0 retweets 0 likes -
You'd still paint front to back? How do you handle blended pixels? I suppose they would need depth information if done in a separate pass
1 reply 0 retweets 0 likes -
Replying to @nicalsilva @eddyb_r and
Oh yeah, they would need depth info. Well, we could have a 16-bit integer depth buffer I suppose.
1 reply 0 retweets 0 likes -
Or just 8 bits and put everything that overflows on the blend pass.
1 reply 0 retweets 0 likes -
Replying to @nicalsilva @eddyb_r and
Yeah, that’d work too. In that case, 4k res would be 240x136 tiles, or 32kB. For rectangular areas you’d have 15 XMM registers per scanline, which should all fit without spilling…
1 reply 0 retweets 0 likes
Though at this point maybe it’s just better to do something like what Gecko does. I worry about the complexity though…I have bad memories of the rect splitting code in WR’s old texture bin packer having horrible edge cases where complexity exploded.
-
-
There's only one way to know!
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.