layers:Fix descriptor dynamic offset handling
authorTobin Ehlis <tobine@google.com>
Thu, 17 Nov 2016 17:50:52 +0000 (10:50 -0700)
committerTobin Ehlis <tobine@google.com>
Thu, 17 Nov 2016 19:46:39 +0000 (12:46 -0700)
commit3e8e513a777f4b74d4fc60770529eeb3c0714c89
tree5c9d7f45f5478942f8e508b0912076057774df60
parent8b47fffe3173cd149c5faf578b558f39c17aafb9
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.
layers/descriptor_sets.cpp
layers/descriptor_sets.h