GL_UNPACK_ALIGNMENTinteger: 1, 2, 4, or 8
https://registry.khronos.org/OpenGL-Refpages/gl4/html/glPixelStore.xhtml
@Override
public void writeToTexture(
final GpuTexture destination,
final ByteBuffer source,
final int mipLevel,
final int depthOrLayer,
final int destX,
final int destY,
final int width,
final int height
) {
int target;
if ((destination.usage() & 16) != 0) {
target = GlConst.CUBEMAP_TARGETS[depthOrLayer % 6];
GL33C.glBindTexture(34067, ((GlTexture)destination).id);
} else {
target = 3553;
GlStateManager._bindTexture(((GlTexture)destination).id);
}
GlStateManager._pixelStore(3314, width);
GlStateManager._pixelStore(3316, 0);
GlStateManager._pixelStore(3315, 0);
GlStateManager._pixelStore(3317, destination.getFormat().componentCount()); // here, byteAlignement() should be used
GlStateManager._texSubImage2D(target, mipLevel, destX, destY, width, height, GlConst.toGlExternalId(destination.getFormat()), 5121, source); // 5121 is hardcoded, should use GlConst toGlType, no?
}
Can confirm. One nit on the report text is the constant is
GL_UNPACK_ALIGNMENT, notGL_PACK_ALIGNMENT. This is an upload path, governed byUNPACK,PACK(0x0D05 / 3333) only applies to reads like glReadPixels. Same 1/2/4/8 constraint either way, so the defect stands unchanged.