| Age | Commit message (Collapse) | Author |
|
When dealing with dynamic offsets, the binding numbers, and array indices within
a binding, are all sequential.
This is according to the spec "Descriptor Set Binding" section which states,
"...entries are ordered by the binding numbers in the descriptor set layouts; and
within a binding array, elements are in order."
This means when processing the binding numbers to validate the dynamic offsets at
draw time, we should do so in order to make sure that the sequential dynamic offset
index correctly correlates with the dynamic offset being processed.
|
|
This commit creates bindings between a cmd buffer and the images/buffers
and their memory allocations that are tied to that cmd buffer's active
descriptor slots (set/binding combination).
The active resources are anything that's in use during any of the draws
issued in the cmd buffer.
If any of the bound resources are deleted, the cmd buffer will become
invalid and an error will be issued on the next attempt to submit it.
|
|
Update SAMPLER_NODE to inherit from BASE_NODE and keep track of
cb_bindings for sampler.
At draw time, add any bindings between cmd buffer and samplers that
are connected to active descriptors.
At DestroySampler() time, set CB_INVALID for any cmd buffers in
cb_bindings.
Also includes some additional plumbing to prepare for connecting
images/buffers that are tied to descriptor sets to cmd buffers that
those sets are bound to.
|
|
Don't create a binding between every set bound to a cmd buffer, but only
the sets that are verified active at draw time.
Gather up active descriptorset bindings in prepration of also binding the
resources from each individual active set to the cmd buffer.
|
|
This is start of a series intended to enable CB_INVALID tracking for
descriptor sets. Much of the tracking is already in place in the
special-purpose uniqueBoundSets data struct, so I'll be migrating
the tracking from that struct to the more general-purpose
object_bindings set.
|
|
|
|
Signed-off-by: Chris Forbes <chrisforbes@google.com>
|
|
We want to be able to impose requirements on images & views bound to
descriptor sets based on their usage in the shader. This adds the
plumbing from pipelines into descriptor sets to enable that.
Signed-off-by: Chris Forbes <chrisforbes@google.com>
|
|
When updating buffer descriptors, make sure that there is memory bound to any
non-sparse buffer.
Add comment that we don't need to do this for image descriptor updates
because they require the imageView (not just image) and we already validate
at imageView creation that memory is bound to image.
|
|
This check was only flagged when Allocating descriptor sets or resetting
a descriptor pool, and in both cases object_tracker will be the first layer
to identify and flag the error.
Removing this as a redundant check and updating documentation.
|
|
Hit 3 new checks just added for VkDescriptorBufferInfo:
1. offset larger than buffer
2. range of 0
3. range larger than buffer size minus offset
Also update descriptor write and copy update error enums to be more clear,
along with also updating documentation.
|
|
For a descriptor write update to a buffer type, verify that the contents of
VkDescriptorBufferInfo struct are valid according to valid usage guidelines
of the spec.
Spun off the usage bit validation into its own function ValidateBufferUsage().
Previous ValidateBufferUpdate() function now calls that function as well as
performing all of the checks for the buffer, range, and offset members of
VkDescriptorBufferInfo struct.
|
|
Created a single vector to track any cmd buffer dependencies that are destroyed
and thereby cause the cmd buffer to become invalid. Currently just tracking
the previous object types of descriptor sets and framebuffers, but will update
the tracking to include all cmd buffer dependencies in future commits.
|
|
Prior to calls to get an global index from a binding, make sure that
HasBinding() is called to verify that the binding exists.
Added HasBinding() calls to a couple of validation functions for
early exist.
Updated code comment to indicate that HasBinding() call should
precede GetGlobal*IndexFromBinding() calls.
Added assert() to GetGlobal*IndexFromBinding() calls in the error case
to make error more obvious in debug builds.
Note that Perform*Update() functions already indicate that they should
be preceded by their matching Validate*Update() functions, which include
the appropriate checks for HasBinding().
case the Validate*Update() funciont
|
|
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.
|
|
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.
|
|
Remove some unneeded passing of poolMap around and use getPoolNode()
function in DescriptorSet class.
|
|
Added getSwapchainNode() helper to core_validation and update
DescriptorSet class to use it.
|
|
Add getSwapchainFromImage() to core_validation and use it from
DescriptorSet class.
|
|
|
|
Add getImageNode() helper to core_validation and use it.
Also update DescriptorSet class to use the helper and kill
its image_map member.
|
|
Switch imageViewMap to store unique_ptrs. Add getImageViewDate() helper
to core_validation and update DescriptorSet to use it.
|
|
Kill sampler_map_ in DescriptorSet and add getSamplerNode() helper
and use it instead.
|
|
Add helper function to core_validation for bufferViewMap look-ups
and use the helper in DescriptorSet class.
|
|
Standardize core_validation use of getMemObjInfo() and update
DescriptorSet class to use it as well.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
More cases where "else" blocks weren't needed because the
"if" block returns.
|
|
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.
|
|
The "if" case returns so no need for this else block or the indentation
that it includes.
|
|
Verify that buffer used to update all buffer descriptor types (texel or
general) has the correct usage bits set.
descriptor
|
|
Verify that images used in imageView that's passed to various image
descriptor types have the correct usage bits set.
|
|
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>
|
|
We do it properly now.
Signed-off-by: Chris Forbes <chrisforbes@google.com>
|
|
Minor formatting improvements, removed some useless "const" decls
and unused vars and updated a few error codes to be more appropriate.
|
|
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.
|
|
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.
|
|
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.
|
|
This migrates code for DescriptorSet in_use and flagging bound
command buffers as invalid from core_validation.cpp into DescriptorSet
class.
|
|
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.
|
|
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.
|
|
All of the functionality that I thought I would need this for is contained
in the ValidateDrawState() function.
|
|
I originally added this thinking it would be useful but currently
unused and not correctly tracked so just killing it.
|
|
|
|
Migrate a number of unneccessary .at() calls to just use [] operator.
Also replace push_back() calls at descriptor creation time with emplace_back().
|
|
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.
|