Skip to content

Commit f6b2798

Browse files
fixed a huge buffer upload/download alignment OpenGL unpack/pack state bug, @Crisspl make sure this is not present on criss_android branch!
1 parent 30af492 commit f6b2798

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/Nabla/COpenGLDriver.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ void COpenGLDriver::copyBufferToImage(IGPUBuffer* srcBuffer, IGPUImage* dstImage
14741474
//assert(?);
14751475

14761476
uint32_t pitch = ((it->bufferRowLength ? it->bufferRowLength:it->imageExtent.width)*bpp).getIntegerApprox();
1477-
int32_t alignment = 0x1<<core::min(core::max(core::findLSB(it->bufferOffset),core::findLSB(pitch)),3u);
1477+
int32_t alignment = 0x1<<core::min(core::min(core::findLSB(it->bufferOffset),core::findLSB(pitch)),3u);
14781478
ctx->nextState.pixelUnpack.alignment = alignment;
14791479
ctx->nextState.pixelUnpack.rowLength = it->bufferRowLength;
14801480
ctx->nextState.pixelUnpack.imgHeight = it->bufferImageHeight;
@@ -1568,7 +1568,7 @@ void COpenGLDriver::copyImageToBuffer(IGPUImage* srcImage, IGPUBuffer* dstBuffer
15681568
//assert(?);
15691569

15701570
uint32_t pitch = ((it->bufferRowLength ? it->bufferRowLength:it->imageExtent.width)*bpp).getIntegerApprox();
1571-
int32_t alignment = 0x1<<core::min(core::max(core::findLSB(it->bufferOffset),core::findLSB(pitch)),3u);
1571+
int32_t alignment = 0x1<<core::min(core::min(core::findLSB(it->bufferOffset),core::findLSB(pitch)),3u);
15721572
ctx->nextState.pixelPack.alignment = alignment;
15731573
ctx->nextState.pixelPack.rowLength = it->bufferRowLength;
15741574
ctx->nextState.pixelPack.imgHeight = it->bufferImageHeight;

0 commit comments

Comments
 (0)