Sign in to follow this  
DirectXFreak

Handling non-power of two screen resolutions with tile based rendering

Recommended Posts

DirectXFreak    166
Greetings,

I'm implementing my own multi-threaded tile-based software rasterizer, and I've come across an interesting issue with handling tiles. According to this article, the Larrabee rasterizer works by dividing the screen buffer into 128x128 tiles (or sometimes 64x64). How do you handle the edges of the screen when normal screen resolutions aren't powers of two?

The solution is that you obviously have to have tiles that aren't power of two for the edges. But take 800x600 as an example, I'd end up having a 32x128 tile on the right edge of the screen. Would you simply use that skewed tile as the edge and not worry about it?

I guess the alternative could be to merge that into the adjacent tile, so then I'd be looking at having 144x128 on the right side. I'm not sure which is better.

I guess Larrabee does its inner tile calculates on 16x16 pixel mini-tiles. In that case, even if they did use some 32x128 tiles, they would still be multiples of 16 so the vector code wouldn't break.

Maybe this isn't even a big deal. I'm just trying to understand the best way to tackle this problem. What do you guys think?

Share this post


Link to post
Share on other sites
TyrianFin    122
Little screen rect check is neaded to skip pixels that are out of screen area.
It`s not ideal sollution, but amount of wasted processing power is minimal.

example:
bucket size = 64 x 64
screen size = 1025 x 1025 (notice that there is one pixel overflow)
buckets area = 17 x 17 buckets (1088 x 1088 pixels)

pixels calculated = 1183744
pixels neaded = 1050625
wasted pixels < 2% (with early exit this can be divided by about 10)

/Tyrian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this