dslibris icon indicating copy to clipboard operation
dslibris copied to clipboard

Double-buffered rendering

Open rhaleblian opened this issue 6 years ago • 17 comments

Is your feature request related to a problem? Please describe. Everything flashes all time.

Describe the solution you'd like Don't flash so much.

Describe alternatives you've considered Closing my eyes.

Additional context My eyes already hurt enough, thank you.

rhaleblian avatar Jan 07 '19 21:01 rhaleblian

never had the thing flash on me, DSi, hiya CFW

Merith-TK avatar May 10 '20 22:05 Merith-TK

I haven't seen it in a while either.

rhaleblian avatar May 12 '20 13:05 rhaleblian

@rhaleblian I made a new branch (off of lefty-mode) to work on this.

AdrianGjonca avatar Jul 23 '25 16:07 AdrianGjonca

Good luck. If you can figure out how to attach your branch to this issue, do so; only "Create branch" has worked for me. Maybe if you mention the branch name in the comments?

You saw that we allocate 2 VRAM locations, that probably becomes 4 and we swap pointers or the like and have an explicit swap buffers() kind of call.

An app on a gaming console that doesn't doublebuffer. Embarrassing, really.

rhaleblian avatar Jul 23 '25 16:07 rhaleblian

I haven't seen it in a while either.

I have, but on 3DS it's less janky.

rhaleblian avatar Jul 23 '25 16:07 rhaleblian

only "Create branch" has worked for me

wait, there's a popup right here that seem to work.

rhaleblian avatar Jul 23 '25 16:07 rhaleblian

Image Is this progress? I don't know 🫠

AdrianGjonca avatar Jul 25 '25 12:07 AdrianGjonca

I haven't seen it in a while either.

I have, but on 3DS it's less janky.

Considering I test this on my DS Lite I get to see it clear as day :/

AdrianGjonca avatar Jul 25 '25 12:07 AdrianGjonca

Rn I'm at a stage where half the bottom screen double buffers and the other half flashes black.

AdrianGjonca avatar Jul 25 '25 13:07 AdrianGjonca

Got full screen but it feels sluggish and janky when changing between app modes. @rhaleblian Can you give it a spin and see what you think. I might need to work further on the rendering because I don't feel this is usable yet.

Also I don't even think it is possible to do hardware double buffering on both screens

AdrianGjonca avatar Jul 25 '25 13:07 AdrianGjonca

@rhaleblian I fixed this but I no longer have push access

AdrianGjonca avatar Jul 26 '25 00:07 AdrianGjonca

@rhaleblian Major Update: I have removed the latency completely but the glyphs are a little off. I will investigate it soon but am struggling to merge my fork with the main branch due to the major changes in both our versions.

https://github.com/AdrianGjonca/dslibris/tree/render-rewrite

Image Note how some of the glyphs are rendered strangely. This is still a WIP.

AdrianGjonca avatar Jul 28 '25 17:07 AdrianGjonca

IMO I am investigating how to implement your changes into my version incrementally before I investigate the glyph issues. I'd appreciate if you took a look at my code as well, seeing as you have a better grasp of this then I do (take a look at cache.cpp and cache.h as that's where the bulk of the 'magic' is happening)

AdrianGjonca avatar Jul 28 '25 17:07 AdrianGjonca

No caching should be involved with double buffering. I am changing text rendering so I recommend you do not touch that.

rhaleblian avatar Jul 30 '25 00:07 rhaleblian

No caching should be involved with double buffering. I am changing text rendering so I recommend you do not touch that.

Yes but I began to investigate why the screen was rendering so slow and I noticed it was the slow lookup of the glyph cache. Take a look what I did on my fork on the render-rewrite branch.

Basically you had a hashmap leading to Cache objects which themselves only contained another hashmap. I switched to a single hashmap increasing the speed but causing bugs. Please take a look as the latency is absurdly jarring, especially on OG hardware.

AdrianGjonca avatar Jul 30 '25 10:07 AdrianGjonca

Yes, that is what is slow. Using FreeType's cache, not ours, is the best answer. Let's not conflate this with double buffering, which will never make anything faster here.

rhaleblian avatar Jul 30 '25 16:07 rhaleblian

Moving your comment to the other issue.

rhaleblian avatar Jul 30 '25 16:07 rhaleblian