sdlShaderCrossReflectComputeSpirv function 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.
\param bytecode the SPIRV bytecode. \param bytecode_size the length of the SPIRV bytecode. \param props a properties object filled in with extra shader metadata, provided by the user. \returns A metadata struct on success, NULL otherwise.
\threadsafety It is safe to call this function from any thread.
extern SDL_DECLSPEC SDL_ShaderCross_ComputePipelineMetadata * SDLCALL SDL_ShaderCross_ReflectComputeSPIRV( const Uint8 *bytecode, size_t bytecode_size, SDL_PropertiesID props)
Implementation
Pointer<SdlShaderCrossComputePipelineMetadata>
sdlShaderCrossReflectComputeSpirv(
Pointer<Uint8> bytecode,
int bytecodeSize,
int props,
) {
final sdlShaderCrossReflectComputeSpirvLookupFunction = _libShadercross
.lookupFunction<
Pointer<SdlShaderCrossComputePipelineMetadata> Function(
Pointer<Uint8> bytecode,
Uint32 bytecodeSize,
Uint32 props,
),
Pointer<SdlShaderCrossComputePipelineMetadata> Function(
Pointer<Uint8> bytecode,
int bytecodeSize,
int props,
)
>('SDL_ShaderCross_ReflectComputeSPIRV');
return sdlShaderCrossReflectComputeSpirvLookupFunction(
bytecode,
bytecodeSize,
props,
);
}