summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-glsl.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-07-27 14:15:16 -0700
committerGitHub <noreply@github.com>2023-07-27 14:15:16 -0700
commit04f72443d717ca7b8304f893452c471fc6b6dc8f (patch)
treec70498d149eeed09cc0f438e68ca5da212f203df /source/slang/slang-emit-glsl.cpp
parentc1216cae34a5e8ef912091fcaaf25b6633ac1db6 (diff)
Fix -fvk-u-shift not applying to global constant buffer. (#3033)
* Fix -fvk-u-shift not applying to global constant buffer. * Fix test. * Fix. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-emit-glsl.cpp')
-rw-r--r--source/slang/slang-emit-glsl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp
index 37c38dd95..321f41d54 100644
--- a/source/slang/slang-emit-glsl.cpp
+++ b/source/slang/slang-emit-glsl.cpp
@@ -241,7 +241,10 @@ void GLSLSourceEmitter::_emitGLSLByteAddressBuffer(IRGlobalParam* varDecl, IRByt
{
// We can use ShaderResource/DescriptorSlot interchangably here.
// This is possible because vk-shift-*
- const LayoutResourceKindFlags kinds = LayoutResourceKindFlag::ShaderResource | LayoutResourceKindFlag::DescriptorTableSlot;
+ bool isReadOnly = (as<IRHLSLByteAddressBufferType>(byteAddressBufferType) != nullptr);
+
+ const LayoutResourceKindFlags kinds = (isReadOnly ? LayoutResourceKindFlag::ShaderResource : LayoutResourceKindFlag::UnorderedAccess)
+ | LayoutResourceKindFlag::DescriptorTableSlot;
EmitVarChain chain(layout);