From 49e7df96ec54be4afc1a78a511cebf71f6c0f334 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 28 Nov 2019 00:27:11 +0100 Subject: [PATCH] [dxbc] Emit a spec constant for uniform buffers This partially reverts commit fd547b666e5324f29eff47f2838832f273bb0fed. For some reason, not doing so breaks Overwatch (because of course it does). --- src/dxbc/dxbc_compiler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 9a65e9e0d..68de83209 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -806,6 +806,13 @@ namespace dxvk { if (asSsbo) m_module.decorate(varId, spv::DecorationNonWritable); + // Declare a specialization constant which will + // store whether or not the resource is bound. + const uint32_t specConstId = m_module.specConstBool(true); + m_module.decorateSpecId(specConstId, bindingId); + m_module.setDebugName(specConstId, + str::format(name, "_bound").c_str()); + DxbcConstantBuffer buf; buf.varId = varId; buf.size = numConstants;