Table of Contents

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

csBytes byte[]

The compute shader's SPIR-V bytecode or ASCII-encoded GLSL source code.

target CrossCompileTarget

The 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

csBytes byte[]

The compute shader's SPIR-V bytecode or ASCII-encoded GLSL source code.

target CrossCompileTarget

The target language.

options CrossCompileOptions

The 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

sourceText string

The shader source code.

fileName string

A descriptive name for the shader. May be null.

stage ShaderStages

The ShaderStages which the shader is used in.

options GlslCompileOptions

Parameters 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

vsBytes byte[]

The vertex shader's SPIR-V bytecode or ASCII-encoded GLSL source code.

fsBytes byte[]

The fragment shader's SPIR-V bytecode or ASCII-encoded GLSL source code.

target CrossCompileTarget

The 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

vsBytes byte[]

The vertex shader's SPIR-V bytecode or ASCII-encoded GLSL source code.

fsBytes byte[]

The fragment shader's SPIR-V bytecode or ASCII-encoded GLSL source code.

target CrossCompileTarget

The target language.

options CrossCompileOptions

The options for shader translation.

Returns

VertexFragmentCompilationResult

A VertexFragmentCompilationResult containing the compiled output.