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
Splitting out GL and Trade functionality to separate libraries #233
Conversation
50d83af
to
421031c
Compare
Codecov Report
@@ Coverage Diff @@
## master #233 +/- ##
==========================================
+ Coverage 45.84% 46.62% +0.78%
==========================================
Files 345 355 +10
Lines 15261 15539 +278
==========================================
+ Hits 6996 7245 +249
- Misses 8265 8294 +29
Continue to review full report at Codecov.
|
5480bbd
to
7ab7f22
Compare
c792bc9
to
e425f37
Compare
3917fe9
to
3c3105b
Compare
Trade library split was merged to master in 920db7a. |
cd55ccc
to
262a70e
Compare
Primitives, MeshTools, Trade and TextureTools are not depending on the GL library anymore.
And adapt the dependencies as well.
For 2018.02 it's still referencing them, but the older changelogs are simply converted to inline code for all references.
Because now with the generic formats all images that are in PixelFormat::R8Unorm are translated to GL::PixelFormat::Luminance on ES2 and WebGL 1. The DistanceFieldGlyphCache still has the original, but that one didn't really work there in the first place. That'll get patched later.
Previously, when requesting OpenGLTester, the script correctly found that it needs some Windowless*Application and a GL library and added them as dependencies to OpenGLTester. But it didn't handle the dependency of Windowless*Application on GL, which caused GL to be linked *before* Windowless*Application, causing linker to complain that Windowless*Application needs some more stuff from GL.
No backwards compatibility provided, sorry.
…ion. The Platform::*Application::Configuration class was split into Configuration and GLConfiguration, the latter containing only GL-specific configuration. Moreover, createContext() and tryCreateContext() were renamed to create() / tryCreate(). There's now a constructor and a create() / tryCreate() overload taking GLConfiguration and this will be later extended with VkConfiguration, for example. GL-specific getters/setters from Configuration are now marked as deprecated and merged into GLConfiguration during context creation. Everything has still hard dependency on GL, that will be done in the next commits.
So it's clear that this is not a Vulkan extension link.
Expecting angry people with pitchforks and torches doing a witch hunt on me now, haha 🙈 🔥 Documentation and proper release notes / upgrading guide coming soon with the 2018.04 release. |
This is the first huge potentially breaking thing on the path to Vulkan support. Basically everything from the
Magnum
namespace that had anything to do with OpenGL is now moved into a newMagnum::GL
library. That goes similarly for include paths and CMake imported targets. But don't worry too much (just a little), this is done with the utmost care to preserve as much backwards compatibility as possible.I'm doing this one little step at a time to avoid getting crazy. Things to do, in order:
Magnum::Trade
CMake imported target (and library)Magnum/GL
subdir and a new library (at this step this means even theImage
class and everything, which means also the whole Trade library and all plugins now depend on GL library), not adding a new namespace yetMagnum::GL
namespaceMagnum::Extensions::GL::*
toMagnum::GL::Extensions::*
?Platform::Context
toPlatform::GLContext
<Magnum/Buffer.h>
that points to<Magnum/GL/Buffer.h>
)Magnum::Buffer
that is a typedef toMagnum::GL::Buffer
)@section
identifiers to use the GL namespace@extension
to@gl_extension
PixelFormat
/PixelType
enums back to root namespace and provide some mapping to GL types (need to check what Vulkan has here)PixelStorage
and put the rest back to root namespaceMeshPrimitive
andMesh::IndexType
enum out of GL libThink about how to separate sampler state out of GL lib (also enums straight in Trade, how to map to GL?)It's a bunch of Sampler enums in the root namespace nowTrade
does not depend on GL anymore, fix the linking and fix that alsoPrimitives
and all pluginsUpdate all packages and CIs to explicitly useno need to, this is enabled by defaultWITH_GL
andWITH_TRADE
TARGET_GL
option, allowing to enable/disable GL support in other librariesTARGET_GL
being turned off (i.e., so it doesn't even link to GL)magnum-info
tomagnum-gl-info
. Backwards compatibility for this is not considered, please complain if you need that.MAGNUM_ASSERT_*_SUPPORTED()
macros toMAGNUM_ASSERT_GL_*_SUPPORTED()
orMAGNUM_GL_*()
(how to handle backwards compat?)MAGNUM_VERIFY_NO_ERROR()
After all the above this PR could be merged back to master, I think. Separating the remaining libraries from GL will be done incrementally over time.
Things I'm not sure how to do:
Backward compatibility so people linking to-- there would be a cyclic dependency with this, so nopeMagnum
will be linked toMagnum::GL
andMagnum::Trade
as wellShould GL::BufferImage have GL::PixelFormat or Magnum::PixelFormat? The former would require a mapping table back to Magnum::PixelFormat, the latter will feel alien (formatExtra etc.)It's the GL-specific format now.Cc: @Squareys