Flint Engine
Modular C++20 2D game engine powered by SDL3
Loading...
Searching...
No Matches

◆ loadFromMemory()

bool Flint::Shader::loadFromMemory ( ShaderStage stage,
const void * data,
size_t size,
Uint32 numSamplers = 0,
Uint32 numStorageTextures = 0,
Uint32 numStorageBuffers = 0,
Uint32 numUniformBuffers = 0 )
inline

Compile and upload a shader stage from bytecode already present in memory.

The supplied data must remain valid for the duration of the call. Reloading a stage replaces any existing SDL shader of the same type after releasing it.

Parameters
stageWhich stage to load (Vertex or Fragment).
dataPointer to shader bytecode.
sizeSize of data in bytes.
numSamplersNumber of texture samplers declared in the shader.
numStorageTexturesNumber of storage textures declared in the shader.
numStorageBuffersNumber of storage buffers declared in the shader.
numUniformBuffersNumber of uniform buffers declared in the shader.
Returns
true if creation succeeded; false if SDL reports an error.

Definition at line 119 of file shaders.h.