1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-14 04:29:15 +01:00

[dxvk] Add binding flag for multisampled images

This commit is contained in:
Philip Rebohle 2025-03-03 12:22:59 +01:00
parent 6edcb70994
commit 4bd97f44c8
4 changed files with 16 additions and 10 deletions

View File

@ -1333,7 +1333,7 @@ namespace dxvk {
SpirvCodeBuffer fsCode(d3d11_video_blit_frag);
const std::array<DxvkBindingInfo, 3> fsBindings = {{
{ 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_UNIFORM_BUFFER, 0, VK_IMAGE_VIEW_TYPE_MAX_ENUM, VK_SHADER_STAGE_FRAGMENT_BIT, VK_ACCESS_UNIFORM_READ_BIT, DxvkAccessOp::None, true },
{ VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 1, VK_IMAGE_VIEW_TYPE_2D, VK_SHADER_STAGE_FRAGMENT_BIT, VK_ACCESS_SHADER_READ_BIT },
{ VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 2, VK_IMAGE_VIEW_TYPE_2D, VK_SHADER_STAGE_FRAGMENT_BIT, VK_ACCESS_SHADER_READ_BIT },
}};

View File

@ -871,7 +871,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;
binding.uboSet = true;
m_bindings.push_back(binding);
}
@ -1080,6 +1080,7 @@ namespace dxvk {
DxvkBindingInfo binding = { };
binding.viewType = typeInfo.vtype;
binding.resourceBinding = bindingId;
binding.isMultisampled = typeInfo.ms;
if (isUav) {
binding.descriptorType = resourceType == DxbcResourceDim::Buffer

View File

@ -37,7 +37,9 @@ namespace dxvk {
&& viewType == other.viewType
&& stage == other.stage
&& access == other.access
&& uboSet == other.uboSet;
&& accessOp == other.accessOp
&& uboSet == other.uboSet
&& isMultisampled == other.isMultisampled;
}
@ -48,7 +50,9 @@ namespace dxvk {
hash.add(uint32_t(viewType));
hash.add(uint32_t(stage));
hash.add(access);
hash.add(uint32_t(accessOp));
hash.add(uint32_t(uboSet));
hash.add(uint32_t(isMultisampled));
return hash;
}

View File

@ -73,13 +73,14 @@ namespace dxvk {
* a given shader, or for the whole pipeline.
*/
struct DxvkBindingInfo {
VkDescriptorType descriptorType; ///< Vulkan descriptor type
uint32_t resourceBinding; ///< API binding slot for the resource
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
DxvkAccessOp accessOp; ///< Order-invariant store type, if any
VkDescriptorType descriptorType = VK_DESCRIPTOR_TYPE_MAX_ENUM; ///< Vulkan descriptor type
uint32_t resourceBinding = 0u; ///< API binding slot for the resource
VkImageViewType viewType = VK_IMAGE_VIEW_TYPE_MAX_ENUM; ///< Image view type
VkShaderStageFlagBits stage = VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM; ///< Shader stage
VkAccessFlags access = 0u; ///< Access mask for the resource
DxvkAccessOp accessOp = DxvkAccessOp::None; ///< Order-invariant store type, if any
bool uboSet = false; ///< Whether to include this in the UBO set
bool isMultisampled = false; ///< Multisampled binding
/**
* \brief Computes descriptor set index for the given binding