return pass;
}
+
+static uint32_t descriptor_type_to_reqs(shader_module const *module, uint32_t type_id) {
+ return 0;
+}
+
+
static bool validate_pipeline_shader_stage(debug_report_data *report_data,
VkPipelineShaderStageCreateInfo const *pStage,
PIPELINE_NODE *pipeline,
/* validate descriptor use */
for (auto use : descriptor_uses) {
// While validating shaders capture which slots are used by the pipeline
- pipeline->active_slots[use.first.first].insert(use.first.second);
+ auto & reqs = pipeline->active_slots[use.first.first][use.first.second];
+ reqs = descriptor_req(reqs | descriptor_type_to_reqs(module, use.second.type_id));
/* verify given pipelineLayout has requested setLayout with requested binding */
const auto &binding = get_descriptor_binding(&pipelineLayout, use.first);
// 3. Grow updateBuffers for pCB to include buffers from STORAGE*_BUFFER descriptor buffers
static bool validate_and_update_drawtime_descriptor_state(
layer_data *dev_data, GLOBAL_CB_NODE *pCB,
- const vector<std::tuple<cvdescriptorset::DescriptorSet *, unordered_set<uint32_t>,
+ const vector<std::tuple<cvdescriptorset::DescriptorSet *, unordered_map<uint32_t, descriptor_req>,
std::vector<uint32_t> const *>> &activeSetBindingsPairs) {
bool result = false;
for (auto set_bindings_pair : activeSetBindingsPairs) {
auto pipeline_layout = pPipe->pipeline_layout;
// Need a vector (vs. std::set) of active Sets for dynamicOffset validation in case same set bound w/ different offsets
- vector<std::tuple<cvdescriptorset::DescriptorSet *, unordered_set<uint32_t>, std::vector<uint32_t> const *>> activeSetBindingsPairs;
+ vector<std::tuple<cvdescriptorset::DescriptorSet *, unordered_map<uint32_t, descriptor_req>, std::vector<uint32_t> const *>> activeSetBindingsPairs;
for (auto & setBindingPair : pPipe->active_slots) {
uint32_t setIndex = setBindingPair.first;
// If valid set is not bound throw an error
// If it has immutable samplers, we'll flag error later as needed depending on binding
if (!pSet->IsUpdated()) {
for (auto binding : setBindingPair.second) {
- if (!pSet->GetImmutableSamplerPtrFromBinding(binding)) {
+ if (!pSet->GetImmutableSamplerPtrFromBinding(binding.first)) {
result |= log_msg(
my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
(uint64_t)pSet->GetSet(), __LINE__, DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED, "DS",
uint32_t active_shaders;
uint32_t duplicate_shaders;
// Capture which slots (set#->bindings) are actually used by the shaders of this pipeline
- std::unordered_map<uint32_t, std::unordered_set<uint32_t>> active_slots;
+ std::unordered_map<uint32_t, std::unordered_map<uint32_t, descriptor_req>> active_slots;
// Vtx input info (if any)
std::vector<VkVertexInputBindingDescription> vertexBindingDescriptions;
std::vector<VkVertexInputAttributeDescription> vertexAttributeDescriptions;
// This includes validating that all descriptors in the given bindings are updated,
// that any update buffers are valid, and that any dynamic offsets are within the bounds of their buffers.
// Return true if state is acceptable, or false and write an error message into error string
-bool cvdescriptorset::DescriptorSet::ValidateDrawState(const std::unordered_set<uint32_t> &bindings,
+bool cvdescriptorset::DescriptorSet::ValidateDrawState(const std::unordered_map<uint32_t, descriptor_req> &bindings,
const std::vector<uint32_t> &dynamic_offsets, std::string *error) const {
auto dyn_offset_index = 0;
- for (auto binding : bindings) {
+ for (auto binding_pair : bindings) {
+ auto binding = binding_pair.first;
if (!p_layout_->HasBinding(binding)) {
std::stringstream error_str;
error_str << "Attempting to validate DrawState for binding #" << binding
return true;
}
// For given bindings, place any update buffers or images into the passed-in unordered_sets
-uint32_t cvdescriptorset::DescriptorSet::GetStorageUpdates(const std::unordered_set<uint32_t> &bindings,
+uint32_t cvdescriptorset::DescriptorSet::GetStorageUpdates(const std::unordered_map<uint32_t, descriptor_req> &bindings,
std::unordered_set<VkBuffer> *buffer_set,
std::unordered_set<VkImageView> *image_set) const {
auto num_updates = 0;
- for (auto binding : bindings) {
+ for (auto binding_pair : bindings) {
+ auto binding = binding_pair.first;
// If a binding doesn't exist, skip it
if (!p_layout_->HasBinding(binding)) {
continue;
// Is this set compatible with the given layout?
bool IsCompatible(const DescriptorSetLayout *, std::string *) const;
// For given bindings validate state at time of draw is correct, returning false on error and writing error details into string*
- bool ValidateDrawState(const std::unordered_set<uint32_t> &, const std::vector<uint32_t> &, std::string *) const;
+ bool ValidateDrawState(const std::unordered_map<uint32_t, descriptor_req> &, const std::vector<uint32_t> &, std::string *) const;
// For given set of bindings, add any buffers and images that will be updated to their respective unordered_sets & return number
// of objects inserted
- uint32_t GetStorageUpdates(const std::unordered_set<uint32_t> &, std::unordered_set<VkBuffer> *,
+ uint32_t GetStorageUpdates(const std::unordered_map<uint32_t, descriptor_req> &, std::unordered_set<VkBuffer> *,
std::unordered_set<VkImageView> *) const;
// Descriptor Update functions. These functions validate state and perform update separately