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

Implement loading DDS textures at run-time again #101549

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

Conversation

Spartan322
Copy link
Contributor

@Spartan322 Spartan322 commented Jan 14, 2025

Adds:

  • Image::load_dds_from_buffer()
  • Ability to load DDS textures at runtime via Image::load_from_file

All the DDS layer loading has been moved from texture loader to image loader as handling layers is a little awkward compared to how the other loaders are handled.

@fire
Copy link
Member

fire commented Jan 24, 2025

When you're ready I'll try to review this for Godot Engine 4.5

@@ -77,11 +78,13 @@ class ImageFormatLoaderExtension : public ImageFormatLoader {
public:
virtual Error load_image(Ref<Image> p_image, Ref<FileAccess> p_fileaccess, BitField<ImageFormatLoader::LoaderFlags> p_flags = FLAG_NONE, float p_scale = 1.0) override;
virtual void get_recognized_extensions(List<String> *p_extensions) const override;
virtual bool should_import(const String &p_resource_type) const override;
Copy link
Member

Choose a reason for hiding this comment

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

virtual bool should_import(const String &p_resource_type) const override; I think this was added so that Godot Engine can ignore this format loader?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah with #100538, should_import enables format loaders to designate when they would and would not be ignored by the import process based on the resource type.

Copy link
Member

Choose a reason for hiding this comment

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

This feels wrong on a gut feeling; I've been ignoring this problem in my other pull request. #101994

@Spartan322
Copy link
Contributor Author

Spartan322 commented Jan 24, 2025

Reason I have this as a draft is really because I'm waiting on whether anything in #100538 needs any changes, this is practically ready outside that.

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.

Implement loading DDS textures at run-time
3 participants