mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-27 04:54:15 +01:00
[dxvk] Check whether pipeline has potentially hazardous stores
This commit is contained in:
parent
6f7a468174
commit
1d8fb818fc
@ -965,9 +965,13 @@ namespace dxvk {
|
||||
m_flags.set(DxvkGraphicsPipelineFlag::HasRasterizerDiscard);
|
||||
}
|
||||
|
||||
if (m_barrier.access & VK_ACCESS_SHADER_WRITE_BIT)
|
||||
if (m_barrier.access & VK_ACCESS_SHADER_WRITE_BIT) {
|
||||
m_flags.set(DxvkGraphicsPipelineFlag::HasStorageDescriptors);
|
||||
|
||||
if (layout->layout().getHazardousSetMask())
|
||||
m_flags.set(DxvkGraphicsPipelineFlag::UnrollMergedDraws);
|
||||
}
|
||||
|
||||
if (m_shaders.fs != nullptr) {
|
||||
if (m_shaders.fs->flags().test(DxvkShaderFlag::HasSampleRateShading))
|
||||
m_flags.set(DxvkGraphicsPipelineFlag::HasSampleRateShading);
|
||||
|
@ -31,6 +31,7 @@ namespace dxvk {
|
||||
HasStorageDescriptors,
|
||||
HasSampleRateShading,
|
||||
HasSampleMaskExport,
|
||||
UnrollMergedDraws,
|
||||
};
|
||||
|
||||
using DxvkGraphicsPipelineFlags = Flags<DxvkGraphicsPipelineFlag>;
|
||||
@ -660,4 +661,4 @@ namespace dxvk {
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ namespace dxvk {
|
||||
|
||||
|
||||
DxvkBindingLayout::DxvkBindingLayout(VkShaderStageFlags stages)
|
||||
: m_pushConst { 0, 0, 0 }, m_pushConstStages(0), m_stages(stages) {
|
||||
: m_pushConst { 0, 0, 0 }, m_pushConstStages(0), m_stages(stages), m_hazards(0u) {
|
||||
|
||||
}
|
||||
|
||||
@ -236,6 +236,9 @@ namespace dxvk {
|
||||
void DxvkBindingLayout::addBinding(const DxvkBindingInfo& binding) {
|
||||
uint32_t set = binding.computeSetIndex();
|
||||
m_bindings[set].addBinding(binding);
|
||||
|
||||
if ((binding.access & VK_ACCESS_2_SHADER_WRITE_BIT) && binding.accessOp == DxvkAccessOp::None)
|
||||
m_hazards |= 1u << set;
|
||||
}
|
||||
|
||||
|
||||
@ -260,6 +263,8 @@ namespace dxvk {
|
||||
|
||||
addPushConstantRange(layout.m_pushConst);
|
||||
m_pushConstStages |= layout.m_pushConstStages;
|
||||
|
||||
m_hazards |= layout.m_hazards;
|
||||
}
|
||||
|
||||
|
||||
@ -400,4 +405,4 @@ namespace dxvk {
|
||||
return barrier;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -337,6 +337,16 @@ namespace dxvk {
|
||||
return m_stages;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Queries hazardous sets
|
||||
*
|
||||
* \returns Mask of sets with storage descriptors
|
||||
* that are not accessed in an order-invariant way.
|
||||
*/
|
||||
uint32_t getHazardousSetMask() const {
|
||||
return m_hazards;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Queries defined descriptor set layouts
|
||||
*
|
||||
@ -394,6 +404,7 @@ namespace dxvk {
|
||||
VkPushConstantRange m_pushConst;
|
||||
VkShaderStageFlags m_pushConstStages;
|
||||
VkShaderStageFlags m_stages;
|
||||
uint32_t m_hazards;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user