Like images, this prevents out-of-bound access when the explicit
binding layout qualifier is used with an array which contains
too much samplers.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
if (storage->type->is_sampler() && storage->opaque[sh].active) {
for (unsigned i = 0; i < elements; i++) {
const unsigned index = storage->opaque[sh].index + i;
+ if (index >= ARRAY_SIZE(shader->Program->SamplerUnits))
+ break;
shader->Program->SamplerUnits[index] =
storage->storage[i].i;
}