Documentation
¶
Index ¶
- Constants
- func CloseLibrary() error
- func CompileComputePipelineFromSPIRV(device *sdl.GPUDevice, info *SPIRVInfo, metadata *ComputePipelineMetadata, ...) (*sdl.GPUComputePipeline, error)
- func CompileDXBCFromHLSL(info *HLSLInfo) ([]byte, error)
- func CompileDXBCFromSPIRV(info *SPIRVInfo) ([]byte, error)
- func CompileDXILFromHLSL(info *HLSLInfo) ([]byte, error)
- func CompileDXILFromSPIRV(info *SPIRVInfo) ([]byte, error)
- func CompileGraphicsShaderFromSPIRV(device *sdl.GPUDevice, info *SPIRVInfo, ...) (*sdl.GPUShader, error)
- func CompileSPIRVFromHLSL(info *HLSLInfo) ([]byte, error)
- func GetHLSLShaderFormats() (sdl.GPUShaderFormat, error)
- func GetSPIRVShaderFormats() (sdl.GPUShaderFormat, error)
- func Init() error
- func LoadLibrary(path string) error
- func Path() string
- func Quit()
- func TranspileHLSLFromSPIRV(info *SPIRVInfo) (string, error)
- func TranspileMSLFromSPIRV(info *SPIRVInfo) (string, error)
- type ComputePipelineMetadata
- type GraphicsShaderMetadata
- type GraphicsShaderResourceInfo
- type HLSLDefine
- type HLSLInfo
- type IOVarMetadata
- type IOVarType
- type SPIRVInfo
- type ShaderStage
Constants ¶
View Source
const ( PROP_SHADER_DEBUG_ENABLE_BOOLEAN = "SDL_shadercross.spirv.debug.enable" PROP_SHADER_DEBUG_NAME_STRING = "SDL_shadercross.spirv.debug.name" PROP_SHADER_CULL_UNUSED_BINDINGS_BOOLEAN = "SDL_shadercross.spirv.cull_unused_bindings" PROP_SPIRV_PSSL_COMPATIBILITY_BOOLEAN = "SDL_shadercross.spirv.pssl.compatibility" PROP_SPIRV_MSL_VERSION_STRING = "SDL_shadercross.spirv.msl.version" )
Variables ¶
This section is empty.
Functions ¶
func CloseLibrary ¶
func CloseLibrary() error
CloseLibrary releases resources associated with the library.
func CompileComputePipelineFromSPIRV ¶
func CompileComputePipelineFromSPIRV(device *sdl.GPUDevice, info *SPIRVInfo, metadata *ComputePipelineMetadata, props sdl.PropertiesID) (*sdl.GPUComputePipeline, error)
func CompileDXBCFromHLSL ¶
func CompileDXBCFromSPIRV ¶
func CompileDXILFromHLSL ¶
func CompileDXILFromSPIRV ¶
func CompileGraphicsShaderFromSPIRV ¶
func CompileGraphicsShaderFromSPIRV(device *sdl.GPUDevice, info *SPIRVInfo, resourceInfo *GraphicsShaderResourceInfo, props sdl.PropertiesID) (*sdl.GPUShader, error)
func CompileSPIRVFromHLSL ¶
func GetHLSLShaderFormats ¶
func GetHLSLShaderFormats() (sdl.GPUShaderFormat, error)
func GetSPIRVShaderFormats ¶
func GetSPIRVShaderFormats() (sdl.GPUShaderFormat, error)
func LoadLibrary ¶
LoadLibrary loads SDL_shadercross library and initializes all functions.
func Path ¶
func Path() string
Path returns the library installation path based on the operating system
func TranspileHLSLFromSPIRV ¶
func TranspileMSLFromSPIRV ¶
Types ¶
type ComputePipelineMetadata ¶
type ComputePipelineMetadata struct {
NumSamplers uint32 /**< The number of samplers defined in the shader. */
NumReadonlyStorageTextures uint32 /**< The number of readonly storage textures defined in the shader. */
NumReadonlyStorageBuffers uint32 /**< The number of readonly storage buffers defined in the shader. */
NumReadwriteStorageTextures uint32 /**< The number of read-write storage textures defined in the shader. */
NumReadwriteStorageBuffers uint32 /**< The number of read-write storage buffers defined in the shader. */
NumUniformBuffers uint32 /**< The number of uniform buffers defined in the shader. */
ThreadcountX uint32 /**< The number of threads in the X dimension. */
ThreadcountY uint32 /**< The number of threads in the Y dimension. */
ThreadcountZ uint32 /**< The number of threads in the Z dimension. */
}
func ReflectComputeSPIRV ¶
func ReflectComputeSPIRV(bytecode []byte, props sdl.PropertiesID) (*ComputePipelineMetadata, error)
type GraphicsShaderMetadata ¶
type GraphicsShaderMetadata struct {
ResourceInfo *GraphicsShaderResourceInfo /**< Sub-struct containing the resource info of the shader. */
Inputs []IOVarMetadata /**< The inputs defined in the shader. */
Outputs []IOVarMetadata /**< The outputs defined in the shader. */
}
func ReflectGraphicsSPIRV ¶
func ReflectGraphicsSPIRV(bytecode []byte, props sdl.PropertiesID) (*GraphicsShaderMetadata, error)
type GraphicsShaderResourceInfo ¶
type GraphicsShaderResourceInfo struct {
NumSamplers uint32 /**< The number of samplers defined in the shader. */
NumStorageTextures uint32 /**< The number of storage textures defined in the shader. */
NumStorageBuffers uint32 /**< The number of storage buffers defined in the shader. */
NumUniformBuffers uint32 /**< The number of uniform buffers defined in the shader. */
}
type HLSLDefine ¶
type HLSLInfo ¶
type HLSLInfo struct {
Source string /**< The HLSL source code for the shader. */
Entrypoint string /**< The entry point function name for the shader in UTF-8. */
IncludeDir string /**< The include directory for shader code. Optional, can be NULL. */
Defines []HLSLDefine /**< An array of defines. Optional, can be NULL. If not NULL, must be terminated with a fully NULL define struct. */
ShaderStage ShaderStage /**< The shader stage to compile the shader with. */
Props sdl.PropertiesID /**< A properties ID for extensions. Should be 0 if no extensions are needed. */
}
type IOVarMetadata ¶
type SPIRVInfo ¶
type SPIRVInfo struct {
Bytecode []byte /**< The SPIRV bytecode. */
Entrypoint string /**< The entry point function name for the shader in UTF-8. */
ShaderStage ShaderStage /**< The shader stage to transpile the shader with. */
Props sdl.PropertiesID /**< A properties ID for extensions. Should be 0 if no extensions are needed. */
}
type ShaderStage ¶
type ShaderStage int32
const ( SHADERSTAGE_VERTEX ShaderStage = iota SHADERSTAGE_FRAGMENT SHADERSTAGE_COMPUTE )
Click to show internal directories.
Click to hide internal directories.