mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-13 07:08:50 +01:00
[dxvk] Create pipeline library for null shader
This commit is contained in:
parent
a0d1ef7f61
commit
a683ecd525
@ -169,6 +169,11 @@ namespace dxvk {
|
||||
m_stateCache(device, this, &m_workers) {
|
||||
Logger::info(str::format("DXVK: Graphics pipeline libraries ",
|
||||
(m_device->canUseGraphicsPipelineLibrary() ? "supported" : "not supported")));
|
||||
|
||||
if (m_device->canUseGraphicsPipelineLibrary()) {
|
||||
auto library = createNullFsPipelineLibrary();
|
||||
library->compilePipeline(m_cache.handle());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -231,7 +236,6 @@ namespace dxvk {
|
||||
DxvkShaderPipelineLibrary* fsLibrary = nullptr;
|
||||
|
||||
if (shaders.tcs == nullptr && shaders.tes == nullptr && shaders.gs == nullptr) {
|
||||
// TODO handle null fs properly
|
||||
vsLibrary = findPipelineLibrary(shaders.vs);
|
||||
fsLibrary = findPipelineLibrary(shaders.fs);
|
||||
}
|
||||
@ -354,6 +358,19 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
DxvkShaderPipelineLibrary* DxvkPipelineManager::createNullFsPipelineLibrary() {
|
||||
std::lock_guard<dxvk::mutex> lock(m_mutex);
|
||||
auto layout = createPipelineLayout(DxvkBindingLayout(
|
||||
VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT));
|
||||
|
||||
auto iter = m_shaderLibraries.emplace(
|
||||
std::piecewise_construct,
|
||||
std::tuple(),
|
||||
std::tuple(m_device, nullptr, layout));
|
||||
return &iter.first->second;
|
||||
}
|
||||
|
||||
|
||||
DxvkShaderPipelineLibrary* DxvkPipelineManager::findPipelineLibrary(
|
||||
const Rc<DxvkShader>& shader) {
|
||||
DxvkShaderPipelineLibraryKey key;
|
||||
|
@ -271,6 +271,8 @@ namespace dxvk {
|
||||
DxvkShaderPipelineLibrary* createPipelineLibrary(
|
||||
const Rc<DxvkShader>& shader);
|
||||
|
||||
DxvkShaderPipelineLibrary* createNullFsPipelineLibrary();
|
||||
|
||||
DxvkShaderPipelineLibrary* findPipelineLibrary(
|
||||
const Rc<DxvkShader>& shader);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user