Skip to content

Commit 5d35e62

Browse files
committed
Fix ShaderLoader treating built-in attributes as user-defined attributes.
1 parent c8864d7 commit 5d35e62

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

repentogon/ShaderLoader.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ static std::vector<GLVertexAttribute> get_shader_vertex_attributes(const KAGE_Gr
9999
for (GLuint i = 0; i < (GLuint)count; i++)
100100
{
101101
glGetActiveAttrib(program, i, maxLength, &length, &size, &type, name.data());
102-
attributes.emplace_back(std::string_view(name.data(), length), type);
102+
auto str = std::string_view(name.data(), length);
103+
if (str.substr(0, 3) == "gl_")
104+
{
105+
continue;
106+
}
107+
attributes.emplace_back(str, type);
103108
}
104109

105110
return attributes;

0 commit comments

Comments
 (0)