From c370eea9486445ea1ca97fc85eff47179cc3e605 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 28 Jun 2018 03:42:11 +0200 Subject: [PATCH] [dxbc] Decorate untyped write-only UAVs as NonReadable --- src/dxbc/dxbc_compiler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 483c1c82..a11dde78 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -888,6 +888,12 @@ namespace dxvk { if (ins.controls.uavFlags().test(DxbcUavFlag::GloballyCoherent)) m_module.decorate(varId, spv::DecorationCoherent); + // On GPUs which don't support storageImageReadWithoutFormat, + // we have to decorate untyped UAVs as write-only + if (isUav && imageFormat == spv::ImageFormatUnknown + && !m_moduleInfo.options.test(DxbcOption::UseStorageImageReadWithoutFormat)) + m_module.decorate(varId, spv::DecorationNonReadable); + // Declare a specialization constant which will // store whether or not the resource is bound. const uint32_t specConstId = m_module.specConstBool(true);