Class SpirvCompilation
- Namespace
- NeoVeldrid.SPIRV
- Assembly
- NeoVeldrid.SPIRV.dll
Static functions for cross-compiling SPIR-V bytecode to various shader languages, and for compiling GLSL to SPIR-V.
public static class SpirvCompilation
- Inheritance
-
SpirvCompilation
- Inherited Members
Methods
CompileCompute(byte[], CrossCompileTarget)
Cross-compiles the given compute shader into some target language.
public static ComputeCompilationResult CompileCompute(byte[] csBytes, CrossCompileTarget target)
Parameters
csBytesbyte[]The compute shader's SPIR-V bytecode or ASCII-encoded GLSL source code.
targetCrossCompileTargetThe target language.
Returns
- ComputeCompilationResult
A ComputeCompilationResult containing the compiled output.
CompileCompute(byte[], CrossCompileTarget, CrossCompileOptions)
Cross-compiles the given compute shader into some target language.
public static ComputeCompilationResult CompileCompute(byte[] csBytes, CrossCompileTarget target, CrossCompileOptions options)
Parameters
csBytesbyte[]The compute shader's SPIR-V bytecode or ASCII-encoded GLSL source code.
targetCrossCompileTargetThe target language.
optionsCrossCompileOptionsThe options for shader translation.
Returns
- ComputeCompilationResult
A ComputeCompilationResult containing the compiled output.
CompileGlslToSpirv(string, string, ShaderStages, GlslCompileOptions)
Compiles the given GLSL source code into SPIR-V.
public static SpirvCompilationResult CompileGlslToSpirv(string sourceText, string fileName, ShaderStages stage, GlslCompileOptions options)
Parameters
sourceTextstringThe shader source code.
fileNamestringA descriptive name for the shader. May be null.
stageShaderStagesThe ShaderStages which the shader is used in.
optionsGlslCompileOptionsParameters for the GLSL compiler.
Returns
- SpirvCompilationResult
A SpirvCompilationResult containing the compiled SPIR-V bytecode.
CompileVertexFragment(byte[], byte[], CrossCompileTarget)
Cross-compiles the given vertex-fragment pair into some target language.
public static VertexFragmentCompilationResult CompileVertexFragment(byte[] vsBytes, byte[] fsBytes, CrossCompileTarget target)
Parameters
vsBytesbyte[]The vertex shader's SPIR-V bytecode or ASCII-encoded GLSL source code.
fsBytesbyte[]The fragment shader's SPIR-V bytecode or ASCII-encoded GLSL source code.
targetCrossCompileTargetThe target language.
Returns
- VertexFragmentCompilationResult
A VertexFragmentCompilationResult containing the compiled output.
CompileVertexFragment(byte[], byte[], CrossCompileTarget, CrossCompileOptions)
Cross-compiles the given vertex-fragment pair into some target language.
public static VertexFragmentCompilationResult CompileVertexFragment(byte[] vsBytes, byte[] fsBytes, CrossCompileTarget target, CrossCompileOptions options)
Parameters
vsBytesbyte[]The vertex shader's SPIR-V bytecode or ASCII-encoded GLSL source code.
fsBytesbyte[]The fragment shader's SPIR-V bytecode or ASCII-encoded GLSL source code.
targetCrossCompileTargetThe target language.
optionsCrossCompileOptionsThe options for shader translation.
Returns
- VertexFragmentCompilationResult
A VertexFragmentCompilationResult containing the compiled output.