Skip to content

switch FBO format to GL_RGB8 and remove swizzle#537

Merged
nschimme merged 1 commit into
MUME:masterfrom
nschimme:master
Jun 5, 2026
Merged

switch FBO format to GL_RGB8 and remove swizzle#537
nschimme merged 1 commit into
MUME:masterfrom
nschimme:master

Conversation

@nschimme

@nschimme nschimme commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Change internal texture formats from GL_RGBA8 to GL_RGB8. Eliminating the alpha channel forces sampled textures to implicitly return an alpha of 1.0, ensuring fully opaque window composition under Wayland.

Summary by Sourcery

Switch OpenGL framebuffer object color attachments to RGB8 and rely on implicit alpha of 1.0 for opaque composition under Wayland.

Enhancements:

  • Change resolved and multisampled FBO internal texture formats from RGBA8 to RGB8 for color attachments.
  • Remove texture alpha-channel swizzle configuration in legacy FBO setup now that alpha is implicitly 1.0.

Change internal texture formats from GL_RGBA8 to GL_RGB8. Eliminating
the alpha channel forces sampled textures to implicitly return an
alpha of 1.0, ensuring fully opaque window composition under Wayland.
@sourcery-ai

sourcery-ai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Switches the legacy OpenGL FBO color attachments from RGBA8 to RGB8 and removes the runtime alpha swizzle, relying on the lack of alpha to implicitly yield an alpha of 1.0 for Wayland composition.

Sequence diagram for updated FBO configuration without alpha swizzle

sequenceDiagram
    participant Functions
    participant FBO
    participant QOpenGLFramebufferObject

    Functions->>FBO: configure(physicalViewport, samples)
    FBO->>FBO: resolvedFormat.setInternalTextureFormat(GL_RGB8)
    FBO->>QOpenGLFramebufferObject: QOpenGLFramebufferObject(physicalSize, resolvedFormat)
    alt multisampling_enabled
        FBO->>FBO: msFormat.setInternalTextureFormat(GL_RGB8)
        FBO->>QOpenGLFramebufferObject: QOpenGLFramebufferObject(physicalSize, msFormat)
    end
Loading

File-Level Changes

Change Details Files
Update FBO internal texture format to use RGB8 instead of RGBA8 for both resolved and multisampled framebuffers.
  • Change the resolved framebuffer internal texture format from GL_RGBA8 to GL_RGB8.
  • Change the multisampled framebuffer internal texture format from GL_RGBA8 to GL_RGB8.
src/opengl/legacy/FBO.cpp
Remove post‑configuration texture alpha swizzle logic now made unnecessary by RGB8 format.
  • Delete the conditional WebGL/Wasm‑guarded code that binds the resolved FBO texture and forces GL_TEXTURE_SWIZZLE_A to GL_ONE.
  • Remove the unused include of ConfigConsts-Computed.h from the legacy OpenGL implementation file.
src/opengl/legacy/Legacy.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Since the FBO color attachments no longer have an alpha channel, review any shaders or blending paths that may read or rely on alpha from this buffer and adjust them to assume a constant 1.0 rather than sampling it.
  • If you still target OpenGL ES 2 or other constrained GL implementations, verify that GL_RGB8 is guaranteed color-renderable in your minimum configuration; if not, you may need to retain GL_RGBA8 or use a more widely supported internal format.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since the FBO color attachments no longer have an alpha channel, review any shaders or blending paths that may read or rely on alpha from this buffer and adjust them to assume a constant 1.0 rather than sampling it.
- If you still target OpenGL ES 2 or other constrained GL implementations, verify that GL_RGB8 is guaranteed color-renderable in your minimum configuration; if not, you may need to retain GL_RGBA8 or use a more widely supported internal format.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.69%. Comparing base (3adf38b) to head (fd2abba).

Files with missing lines Patch % Lines
src/opengl/legacy/FBO.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #537   +/-   ##
=======================================
  Coverage   25.69%   25.69%           
=======================================
  Files         521      521           
  Lines       43192    43187    -5     
  Branches     4709     4708    -1     
=======================================
  Hits        11099    11099           
+ Misses      32093    32088    -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nschimme nschimme merged commit e912fbf into MUME:master Jun 5, 2026
20 of 21 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.

1 participant