aboutsummaryrefslogtreecommitdiff
path: root/layers/descriptor_sets.cpp
AgeCommit message (Collapse)Author
2016-06-20layers: GH644 Validate DS image aspect bit restrictionTobin Ehlis
If a DS image is used in a descriptor, regardless of the underlying image layout, we need to validate that BOTH DEPTH and STENCIL aspect bits are NOT set. Only one of the two bits is allowed.
2016-06-20layers: Fix dynamic descriptor countTobin Ehlis
When creating descriptor set layout, we were only incrementing the dynamic descriptor count by 1 regardless of the number of descriptors in a binding. This fix increments the count by the number of descriptors in the binding.
2016-06-02layers: Clean up poolMap accessTobin Ehlis
Remove some unneeded passing of poolMap around and use getPoolNode() function in DescriptorSet class.
2016-06-02layers: Added getSwapchainNode() helperTobin Ehlis
Added getSwapchainNode() helper to core_validation and update DescriptorSet class to use it.
2016-06-02layers: Add getSwapchainFromImage() helperTobin Ehlis
Add getSwapchainFromImage() to core_validation and use it from DescriptorSet class.
2016-06-02layers: Remove unneeded layout_mapTobin Ehlis
2016-06-02layers: Add getImageNode() helperTobin Ehlis
Add getImageNode() helper to core_validation and use it. Also update DescriptorSet class to use the helper and kill its image_map member.
2016-06-02layers: Add getImageViewData() helperTobin Ehlis
Switch imageViewMap to store unique_ptrs. Add getImageViewDate() helper to core_validation and update DescriptorSet to use it.
2016-06-02layers: Add getSamplerNode() helperTobin Ehlis
Kill sampler_map_ in DescriptorSet and add getSamplerNode() helper and use it instead.
2016-06-02layers: Add getBufferViewInfo() helperTobin Ehlis
Add helper function to core_validation for bufferViewMap look-ups and use the helper in DescriptorSet class.
2016-06-02layers: Update getMemObjInfo helperTobin Ehlis
Standardize core_validation use of getMemObjInfo() and update DescriptorSet class to use it as well.
2016-06-02layers: Add getBufferNode() helperTobin Ehlis
Move core_validation bufferMap to use unique_ptr to BUFFER_NODE. Perform bufferMap look-ups using getBufferNode() helper function. Update DescriptorSet class to use getBufferNode() helper and store layer_data instead of bufferMap.
2016-06-02layers: Make layer_data visible to DescriptorSetTobin Ehlis
This is the start of migrating core_validation::layer_data to be visible in DescriptorSet class. DescriptorSet class can't see the contents of layer_data, so it also needs the get<Object>() helper functions to look up items from the maps. This first change only brings along getSetNode() utility function so only set_map references can be removed. Will add follow-on CLs to remove more maps from DescriptorSet class and bring in more utility functions.
2016-06-02layers: Pass common data between pre/post AllocDescriptorSetsTobin Ehlis
With the break between PreValidate* and PostRecord* calls in the layers we can suffer having to do some repeat work in the Post step. In order to prevent this, this CL slightly modifies the interface to pass common data between the pre/post calls in a custom AllocateDescriptorSetsData struct. I initially attempted to fill this data in a separate function that would preceed the PreValidate* call, but such a function would need to include some validation as it includes map checks which may fail. The simplest solution, then, seems to be passing a ptr to the common data to the PreValidate* function who then fills the data. If the validation and call down the chain succeed, the PostRecord* function then takes a ptr to the common data to prevent having to redo the work that was done at validation time.
2016-06-02layers: Add DescriptorSet interface for allocationTobin Ehlis
Create a top-level "Validate" and "Perform" interface for the vkAllocateDescriptorSets() function in DescriptorSet class. Refactor AllocateDescriptorSets() in core_validation to use the new interface. All checks are now performed in a "Pre" function and all state updates are recorded in a "Post" function.
2016-06-02layers: GH611 Fix dynamic offset indexingiostrows
2016-05-31layers: DescriptorSet class indentation fixesTobin Ehlis
More cases where "else" blocks weren't needed because the "if" block returns.
2016-05-31layers: Improve descriptor copy update validationTobin Ehlis
Add buffer usage bit validation for descriptor copy updates. Pass down known descriptor type to copy validate function to avoid having to look it up again. Fix various incorrect "write" references in the copy update error messages.
2016-05-31layers: Remove unneeded else blockTobin Ehlis
The "if" case returns so no need for this else block or the indentation that it includes.
2016-05-31layers: Add usage bit validation for buffer descriptorsTobin Ehlis
Verify that buffer used to update all buffer descriptor types (texel or general) has the correct usage bits set. descriptor
2016-05-31layers: Add usage bit validation for image descriptorsTobin Ehlis
Verify that images used in imageView that's passed to various image descriptor types have the correct usage bits set.
2016-05-31layers: take better advantage of emplace_back in descriptor setsChris Forbes
Doesn't win us anything to use emplace_back to invoke a copy constructor. Construct the unique_ptr from raw ptr in-place instead. Signed-off-by: Chris Forbes <chrisforbes@google.com>
2016-05-31layers: Remove old hacks for imprecise descriptor tracking for computeChris Forbes
We do it properly now. Signed-off-by: Chris Forbes <chrisforbes@google.com>
2016-05-19layers: DescriptorSet class clean-upTobin Ehlis
Minor formatting improvements, removed some useless "const" decls and unused vars and updated a few error codes to be more appropriate.
2016-05-19layers: Verify that src of copy update is updatedTobin Ehlis
Before verifying source update comments make sure that the source descriptors have been updated. This guards against some obscure corner cases where a bad source descriptor could slip through the content verification.
2016-05-19layers: Refactor DescriptorSet update interfaceTobin Ehlis
Mainly refactor and moving code in order to provide an interface to DescriptorSet class that matches top-level vkUpdateDescriptorSets() function. Split the validation of an update as a separate task from performing the update. This allows validation prior to calling down the chain and then only update the state if validation is clean. Hoisted all of the update validation into the DescriptorSet class which prevents having to copy all of the maps into the individual Descriptor classes. This simplifies both their creation and updating their contents. Updated the top-level core_validation UpdateDescriptorSets() code to match Vulkan Validation Layer Authoring Guidelines. As this is an initial POC for the architecture, I kept the Pre* & Post* functions in the core_validation.cpp file, but they should eventually be spun out.
2016-05-19layers: Improve DescriptorSet cleanupTobin Ehlis
Create private helper function InvalidateBoundCmdBuffers() within the DescriptorSet class to unify invalidate cases due to set being updated or freed. Add a destructor for DescriptorSet to make sure that no bound cmd buffers hang on to deleted set references.
2016-05-19layers: Refactor DescriptorSet Update codeTobin Ehlis
This migrates code for DescriptorSet in_use and flagging bound command buffers as invalid from core_validation.cpp into DescriptorSet class.
2016-05-05layers: Migrate VerifyUpdateConsistency to DescriptorSetLayout classTobin Ehlis
This was in the DescriptorSet class, but really belonged in the Layer. There was also a bug where it did not correctly handle the case of an initial offset that oversteps the size of the first binding being updated. That is legal according to the spec so added code to handle that case by walking the bindings until we get to the actual binding on which the first update will occur.
2016-05-05layers: Store layout bindings_ by value instead of ptrTobin Ehlis
Kill the ptr to safe_VkDescriptorSetLayoutBinding in DescriptorSetLayout class. This saves us the "new" and the need for a custom destructor. Couldn't do this initially but I've since added copy constructors to all of the safe_* struct types.
2016-05-05layers: Remove unused IsUpdated(uint32_t) from DescriptorSet classTobin Ehlis
All of the functionality that I thought I would need this for is contained in the ValidateDrawState() function.
2016-05-05layers: Removed unused full_update_ from DescriptorSet classTobin Ehlis
I originally added this thinking it would be useful but currently unused and not correctly tracked so just killing it.
2016-05-05layers: Remove use of map at() function from descriptor_set classTobin Ehlis
2016-05-05layers: Clean up access to descriptors_ vectorTobin Ehlis
Migrate a number of unneccessary .at() calls to just use [] operator. Also replace push_back() calls at descriptor creation time with emplace_back().
2016-05-05layers: Rearchitect Descriptor Set validation codeTobin Ehlis
This change pulls all of the DescriptorSet code out of core_validation.cpp and into its own files/classes in descriptor_set.h/cpp. See header file for complete class documentation. These changes pass tri/cube/smoketest --validate. All related layer validation tests are also updated and passing. Finally, I ran it through mustpass CTS and did not hit any issues related to these changes. These changes not only update the descriptor interface but fix some known lingering bugs with how descriptor updates occurred. This includes now correctly handling updates that cross binding boundaries and updates that write a subset of a binding. Going forward this is a general outline for how we would like to evolve core_validation. That is, we'd like to move the functionality of the checks into reasonable classes and just have core_validation call into those classes to do the majority of the work.