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;