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:
parent
5002290428
commit
122857e5b5
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user