diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-10-15 17:08:15 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-10-17 12:43:59 -0700 |
commit | 34240fec4adc3316920a269478f84b3dbebca78b (patch) | |
tree | 6f0e39591480c57d9a6d859bef50127d43c3a05b /tests | |
parent | eb466e688fb95efe4bdf32facb99c1b668e6cb4e (diff) |
return identical ids from glGetUniformLocation when we need to
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cubegeom.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/cubegeom.c b/tests/cubegeom.c index ecefb24a..c137ad80 100644 --- a/tests/cubegeom.c +++ b/tests/cubegeom.c @@ -256,6 +256,14 @@ int main(int argc, char *argv[]) GLint lightmapLocation = glGetUniformLocation(program, "lightmap"); assert(lightmapLocation >= 0); + assert(lightmapLocation == glGetUniformLocation(program, "lightmap")); // must get identical ids + glLinkProgram(program); + glGetProgramiv(program, GL_LINK_STATUS, &ok); + assert(ok); + assert(lightmapLocation != glGetUniformLocation(program, "lightmap")); // must NOT get identical ids, we re-linked! + lightmapLocation = glGetUniformLocation(program, "lightmap"); + assert(lightmapLocation == glGetUniformLocation(program, "lightmap")); // must get identical ids + glUniform1i(lightmapLocation, 1); // sampler2D? Is it the texture unit? GLint diffusemapLocation = glGetUniformLocation(program, "diffusemap"); |