layers: MR77, Add draw-time checks for descriptorSet compatibility
When PSO is created, gather the group of sets that are actually used by that PSO.
Then, at Draw time, verify that for each set used by the bound PSO, there is a
corresponding valid descriptorSet bound which also matches the associated
setLayout from the PSO's pipelineLayout. Added two more tests to the
DescriptorSetCompatibility test case to verify that these checks correctly fire.
diff --git a/layers/draw_state.h b/layers/draw_state.h
index ffc106d..c430419 100755
--- a/layers/draw_state.h
+++ b/layers/draw_state.h
@@ -91,6 +91,7 @@
DRAWSTATE_INVALID_RENDERPASS_CMD, // Invalid cmd submitted while a RenderPass is active
DRAWSTATE_NO_ACTIVE_RENDERPASS, // Rendering cmd submitted without an active RenderPass
DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED, // DescriptorSet bound but it was never updated. This is a warning code.
+ DRAWSTATE_DESCRIPTOR_SET_NOT_BOUND, // DescriptorSet used by pipeline at draw time is not bound, or has been disturbed (which would have flagged previous warning)
DRAWSTATE_INVALID_DYNAMIC_OFFSET_COUNT, // DescriptorSets bound with different number of dynamic descriptors that were included in dynamicOffsetCount
DRAWSTATE_CLEAR_CMD_BEFORE_DRAW, // Clear cmd issued before any Draw in CommandBuffer, should use RenderPass Ops instead
DRAWSTATE_BEGIN_CB_INVALID_STATE, // Primary/Secondary CB created with mismatched FB/RP information
@@ -147,6 +148,8 @@
VkComputePipelineCreateInfo computePipelineCI;
// Flag of which shader stages are active for this pipeline
uint32_t active_shaders;
+ // Capture which sets are actually used by the shaders of this pipeline
+ std::set<unsigned> active_sets;
// Vtx input info (if any)
uint32_t vtxBindingCount; // number of bindings
VkVertexInputBindingDescription* pVertexBindingDescriptions;