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

Remove DDS_INDEXED from DDSFormat #80669

Merged

Conversation

BlueCube3310
Copy link
Contributor

@BlueCube3310 BlueCube3310 commented Aug 15, 2023

Edit: MRP ddsfix.zip

The DDS_INDEXED value within DDSFormat has been redundant since around 3.0. At one point this value used to correspond to an entry in the Format Info array, however, that entry got removed while the enum value remained.

This causes some textures to be imported incorrectly (e.g. L8 as L8A8) due to incorrect array indices.

@BlueCube3310 BlueCube3310 requested a review from a team as a code owner August 15, 2023 20:04
@lyuma
Copy link
Contributor

lyuma commented Aug 15, 2023

Do you have access to any test assets which can help us test if this change is correct? Ideally in the form of a minimal reproduction project (MRP) which is a zip of a new project with the assets in it that reproduce the problem.

Are there any implications of changing the enum: will this break compatibility of any assets already imported into Godot 4.0 or 4.1?

@BlueCube3310
Copy link
Contributor Author

BlueCube3310 commented Aug 16, 2023

Do you have access to any test assets which can help us test if this change is correct? Ideally in the form of a minimal reproduction project (MRP) which is a zip of a new project with the assets in it that reproduce the problem.

Added a MRP. The file tulips.dds is an l8 grayscale image, which gets imported as l8a8.

@BlueCube3310
Copy link
Contributor Author

BlueCube3310 commented Aug 16, 2023

Are there any implications of changing the enum: will this break compatibility of any assets already imported into Godot 4.0 or 4.1?

As for breaking compatibility, this PR only affects l8 and l8a8 dds importing, however the imported images used to be broken, so it shouldn't matter that much.

@BlueCube3310
Copy link
Contributor Author

Here are the test results from the attached MRP:

result

@BlueCube3310
Copy link
Contributor Author

Additionally, attempting to load grayscale-alpha images such as dice_l8a8.dds (inside of dice_l8a8.zip) fails on v4.2-dev3 due to reaching outside of the Format Info array's boundaries:

resultfail

This PR also fixes that issue:

resultcorr

Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

This change makes sense. It is clear that DDSFormat needs to line up with the entries in dds_format_info

@clayjohn clayjohn added cherrypick:4.0 cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Aug 21, 2023
@akien-mga akien-mga changed the title Remove DDS_INDEXED from DDSFormat Remove DDS_INDEXED from DDSFormat Aug 21, 2023
@akien-mga akien-mga merged commit ca00520 into godotengine:master Aug 21, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@akien-mga akien-mga removed cherrypick:4.0 cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Aug 29, 2023
@BlueCube3310 BlueCube3310 deleted the DDS-format-indexed-remove branch April 25, 2024 10:21
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.

6 participants