1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[dxvk] Use new specialization constant code for compute pipelines

This commit is contained in:
Philip Rebohle 2019-05-01 00:34:27 +02:00
parent 433c707888
commit c3f7dfd197
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -95,23 +95,17 @@ namespace dxvk {
Logger::debug(str::format(" cs : ", m_cs->debugName()));
}
DxvkSpecConstants specData;
for (uint32_t i = 0; i < m_layout->bindingCount(); i++)
specData.set(i, state.bsBindingMask.isBound(i), true);
VkSpecializationInfo specInfo = specData.getSpecInfo();
DxvkShaderModuleCreateInfo moduleInfo;
moduleInfo.fsDualSrcBlend = false;
auto csm = m_cs->createShaderModule(m_vkd, m_slotMapping, moduleInfo);
DxvkSpecConstantData specData = { };
for (uint32_t i = 0; i < MaxNumActiveBindings; i++)
specData.activeBindings[i] = state.bsBindingMask.isBound(i) ? VK_TRUE : VK_FALSE;
VkSpecializationInfo specInfo;
specInfo.mapEntryCount = g_specConstantMap.mapEntryCount();
specInfo.pMapEntries = g_specConstantMap.mapEntryData();
specInfo.dataSize = sizeof(specData);
specInfo.pData = &specData;
VkComputePipelineCreateInfo info;
info.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO;
info.pNext = nullptr;