-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Introduce IMGUI_USE_BGRA_PACKED_COLOR in imconfig.h. #767
Conversation
Or you could change the vertex shader to do a This will still allow use of memcpy in the backend. |
@ratchetfreak In example application I can, but in engine I have no direct access to shaders. Yet, there may be no shaders at all and renderer may use fixed pipeline. This feature is handy in real world use when control over what you can change is limited. |
@thedmd Have you measure the cost of your RGBA>BGRA conversion loop at the end of the render? Is it actually meaningful? Patch feedback
|
@ocornut No, I did not. I think it is very unlikely my conversion loop will get anywhere close to memcpy performance without committing many hours in utilization of processor extensions. But that is aftermath. What is your opinion? |
My question is have you ever measured the cost of your naive conversion loop? |
No, I didn't. Motivation was to avoid need of doing conversion, not to speed up copying. |
When IMGUI_USE_BGRA_PACKED_COLOR is defined packed color hold in ImU32 use BGRA format instead RGBA.
…RR,GG,BB,AA) format.
PR was recreated due to lost references after changing fork origin. That was not my intention, sorry. |
…ible items for scoring (note that this only work assuming the NavFlattened child window has interactive items). Fixes accidentally hoping into a NavFlattened child. (#767)
…of _NavEnableKeyboard. (ocornut#4023, ocornut#767)
PR adds ability to tell ImGui to generate packed color in BGRA format instead of RGBA.
This change simplify backend implementation by removing need to convert colors in vertex buffer before uploading to engine. For ImGui packing colors differently make no difference and backend can use memcpy().
To change color packing uncomment
#define IMGUI_USE_BGRA_PACKED_COLOR
in imconfig.hWhat changes. Hardcoded bit shifts were replaced by constants like
IM_COL32_R_SHIFT
. Depending ofIMGUI_USE_BGRA_PACKED_COLOR
being defined constants have different values.