do not try to transition non-existent layers
We need to subtract the start layer here, otherwise we end up trying to transition non-existent layers here.
But let's also start respecting the view-state here, as we should. Otherwise we'll also transition unused layers.
This fixes an assertion while running the "spec@arb_texture_view@rendering-layers" piglit test.
Edited by Erik Faye-Lund