1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-27 06:35:04 +00:00

Improves automatic index generation, to allow for matrices implicitly taking up to four slots.

This commit is contained in:
Thomas Harte 2019-01-30 18:20:42 -05:00
parent 5002290428
commit 122857e5b5
2 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ Shader::Shader(const std::string &vertex_shader, const std::string &fragment_sha
GLuint index = 0;
for(const auto &name: binding_names) {
bindings.emplace_back(name, index);
++index;
index += 4;
}
init(vertex_shader, fragment_shader, bindings);
}

View File

@ -50,7 +50,7 @@ public:
Attempts to compile a shader, throwing @c VertexShaderCompilationError, @c FragmentShaderCompilationError or @c ProgramLinkageError upon failure.
@param vertex_shader The vertex shader source code.
@param fragment_shader The fragment shader source code.
@param binding_names A list of attributes to generate bindings for; these will be given indices 0...n-1.
@param binding_names A list of attributes to generate bindings for; these will be given indices 0, 4, 8 ... 4(n-1).
*/
Shader(const std::string &vertex_shader, const std::string &fragment_shader, const std::vector<std::string> &binding_names);
~Shader();