layers:Fix descriptor dynamic offset handling
Fixes #1162
The dynamic offsets passed in at descriptor bind time are ordered based
on the binding order and any consecutive array indicies within those
bindings. When we validate the dynamic offsets at draw time, we were
using the entire dynamic offset array, but only the active bindings.
If we had an inactive dynamic binding before the end of the bindings
we would use the wrong offsets.
This change fixes the issue by creating a mapping between bindings and
dynamic offset array indicies at descriptor layout creation time. At
draw time the mapping is then used to lookup the correct dynamic offset
array index for a given binding.