fix(renderer): disable window framebuffer alpha#1
Open
ClaudioBo wants to merge 2 commits into
Open
Conversation
aalhendi
requested changes
Jun 15, 2026
aalhendi
left a comment
Collaborator
There was a problem hiding this comment.
We currently use framebuffer alpha as PS1 GPU metadata. The shader writes PS1 mask/STP state into the output alpha channel, and framebuffer readback packs that alpha back into PS1 VRAM bit 15.
Setting SDL_GL_ALPHA_SIZE = 0 can remove that storage from the default framebuffer, which risks breaking mask/STP behavior and framebuffer-feedback effects.
PSX Layout:
rrrrr ggggg bbbbb bit15
// Native:
// when storing:
fragColor.a = ... ? 1.0 : 0.0; // storing bit15 into GL alpha channel
// when renderer copies fb back into emulated psx vram
u8 a = (c >> 31) & 1;
*data_dst++ = r | (g << 5) | (b << 10) | (a << 15); // NOTE(aalhendi): alpha gets packed in bit 15
The safer fix is to separate emulation state from presentation.
We would probably keep PS1 mask/STP alpha in an internal RGBA target, then present an explicitly opaque final image to the SDL window.
Since this issue is compositor dependent, it is a low-priority target.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Disables alpha in the window framebuffer to prevent the compositor from interpreting it as window
transparency.
Tested on
Before
unfixed.mp4
After
fixed.mp4