Implement byte swapping for vertex colors and textures#9400
Conversation
Added a vertex color byte swapper for big-endian systems and adjusted texture creation based on byte order. This allows proper building for PowerPC and other big-endian systems.
|
Hello, If it does, then presumably what's left is only the |
|
(Note that if Please confirm that you can use Please also confirm how you are validating that the texture format is correct, since by default dear imgui doesn't write colors to the texture. |
|
Check what the macro is doing and find the right define combination that does the same for free.
still does have a cost which is unnecessary. |
|
The code in imgui.h only does: #ifndef IM_COL32_R_SHIFT
#ifdef IMGUI_USE_BGRA_PACKED_COLOR
#define IM_COL32_R_SHIFT 16
#define IM_COL32_G_SHIFT 8
#define IM_COL32_B_SHIFT 0
#define IM_COL32_A_SHIFT 24
#define IM_COL32_A_MASK 0xFF000000
#else
#define IM_COL32_R_SHIFT 0
#define IM_COL32_G_SHIFT 8
#define IM_COL32_B_SHIFT 16
#define IM_COL32_A_SHIFT 24
#define IM_COL32_A_MASK 0xFF000000
#endif
#endifSo you should be able to provide all 4+1 defines to do this without any post-processing. I guess you would need: #define IM_COL32_R_SHIFT 24
#define IM_COL32_G_SHIFT 16
#define IM_COL32_B_SHIFT 8
#define IM_COL32_A_SHIFT 0
#define IM_COL32_A_MASK 0x000000FFOnce this is done, there's a possibility that you don't need to change the Note that on low spec hardware like the Wii, if texture memory is scarce you might want to set |
I tried this but it currently can't be made to work because SDL_Renderer doesn't support single channel format, see libsdl-org/SDL#9847. I tried the |



Added a vertex color byte swapper for big-endian systems and adjusted texture creation based on byte order. This allows proper building for PowerPC and other big-endian systems.