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

Texture format info: Invert R and B in RGBA4 #2878

Merged
merged 3 commits into from
Aug 23, 2022

Conversation

bwrsandman
Copy link
Contributor

d3d9: Revert 06c08ad to force software
conversion because the format doesn't exist
d3d11: Force software conversion because the format doesn't exist
gl: Revert 3e3e655 to swizzle R and B
mtl: Swizzle channels

Removed software conversion in metal for RGBA4 and RGB5A1.
Fix alpha in RGB5A1

Tested in metal:
Screen Shot 2022-08-22 at 9 27 47 PM
Screen Shot 2022-08-22 at 9 27 55 PM

d3d9: Revert 06c08ad to force software
      conversion because the format doesn't exist
d3d11: Force software conversion because the format doesn't exist
gl: Revert 3e3e655 to swizzle R and B
mtl: Swizzle channels
@bwrsandman bwrsandman requested a review from bkaradzic as a code owner August 23, 2022 01:31
@bkaradzic bkaradzic merged commit 054a9ec into bkaradzic:master Aug 23, 2022
@bkaradzic
Copy link
Owner

This is incorrect:

{ MTLPixelFormatBGR5A1Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $A, $R, $G, $B }, true }, // RGB5A1

Screen Shot 2022-08-22 at 7 06 35 PM

This is correct on mine:
{ MTLPixelFormatA1BGR5Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $B, $G, $R, $A }, true }, // RGB5A1

@bkaradzic
Copy link
Owner

Ah never-mind I see it was disabled...

@bwrsandman bwrsandman deleted the swizzle-rgba4 branch August 23, 2022 02:31
@bwrsandman
Copy link
Contributor Author

Half right. It should actually be this. My changes weren't properly pushed 😨

{ MTLPixelFormatBGR5A1Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $B, $G, $R, $A }, true }, // RGB5A1

@bwrsandman
Copy link
Contributor Author

This format: MTLPixelFormatBGR5A1Unorm, not MTLPixelFormatA1BGR5Unorm

mipek pushed a commit to mipek/bgfx that referenced this pull request Mar 2, 2024
* texture format info: Invert R and B in RGBA4

d3d9: Revert 06c08ad to force software
      conversion because the format doesn't exist
d3d11: Force software conversion because the format doesn't exist
gl: Revert 3e3e655 to swizzle R and B
mtl: Swizzle channels

* metal: Remove explicit conversion of RGBA4 and RGB5A1 in osx

* metal: Set alpha bit to correct end of short
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.

2 participants