Open jamesfAnet opened 1 year ago
might be worth adding these formats to 08-update example
Oh wow, that code is quite idiotic...
I deleted it: https://github.com/bkaradzic/bgfx/commit/27602120e9af88ac36913e94824ed5ba8ec84864
That works. Adding an assert or something might be nice. Now if someone went down this codepath with an RGBA4 it would upload swizzled, but if they provide the mem in createTexture2D it will be correct. See nearly matching bimg::imageConvert calls in TextureD3D11::create.
I am actually using RGBA4 so it was weird to sync latest and see those textures breaking. The fix for me was to just swap to new BGRA4 enum since all my use-cases are greyscale. Seems like that's how the backend actually wants it anyway. Feel free to close this issue if you'd like.
This just need to be re-implemented and tested.
Similar conversion was done in D3D9, there could be an issue there too
@bwrsandman But it doesn't allocate memory per row: https://github.com/bkaradzic/bgfx/blob/9e7aa2d2eff46087d68d801c38d0891d649b63af/src/renderer_d3d9.cpp#L3115-L3141
https://github.com/bkaradzic/bgfx/blob/a855f1cf2dde73dc26346768b032530ca200c1b3/src/renderer_d3d11.cpp#L4818
@bwrsandman
There's a few issues going on with recent changes to TextureD3D11::update
Here's code for reference, with some interleaved comments