class ShaderModuleTemplate

Defined at line 32 of file ../../src/ui/lib/escher/vk/shader_module_template.h

ShaderModuleTemplate is a caching factory for ShaderModule variants,

each parameterized by ShaderVariantArgs; see GetShaderModuleVariant().

Currently each variant is generated by compiling GLSL to SPIR-V. All

variants are compiled from the same base file, but with different

preprocessor definitions. The base file can #include other files, and

different variants may include different sets of files, depending on whether

various #include directives are "#ifdeffed out".

Public Methods

void ShaderModuleTemplate (vk::Device device, shaderc::Compiler * compiler, ShaderStage shader_stage, HackFilePath path, HackFilesystemPtr filesystem)

Defined at line 98 of file ../../src/ui/lib/escher/vk/shader_module_template.cc

void ShaderModuleTemplate (vk::Device device, ShaderStage shader_stage, HackFilePath path, HackFilesystemPtr filesystem)

Defined at line 107 of file ../../src/ui/lib/escher/vk/shader_module_template.cc

void ~ShaderModuleTemplate ()

Defined at line 115 of file ../../src/ui/lib/escher/vk/shader_module_template.cc

ShaderModulePtr GetShaderModuleVariant (const ShaderVariantArgs & args)

Obtain a ShaderModule variant from the template, either a cached one, or a

newly-created module if none matches the provided args. If any of the

assets used to generate the variant (e.g. files) change dynamically, then

the module is automatically invalidated and updated. As with any

ShaderModule, clients are notified of these changes by registering a

ShaderModuleListener; see ShaderModule/ShaderModuleListener for more more

details.

Defined at line 117 of file ../../src/ui/lib/escher/vk/shader_module_template.cc

bool CompileVariantToSpirv (const ShaderVariantArgs & args, std::vector<uint32_t> * output)

Generates a shader variant based on the provided arguments and compiles them to spirv.

Returns true on success and false if there is a shader compilation error. The spirv

code itself is output to the |output| vector parameter.

Defined at line 153 of file ../../src/ui/lib/escher/vk/shader_module_template.cc