Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-225075

Blaze3D, NativeImage, has a wrong GL_UNPACK_ALIGNMENT usage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.16.5, 21w18a, 1.17.1
    • None
    • Plausible
    • (Unassigned)

      For com.mojang.blaze3d.platform.NativeImage.Format.RGB, the number of channels is 3, which is directly passed to glPixelStorei(GL_UNPACK_ALIGNMENT, param), whereas valid range for GL_UNPACK_ALIGNMENT is 1, 2, 4, or 8.

      See glPixelStore

      STBImage reading png files is generally 1 byte-aligned, so pass 1, 2, or 4 for RGBA format is fine.

      Although no usage currently found with Minecraft, I'm hoping it can be fixed to stop mod developers from using it wrongly.

            Unassigned Unassigned
            BloCamLimb Icyllis Milica
            Votes:
            4 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: