diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-02-15 21:14:46 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-02-15 21:16:08 +0300 |
commit | e401e2d89c2a98ced3509fcc89b3dfb300158f9c (patch) | |
tree | af24f0eab07511b270194be950cc895365ba72f3 /intern/gawain | |
parent | 4438325ec91dac9ab0c30b910c9bd6a4fb1471c1 (diff) |
GWN: Fix attrib arrays giving incorrect name depending on the platform.
It seems that some opengl implementations are returning "[0]" after array names but some others dont.
Remove the "[0]" so everything is consistent.
Diffstat (limited to 'intern/gawain')
-rw-r--r-- | intern/gawain/src/gwn_shader_interface.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/gawain/src/gwn_shader_interface.c b/intern/gawain/src/gwn_shader_interface.c index 1fb941f9225..d18629736f2 100644 --- a/intern/gawain/src/gwn_shader_interface.c +++ b/intern/gawain/src/gwn_shader_interface.c @@ -222,6 +222,13 @@ Gwn_ShaderInterface* GWN_shaderinterface_create(GLint program) glGetActiveAttrib(program, i, remaining_buffer, &name_len, &input->size, &input->gl_type, name); + // remove "[0]" from array name + if (name[name_len-1] == ']') + { + name[name_len-3] = '\0'; + name_len -= 3; + } + // TODO: reject DOUBLE gl_types input->location = glGetAttribLocation(program, name); |