Limitations
This document describes the known limitations of the AXSLC compiler.
Type System Limitations
AXSLC does not catch type-level errors. These are delegated to the downstream GLSL compiler.
What AXSLC Does Not Check
- Type errors - wrong argument types to functions
- Type mismatches - assigning
inttofloatwithout cast - Missing main function - shader entry point validation
- Interface block mismatches - mismatches between shader stages
These are reported by the GLSL compiler (OpenGL driver) when you call glCompileShader. Always check the GLSL compiler's error log.
Example Workflow
cpp
// Compile AXSL
Compiler compiler;
auto result = compiler.compile(source, "shader.axsl");
if (!result.errors.empty()) {
// AXSLC errors (symbol resolution, includes, parse errors)
for (const auto& err : result.errors) {
std::cerr << err << std::endl;
}
return 1;
}
// Write GLSL files
write_file("shader.vert.glsl", result.stages[StageKind::Vertex]);
// Compile with OpenGL
GLuint shader = glCreateShader(GL_VERTEX_SHADER);
const char* source_cstr = result.stages[StageKind::Vertex].c_str();
glShaderSource(shader, 1, &source_cstr, nullptr);
glCompileShader(shader);
// Check GLSL compilation status
GLint success;
glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
if (!success) {
// GLSL errors (type errors, etc.)
char info_log[512];
glGetShaderInfoLog(shader, 512, nullptr, info_log);
std::cerr << "GLSL compilation failed:\n" << info_log << std::endl;
}Best Practices
- Fix AXSLC errors first - symbol resolution and syntax errors before worrying about GLSL type errors
- Check both compilers - AXSLC for structure, GLSL for semantics
- Use verbose mode (
-v) to see which stages are being compiled - Verify output files - inspect generated
.glslfiles if GLSL compilation fails