Skip to content

BasisImporter - #62

Closed
Squareys wants to merge 4 commits into
mosra:masterfrom
Squareys:basis-importer
Closed

BasisImporter#62
Squareys wants to merge 4 commits into
mosra:masterfrom
Squareys:basis-importer

Conversation

@Squareys

@Squareys Squareys commented Jul 31, 2019

Copy link
Copy Markdown
Contributor
> BasisImporter< BasisImageConverter AnyImageImporter/Converter

Hi @mosra !

This is the pullrequest for the BasisImporter plugin. The BasisConverter will be in a separate pullrequest.

I will ping you once you can take the first look at it. Big warning: I currently added all of the https://github.com/binomialLLC/basis_universal code with my patch. I am still hoping BinomialLLC/basis_universal#46 or BinomialLLC/basis_universal#11 or maybe BinomialLLC/basis_universal#13 will be fixed/merged/dealt with by the time this pullrequest is ready or the next release that Rich is working on solves linking to it as a library.

If not, we can rediscuss options for how to integrate it best.

Sincerely,
Jonathan

TODOs

  • Transcode a basis file
  • Target format configuration
  • Magnum plugins find module
  • Basis find module
    • Implement
    • Await tested on all platforms
  • Add to all the packages
  • Remove basis source code
  • Basis dependency on CI
    • AppVeyor
    • travis
  • ... and packages?
  • Add to changelog and other parts of docs
  • Compiled snippets
  • Enable on CI
  • Test
    • Basic, open twice, import twice
    • All aliases (instanced)
    • Some more basis input file configurations
      • Multiple images in a file
  • [ ] AnyImageImporter delegation => AnyImageImporter: Delegate .basis files magnum#370

@mosra mosra added this to the 2019.0b milestone Aug 1, 2019
@codecov-io

codecov-io commented Aug 20, 2019

Copy link
Copy Markdown

Codecov Report

Merging #62 into master will decrease coverage by 0.15%.
The diff coverage is 78.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #62      +/-   ##
==========================================
- Coverage   90.94%   90.79%   -0.16%     
==========================================
  Files          49       51       +2     
  Lines        4240     3898     -342     
==========================================
- Hits         3856     3539     -317     
+ Misses        384      359      -25
Impacted Files Coverage Δ
src/MagnumPlugins/BasisImporter/BasisImporter.h 100% <100%> (ø)
src/MagnumPlugins/BasisImporter/BasisImporter.cpp 78.65% <78.65%> (ø)
...rc/MagnumPlugins/AssimpImporter/AssimpImporter.cpp 82.42% <0%> (-3.21%) ⬇️
src/Magnum/OpenDdl/Document.h 88.57% <0%> (-0.32%) ⬇️
src/MagnumPlugins/FreeTypeFont/FreeTypeFont.cpp 98.73% <0%> (-0.07%) ⬇️
src/Magnum/OpenDdl/Structure.h 96.49% <0%> (-0.07%) ⬇️
src/MagnumPlugins/DdsImporter/DdsImporter.cpp 77.95% <0%> (-0.04%) ⬇️
src/MagnumPlugins/OpenGexImporter/openGexSpec.hpp 100% <0%> (ø) ⬆️
... and 19 more

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 553154e...b3341af. Read the comment docs.

@Squareys

Copy link
Copy Markdown
Contributor Author

@mosra So, there has been zero visible progress on build system / library support in basis_universal since June. With this PR, I just copied the files of my forked repository with the debug iterator level fix into external, but that was just a temporary solution.

How are we going to include basis? I currently don't see a way that doesn't involve our own patched version, but maybe a submodule is a better idea than just copying the files?
Otoh, we can stick to only the essential files this way and provide our own CMake setup.

@mosra

mosra commented Aug 22, 2019

Copy link
Copy Markdown
Owner

Oh well.

I would say we do it similarly as we did with ImGui (finding sources and building through and external CMake script), plus relying on your fork for Windows builds until BinomialLLC/basis_universal#46 gets finally merged. Or is there anything else needed beyond that?

