1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-01 16:24:12 +01:00

[dxvk] Determine whether a graphics pipeline writes to resources

- Fix missing test for storage texel buffers
This commit is contained in:
Philip Rebohle 2018-10-29 10:40:42 +01:00
parent ec8559f40a
commit 9decfb34b7
3 changed files with 19 additions and 0 deletions

View File

@ -73,6 +73,9 @@ namespace dxvk {
if (gs != nullptr && gs->hasCapability(spv::CapabilityTransformFeedback))
m_flags.set(DxvkGraphicsPipelineFlag::HasTransformFeedback);
if (m_layout->hasStorageDescriptors())
m_flags.set(DxvkGraphicsPipelineFlag::HasStorageDescriptors);
m_common.msSampleShadingEnable = fs != nullptr && fs->hasCapability(spv::CapabilitySampleRateShading);
m_common.msSampleShadingFactor = 1.0f;
}

View File

@ -21,6 +21,7 @@ namespace dxvk {
*/
enum class DxvkGraphicsPipelineFlag {
HasTransformFeedback,
HasStorageDescriptors,
};
using DxvkGraphicsCommonPipelineFlags = Flags<DxvkGraphicsPipelineFlag>;

View File

@ -218,6 +218,21 @@ namespace dxvk {
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER);
}
/**
* \brief Checks whether buffers or images are written to
*
* It is assumed that storage images and buffers
* will be written to if they are present. Used
* for synchronization purposes.
*/
bool hasStorageDescriptors() const {
return m_descriptorTypes.any(
VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC,
VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER);
}
private:
Rc<vk::DeviceFn> m_vkd;