Documentation
¶
Overview ¶
Package gshaderc provides an API wrapper around https://github.com/google/shaderc the primary goal being to allow opengl and vulkan based go applications to have the ability to compile shaders into SPIRV (https://en.wikipedia.org/wiki/Standard_Portable_Intermediate_Representation)
With the release of Vulkan ( https://www.khronos.org/vulkan/ ) the ability to compile shaders is no longer directly provided with the Vulkan API as it was previously provided as part of the OpenGL APIs.
Index ¶
- Constants
- Variables
- func CompileShader(source, filename, target string) ([]byte, error)
- func GetShaderExtensionByType(stype ShaderType) string
- type CompilationResult
- type Compiler
- func (c *Compiler) AssembleIntoSPV(source string, options *CompilerOptions) *CompilationResult
- func (c *Compiler) CompileIntoPreProcessedText(source string, shaderType ShaderType, inputFilename string, entryPoint string, ...) *CompilationResult
- func (c *Compiler) CompileIntoSPV(source string, shaderType ShaderType, inputFilename string, entryPoint string, ...) *CompilationResult
- func (c *Compiler) Release()
- type CompilerOptions
- func (c *CompilerOptions) AddMacroDefinition(name, value string)
- func (c *CompilerOptions) Clone() *CompilerOptions
- func (c *CompilerOptions) Release()
- func (c *CompilerOptions) SetAutoBindUniforms(auto bool)
- func (c *CompilerOptions) SetBindingBase(kind UniformKind, base uint32)
- func (c *CompilerOptions) SetIncludeCallback(resolver IncludeResolver)
- func (c *CompilerOptions) SetInvertY(enabled bool)
- func (c *CompilerOptions) SetLimit(limit ResourceLimit, value int)
- func (c *CompilerOptions) SetNanClamp(enabled bool)
- func (c *CompilerOptions) SetOptimizationLevel(level OptimizationLevel)
- func (c *CompilerOptions) SetSPIRVVersion(version SPIRVVersion)
- func (c *CompilerOptions) SetTargetByName(target string) error
- func (c *CompilerOptions) SetTargetEnv(target Target, version EnvVersion)
- func (c *CompilerOptions) SetWarningsAsErrors()
- func (c *CompilerOptions) SuppressWarnings()
- type EnvVersion
- type IncludeResolver
- type IncludeType
- type OptimizationLevel
- type ResourceLimit
- type SPIRVVersion
- type ShaderType
- type Target
- type UniformKind
Constants ¶
const ( // Forced shader kinds. These shader kinds force the compiler to compile the // source code as the specified kind of shader. VertexShader ShaderType = ShaderType(C.shaderc_vertex_shader) FragmentShader = ShaderType(C.shaderc_fragment_shader) ComputeShader = ShaderType(C.shaderc_compute_shader) GeometryShader = ShaderType(C.shaderc_geometry_shader) TessControlShader = ShaderType(C.shaderc_tess_control_shader) TessEvaluationShader = ShaderType(C.shaderc_tess_evaluation_shader) // Deduce the shader kind from #pragma annotation in the source code. Compiler // will emit error if #pragma annotation is not found. InferFromSource = ShaderType(C.shaderc_glsl_infer_from_source) // Default shader kinds. Compiler will fall back to compile the source code as // the specified kind of shader when #pragma annotation is not found in the // source code. DefaultVertexShader = ShaderType(C.shaderc_glsl_default_vertex_shader) DefaultFragmentShader = ShaderType(C.shaderc_glsl_default_fragment_shader) DefaultComputeShader = ShaderType(C.shaderc_glsl_default_compute_shader) DefaultGeometryShader = ShaderType(C.shaderc_glsl_default_geometry_shader) DefaultTessControlShader = ShaderType(C.shaderc_glsl_default_tess_control_shader) DefaultTessEcaluationShader = ShaderType(C.shaderc_glsl_default_tess_evaluation_shader) SPIRVAssembly = ShaderType(C.shaderc_spirv_assembly) )
const ( Vulkan Target = Target(C.shaderc_target_env_vulkan) // SPIR-V under Vulkan semantics OpenGL = Target(C.shaderc_target_env_opengl) // SPIR-V under OpenGL semantics // NOTE: SPIR-V code generation is not supported for shaders under OpenGL // compatibility profile. OpenGLCompat = Target(C.shaderc_target_env_opengl_compat) // SPIR-V under OpenGL semantics, // including compatibility profile // functions WebGPU = Target(C.shaderc_target_env_webgpu) // SPIR-V under WebGPU semantics Default = Vulkan )
const ( Vulkan_1_0 EnvVersion = EnvVersion(C.shaderc_env_version_vulkan_1_0) Vulkan_1_1 = EnvVersion(C.shaderc_env_version_vulkan_1_1) OpenGL_4_5 = EnvVersion(C.shaderc_env_version_opengl_4_5) WebGPUAll = EnvVersion(C.shaderc_env_version_webgpu) )
const ( Zero OptimizationLevel = OptimizationLevel(C.shaderc_optimization_level_zero) // no optimization Size = OptimizationLevel(C.shaderc_optimization_level_size) Performance = OptimizationLevel(C.shaderc_optimization_level_performance) )
const ( // Image and image buffer. UniformKindImage UniformKind = UniformKind(C.shaderc_uniform_kind_image) // Pure sampler. UniformKindSampler = UniformKind(C.shaderc_uniform_kind_sampler) // Sampled texture in GLSL, and Shader Resource View in HLSL. UniformKindTexture = UniformKind(C.shaderc_uniform_kind_texture) // Uniform Buffer Object (UBO) in GLSL. Cbuffer in HLSL. UniformKindBuffer = UniformKind(C.shaderc_uniform_kind_buffer) // Shader Storage Buffer Object (SSBO) in GLSL. UniformKindStorageBuffer = UniformKind(C.shaderc_uniform_kind_storage_buffer) // Unordered Access View, in HLSL. (Writable storage image or storage // buffer.) UniformKindUnorderedAccessView = UniformKind(C.shaderc_uniform_kind_unordered_access_view) )
const ( MaxLights ResourceLimit = ResourceLimit(C.shaderc_limit_max_lights) MaxClipPlanes = ResourceLimit(C.shaderc_limit_max_clip_planes) MaxTextureUnits = ResourceLimit(C.shaderc_limit_max_texture_units) MaxTextureCoords = ResourceLimit(C.shaderc_limit_max_texture_coords) MaxVertexAttribs = ResourceLimit(C.shaderc_limit_max_vertex_attribs) MaxVertexUniformComponents = ResourceLimit(C.shaderc_limit_max_vertex_uniform_components) MaxVaryingFloats = ResourceLimit(C.shaderc_limit_max_varying_floats) MaxVertexTextureImageUnits = ResourceLimit(C.shaderc_limit_max_vertex_texture_image_units) MaxCombinedTextureImageUnits = ResourceLimit(C.shaderc_limit_max_combined_texture_image_units) MaxTextureImageUnits = ResourceLimit(C.shaderc_limit_max_texture_image_units) MaxFragmentUniformComponents = ResourceLimit(C.shaderc_limit_max_fragment_uniform_components) MaxDrawBuffers = ResourceLimit(C.shaderc_limit_max_draw_buffers) MaxVertexUniformVectors = ResourceLimit(C.shaderc_limit_max_vertex_uniform_vectors) MaxVaryingVectors = ResourceLimit(C.shaderc_limit_max_varying_vectors) MaxFragmentUniformVectors = ResourceLimit(C.shaderc_limit_max_fragment_uniform_vectors) MaxVertexOutputVectors = ResourceLimit(C.shaderc_limit_max_vertex_output_vectors) MaxFragmentInputVectors = ResourceLimit(C.shaderc_limit_max_fragment_input_vectors) MinProgramTexelOffset = ResourceLimit(C.shaderc_limit_min_program_texel_offset) MaxProgramTexelOffset = ResourceLimit(C.shaderc_limit_max_program_texel_offset) MaxClipDistances = ResourceLimit(C.shaderc_limit_max_clip_distances) MaxComputeWorkGroupCountX = ResourceLimit(C.shaderc_limit_max_compute_work_group_count_x) MaxComputeWorkGroupCountY = ResourceLimit(C.shaderc_limit_max_compute_work_group_count_y) MaxComputeWorkGroupCountZ = ResourceLimit(C.shaderc_limit_max_compute_work_group_count_z) MaxComputeWorkGroupSizeX = ResourceLimit(C.shaderc_limit_max_compute_work_group_size_x) MaxComputeWorkGroupSizeY = ResourceLimit(C.shaderc_limit_max_compute_work_group_size_y) MaxComputeWorkGroupSizeZ = ResourceLimit(C.shaderc_limit_max_compute_work_group_size_z) MaxComputeUniformComponents = ResourceLimit(C.shaderc_limit_max_compute_uniform_components) MaxComputeTextureImageUnits = ResourceLimit(C.shaderc_limit_max_compute_texture_image_units) MaxComputeImageUniforms = ResourceLimit(C.shaderc_limit_max_compute_image_uniforms) MaxComputeAtomicCounters = ResourceLimit(C.shaderc_limit_max_compute_atomic_counters) MaxComputeAtomicCounterBuffers = ResourceLimit(C.shaderc_limit_max_compute_atomic_counter_buffers) MaxVaryingComponents = ResourceLimit(C.shaderc_limit_max_varying_components) MaxVertexOutputComponents = ResourceLimit(C.shaderc_limit_max_vertex_output_components) MaxGeometryInputComponents = ResourceLimit(C.shaderc_limit_max_geometry_input_components) MaxGeometryOutputComponents = ResourceLimit(C.shaderc_limit_max_geometry_output_components) MaxFragmentInputComponents = ResourceLimit(C.shaderc_limit_max_fragment_input_components) MaxImageUnits = ResourceLimit(C.shaderc_limit_max_image_units) MaxCombinedImageUnitsAndFragment_outputs = ResourceLimit(C.shaderc_limit_max_combined_image_units_and_fragment_outputs) MaxCombinedShaderOutputResources = ResourceLimit(C.shaderc_limit_max_combined_shader_output_resources) MaxImageSamples = ResourceLimit(C.shaderc_limit_max_image_samples) MaxVertexImageUniforms = ResourceLimit(C.shaderc_limit_max_vertex_image_uniforms) MaxTessControlImageUniforms = ResourceLimit(C.shaderc_limit_max_tess_control_image_uniforms) MaxTessEvaluationImageUniforms = ResourceLimit(C.shaderc_limit_max_tess_evaluation_image_uniforms) MaxGeometryImageUniforms = ResourceLimit(C.shaderc_limit_max_geometry_image_uniforms) MaxFragmentImageUniforms = ResourceLimit(C.shaderc_limit_max_fragment_image_uniforms) MaxCombinedImageUniforms = ResourceLimit(C.shaderc_limit_max_combined_image_uniforms) MaxGeometryTextureImageUnits = ResourceLimit(C.shaderc_limit_max_geometry_texture_image_units) MaxGeometryOutputVertices = ResourceLimit(C.shaderc_limit_max_geometry_output_vertices) MaxGeometryTotalOutputComponents = ResourceLimit(C.shaderc_limit_max_geometry_total_output_components) MaxGeometryUniformComponents = ResourceLimit(C.shaderc_limit_max_geometry_uniform_components) MaxGeometryVaryingComponents = ResourceLimit(C.shaderc_limit_max_geometry_varying_components) MaxTessControlInputComponents = ResourceLimit(C.shaderc_limit_max_tess_control_input_components) MaxTessControlOutputComponents = ResourceLimit(C.shaderc_limit_max_tess_control_output_components) MaxTessControlTextureImageUnits = ResourceLimit(C.shaderc_limit_max_tess_control_texture_image_units) MaxTessControlUniformComponents = ResourceLimit(C.shaderc_limit_max_tess_control_uniform_components) MaxTessControlTotalOutputComponents = ResourceLimit(C.shaderc_limit_max_tess_control_total_output_components) MaxTessEvaluationInputComponents = ResourceLimit(C.shaderc_limit_max_tess_evaluation_input_components) MaxTessEvaluationOutputComponents = ResourceLimit(C.shaderc_limit_max_tess_evaluation_output_components) MaxTessEvaluationTextureImageUnits = ResourceLimit(C.shaderc_limit_max_tess_evaluation_texture_image_units) MaxTessEvaluationUniformComponents = ResourceLimit(C.shaderc_limit_max_tess_evaluation_uniform_components) MaxTessPatchComponents = ResourceLimit(C.shaderc_limit_max_tess_patch_components) MaxPatchVertices = ResourceLimit(C.shaderc_limit_max_patch_vertices) MaxTessGenLevel = ResourceLimit(C.shaderc_limit_max_tess_gen_level) MaxViewports = ResourceLimit(C.shaderc_limit_max_viewports) MaxVertexAtomicCounters = ResourceLimit(C.shaderc_limit_max_vertex_atomic_counters) MaxTessControlAtomicCounters = ResourceLimit(C.shaderc_limit_max_tess_control_atomic_counters) MaxTessEvaluationAtomicCounters = ResourceLimit(C.shaderc_limit_max_tess_evaluation_atomic_counters) MaxGeometryAtomicCounters = ResourceLimit(C.shaderc_limit_max_geometry_atomic_counters) MaxFragmentAtomicCounters = ResourceLimit(C.shaderc_limit_max_fragment_atomic_counters) MaxCombinedAtomicCounters = ResourceLimit(C.shaderc_limit_max_combined_atomic_counters) MaxAtomicCounterBindings = ResourceLimit(C.shaderc_limit_max_atomic_counter_bindings) MaxVertexAtomicCounterBuffers = ResourceLimit(C.shaderc_limit_max_vertex_atomic_counter_buffers) MaxTessControlAtomicCounterBuffers = ResourceLimit(C.shaderc_limit_max_tess_control_atomic_counter_buffers) MaxTessEvaluationAtomicCounterBuffers = ResourceLimit(C.shaderc_limit_max_tess_evaluation_atomic_counter_buffers) MaxGeometryAtomicCounterBuffers = ResourceLimit(C.shaderc_limit_max_geometry_atomic_counter_buffers) MaxFragmentAtomicCounterBuffers = ResourceLimit(C.shaderc_limit_max_fragment_atomic_counter_buffers) MaxCombinedAtomicCounterBuffers = ResourceLimit(C.shaderc_limit_max_combined_atomic_counter_buffers) MaxAtomicCounterBufferSize = ResourceLimit(C.shaderc_limit_max_atomic_counter_buffer_size) MaxTransformFeedbackBuffers = ResourceLimit(C.shaderc_limit_max_transform_feedback_buffers) MaxTransformFeedbackInterleavedComponents = ResourceLimit(C.shaderc_limit_max_transform_feedback_interleaved_components) MaxCullDistances = ResourceLimit(C.shaderc_limit_max_cull_distances) MaxCombinedClipAndCullDistances = ResourceLimit(C.shaderc_limit_max_combined_clip_and_cull_distances) MaxSamples = ResourceLimit(C.shaderc_limit_max_samples) )
Some vim regex foo, incase this list ever needs to be regenerated
s/\(shaderc_\(.*\)\),/\2=ResourceLimit(C.\1)/g s/^\s\+limit_max_\([a-z]\+\)/Max\u\1/g s/^\s\+limit_max_\([a-z]\+\)_\([a-z]\+\)_\([a-z]\+\)_\([a-z]\+\)_\([a-z]\+\)/Max\u\1\u\2\u\3\u\4\u\5/g
const ( TargetVulkan11 string = "vulkan_1_1" TargetVulkan10 = "vulkan_1_0" TargetOpenGL = "opengl" TargetOpenGLCompat = "opengl_compat" TargetWebGPU = "webgpu" )
Variables ¶
var CompilationError = fmt.Errorf("compilation error")
var ConfigurationError = fmt.Errorf("configuration error")
var InternalError = fmt.Errorf("internal error")
var InvalidAssemblyError = fmt.Errorf("invalid assembly error")
var InvalidStageError = fmt.Errorf("invalid stage")
var NullResultObjectError = fmt.Errorf("null result object error")
var TransformationError = fmt.Errorf("transformation error")
var ValidationError = fmt.Errorf("validation error")
Functions ¶
func CompileShader ¶
CompileShader is a utility function for compiling a shader, it will determine the shader type based upon filename, and will default to vulkan_1_1 if no target type is specified. It assumes a default entry point of "main"
func GetShaderExtensionByType ¶
func GetShaderExtensionByType(stype ShaderType) string
Types ¶
type CompilationResult ¶
type CompilationResult struct {
// contains filtered or unexported fields
}
CompilationResult the result of compiling stuff
func (*CompilationResult) Bytes ¶
func (c *CompilationResult) Bytes() []byte
Bytes returns the resulting compiled item
func (*CompilationResult) Error ¶
func (c *CompilationResult) Error() error
Error returns a generic error message
func (*CompilationResult) ErrorMessage ¶
func (c *CompilationResult) ErrorMessage() string
ErrorMessage returns a specific error message
func (*CompilationResult) NumErrors ¶
func (c *CompilationResult) NumErrors() int
NumErrors returns the number of errors
func (*CompilationResult) NumWarnings ¶
func (c *CompilationResult) NumWarnings() int
NumWarnings returns the number of warnings
func (*CompilationResult) Release ¶
func (c *CompilationResult) Release()
Release releases the compilation results
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
func (*Compiler) AssembleIntoSPV ¶
func (c *Compiler) AssembleIntoSPV(source string, options *CompilerOptions) *CompilationResult
AssembleIntoSPV Takes an assembly string of the format defined in the SPIRV-Tools project (https://github.com/KhronosGroup/SPIRV-Tools/blob/master/syntax.md), assembles it into SPIR-V binary and a shaderc_compilation_result will be returned to hold the results. The assembling will pick options suitable for assembling specified in the additional_options parameter. May be safely called from multiple threads without explicit synchronization. If there was failure in allocating the compiler object, null will be returned.
func (*Compiler) CompileIntoPreProcessedText ¶
func (c *Compiler) CompileIntoPreProcessedText(source string, shaderType ShaderType, inputFilename string, entryPoint string, options *CompilerOptions) *CompilationResult
CompileIntoPreProcessedText Like shaderc_compile_into_spv, but the result contains SPIR-V assembly text instead of a SPIR-V binary module. The SPIR-V assembly syntax is as defined by the SPIRV-Tools open source project.
func (*Compiler) CompileIntoSPV ¶
func (c *Compiler) CompileIntoSPV(source string, shaderType ShaderType, inputFilename string, entryPoint string, options *CompilerOptions) *CompilationResult
CompileIntoSPV Takes a GLSL source string and the associated shader kind, input file name, compiles it according to the given additional_options. If the shader kind is not set to a specified kind, but shaderc_glslc_infer_from_source, the compiler will try to deduce the shader kind from the source string and a failure in deducing 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 default shader kind in case it failed to deduce the shader kind from 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 source string will be compiled into SPIR-V binary and a shaderc_compilation_result will be returned to hold the results. The entry_point_name null-terminated string defines the name of the entry point to associate with this GLSL source. If the additional_options parameter is not null, then the compilation is modified by any options present. May be safely called from multiple threads without explicit synchronization. If there was failure in allocating the compiler object, null will be returned.
type CompilerOptions ¶
type CompilerOptions struct {
// contains filtered or unexported fields
}
CommpilerOptions allows specific compiler options to be set
func NewCompilerOptions ¶
func NewCompilerOptions() *CompilerOptions
NewCompilerOptions creates a new compiler options object
func (*CompilerOptions) AddMacroDefinition ¶
func (c *CompilerOptions) AddMacroDefinition(name, value string)
AddMacroDefinition Adds a predefined macro to the compilation options. This has the same effect as passing -Dname=value to the command-line compiler. If value is NULL, it has the same effect as passing -Dname to the command-line compiler. If a macro definition with the same name has previously been added, the value is replaced with the new value. The macro name and value are passed in with char pointers, which point to their data, and the lengths of their data.
func (*CompilerOptions) Clone ¶
func (c *CompilerOptions) Clone() *CompilerOptions
Clone clones a copy of the compiler options
func (*CompilerOptions) SetAutoBindUniforms ¶
func (c *CompilerOptions) SetAutoBindUniforms(auto bool)
SetAutoBindUniforms Sets whether the compiler should automatically assign bindings to uniforms that aren't already explicitly bound in the shader source.
func (*CompilerOptions) SetBindingBase ¶
func (c *CompilerOptions) SetBindingBase(kind UniformKind, base uint32)
SetBindingBase Sets the base binding number used for for a uniform resource type when automatically assigning bindings. For GLSL compilation, sets the lowest automatically assigned number. For HLSL compilation, the regsiter number assigned to the resource is added to this specified base.
func (*CompilerOptions) SetIncludeCallback ¶
func (c *CompilerOptions) SetIncludeCallback(resolver IncludeResolver)
SetIncludeCallback sets a include resolver
func (*CompilerOptions) SetInvertY ¶
func (c *CompilerOptions) SetInvertY(enabled bool)
SetInvertY Sets whether the compiler should invert position.Y output in vertex shader.
func (*CompilerOptions) SetLimit ¶
func (c *CompilerOptions) SetLimit(limit ResourceLimit, value int)
SetLimit sets a resource limit
func (*CompilerOptions) SetNanClamp ¶
func (c *CompilerOptions) SetNanClamp(enabled bool)
SetNanClamp Sets whether the compiler generates code for max and min builtins which, if given a NaN operand, will return the other operand. Similarly, the clamp builtin will favour the non-NaN operands, as if clamp were implemented as a composition of max and min.
func (*CompilerOptions) SetOptimizationLevel ¶
func (c *CompilerOptions) SetOptimizationLevel(level OptimizationLevel)
SetOptimizationLevel Sets the compiler optimization level to the given level. Only the last one takes effect if multiple calls of this function exist.
func (*CompilerOptions) SetSPIRVVersion ¶
func (c *CompilerOptions) SetSPIRVVersion(version SPIRVVersion)
SetSPIRVVersion Sets the target SPIR-V version. The generated module will use this version of SPIR-V. Each target environment determines what versions of SPIR-V it can consume. Defaults to the highest version of SPIR-V 1.0 which is required to be supported by the target environment. E.g. Default to SPIR-V 1.0 for Vulkan 1.0 and SPIR-V 1.3 for Vulkan 1.1.
func (*CompilerOptions) SetTargetByName ¶
func (c *CompilerOptions) SetTargetByName(target string) error
func (*CompilerOptions) SetTargetEnv ¶
func (c *CompilerOptions) SetTargetEnv(target Target, version EnvVersion)
SetTargetEnv Sets the target shader environment, affecting which warnings or errors will be issued. The version will be for distinguishing between different versions of the target environment. The version value should be either 0 or a value listed in shaderc_env_version. The 0 value maps to Vulkan 1.0 if |target| is Vulkan, and it maps to OpenGL 4.5 if |target| is OpenGL.
func (*CompilerOptions) SetWarningsAsErrors ¶
func (c *CompilerOptions) SetWarningsAsErrors()
SetWarningsAsErrors Sets the compiler mode to treat all warnings as errors. Note the suppress-warnings mode overrides this option, i.e. if both warning-as-errors and suppress-warnings modes are set, warnings will not be emitted as error messages.
func (*CompilerOptions) SuppressWarnings ¶
func (c *CompilerOptions) SuppressWarnings()
SuppressWarnings Sets the compiler mode to suppress warnings, overriding warnings-as-errors mode. When both suppress-warnings and warnings-as-errors modes are turned on, warning messages will be inhibited, and will not be emitted as error messages.
type EnvVersion ¶
type EnvVersion int
type IncludeResolver ¶
type IncludeResolver func(requestedSource string, itype IncludeType, requestingSource string, includeDepth int) (sourceName, content string, err error)
IncludeResolver An includer resolver type for mapping an #include request to an include result. The requested_source parameter specifies the name of the source being requested. The type parameter specifies the kind of inclusion request being made. The requesting_source parameter specifies the name of the source containing the #include request. Returns the name of the source file, the contents and optionally an error
func CreateDefaultIncludeResolver ¶
func CreateDefaultIncludeResolver(dirs []string) IncludeResolver
CreateDefaultIncludeResolver returns a basic include resolover which looks for files in a list of specified directories
type IncludeType ¶
type IncludeType int
const ( // IncludeRelative E.g. #include "source" IncludeRelative IncludeType = IncludeType(C.shaderc_include_type_relative) // IncludeStandard E.g. #include <source> IncludeStandard = IncludeType(C.shaderc_include_type_standard) )
type OptimizationLevel ¶
type OptimizationLevel int
type ResourceLimit ¶
type ResourceLimit int
type SPIRVVersion ¶
type SPIRVVersion int
const ( SPIRV_1_0 SPIRVVersion = SPIRVVersion(C.shaderc_spirv_version_1_0) SPIRV_1_1 SPIRVVersion = SPIRVVersion(C.shaderc_spirv_version_1_1) SPIRV_1_2 SPIRVVersion = SPIRVVersion(C.shaderc_spirv_version_1_2) SPIRV_1_3 SPIRVVersion = SPIRVVersion(C.shaderc_spirv_version_1_3) SPIRV_1_4 SPIRVVersion = SPIRVVersion(C.shaderc_spirv_version_1_4) SPIRV_1_5 SPIRVVersion = SPIRVVersion(C.shaderc_spirv_version_1_5) )
type ShaderType ¶
type ShaderType int
func GetShaderTypeByFilename ¶
func GetShaderTypeByFilename(filename string) ShaderType
type UniformKind ¶
type UniformKind int
Uniform resource kinds. In Vulkan, uniform resources are bound to the pipeline via descriptors with numbered bindings and sets.