mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-07 19:58:32 +09:00
[Fix] (MG_Backend/DirectGLES): upload shadow mips with UNPACK_ALIGNMENT=1 - shadow rows are tightly packed but uploads ran with alignment 4, shifting every row of non-multiple-of-4-width textures by one pixel (R8 7-wide CTS gradients read back diagonally)
This commit is contained in:
@@ -1405,7 +1405,11 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
m_prevSkipPixels = s_skipPixels;
|
||||
m_prevImageHeight = s_imageHeight;
|
||||
m_prevSkipImages = s_skipImages;
|
||||
Apply(4, 0, 0, 0, 0, 0);
|
||||
// Shadow mip data is tightly packed (ProcessTexturePixelsDataUnpack emits
|
||||
// width * bpp rows with no padding), so uploads must use UNPACK_ALIGNMENT = 1.
|
||||
// Alignment 4 made the driver read e.g. 7-byte R8 rows at an 8-byte stride,
|
||||
// shifting every row of a non-multiple-of-4 upload by one pixel.
|
||||
Apply(1, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
~ScopedDefaultUnpackState() {
|
||||
|
||||
Reference in New Issue
Block a user