Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing color order for RGB10A2 on vulkan. #3403

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mtytel
Copy link
Contributor

@mtytel mtytel commented Jan 28, 2025

Not sure why this was flipped but this fixes RGB10A2 frame buffer colors on vulkan.

@bkaradzic
Copy link
Owner

What is wrong with it?

image

@mtytel
Copy link
Contributor Author

mtytel commented Jan 28, 2025

Hmm, ok that example is correct.
But if I change the RGBA32F frame buffers in the 38-bloom example to RGB10A2 format. R and B are flipped.
RGBA32F:
image

RGB10A2:
image

@mtytel
Copy link
Contributor Author

mtytel commented Jan 28, 2025

OK, now this change seems to make both work.

@mtytel
Copy link
Contributor Author

mtytel commented Feb 4, 2025

@bwrsandman Sorry for the ping but I saw you've touched this format/swizzle code before. You mind taking a look?
It looks like the color was only flipped when creating a framebuffer and not a texture and this change makes both work.

@bwrsandman
Copy link
Contributor

bwrsandman commented Feb 5, 2025

I can have a look over the weekend.
What's missing from the 47-pixel format example to repro the bug?

@mtytel
Copy link
Contributor Author

mtytel commented Feb 6, 2025

Thanks!
The bug is when creating frame buffers with createFrameBuffer and 47-pixelformats uses createTexture2D so it works fine there.

To reproduce the bug change this line

, bgfx::TextureFormat::RGBA32F

to use RGB10A2 instead and the colors will change like above (flipping R and B)

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.

3 participants