1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[dxvk] Add UBO set property to descriptor info

Used to explicitly propagate storage buffer bindings
to the respective UBO set.
This commit is contained in:
Philip Rebohle 2023-01-12 19:09:24 +01:00 committed by Philip Rebohle
parent 6f194b0e7b
commit 4a30933359
7 changed files with 21 additions and 6 deletions

View File

@ -329,7 +329,7 @@ namespace dxvk {
SpirvCodeBuffer fsCode(d3d11_video_blit_frag);
const std::array<DxvkBindingInfo, 4> fsBindings = {{
{ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 0, VK_IMAGE_VIEW_TYPE_MAX_ENUM, VK_SHADER_STAGE_FRAGMENT_BIT, VK_ACCESS_UNIFORM_READ_BIT },
{ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 0, VK_IMAGE_VIEW_TYPE_MAX_ENUM, VK_SHADER_STAGE_FRAGMENT_BIT, VK_ACCESS_UNIFORM_READ_BIT, VK_TRUE },
{ VK_DESCRIPTOR_TYPE_SAMPLER, 1, VK_IMAGE_VIEW_TYPE_MAX_ENUM, VK_SHADER_STAGE_FRAGMENT_BIT, 0 },
{ VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 2, VK_IMAGE_VIEW_TYPE_2D, VK_SHADER_STAGE_FRAGMENT_BIT, VK_ACCESS_SHADER_READ_BIT },
{ VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 3, VK_IMAGE_VIEW_TYPE_2D, VK_SHADER_STAGE_FRAGMENT_BIT, VK_ACCESS_SHADER_READ_BIT },

View File

@ -423,6 +423,7 @@ namespace dxvk {
binding.resourceBinding = getSpecConstantBufferSlot();
binding.viewType = VK_IMAGE_VIEW_TYPE_MAX_ENUM;
binding.access = VK_ACCESS_UNIFORM_READ_BIT;
binding.uboSet = VK_TRUE;
bindings.push_back(binding);
return specBlock;
@ -1577,6 +1578,7 @@ namespace dxvk {
binding.resourceBinding = bindingId;
binding.viewType = VK_IMAGE_VIEW_TYPE_MAX_ENUM;
binding.access = VK_ACCESS_UNIFORM_READ_BIT;
binding.uboSet = VK_TRUE;
m_bindings.push_back(binding);
}
@ -1616,6 +1618,7 @@ namespace dxvk {
binding.resourceBinding = bindingId;
binding.viewType = VK_IMAGE_VIEW_TYPE_MAX_ENUM;
binding.access = VK_ACCESS_SHADER_READ_BIT;
binding.uboSet = VK_TRUE;
m_bindings.push_back(binding);
}
@ -2227,6 +2230,7 @@ namespace dxvk {
binding.resourceBinding = bindingId;
binding.viewType = VK_IMAGE_VIEW_TYPE_MAX_ENUM;
binding.access = VK_ACCESS_UNIFORM_READ_BIT;
binding.uboSet = VK_TRUE;
m_bindings.push_back(binding);
// Load constants
@ -2314,6 +2318,7 @@ namespace dxvk {
binding.resourceBinding = bindingId;
binding.viewType = VK_IMAGE_VIEW_TYPE_MAX_ENUM;
binding.access = VK_ACCESS_UNIFORM_READ_BIT;
binding.uboSet = VK_TRUE;
m_bindings.push_back(binding);
}
@ -2353,6 +2358,7 @@ namespace dxvk {
binding.resourceBinding = bindingId;
binding.viewType = VK_IMAGE_VIEW_TYPE_MAX_ENUM;
binding.access = VK_ACCESS_UNIFORM_READ_BIT;
binding.uboSet = VK_TRUE;
m_bindings.push_back(binding);
// Declare output array for clip distances

View File

@ -135,6 +135,7 @@ namespace dxvk {
m_bufferBinding.resourceBinding = bufferSlot;
m_bufferBinding.stage = VK_SHADER_STAGE_GEOMETRY_BIT;
m_bufferBinding.access = VK_ACCESS_SHADER_WRITE_BIT;
m_bufferBinding.uboSet = VK_TRUE;
// Load our builtins
uint32_t primitiveIdPtr = m_module.newVar(m_module.defPointerType(uint_t, spv::StorageClassInput), spv::StorageClassInput);

View File

@ -862,6 +862,7 @@ namespace dxvk {
binding.viewType = VK_IMAGE_VIEW_TYPE_MAX_ENUM;
binding.access = VK_ACCESS_UNIFORM_READ_BIT;
binding.resourceBinding = bindingId;
binding.uboSet = VK_TRUE;
m_bindings.push_back(binding);
}

View File

@ -307,6 +307,7 @@ namespace dxvk {
binding.resourceBinding = bindingId;
binding.viewType = VK_IMAGE_VIEW_TYPE_MAX_ENUM;
binding.access = VK_ACCESS_UNIFORM_READ_BIT;
binding.uboSet = VK_TRUE;
m_bindings.push_back(binding);
}
@ -398,6 +399,7 @@ namespace dxvk {
binding.access = asSsbo
? VK_ACCESS_SHADER_READ_BIT
: VK_ACCESS_UNIFORM_READ_BIT;
binding.uboSet = VK_TRUE;
m_bindings.push_back(binding);
return constantBufferId;
@ -483,6 +485,7 @@ namespace dxvk {
binding.resourceBinding = bindingId;
binding.viewType = VK_IMAGE_VIEW_TYPE_MAX_ENUM;
binding.access = VK_ACCESS_UNIFORM_READ_BIT;
binding.uboSet = VK_TRUE;
m_bindings.push_back(binding);
}
@ -3457,6 +3460,7 @@ void DxsoCompiler::emitControlFlowGenericLoop(
binding.resourceBinding = bindingId;
binding.viewType = VK_IMAGE_VIEW_TYPE_MAX_ENUM;
binding.access = VK_ACCESS_UNIFORM_READ_BIT;
binding.uboSet = VK_TRUE;
m_bindings.push_back(binding);
// Declare output array for clip distances

View File

@ -34,11 +34,12 @@ namespace dxvk {
bool DxvkBindingInfo::eq(const DxvkBindingInfo& other) const {
return descriptorType == other.descriptorType
&& resourceBinding == other.resourceBinding
&& viewType == other.viewType
&& stage == other.stage
&& access == other.access;
return descriptorType == other.descriptorType
&& resourceBinding == other.resourceBinding
&& viewType == other.viewType
&& stage == other.stage
&& access == other.access
&& uboSet == other.uboSet;
}
@ -49,6 +50,7 @@ namespace dxvk {
hash.add(uint32_t(viewType));
hash.add(uint32_t(stage));
hash.add(access);
hash.add(uint32_t(uboSet));
return hash;
}

View File

@ -36,6 +36,7 @@ namespace dxvk {
VkImageViewType viewType; ///< Image view type
VkShaderStageFlagBits stage; ///< Shader stage
VkAccessFlags access; ///< Access mask for the resource
VkBool32 uboSet; ///< Whether to include this in the UBO set
/**
* \brief Computes descriptor set index for the given binding