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:
- 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.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
- This notice may not be removed or altered from any source distribution.
Classes
- SdlkShadercrossIovarType shadercross
- SdlkShadercrossProp shadercross
- SdlkShadercrossShaderstage shadercross
- SdlShaderCrossComputePipelineMetadata shadercross
- SdlShaderCrossGraphicsShaderMetadata shadercross
- SdlShaderCrossGraphicsShaderResourceInfo shadercross
- SdlShaderCrossHlslDefine shadercross
- SdlShaderCrossHlslInfo shadercross
- SdlShaderCrossIoVarMetadata shadercross
- SdlShaderCrossSpirvInfo shadercross
Extensions
Functions
-
sdlShaderCrossCompileComputePipelineFromSpirv(
Pointer< shadercrossSdlGpuDevice> device, Pointer<SdlShaderCrossSpirvInfo> info, Pointer<SdlShaderCrossComputePipelineMetadata> metadata, int props) → Pointer<SdlGpuComputePipeline> - 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< shadercrossSdlShaderCrossHlslInfo> info, Pointer<Uint32> size) → Pointer<NativeType> - Compile to DXBC bytecode from HLSL code via a SPIRV-Cross round trip.
-
sdlShaderCrossCompileDxbcFromSpirv(
Pointer< shadercrossSdlShaderCrossSpirvInfo> info, Pointer<Uint32> size) → Pointer<NativeType> - Compile DXBC bytecode from SPIRV code.
-
sdlShaderCrossCompileDxilFromHlsl(
Pointer< shadercrossSdlShaderCrossHlslInfo> info, Pointer<Uint32> size) → Pointer<NativeType> - Compile to DXIL bytecode from HLSL code via a SPIRV-Cross round trip.
-
sdlShaderCrossCompileDxilFromSpirv(
Pointer< shadercrossSdlShaderCrossSpirvInfo> info, Pointer<Uint32> size) → Pointer<NativeType> - Compile DXIL bytecode from SPIRV code.
-
sdlShaderCrossCompileGraphicsShaderFromSpirv(
Pointer< shadercrossSdlGpuDevice> device, Pointer<SdlShaderCrossSpirvInfo> info, Pointer<SdlShaderCrossGraphicsShaderResourceInfo> resourceInfo, int props) → Pointer<SdlGpuShader> - 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< shadercrossSdlShaderCrossHlslInfo> info, Pointer<Uint32> size) → Pointer<NativeType> - 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< shadercrossUint8> bytecode, int bytecodeSize, int props) → Pointer<SdlShaderCrossComputePipelineMetadata> - 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< shadercrossUint8> bytecode, int bytecodeSize, int props) → Pointer<SdlShaderCrossGraphicsShaderMetadata> - 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< shadercrossSdlShaderCrossSpirvInfo> info) → Pointer<NativeType> - Transpile to HLSL code from SPIRV code.
-
sdlShaderCrossTranspileMslFromSpirv(
Pointer< shadercrossSdlShaderCrossSpirvInfo> info) → Pointer<NativeType> - Transpile to MSL code from SPIRV code.