The root of the problem is that in the main rendering loop we need
to set the correct per-view descriptor-set based on the material and
variants.
But we have two cases, either the descriptor set is always constant,
which is the case with ssr, structure, shadows and postfx passes, or
it need to be dynamically changed based on the material & variant.
In the 2nd case, where was a problem where the postfx descriptor set
could be used, which is wrong (e.g. while rendering shadows we need
the shadow UBO, even with a postfx material), and would corrupt the
correct descriptor set, which would never be set back.
Another issue was related to running a custom command, it could
change the state without updating the local copy, causing corruptions
or validation errors.
In this CL we:
- use the same descriptorsetlayout for both postfx and depth
- invalidate the state after a custom command
- only switch to postfx descriptor set in dynamic mode (color pass)
This fixes setChannelDepthClearEnabled() which could cause
validation error, corruption or crashes.
FIXES=[459567258]