aboutsummaryrefslogtreecommitdiff
path: root/layers/descriptor_sets.cpp
AgeCommit message (Collapse)Author
2017-04-24layers: Banish 'skip_call' once and foreverMark Lobodzinski
Except for swapchain.cpp, which is undergoing a merge into CV. Change-Id: I8b18518ef662a9a11a808ef3dce1b8f60d858fb3
2017-04-22layers: Switch CV over to layer object typesMark Lobodzinski
Convert internal uses of VkDebugReportObjectTypeEXT for the core- validation layer to use the internal layer-povided object-type. Also modified tests for changed error text. Change-Id: If080f4bf452ead0c6fecc648309bfd95b27fc0ce
2017-04-14layers:Add image layout validation for descriptorsTobin Ehlis
This change adds validation to make sure that an image layout at the time the image is used in a descriptor matches the layout that was given when the descriptor was updated. Because image view covers a range of mip levels, loop over each level and verify layouts one at a time. Also Updated a number of validate functions to use cont ptr params for data that they aren't changing.
2017-03-29layers: Rename format utils, strip VkDave Houlton
Change-Id: I4d192db22c51d2e9224b74487bfd5d6a58405028
2017-03-29layers: refactor layer utilsDave Houlton
Split format-related helper fxns out of vk_layer_utils.cpp into a new file vk_format_utils.cpp. Remove the duplicated fxns in the render framework and share the new format utils across both projects. Rename the util fxns into CamelCase per coding std. Change-Id: I0f9a34bc5931dfca085dfdc8d4800664aec526cf
2017-03-27layers: VK_KHR_maintenance1 false positivesMike Schuchardt
Skip checks that no longer apply when VK_KHR_maintenance1 is enabled. Change-Id: I84d0fe889d0e567045aeb7fa7463dd2ec0d56789
2017-03-15layers:Connect VK_EXT_validation_flagsTobin Ehlis
Add support for VK_EXT_validation_flags in core_validation. The only enum currently supported is VK_VALIDATION_CHECK_ALL_EXT which disables all existing flags in validation. Note that most checks are still not guarded by flags so that option will only disable the checks that are guarded by flags. In testing this I found a bug with AllocateDescriptorSets() where common state was not updated with the flag enabled so this includes a fix for that issue as well.
2017-03-14tests: Fix DSBufferInfo unexpected errorsJeremy Hayes
Change-Id: I594243d7879ed9999571c4f185724ba42d2ed7b6
2017-03-13layers: Add GetNextValidBinding function to CVMark Lobodzinski
Change-Id: Ifaa7aea1c7569ffaf5d417a1cd5caadaa38c96b0
2017-03-13layers: Move desc set helper to descriptorset moduleMark Lobodzinski
Change-Id: I695cf51b6fa27df7585582f545c0077efb9fd432
2017-02-10layers: Consolidate GetPhysicalDevice* accessorsMark Lobodzinski
Simplified core_validation->descriptor_sets/buffer_validation. Change-Id: I6921ac458bce5899e8bd60145bfaa0e0f5e8a2ac
2017-02-08layers:Add using statements for layer_dataTobin Ehlis
Add "using core_validation::layer_data;" to descriptor and buffer validation files. This cleans up the code without adding any confusion or name collisions.
2017-02-08layers:Rename get* utility functionsTobin Ehlis
Rename get* helper functions to have capital first letter in-line with coding standard.
2017-02-06layers:Add buffer descriptor device limit checksTobin Ehlis
This adds missing checks for max range for storage and uniform buffer updates. Also update database file.
2017-01-26repo: Clang-format LVL source files using GoogleMark Lobodzinski
Switch clang-format standard from the LLVM style to the Google style for more consistency. Change-Id: I247c4abc275d7873a91522e1e234198adaa24033
2017-01-26repo: Clang-format c/cpp/h LVL files using LLVMMark Lobodzinski
Bring all source files in the repo up to date with consistent coding style/standard. Change-Id: Iceedbc17109974d3a0437fc4995441c9ad7e0c23
2017-01-04layers:Remove redundant checksTobin Ehlis
Remove descriptor set check to make sure that src & dest descriptor sets of copy update are valid. Object_tracker already verifies this.
2017-01-04layers:Add TODO comments for valid usage updatesTobin Ehlis
Note a few unique error enum duplicates that should have their own unique ids added through spec updates.
2017-01-04scripts:Exceptions for duplicate unique idsTobin Ehlis
Added a number of exceptions for duplicate uses of unique error enums that are valid. Also added some comments to a few cases that need new unique ids.
2016-12-29layers:Don't pass active binding set aroundTobin Ehlis
The active bindings set was being passed around but the data is only used in a couple places and an alternate form of it is available in the binding->requirement map. Also, the binding set was wrong in that it stored bindings for all bound sets at draw time, but was being used to check bindings for individual sets.
2016-12-23layers:Remove redundant checkTobin Ehlis
Remove valid buffer check from descriptor_sets.cpp that's already handled in object_tracker.
2016-12-23layer:Add unique error ids for memory bindingTobin Ehlis
Update all of the cases to validate that memory is bound to non-sparse images and buffers to use the correct unique error id.
2016-12-23layers:Add valid usage error idsTobin Ehlis
Update descriptor set cases where no memory bound to buffer or image to use the correct respective unique error ids.
2016-12-23layers:Split ValidateAndUpdateDrawState()Tobin Ehlis
Split ValidateAndUpdateDrawState() to isolate validation and state updates into ValidateDrawState() & UpdateDrawState() functions. Refactored CmdDraw() to use Pre/Post patter with all state updates now occurring in the Post function. Made some initial updates to other Draw/Dispatch functions to call each new function in-line, but will refactor these functions to use Pre/Post in follow-on commits.
2016-12-19layers: Fix size_t-int cast warning in descriptor_setsJamie Madill
Discovered in VS2015. Change-Id: I2a42209a9ee9bd0e8f3da21c0f1a613315d5a6ce
2016-12-15layers:Refactor consecutive descriptor countTobin Ehlis
Refactor GetConsecutiveDescriptorCountFromBinding() to use the fact that bindings are now stored in-order. No longer need to chase binding order through the map, just get current binding index and then parse rest of the binding array in-order.
2016-12-15layers:Store DescriptorSetLayout class in-orderTobin Ehlis
Sort the bindings in the internal data structure of the DescriptorSetLayout class so that they're stored in binding order. This commit keeps the interface and mapping structures the same. Further commits will take more use of the fact that layout is now stored in binding order.
2016-12-02layers: Fix Windows buildMark Lobodzinski
STL min/max functions were causing windows build failures. Change-Id: Ia153a5d6a3d245b645b5f829c3f076c023d865f1
2016-12-02layers:Handle consecutive descriptor updatesTobin Ehlis
Fixes #1165 According to spec descriptor updates should roll over to the next binding number. If bindings were out of order, this was broken in validation. This fix corrects validation and state update for out-of-order descriptor bindings by checking consecutive updates based on correct binding count for consecutive bindings and by performing updates on a per-binding basis, making sure to roll update over to the correct next binding. Also update the error message, related negative test, and database file.
2016-11-23layers:Unique enums for vkAllocateDescriptorSetsTobin Ehlis
Add appropriate unique error enums to the code for allocating descriptor sets from a pool without enough sets left and without enough descriptors left. These were already flagged as implemented but the enums hadn't been added to the code.
2016-11-21layers:Remove redundant periodsTobin Ehlis
These error messages are all amended to error messages that already include a period at the end so deleting the extra periods.
2016-11-21layers:Check for update of empty bindingTobin Ehlis
Validation error if descriptor update performed on an empty binding.
2016-11-21layers:Warn on cmd buffer invalidateTobin Ehlis
From Mikko Strandborg When a resource gets deleted, any command buffer that references it gets invalidated, and an error gets thrown whenever that command buffer is submitted. However, for a developer, it's quite hard to deduce what exactly caused that to happen. This patch emits a warning whenever a command buffer that's in CB_RECORDING state (meaning that it has had its vkBeginCommandBuffer called but not End). This way the developer can set a breakpoint on that to see exactly what causes the buffer to be invalidated. Destroying a resource that's being used in an open command buffer is almost certainly a bug, but there might still be cases where it might be valid behavior (for example, when the application decides to abort an operation), therefore it's not an error but a warning instead.
2016-11-17layers:Rename BUFFER_NODE->BUFFER_STATETobin Ehlis
2016-11-17layers:Check all memory bindingsTobin Ehlis
There are a few places in the code where we assume that an image or buffer doesn't have a sparse binding. These cases break with sparse bindings. To fix I added a function to BINDING class to retrieve all memory bindings and then updated a few spots with bad assumption to make use of this new GetBoundMemory() function.
2016-11-17layers:Fix descriptor dynamic offset handlingTobin Ehlis
Fixes #1162 The dynamic offsets passed in at descriptor bind time are ordered based on the binding order and any consecutive array indicies within those bindings. When we validate the dynamic offsets at draw time, we were using the entire dynamic offset array, but only the active bindings. If we had an inactive dynamic binding before the end of the bindings we would use the wrong offsets. This change fixes the issue by creating a mapping between bindings and dynamic offset array indicies at descriptor layout creation time. At draw time the mapping is then used to lookup the correct dynamic offset array index for a given binding.
2016-10-25layers:Rename SAMPLER_NODE->SAMPLER_STATETobin Ehlis
2016-10-25layers:CreateDescriptorSetLayout cleanupTobin Ehlis
Streamline duplicate binding check, use [] operator instead of emplace, remove dead comment and add new comment.
2016-10-25layers:Refactor CreateDescriptorSetLayoutTobin Ehlis
Update CreateDescriptorSetLayout() to use Pre/Post pattern and split out validation of createInfo for the layout to occur before the creation of the layout.
2016-10-25layers:Update error enum for duplicate bindingsTobin Ehlis
Add unique error enum for the case where descriptor bindings are duplicated.
2016-10-19layers: Reword from cryptic abbreviations to readable wordsMike Weiblen
Expand abbreviations to improve readability: DS=depth/stencil DS=descriptor set CB=command buffer VS=vertex shader FS=fragment shader VTX=vertex PSO=pipeline state object Change-Id: I48fe917aac50d1911fe2a3aa1ed2c739637c7645
2016-10-18layers:Add BINDABLE superclass for image/buffer stateTobin Ehlis
Support for sparse memory binding is virually non-existant in current validation layers. This is a first step down a long path to improve sparse binding support. The BINDABLE superclass is sub-classed by IMAGE & BUFFER state objs and contains memory binding info in both the single binding and sparse binding cases. Bindings are initially encapsulated in the new MEM_BINDING struct. For single binding cases, things are almost exactly the same as they have always been. For sparse binding, the various bindings will be stored in the sparse_bindings set where we initally don't have complete information on the sparse binding as we only store the MEM_BINDING info but this is a start.
2016-10-18layers:Kill blank array element for empty bindingTobin Ehlis
Fixes #1053 DescriptorLayout class was incrementing global index for empty bindings which led to an empty array entry that could cause invalid errors when updating descriptors. This change will only increment global index for non-empty bindings.
2016-10-13layers:Rename IMAGE_NODE to IMAGE_STATETobin Ehlis
Another node->state rename pass.
2016-10-13layers:Bind descriptor pool to cmd bufferTobin Ehlis
Add pool state to DescriptorSet instead of just the pool. Then, at bind time, create a dual binding between the cmd buffer and the pool. This correcly puts pool in-use when cmd buffer is submitted, as well as flagging cmd buffer as INVALID if/when the pool is destroyed.
2016-10-13layers:Update some pool_node namingTobin Ehlis
Change some pool_node names to pool_state in DescriptorSet class. Also update getPool function prototype to the new name of getDescriptorSetState().
2016-10-13layers:Add pool member to DescriptorSet classTobin Ehlis
When creating a DescriptorSet instance, record the pool that the set is allocated from in a private pool_ variable. Then, when binding a set to a cmd buffer, also create a binding between the command buffer and the pool. This allows us to catch the in-use case when sets are implicitly freed by calling vkDestroyDescriptorPool().
2016-10-13layers:Rename DESCRIPTOR_POOL_NODE to *_STATETobin Ehlis
Continuing the NODE->STATE renaming effort
2016-10-11layers: Validate correct layout for STORAGE_IMAGE descriptorsTobin Ehlis
According to the spec "Load and store operations on storage images can only be done on images in VK_IMAGE_LAYOUT_GENERAL layout." This change flags an error if a STORAGE_IMAGE descriptor is updated with an image layout other than GENERAL.
2016-10-10layers: Pass unique error codes through descriptor validationTobin Ehlis
Descriptor validation builds up error strings at multiple levels such as UpdateError->WriteUpdate->BufferUpdate->BufferOffset. The final error is then reported via a log_msg() call at the top level. In order for this design to allow for the new unique error codes, we need to pass error codes down the chain in the same way we pass error strings down the chain. This change adds error msg passing for descriptor updates. Many error codes are added in as well as comments for codes that are missing or need to be updated. The database file is also updated to account for all of the checks that were updated and/or reviewed.