We'll add this to the root descriptor set since moving the binding
to one of the bindless sets would be hard to do; we'd need to track
the binding index of each "bindless" binding for set updates etc.
In order to stay within the limit of 8 sets, we also cannot introduce
a separate set for UAV counters (currently there are 6 bindless sets,
the static sampler set, and the root descriptor set).
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
NVIDIA currently seems to have some issues with bindless CBV on Vulkan,
which have been reported. Somehow, bindless SSBO works around black
screen on SotTR, as well as some rendering glitches on Control.
AMD won't care since UBOs and SSBOs are basically the same thing.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Used as a fallback for older Nvidia generations which do not
support bindless uniform buffers.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Logically split up descriptor pool allocation in three types:
- STATIC: Root descriptors and internal allocation.
- VOLATILE: For packed descriptor set which comes from heaps.
- IMMUTABLE_SAMPLER: For immutable samplers. This should be removed once
we start allocating sampler sets at sampler creation time.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
For now this is enbaled based on device capabilities, but future changes
may require this to be disabled for certain root signatures.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Will be used on implementations that do not support enough
push constants to hold all root signature data.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
We still need to pass binding info for each range to the shader compiler,
but bindless ranges will not contribute to the packed descriptor count.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Don't enable any bindless features for now so that we don't
introduce regressions as features get added.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Now that the binding code no longer makes any wild assumptions about
the exact binding layout, we can safely do this. Will make implementing
bindless a bit easier.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Uses the new data structures to iterate over descriptor
tables and populate the packed descriptor set.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Further changes will require a rework of how resource binding
works inside a command list, so for now, this is just a cleanup
that also removes some old code that is no longer needed.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Static samplers are embedded in the root signature, so we can create
a separate descriptor set layout and descriptor set which we only
need to rebind when the root signature itself changes.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
- descriptor_index is the index of the descriptor within the packed
descriptor set or root descriptor set. Currently unused.
- binding_index should now index into the root_signature->bindings array.
- vk_set and vk_binding refer to the Vulkan descriptor set index and
binding number of packed descriptors or root descriptors.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Allows us to more easily refactor root signature-related code
without having to worry about root descriptors for now.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
All vkDestroy* functions are defined to perform no operation when passed
a null handle. vkd3d_free should follow regular free semantics.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Removes some unused counters and repurposes the existing ones to
differentiate between bindings (i.e. the array passed to the shader
compiler) and packed descriptors.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Fixes an issue where push constants can be invalidated by
shader-based clear/copy commands.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Uses one push constant range with VK_SHADER_STAGE_ALL. This
will allow us to easily add descriptor table offsets as push
constants.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
This needs a major rework as the current implementation has bugs,
is hard to reason about, and very hard to maintain as we're about
to make major changes to the binding model as a whole.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>