Submodules are problematic since git submodule update --init implicitly pulls in everything (what if the 3rd party repo suddenly starts including hundreds of megabytes of data, like assimp did? then everyone downloading plugins or having plugins as a submodule would have to transitively suffer through that too) and this would add a dangerous precedent when other dependencies get considered in the future. (Plus iterating on that 3rd party lib or trying out various forks of it is harder when you have a submodule pinned -- a problem I'm running into very often recently.)

@Squareys

Copy link
Copy Markdown
Contributor Author

That submodule concern makes a lot of sense, yes.

Finding the sources via CMake is a good idea, I remember you suggested that before 👍 But good to have it documented here on GitHub now.

Or is there anything else needed beyond that?

For windows support, no further code changes. But to build as a library, we will have to add some cmake project. (Theirs just builds the basisu tool.)
But that can be done through the find module.

Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.h Outdated
@Squareys
Squareys force-pushed the basis-importer branch 7 times, most recently from f6bbf13 to 9a637c3 Compare August 25, 2019 19:32
@Squareys
Squareys force-pushed the basis-importer branch 3 times, most recently from 032b19b to 2cd6e42 Compare August 27, 2019 16:08
Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.cpp Outdated

@mosra mosra left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This looks quite finished already! 🎉

Comment thread src/MagnumPlugins/BasisImporter/Test/BasisImporterTest.cpp Outdated
Comment thread src/MagnumPlugins/BasisImporter/Test/README.md Outdated
Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.h
Comment thread src/MagnumPlugins/BasisImporter/Test/BasisImporterTest.cpp Outdated
Comment thread src/MagnumPlugins/BasisImporter/Test/CMakeLists.txt Outdated
Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.cpp Outdated
Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.cpp Outdated
Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.cpp Outdated
Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.h
Comment thread doc/building-plugins.dox
@Squareys
Squareys force-pushed the basis-importer branch 2 times, most recently from aab0800 to 0c9df86 Compare August 28, 2019 11:59
@Squareys

Copy link
Copy Markdown
Contributor Author

@mosra How should I handle the basis dependency on debian/arch/etc packages? Clone the repo or download from specific revision like on travis and appveyor?

@mosra

mosra commented Aug 29, 2019

Copy link
Copy Markdown
Owner

For the no-default thing I mentioned in mosra/magnum#370, I think it would be enough to have just an empty format line in the config, like:

[configuration]

# No format is specified by default and you have to choose one either
# by changing this value or by loading the plugin under an alias. See 
# class documentation for more information.
format=

And then this should have an explicit test so we are sure this fails gracefully with a good UX :)

@Squareys

Copy link
Copy Markdown
Contributor Author

Alright, done! 🎉

@Squareys Squareys changed the title [WIP] BasisImporter BasisImporter Aug 29, 2019

@mosra mosra left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I'm a bit sad that codecov is broken and doesn't show the actual covered lines. Would need to check the coverage locally, then.

Comment thread src/MagnumPlugins/BasisImporter/Test/BasisImporterTest.cpp Outdated
Comment thread src/MagnumPlugins/BasisImporter/Test/BasisImporterTest.cpp Outdated
Comment thread src/MagnumPlugins/BasisImporter/Test/BasisImporterTest.cpp Outdated
Comment thread src/MagnumPlugins/BasisImporter/Test/BasisImporterTest.cpp Outdated
Comment thread src/MagnumPlugins/BasisImporter/Test/BasisImporterTest.cpp Outdated
Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.cpp
Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.cpp Outdated
Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.cpp Outdated
Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.cpp Outdated
Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.cpp
@Squareys Squareys mentioned this pull request Aug 29, 2019
15 tasks
Comment thread package/ci/appveyor-desktop.bat Outdated
Comment thread package/ci/appveyor-desktop-mingw.bat Outdated
Comment thread src/MagnumPlugins/BasisImporter/Test/BasisImporterTest.cpp Outdated
@Squareys
Squareys force-pushed the basis-importer branch 3 times, most recently from 6d7b29e to 23cead4 Compare August 30, 2019 05:33
@Squareys

Copy link
Copy Markdown
Contributor Author

@mosra Ready! 👍

@mosra mosra left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Last few bits and then I'll leave you in peace :)

For the real-world test before I merge to master (and a nice & useful feature as a side-effect) I'll add compressed image support to magnum-player and try to open a few Basis images with it.

Comment thread doc/snippets/MagnumPluginsBasisImporter.cpp Outdated
Comment thread package/ci/appveyor-desktop-mingw.bat Outdated
Comment thread src/MagnumPlugins/BasisImporter/Test/BasisImporterTest.cpp
Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.cpp
Comment thread src/MagnumPlugins/BasisImporter/BasisImporter.h Outdated
@Squareys
Squareys force-pushed the basis-importer branch 2 times, most recently from d50b492 to 124d4c8 Compare August 31, 2019 10:51
@Squareys

Copy link
Copy Markdown
Contributor Author

Done once more :)
(Waiting for the CI still, though)

Signed-off-by: Squareys <squareys@googlemail.com>
Signed-off-by: Squareys <squareys@googlemail.com>
Signed-off-by: Squareys <squareys@googlemail.com>
Signed-off-by: Squareys <squareys@googlemail.com>
@mosra

mosra commented Oct 2, 2019

Copy link
Copy Markdown
Owner

Merged in 627beff, 0c238b8, cd9d838 and 3c00412; updated to ASTC and uncompressed formats in fcb1439. Docs are up now as well.

There's still stuff to be done on Basis side, see #70.

Thanks for working on this!

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

Development

Successfully merging this pull request may close these issues.

3 participants