Vulkan2D
2D renderer written in C using Vulkan and SDL2
|
Makes shaders possible in VK2D. More...
Go to the source code of this file.
Functions | |
VK2DShader | vk2dShaderLoad (const char *vertexShader, const char *fragmentShader, uint32_t uniformBufferSize) |
Creates a shader you can use to render textures. More... | |
VK2DShader | vk2dShaderFrom (uint8_t *vertexShaderBuffer, int vertexShaderBufferSize, uint8_t *fragmentShaderBuffer, int fragmentShaderBufferSize, uint32_t uniformBufferSize) |
Creates a shader you can use to render textures from an in-memory buffer. More... | |
void | vk2dShaderFree (VK2DShader shader) |
Frees a shader from memory. More... | |
Makes shaders possible in VK2D.
void vk2dShaderFree | ( | VK2DShader | shader | ) |
Frees a shader from memory.
shader | Shader to free |
VK2DShader vk2dShaderFrom | ( | uint8_t * | vertexShaderBuffer, |
int | vertexShaderBufferSize, | ||
uint8_t * | fragmentShaderBuffer, | ||
int | fragmentShaderBufferSize, | ||
uint32_t | uniformBufferSize | ||
) |
Creates a shader you can use to render textures from an in-memory buffer.
vertexShaderBuffer | Buffer containing compiled SPIR-V shader code |
vertexShaderBufferSize | Size of the vertexShaderBuffer buffer in bytes |
fragmentShaderBuffer | File containing the compiled SPIR-V fragment shader |
fragmentShaderBufferSize | Size of the fragmentShaderBuffer buffer in bytes |
uniformBufferSize | Size of the shader's expected uniform buffer (0 is valid) |
maxShaderBufferSize
field of vk2dRendererGetLimits
Check the shaders shaders/tex.vert and shaders/tex.frag for information on how the shaders should be set up. You may choose to not include a uniform buffer if you specify a uniform buffer size of 0.
VK2DShader vk2dShaderLoad | ( | const char * | vertexShader, |
const char * | fragmentShader, | ||
uint32_t | uniformBufferSize | ||
) |
Creates a shader you can use to render textures.
vertexShader | File containing the compiled SPIR-V vertex shader |
fragmentShader | File containing the compiled SPIR-V fragment shader |
uniformBufferSize | Size of the shader's expected uniform buffer (0 is valid) |
maxShaderBufferSize
field of vk2dRendererGetLimits
Check the shaders shaders/tex.vert and shaders/tex.frag for information on how the shaders should be set up. You may choose to not include a uniform buffer if you specify a uniform buffer size of 0.