Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to 8bit buffers in some or all places #60

Closed
hwhw opened this issue Sep 3, 2013 · 3 comments · Fixed by #249
Closed

Switch to 8bit buffers in some or all places #60

hwhw opened this issue Sep 3, 2013 · 3 comments · Fixed by #249

Comments

@hwhw
Copy link
Member

hwhw commented Sep 3, 2013

Blitbuffers are currently 4bit based. That looked like a good idea since it saves memory (e.g. on the KDX: ~500kB vs. ~1MB for a fullscreen buffer) and resembled the framebuffer's layout.

However, blitting is very slow for a lot of cases (odd source or target X coordinates and rotated or modified buffers, namely). And we lose information that we could use e.g. for contrast/gamma setting, dithering or other occasions. Painting single pixels is awful for the memory cache as well.

My suggestion is to convert a lot of the buffers to 8bpp and to do the final step to 4bpp only when blitting to the framebuffer. I think we could make it interoperable with existing code in KPV.

All our rendering backends generate >=8bpp renderings anyway - the higher memory usage would just be for cached tiles.

@houqp
Copy link
Member

houqp commented Sep 4, 2013

Totally agree with you. I have been wanted to do this for a long time. It will make a code a lot cleaner and easier to maintain.

Sadly, I will be crazily busy for the coming 4 months so probably won't have time to do any serious hacking :(

@hwhw
Copy link
Member Author

hwhw commented Oct 4, 2014

OK, as a first step, font rendering is now 8bpp. And a bit different - the 8bpp grayscale is taken as an alpha value for rendering an arbitrary color. Thus, we don't render a "background" for text, which was of no use anyway, since it was dependent on the "box" size of the glyph. Now we can properly render over any color, image or whatnot.

@houqp
Copy link
Member

houqp commented Oct 4, 2014

nice, the font rendering code seems a lot cleaner now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants