Magnum::ShaderTools::AnyConverter class new in Git master

Any shader converter plugin.

Detects file type based on file extension, loads corresponding plugin and then tries to either validate or convert the file with it. Detected file formats:

  • 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

Only validating and converting files is supported.

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::PluginManager::Manager.

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.