UgShaderProgram
Linked vertex and fragment shader program
It
Vertex and fragment shader pair with their pipeline stage info
struct It {
VkPipelineShaderStageCreateInfo handle[2];
VkShaderModule vertexShader;
VkShaderModule fragmentShader;
};createShaderInfo
Build the pipeline shader stage create info for a single stage
VkPipelineShaderStageCreateInfo createShaderInfo(VkShaderStageFlagBits stage, VkShaderModule shader);Parameters
stage— Shader stage flag (vertex or fragment)shader— Shader module to attach
Returns — Populated pipeline shader stage create info
create
Create a shader program from vertex and fragment SPIR-V files
UgShaderProgram.It create(UgContext.It& ctx, const I8* vertexSource, const I8* fragmentSource);Parameters
ctx— Vulkan contextvertexSource— Path to the compiled vertex SPIR-V binaryfragmentSource— Path to the compiled fragment SPIR-V binary
Returns — Initialized shader program object
destroy
Destroy a shader program and both its shader modules
U0 destroy(UgContext.It& ctx, UgShaderProgram.It& shaderProgram);Parameters
ctx— Vulkan contextshaderProgram— Shader program to destroy