Module dagon.core.shaderloader

Utilities for compiling and linking OpenGL shaders.

Description

The dagon.core.shaderloader module defines functions for compiling individual shader stages from source code, linking multiple shaders into a program, and checking compilation/linking status with detailed logging. The module supports all standard OpenGL shader stages, including vertex, tessellation control/evaluation, geometry, fragment, and (if supported) compute shaders.

Functions

NameDescription
checkCompilation(shaderID, stage) Checks the compilation status of a shader and logs errors or warnings.
checkLinking(programID) Checks the linking status of a shader program and logs errors or warnings.
compileShader(source, stage) Compiles a single shader from source code.
isFieldsOffsetAligned() Checks if all fields of a struct are aligned to the specified number of bytes.
linkShaders(shaderIDs) Links multiple compiled shaders into a single OpenGL program.
shaderStageToGLenum(stage) Converts a ShaderStage to the corresponding OpenGL enum value.

Enums

NameDescription
ShaderStage Enumerates supported OpenGL shader stages.

Aliases

NameTypeDescription
isStd140Compliant isFieldsOffsetAligned!(T,16) Alias for checking std140 alignment compliance for a struct.