I have been writing GLSL shaders for over a year but this is the first time I have run into this problem. I am on the iOS platform - if that matters.
In a vertex shader I have this:
uniform mediump mat4 projectionViewModelMatrix;
In a fragment shader I have been using for months I have the following uniforms:
uniform int channels;
uniform sampler2D hero;
Nothing to write home about. I added three additional uniforms to the fragment shader:
uniform int heroChannels;
uniform int heroWidth;
uniform int heroHeight;
Using
glGetUniformLocation
I tried to grab the location of all my uniforms. This is when my own personal hell began. This is the result:
uniform heroChannels location -1
uniform channels location 4
uniform hero location 5
uniform heroHeight location -1
uniform projectionViewModelMatrix location 0
uniform heroWidth location -1
Huh? Why are the recently added uniforms not given a valid location by the GL Gods?