shadercross topic

Simple DirectMedia Layer Shader Cross Compiler Copyright (C) 2024 Sam Lantinga slouken@libsdl.org

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

Functions

sdlShaderCrossCompileComputePipelineFromSpirv(Pointer<SdlGpuDevice> device, Pointer<SdlShaderCrossSpirvInfo> info, Pointer<SdlShaderCrossComputePipelineMetadata> metadata, int props) Pointer<SdlGpuComputePipeline> shadercross
Compile an SDL GPU compute pipeline from SPIRV code. If your shader source is HLSL, you should obtain SPIR-V bytecode from SDL_ShaderCross_CompileSPIRVFromHLSL().
sdlShaderCrossCompileDxbcFromHlsl(Pointer<SdlShaderCrossHlslInfo> info, Pointer<Uint32> size) Pointer<NativeType> shadercross
Compile to DXBC bytecode from HLSL code via a SPIRV-Cross round trip.
sdlShaderCrossCompileDxbcFromSpirv(Pointer<SdlShaderCrossSpirvInfo> info, Pointer<Uint32> size) Pointer<NativeType> shadercross
Compile DXBC bytecode from SPIRV code.
sdlShaderCrossCompileDxilFromHlsl(Pointer<SdlShaderCrossHlslInfo> info, Pointer<Uint32> size) Pointer<NativeType> shadercross
Compile to DXIL bytecode from HLSL code via a SPIRV-Cross round trip.
sdlShaderCrossCompileDxilFromSpirv(Pointer<SdlShaderCrossSpirvInfo> info, Pointer<Uint32> size) Pointer<NativeType> shadercross
Compile DXIL bytecode from SPIRV code.
sdlShaderCrossCompileGraphicsShaderFromSpirv(Pointer<SdlGpuDevice> device, Pointer<SdlShaderCrossSpirvInfo> info, Pointer<SdlShaderCrossGraphicsShaderResourceInfo> resourceInfo, int props) Pointer<SdlGpuShader> shadercross
Compile an SDL GPU shader from SPIRV code. If your shader source is HLSL, you should obtain SPIR-V bytecode from SDL_ShaderCross_CompileSPIRVFromHLSL().
sdlShaderCrossCompileSpirvFromHlsl(Pointer<SdlShaderCrossHlslInfo> info, Pointer<Uint32> size) Pointer<NativeType> shadercross
Compile to SPIRV bytecode from HLSL code.
sdlShaderCrossGetHlslShaderFormats() int shadercross
Get the supported shader formats that HLSL cross-compilation can output
sdlShaderCrossGetSpirvShaderFormats() int shadercross
Get the supported shader formats that SPIRV cross-compilation can output
sdlShaderCrossInit() bool shadercross
Initializes SDL_shadercross
sdlShaderCrossQuit() → void shadercross
De-initializes SDL_shadercross
sdlShaderCrossReflectComputeSpirv(Pointer<Uint8> bytecode, int bytecodeSize, int props) Pointer<SdlShaderCrossComputePipelineMetadata> shadercross
Reflect compute pipeline info from SPIRV code. If your shader source is HLSL, you should obtain SPIR-V bytecode from SDL_ShaderCross_CompileSPIRVFromHLSL(). This must be freed with SDL_free() when you are done with the metadata.
sdlShaderCrossReflectGraphicsSpirv(Pointer<Uint8> bytecode, int bytecodeSize, int props) Pointer<SdlShaderCrossGraphicsShaderMetadata> shadercross
Reflect graphics shader info from SPIRV code. If your shader source is HLSL, you should obtain SPIR-V bytecode from SDL_ShaderCross_CompileSPIRVFromHLSL(). This must be freed with SDL_free() when you are done with the metadata.
sdlShaderCrossTranspileHlslFromSpirv(Pointer<SdlShaderCrossSpirvInfo> info) Pointer<NativeType> shadercross
Transpile to HLSL code from SPIRV code.
sdlShaderCrossTranspileMslFromSpirv(Pointer<SdlShaderCrossSpirvInfo> info) Pointer<NativeType> shadercross
Transpile to MSL code from SPIRV code.