Backends: DX9: use RGBA texture to avoid conversion if supported #6575
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My application users are Chinese and Japanese, so there are many glyphs and the font atlas texture is large (equal to or more than 2048x2048). Since dear-imgui does not yet support dynamic glyph caching, I also have to dynamically add glyphs and then recreate texture.
Converting 2048x2048 texture takes 16ms on Intel i7-12700h.
In order to shorten the time of application initialization, font size setup, response to DPI scaling, font atlas texture recreate, I think it is necessary to add support for RGBA texture formats (if supported).
Although theoretically DX9 does not support the RGBA format very well, I'm happy to find that there are still many devices support RGBA format, include d3d9on12 device, and d3d9on12 device is everywhere on the Intel 12th Gen or later CPU.