Initialize strides to zero, and return a location of -1 for uniforms in
blocks.
info.block = 0;
info.name = name;
info.size = size;
+ info.array_stride = 0;
+ info.matrix_stride = 0;
info.type = type;
uniforms_by_index[i] = &info;
}
add an offset. */
unsigned offset = lexical_cast<unsigned>(n.substr(open_bracket+1, n.size()-2-open_bracket));
i = uniforms.find(n.substr(0, open_bracket)+"[0]");
- if(i!=uniforms.end() && offset<i->second.size)
+ if(i!=uniforms.end() && !i->second.block && offset<i->second.size)
return i->second.location+offset;
}
}
return -1;
}
- return i->second.location;
+ return i->second.block ? -1 : i->second.location;
}
void Program::bind() const