class Compiler
Defined at line 385 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
The compilation context for compiling source to SPIR-V.
Public Methods
void Compiler ()
Defined at line 387 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
void ~Compiler ()
Defined at line 388 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
void Compiler (Compiler && other)
Defined at line 390 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
bool IsValid ()
Defined at line 395 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
SpvCompilationResult CompileGlslToSpv (const char * source_text, size_t source_text_size, shaderc_shader_kind shader_kind, const char * input_file_name, const char * entry_point_name, const CompileOptions & options)
Compiles the given source GLSL and returns a SPIR-V binary module
compilation result.
The source_text parameter must be a valid pointer.
The source_text_size parameter must be the length of the source text.
The shader_kind parameter either forces the compilation to be done with a
specified shader kind, or hint the compiler how to determine the exact
shader kind. If the shader kind is set to shaderc_glslc_infer_from_source,
the compiler will try to deduce the shader kind from the source string and
a failure in this proess will generate an error. Currently only #pragma
annotation is supported. If the shader kind is set to one of the default
shader kinds, the compiler will fall back to the specified default shader
kind in case it failed to deduce the shader kind from the source string.
The input_file_name is a null-termintated string. It is used as a tag to
identify the source string in cases like emitting error messages. It
doesn't have to be a 'file name'.
The entry_point_name parameter is a null-terminated string specifying
the entry point name for HLSL compilation. For GLSL compilation, the
entry point name is assumed to be "main".
The compilation is passed any options specified in the CompileOptions
parameter.
It is valid for the returned CompilationResult object to outlive this
compiler object.
Note when the options_ has disassembly mode or preprocessing only mode set
on, the returned CompilationResult will hold a text string, instead of a
SPIR-V binary generated with default options.
Defined at line 422 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
SpvCompilationResult CompileGlslToSpv (const char * source_text, size_t source_text_size, shaderc_shader_kind shader_kind, const char * input_file_name, const CompileOptions & options)
Compiles the given source shader and returns a SPIR-V binary module
compilation result.
Like the first CompileGlslToSpv method but assumes the entry point name
is "main".
Defined at line 438 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
SpvCompilationResult CompileGlslToSpv (const char * source_text, size_t source_text_size, shaderc_shader_kind shader_kind, const char * input_file_name)
Compiles the given source GLSL and returns a SPIR-V binary module
compilation result.
Like the previous CompileGlslToSpv method but uses default options.
Defined at line 450 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
SpvCompilationResult CompileGlslToSpv (const std::string & source_text, shaderc_shader_kind shader_kind, const char * input_file_name, const CompileOptions & options)
Compiles the given source shader and returns a SPIR-V binary module
compilation result.
Like the first CompileGlslToSpv method but the source is provided as
a std::string, and we assume the entry point is "main".
Defined at line 464 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
SpvCompilationResult CompileGlslToSpv (const std::string & source_text, shaderc_shader_kind shader_kind, const char * input_file_name, const char * entry_point_name, const CompileOptions & options)
Compiles the given source shader and returns a SPIR-V binary module
compilation result.
Like the first CompileGlslToSpv method but the source is provided as
a std::string.
Defined at line 476 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
SpvCompilationResult CompileGlslToSpv (const std::string & source_text, shaderc_shader_kind shader_kind, const char * input_file_name)
Compiles the given source GLSL and returns a SPIR-V binary module
compilation result.
Like the previous CompileGlslToSpv method but assumes the entry point
name is "main".
Defined at line 489 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
SpvCompilationResult AssembleToSpv (const char * source_assembly, size_t source_assembly_size, const CompileOptions & options)
Assembles the given SPIR-V assembly and returns a SPIR-V binary module
compilation result.
The assembly should follow the syntax defined in the SPIRV-Tools project
(https://github.com/KhronosGroup/SPIRV-Tools/blob/master/syntax.md).
It is valid for the returned CompilationResult object to outlive this
compiler object.
The assembling will pick options suitable for assembling specified in the
CompileOptions parameter.
Defined at line 504 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
SpvCompilationResult AssembleToSpv (const char * source_assembly, size_t source_assembly_size)
Assembles the given SPIR-V assembly and returns a SPIR-V binary module
compilation result.
Like the first AssembleToSpv method but uses the default compiler options.
Defined at line 514 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
SpvCompilationResult AssembleToSpv (const std::string & source_assembly, const CompileOptions & options)
Assembles the given SPIR-V assembly and returns a SPIR-V binary module
compilation result.
Like the first AssembleToSpv method but the source is provided as a
std::string.
Defined at line 524 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
SpvCompilationResult AssembleToSpv (const std::string & source_assembly)
Assembles the given SPIR-V assembly and returns a SPIR-V binary module
compilation result.
Like the first AssembleToSpv method but the source is provided as a
std::string and also uses default compiler options.
Defined at line 535 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
AssemblyCompilationResult CompileGlslToSpvAssembly (const char * source_text, size_t source_text_size, shaderc_shader_kind shader_kind, const char * input_file_name, const char * entry_point_name, const CompileOptions & options)
Compiles the given source GLSL and returns the SPIR-V assembly text
compilation result.
Options are similar to the first CompileToSpv method.
Defined at line 543 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
AssemblyCompilationResult CompileGlslToSpvAssembly (const char * source_text, size_t source_text_size, shaderc_shader_kind shader_kind, const char * input_file_name, const CompileOptions & options)
Compiles the given source GLSL and returns the SPIR-V assembly text
compilation result.
Similare to the previous method, but assumes entry point name is "main".
Defined at line 557 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
AssemblyCompilationResult CompileGlslToSpvAssembly (const std::string & source_text, shaderc_shader_kind shader_kind, const char * input_file_name, const char * entry_point_name, const CompileOptions & options)
Compiles the given source GLSL and returns the SPIR-V assembly text
result. Like the first CompileGlslToSpvAssembly method but the source
is provided as a std::string. Options are otherwise similar to
the first CompileToSpv method.
Defined at line 569 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
AssemblyCompilationResult CompileGlslToSpvAssembly (const std::string & source_text, shaderc_shader_kind shader_kind, const char * input_file_name, const CompileOptions & options)
Compiles the given source GLSL and returns the SPIR-V assembly text
result. Like the previous CompileGlslToSpvAssembly method but assumes
the entry point name is "main".
Defined at line 581 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
PreprocessedSourceCompilationResult PreprocessGlsl (const char * source_text, size_t source_text_size, shaderc_shader_kind shader_kind, const char * input_file_name, const CompileOptions & options)
Preprocesses the given source GLSL and returns the preprocessed
source text as a compilation result.
Options are similar to the first CompileToSpv method.
Defined at line 591 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp
PreprocessedSourceCompilationResult PreprocessGlsl (const std::string & source_text, shaderc_shader_kind shader_kind, const char * input_file_name, const CompileOptions & options)
Preprocesses the given source GLSL and returns text result. Like the first
PreprocessGlsl method but the source is provided as a std::string.
Options are otherwise similar to the first CompileToSpv method.
Defined at line 605 of file ../../third_party/shaderc/src/libshaderc/include/shaderc/shaderc.hpp