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

AnyImageImporter: Delegate .basis files #370

Closed
wants to merge 2 commits into from

Conversation

@Squareys
Copy link
Contributor

Squareys commented Aug 27, 2019

BasisImporter BasisImageConverter >AnyImageImporter/Converter<

Hello @mosra !

This part of mosra/magnum-plugins#62 is hereby up for discussion.

TODOs

  • Rebase
  • Test ?
@Squareys Squareys mentioned this pull request Aug 27, 2019
20 of 20 tasks complete
@mosra

This comment has been minimized.

Copy link
Owner

mosra commented Aug 27, 2019

Why BasisImporterEtc2 and not BasisImporter? Concrete format selection could be done either with

manager.setPreferredPlugins("BasisImporter", {"BasisImporterEtc2"});

or by modifying global configuration for the BasisImporter plugin:

manager.metadata("BasisImporter")->configuration().setValue("format", "Etc2");
@Squareys

This comment has been minimized.

Copy link
Contributor Author

Squareys commented Aug 28, 2019

The issue is that BasisImporter has Etc2 as default, but a hypothetical TinyBasisImporter could use Etc1. So the user would get a different ->compressedFormat() depending on which plugins he has installed 🤔

@mosra

This comment has been minimized.

Copy link
Owner

mosra commented Aug 28, 2019

Hypothetical

Yes. But even in that case, both defaults are equally arbitrary and probably wrong, which leads me to think...

default

What about ... not having a default at all? Like, the plugin failing to load a file when you forget to give it a default? That seems like the best way to avoid errors. Things that deal with AnyImageImporter need to handle loading errors anyway so this wouldn't introduce anything unexpected, and if the code wants to deal with basis files, it needs to set those defaults properly in advance, otherwise image2D() always gives NullOpt.

@mosra mosra added this to the 2019.0b milestone Aug 28, 2019
@Squareys

This comment has been minimized.

Copy link
Contributor Author

Squareys commented Aug 29, 2019

That is actually an awesome idea, as it will nudge people to read the docs for how to configure and make a probably way more suited decision than "use default Etc2". Will make that change to BasisImporter

@mosra mosra added this to TODO in Asset management via automation Aug 29, 2019
@Squareys Squareys force-pushed the Squareys:anyimporter-basis branch from 656a429 to 03ad02b Aug 29, 2019
Copy link
Owner

mosra left a comment

Maybe I'll merge the converter part later, don't want people to complain that "it wants a BasisImageConverter, but I can't find it anywhere! where it is?" 😆

@Squareys

This comment has been minimized.

Copy link
Contributor Author

Squareys commented Aug 30, 2019

Maybe I'll merge the converter part later, don't want people to complain that "it wants a BasisImageConverter, but I can't find it anywhere! where it is?" 😆

I doubt that anyone will stumble over this in the next couple of days... I'm planning to get mosra/magnum-plugins#65 merge-ready by Sunday at the latest 😅 Depends on your schedule, though :P

@Squareys Squareys force-pushed the Squareys:anyimporter-basis branch from 03ad02b to ef24c45 Aug 30, 2019
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Aug 30, 2019

Codecov Report

Merging #370 into master will decrease coverage by <.01%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #370      +/-   ##
==========================================
- Coverage   71.99%   71.98%   -0.01%     
==========================================
  Files         348      348              
  Lines       18180    18186       +6     
==========================================
+ Hits        13088    13092       +4     
- Misses       5092     5094       +2
Impacted Files Coverage Δ
.../MagnumPlugins/AnyImageImporter/AnyImageImporter.h 100% <ø> (ø) ⬆️
...agnumPlugins/AnyImageConverter/AnyImageConverter.h 100% <ø> (ø) ⬆️
...numPlugins/AnyImageConverter/AnyImageConverter.cpp 84.61% <50%> (-1.88%) ⬇️
...agnumPlugins/AnyImageImporter/AnyImageImporter.cpp 90.99% <83.33%> (-0.6%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b43ab5...d5b5ac1. Read the comment docs.

Copy link
Owner

mosra left a comment

Last two bits, otherwise I'm happy and this is ready to land :)

Squareys added 2 commits Aug 27, 2019
Signed-off-by: Squareys <squareys@googlemail.com>
Signed-off-by: Squareys <squareys@googlemail.com>
@Squareys Squareys force-pushed the Squareys:anyimporter-basis branch from ef24c45 to d5b5ac1 Aug 31, 2019
@Squareys Squareys mentioned this pull request Sep 1, 2019
15 of 15 tasks complete
@mosra

This comment has been minimized.

Copy link
Owner

mosra commented Sep 28, 2019

Merged as a1c2c9c and b4ca71e, thank you!

@mosra mosra closed this Sep 28, 2019
Asset management automation moved this from TODO to Done Sep 28, 2019
@mosra

This comment has been minimized.

Copy link
Owner

mosra commented Sep 28, 2019

Ugh why is it that I always discover bugs after things get pushed to master -- the file signature is just sB, the bytes after are just a version that changes all the time (in particular, files generated with current basisu have some other version than the bundled kodim20.basis etc. in the Basis repo, so those won't load).

Fix pushed as 64e365e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
3 participants
You can’t perform that action at this time.