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

RenderingDevice: Fix certain RD to Image format conversions #102805

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

BlueCube3310
Copy link
Contributor

Fixes #97628

Certain RD texture formats used to be incorrectly mapped to their Image::Format counterparts. This PR fixes RGBAF and changes ETC2 RGBA8, which used to convert to ETC2_RA_As_RG, which is much less common now that we support ETC2_RG11, and it compliments the existing conversion of BC3 to DXT5 instead of DXT5_RA_As_RG

ASTC HDR conversion is broken currently, as it maps SRGB variants to HDR ones. This is fixed by #102777

@BlueCube3310 BlueCube3310 requested a review from a team as a code owner February 13, 2025 09:51
@BlueCube3310 BlueCube3310 added this to the 4.4 milestone Feb 13, 2025
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Code looks good to me.

@@ -2553,6 +2551,7 @@ void TextureStorage::_texture_format_from_rd(RD::DataFormat p_rd_format, Texture
r_format.swizzle_b = RD::TEXTURE_SWIZZLE_B;
r_format.swizzle_a = RD::TEXTURE_SWIZZLE_A;
} break;
/* already maps to FORMAT_ETC2_RGBA8
Copy link
Member

Choose a reason for hiding this comment

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

We tend to delete code rather than comment out, is there a specific reason we're not doing that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's done to explicitly state that there are certain Image formats to which we're not mapping to, since they're just swizzled variants of other formats.

@Repiteo Repiteo merged commit 1a0bf54 into godotengine:master Feb 13, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Feb 13, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Texture2DRD thumbnail preview fails to generate
4 participants