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

[dxvk] Don't use derivative pipelines

No driver appears to be taking advantage of this, so why bother.
This commit is contained in:
Philip Rebohle 2019-07-14 13:58:00 +02:00
parent 03c6df56c1
commit a93dd74f71
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 9 additions and 30 deletions

View File

@ -52,14 +52,11 @@ namespace dxvk {
// If no pipeline instance exists with the given state
// vector, create a new one and add it to the list.
newPipelineHandle = this->compilePipeline(state, m_basePipeline);
newPipelineHandle = this->compilePipeline(state);
// Add new pipeline to the set
m_pipelines.push_back({ state, newPipelineHandle });
m_pipeMgr->m_numComputePipelines += 1;
if (!m_basePipeline && newPipelineHandle)
m_basePipeline = newPipelineHandle;
}
if (newPipelineHandle != VK_NULL_HANDLE)
@ -84,8 +81,7 @@ namespace dxvk {
VkPipeline DxvkComputePipeline::compilePipeline(
const DxvkComputePipelineStateInfo& state,
VkPipeline baseHandle) const {
const DxvkComputePipelineStateInfo& state) const {
std::vector<VkDescriptorSetLayoutBinding> bindings;
if (Logger::logLevel() <= LogLevel::Debug) {
@ -107,12 +103,10 @@ namespace dxvk {
VkComputePipelineCreateInfo info;
info.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO;
info.pNext = nullptr;
info.flags = baseHandle == VK_NULL_HANDLE
? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT
: VK_PIPELINE_CREATE_DERIVATIVE_BIT;
info.flags = 0;
info.stage = csm.stageInfo(&specInfo);
info.layout = m_layout->pipelineLayout();
info.basePipelineHandle = baseHandle;
info.basePipelineHandle = VK_NULL_HANDLE;
info.basePipelineIndex = -1;
// Time pipeline compilation for debugging purposes

View File

@ -82,15 +82,12 @@ namespace dxvk {
sync::Spinlock m_mutex;
std::vector<PipelineStruct> m_pipelines;
VkPipeline m_basePipeline = VK_NULL_HANDLE;
bool findPipeline(
const DxvkComputePipelineStateInfo& state,
VkPipeline& pipeline) const;
VkPipeline compilePipeline(
const DxvkComputePipelineStateInfo& state,
VkPipeline baseHandle) const;
const DxvkComputePipelineStateInfo& state) const;
void destroyPipeline(
VkPipeline pipeline);

View File

@ -119,14 +119,11 @@ namespace dxvk {
// If no pipeline instance exists with the given state
// vector, create a new one and add it to the list.
newPipelineHandle = this->compilePipeline(state, renderPass, m_basePipeline);
newPipelineHandle = this->compilePipeline(state, renderPass);
// Add new pipeline to the set
m_pipelines.emplace_back(state, renderPassHandle, newPipelineHandle);
m_pipeMgr->m_numGraphicsPipelines += 1;
if (!m_basePipeline && newPipelineHandle)
m_basePipeline = newPipelineHandle;
}
if (newPipelineHandle != VK_NULL_HANDLE)
@ -150,8 +147,7 @@ namespace dxvk {
VkPipeline DxvkGraphicsPipeline::compilePipeline(
const DxvkGraphicsPipelineStateInfo& state,
const DxvkRenderPass& renderPass,
VkPipeline baseHandle) const {
const DxvkRenderPass& renderPass) const {
if (Logger::logLevel() <= LogLevel::Debug) {
Logger::debug("Compiling graphics pipeline...");
this->logPipelineState(LogLevel::Debug, state);
@ -427,13 +423,9 @@ namespace dxvk {
info.layout = m_layout->pipelineLayout();
info.renderPass = renderPass.getDefaultHandle();
info.subpass = 0;
info.basePipelineHandle = baseHandle;
info.basePipelineHandle = VK_NULL_HANDLE;
info.basePipelineIndex = -1;
info.flags |= baseHandle == VK_NULL_HANDLE
? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT
: VK_PIPELINE_CREATE_DERIVATIVE_BIT;
if (tsInfo.patchControlPoints == 0)
info.pTessellationState = nullptr;

View File

@ -273,17 +273,13 @@ namespace dxvk {
alignas(CACHE_LINE_SIZE) sync::Spinlock m_mutex;
std::vector<DxvkGraphicsPipelineInstance> m_pipelines;
// Pipeline handles used for derivative pipelines
VkPipeline m_basePipeline = VK_NULL_HANDLE;
const DxvkGraphicsPipelineInstance* findInstance(
const DxvkGraphicsPipelineStateInfo& state,
VkRenderPass renderPass) const;
VkPipeline compilePipeline(
const DxvkGraphicsPipelineStateInfo& state,
const DxvkRenderPass& renderPass,
VkPipeline baseHandle) const;
const DxvkRenderPass& renderPass) const;
void destroyPipeline(
VkPipeline pipeline) const;