class new in Git master
AnyConverterAny shader converter plugin.
Contents
Loads a plugin corresponding to a format either explicitly set using setInputFormat() / setOutputFormat() or detected based on input / output file extension plugin and then tries to either validate or convert the file with it. These formats are detected based on extension:
- GLSL (
*.glsl
,*.vert
,*.frag
,*.geom
,*.comp
,*.tesc
,*.tese
,*.rgen
,*.rint
,*.rahit
,*.rchit
,*.rmiss
,*.rcall
,*.mesh
,*.task
) - SPIR-V (
*.spv
) - SPIR-V Assembly (
*.spvasm
,*.asm.vert
, ...,*.asm.task
)
Supported validation scenarios:
- GLSL, validated with any plugin that provides
GlslShaderConverter
- SPIR-V, validated with any plugin that provides
SpirvShaderConverter
- SPIR-V Assembly, validated with any plugin that provides
SpirvAssemblyShaderConverter
Supported conversion paths:
- GLSL to SPIR-V, converted with any plugin that provides
GlslToSpirvShaderConverter
- SPIR-V to SPIR-V, converted with any plugin that provides
SpirvShaderConverter
- SPIR-V to SPIR-V Assembly, converted with any plugin that provides
SpirvToSpirvAssemblyShaderConverter
- SPIR-V Assembly to SPIR-V, converted with any plugin that provides
SpirvAssemblyToSpirvShaderConverter
- SPIR-V Assembly to SPIR-V Assembly, converted with any plugin that provides
SpirvAssemblyShaderConverter
There's format detection based on file contents, so the plugin has to either operate on files or setInputFormat() / setOutputFormat() has to be explicitly set.
Usage
This plugin depends on the ShaderTools library and is built if WITH_ANYSHADERCONVERTER
is enabled when building Magnum. To use as a dynamic plugin, load "AnyShaderConverter"
via Corrade::
Additionally, if you're using Magnum as a CMake subproject, do the following:
set(WITH_ANYSHADERCONVERTER ON CACHE BOOL "" FORCE) add_subdirectory(magnum EXCLUDE_FROM_ALL) # So the dynamically loaded plugin gets built implicitly add_dependencies(your-app Magnum::AnyShaderConverter)
To use as a static plugin or as a dependency of another plugin with CMake, you need to request the AnyShaderConverter
component of the Magnum
package and link to the Magnum::AnyShaderConverter
target:
find_package(Magnum REQUIRED AnyShaderConverter) # ... target_link_libraries(your-app PRIVATE Magnum::AnyShaderConverter)
See Downloading and building, Usage with CMake and Loading and using plugins for more information.
Base classes
- class AbstractConverter new in Git master
- Base for shader converter plugins.
Constructors, destructors, conversion operators
-
AnyConverter(PluginManager::
Manager<AbstractConverter>& manager) explicit - Constructor with access to plugin manager.
-
AnyConverter(PluginManager::
AbstractManager& manager, const std:: string& plugin) explicit - Plugin manager constructor.