Skip to content

Restore GLES support for BGR/ARGB/BGRA/ABGR texture formats via swizzle#2837

Merged
riccardobl merged 3 commits into
masterfrom
copilot/use-texture-swizzle-support
May 29, 2026
Merged

Restore GLES support for BGR/ARGB/BGRA/ABGR texture formats via swizzle#2837
riccardobl merged 3 commits into
masterfrom
copilot/use-texture-swizzle-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 29, 2026

ANGLE GLES no longer exposed several common jME image formats that remain supported on the desktop GL path: BGR8, ARGB8, BGRA8, and ABGR8, including sRGB variants. This change restores those formats on GLES by mapping them to GLES-supported upload formats and applying texture swizzles to preserve channel order.

  • GLES format mappings

    • Add GLES 3 mappings for BGR8, ARGB8, BGRA8, and ABGR8
    • Add matching sRGB mappings for the same formats
    • Use swizzled RGB8 / RGBA8 and SRGB8 / SRGB8_ALPHA8 internal formats instead of desktop-only byte-order upload formats
  • Texture swizzle handling

    • Extend TextureUtil swizzle setup to cover the restored byte-order formats
    • Preserve expected channel semantics after upload on GLES without changing the desktop GL path
  • Focused coverage

    • Update GLImageFormatsTest to assert that GLES 3 now exposes these formats through swizzled mappings in both linear and sRGB paths
// GLES 3 now exposes byte-order formats through swizzled RGB/RGBA uploads.
formatSwiz(formatToGL, Format.BGR8,  GL2.GL_RGB8,    GL.GL_RGB,  GL.GL_UNSIGNED_BYTE, true, false, true);
formatSwiz(formatToGL, Format.ARGB8, GLExt.GL_RGBA8, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, true, false, true);

formatSrgbSwiz(formatToGL, Format.BGR8,  GLExt.GL_SRGB8_EXT,        GL.GL_RGB,  GL.GL_UNSIGNED_BYTE, false, false, true);
formatSrgbSwiz(formatToGL, Format.ARGB8, GLExt.GL_SRGB8_ALPHA8_EXT, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, true,  false, true);

Copilot AI changed the title [WIP] Add texture swizzle support for common GLES formats Restore GLES support for BGR/ARGB/BGRA/ABGR texture formats via swizzle May 29, 2026
Copilot AI requested a review from riccardobl May 29, 2026 10:38
@riccardobl riccardobl marked this pull request as ready for review May 29, 2026 10:49
@yaRnMcDonuts yaRnMcDonuts added this to the v3.10.0 milestone May 29, 2026
@riccardobl riccardobl merged commit 1c2822a into master May 29, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use texture swizzle to implement common unsupported GLES texture format

3 participants