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

Delete unused compression formats from .import files when exporting #74684

Merged
merged 1 commit into from
Mar 19, 2023

Conversation

clayjohn
Copy link
Member

@clayjohn clayjohn commented Mar 9, 2023

Fixes: #74451

This strips the unused compression formats out of the exported copy of the .import file. This way the engine will only attempt to load textures that have been exported.

In #74451 I said that part of the change we would like to make is to unify the compression export options with the import options. However, I think that is better left to another PR as it will change behaviour and this is purely a bugfix.

@Malcolmnixon Could you test on the Quest? I have tested on a device that supports all 4 formats and can confirm that this fixes the issue on it. But I have not tested on Android.

@Malcolmnixon
Copy link
Contributor

I tested this on the Quest and it seems to work perfectly. Specifically:

  • The .import file is highly stripped down and contains only the path to the exported ASTC texture
  • It runs on the Quest 2 headset

For reference this is a stripped down version of one of the .import files:

[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dqoe1c5yn5dnv"
path.astc="res://.godot/imported/SkyOnlyHDRI023_2K-TONEMAPPED.jpg-bcb5464e5ed42ee2463b71652f907f38.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}

It might theoretically be possible to strip the "s3tc_bptc" entry from "imported_formats" - the host doesn't need to know which formats the development PC imported - just the one available in the imports. However I don't think it's really a big issue as it doesn't cause an issue - it's just an information leak.

@Malcolmnixon
Copy link
Contributor

Was there any additional testing needed for this to go in?

It would be nice to try and target this fix for the 4.0.1 release if possible. Currently the VR developers are having to erroneously add s3tc and bptc support to their android exports in order to prevent loading issues.

@akien-mga akien-mga merged commit 7752b52 into godotengine:master Mar 19, 2023
@akien-mga
Copy link
Member

Thanks!

@YuriSizov
Copy link
Contributor

Cherry-picked for 4.0.2.

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.

Godot attempting to load BPTC textures on Android
4 participants