mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-07 16:54:14 +01:00
[dxvk] Don't cache shader modules for compute pipelines
This commit is contained in:
parent
632b254714
commit
79e867624a
@ -23,23 +23,17 @@ namespace dxvk {
|
|||||||
DxvkPipelineManager* pipeMgr,
|
DxvkPipelineManager* pipeMgr,
|
||||||
const Rc<DxvkShader>& cs)
|
const Rc<DxvkShader>& cs)
|
||||||
: m_vkd(pipeMgr->m_device->vkd()),
|
: m_vkd(pipeMgr->m_device->vkd()),
|
||||||
m_pipeMgr(pipeMgr) {
|
m_pipeMgr(pipeMgr), m_cs(cs) {
|
||||||
DxvkDescriptorSlotMapping slotMapping;
|
cs->defineResourceSlots(m_slotMapping);
|
||||||
cs->defineResourceSlots(slotMapping);
|
|
||||||
|
|
||||||
slotMapping.makeDescriptorsDynamic(
|
m_slotMapping.makeDescriptorsDynamic(
|
||||||
m_pipeMgr->m_device->options().maxNumDynamicUniformBuffers,
|
m_pipeMgr->m_device->options().maxNumDynamicUniformBuffers,
|
||||||
m_pipeMgr->m_device->options().maxNumDynamicStorageBuffers);
|
m_pipeMgr->m_device->options().maxNumDynamicStorageBuffers);
|
||||||
|
|
||||||
m_layout = new DxvkPipelineLayout(m_vkd,
|
m_layout = new DxvkPipelineLayout(m_vkd,
|
||||||
slotMapping.bindingCount(),
|
m_slotMapping.bindingCount(),
|
||||||
slotMapping.bindingInfos(),
|
m_slotMapping.bindingInfos(),
|
||||||
VK_PIPELINE_BIND_POINT_COMPUTE);
|
VK_PIPELINE_BIND_POINT_COMPUTE);
|
||||||
|
|
||||||
DxvkShaderModuleCreateInfo moduleInfo;
|
|
||||||
moduleInfo.fsDualSrcBlend = false;
|
|
||||||
|
|
||||||
m_cs = cs->createShaderModule(m_vkd, slotMapping, moduleInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -98,9 +92,15 @@ namespace dxvk {
|
|||||||
|
|
||||||
if (Logger::logLevel() <= LogLevel::Debug) {
|
if (Logger::logLevel() <= LogLevel::Debug) {
|
||||||
Logger::debug("Compiling compute pipeline...");
|
Logger::debug("Compiling compute pipeline...");
|
||||||
Logger::debug(str::format(" cs : ", m_cs->shader()->debugName()));
|
Logger::debug(str::format(" cs : ", m_cs->debugName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DxvkShaderModuleCreateInfo moduleInfo;
|
||||||
|
moduleInfo.fsDualSrcBlend = false;
|
||||||
|
|
||||||
|
auto csm = m_cs->createShaderModule(m_vkd, m_slotMapping, moduleInfo);
|
||||||
|
|
||||||
DxvkSpecConstantData specData;
|
DxvkSpecConstantData specData;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < MaxNumActiveBindings; i++)
|
for (uint32_t i = 0; i < MaxNumActiveBindings; i++)
|
||||||
@ -118,7 +118,7 @@ namespace dxvk {
|
|||||||
info.flags = baseHandle == VK_NULL_HANDLE
|
info.flags = baseHandle == VK_NULL_HANDLE
|
||||||
? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT
|
? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT
|
||||||
: VK_PIPELINE_CREATE_DERIVATIVE_BIT;
|
: VK_PIPELINE_CREATE_DERIVATIVE_BIT;
|
||||||
info.stage = m_cs->stageInfo(&specInfo);
|
info.stage = csm->stageInfo(&specInfo);
|
||||||
info.layout = m_layout->pipelineLayout();
|
info.layout = m_layout->pipelineLayout();
|
||||||
info.basePipelineHandle = baseHandle;
|
info.basePipelineHandle = baseHandle;
|
||||||
info.basePipelineIndex = -1;
|
info.basePipelineIndex = -1;
|
||||||
@ -130,7 +130,7 @@ namespace dxvk {
|
|||||||
if (m_vkd->vkCreateComputePipelines(m_vkd->device(),
|
if (m_vkd->vkCreateComputePipelines(m_vkd->device(),
|
||||||
m_pipeMgr->m_cache->handle(), 1, &info, nullptr, &pipeline) != VK_SUCCESS) {
|
m_pipeMgr->m_cache->handle(), 1, &info, nullptr, &pipeline) != VK_SUCCESS) {
|
||||||
Logger::err("DxvkComputePipeline: Failed to compile pipeline");
|
Logger::err("DxvkComputePipeline: Failed to compile pipeline");
|
||||||
Logger::err(str::format(" cs : ", m_cs->shader()->debugName()));
|
Logger::err(str::format(" cs : ", m_cs->debugName()));
|
||||||
return VK_NULL_HANDLE;
|
return VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,11 +71,13 @@ namespace dxvk {
|
|||||||
VkPipeline pipeline;
|
VkPipeline pipeline;
|
||||||
};
|
};
|
||||||
|
|
||||||
Rc<vk::DeviceFn> m_vkd;
|
Rc<vk::DeviceFn> m_vkd;
|
||||||
DxvkPipelineManager* m_pipeMgr;
|
DxvkPipelineManager* m_pipeMgr;
|
||||||
|
|
||||||
Rc<DxvkPipelineLayout> m_layout;
|
DxvkDescriptorSlotMapping m_slotMapping;
|
||||||
Rc<DxvkShaderModule> m_cs;
|
|
||||||
|
Rc<DxvkShader> m_cs;
|
||||||
|
Rc<DxvkPipelineLayout> m_layout;
|
||||||
|
|
||||||
sync::Spinlock m_mutex;
|
sync::Spinlock m_mutex;
|
||||||
std::vector<PipelineStruct> m_pipelines;
|
std::vector<PipelineStruct> m_pipelines;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user