mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +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:
parent
03c6df56c1
commit
a93dd74f71
@ -52,14 +52,11 @@ namespace dxvk {
|
|||||||
|
|
||||||
// If no pipeline instance exists with the given state
|
// If no pipeline instance exists with the given state
|
||||||
// vector, create a new one and add it to the list.
|
// 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
|
// Add new pipeline to the set
|
||||||
m_pipelines.push_back({ state, newPipelineHandle });
|
m_pipelines.push_back({ state, newPipelineHandle });
|
||||||
m_pipeMgr->m_numComputePipelines += 1;
|
m_pipeMgr->m_numComputePipelines += 1;
|
||||||
|
|
||||||
if (!m_basePipeline && newPipelineHandle)
|
|
||||||
m_basePipeline = newPipelineHandle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newPipelineHandle != VK_NULL_HANDLE)
|
if (newPipelineHandle != VK_NULL_HANDLE)
|
||||||
@ -84,8 +81,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
VkPipeline DxvkComputePipeline::compilePipeline(
|
VkPipeline DxvkComputePipeline::compilePipeline(
|
||||||
const DxvkComputePipelineStateInfo& state,
|
const DxvkComputePipelineStateInfo& state) const {
|
||||||
VkPipeline baseHandle) const {
|
|
||||||
std::vector<VkDescriptorSetLayoutBinding> bindings;
|
std::vector<VkDescriptorSetLayoutBinding> bindings;
|
||||||
|
|
||||||
if (Logger::logLevel() <= LogLevel::Debug) {
|
if (Logger::logLevel() <= LogLevel::Debug) {
|
||||||
@ -107,12 +103,10 @@ namespace dxvk {
|
|||||||
VkComputePipelineCreateInfo info;
|
VkComputePipelineCreateInfo info;
|
||||||
info.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO;
|
info.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO;
|
||||||
info.pNext = nullptr;
|
info.pNext = nullptr;
|
||||||
info.flags = baseHandle == VK_NULL_HANDLE
|
info.flags = 0;
|
||||||
? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT
|
|
||||||
: VK_PIPELINE_CREATE_DERIVATIVE_BIT;
|
|
||||||
info.stage = csm.stageInfo(&specInfo);
|
info.stage = csm.stageInfo(&specInfo);
|
||||||
info.layout = m_layout->pipelineLayout();
|
info.layout = m_layout->pipelineLayout();
|
||||||
info.basePipelineHandle = baseHandle;
|
info.basePipelineHandle = VK_NULL_HANDLE;
|
||||||
info.basePipelineIndex = -1;
|
info.basePipelineIndex = -1;
|
||||||
|
|
||||||
// Time pipeline compilation for debugging purposes
|
// Time pipeline compilation for debugging purposes
|
||||||
|
@ -82,15 +82,12 @@ namespace dxvk {
|
|||||||
sync::Spinlock m_mutex;
|
sync::Spinlock m_mutex;
|
||||||
std::vector<PipelineStruct> m_pipelines;
|
std::vector<PipelineStruct> m_pipelines;
|
||||||
|
|
||||||
VkPipeline m_basePipeline = VK_NULL_HANDLE;
|
|
||||||
|
|
||||||
bool findPipeline(
|
bool findPipeline(
|
||||||
const DxvkComputePipelineStateInfo& state,
|
const DxvkComputePipelineStateInfo& state,
|
||||||
VkPipeline& pipeline) const;
|
VkPipeline& pipeline) const;
|
||||||
|
|
||||||
VkPipeline compilePipeline(
|
VkPipeline compilePipeline(
|
||||||
const DxvkComputePipelineStateInfo& state,
|
const DxvkComputePipelineStateInfo& state) const;
|
||||||
VkPipeline baseHandle) const;
|
|
||||||
|
|
||||||
void destroyPipeline(
|
void destroyPipeline(
|
||||||
VkPipeline pipeline);
|
VkPipeline pipeline);
|
||||||
|
@ -119,14 +119,11 @@ namespace dxvk {
|
|||||||
|
|
||||||
// If no pipeline instance exists with the given state
|
// If no pipeline instance exists with the given state
|
||||||
// vector, create a new one and add it to the list.
|
// 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
|
// Add new pipeline to the set
|
||||||
m_pipelines.emplace_back(state, renderPassHandle, newPipelineHandle);
|
m_pipelines.emplace_back(state, renderPassHandle, newPipelineHandle);
|
||||||
m_pipeMgr->m_numGraphicsPipelines += 1;
|
m_pipeMgr->m_numGraphicsPipelines += 1;
|
||||||
|
|
||||||
if (!m_basePipeline && newPipelineHandle)
|
|
||||||
m_basePipeline = newPipelineHandle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newPipelineHandle != VK_NULL_HANDLE)
|
if (newPipelineHandle != VK_NULL_HANDLE)
|
||||||
@ -150,8 +147,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
VkPipeline DxvkGraphicsPipeline::compilePipeline(
|
VkPipeline DxvkGraphicsPipeline::compilePipeline(
|
||||||
const DxvkGraphicsPipelineStateInfo& state,
|
const DxvkGraphicsPipelineStateInfo& state,
|
||||||
const DxvkRenderPass& renderPass,
|
const DxvkRenderPass& renderPass) const {
|
||||||
VkPipeline baseHandle) const {
|
|
||||||
if (Logger::logLevel() <= LogLevel::Debug) {
|
if (Logger::logLevel() <= LogLevel::Debug) {
|
||||||
Logger::debug("Compiling graphics pipeline...");
|
Logger::debug("Compiling graphics pipeline...");
|
||||||
this->logPipelineState(LogLevel::Debug, state);
|
this->logPipelineState(LogLevel::Debug, state);
|
||||||
@ -427,13 +423,9 @@ namespace dxvk {
|
|||||||
info.layout = m_layout->pipelineLayout();
|
info.layout = m_layout->pipelineLayout();
|
||||||
info.renderPass = renderPass.getDefaultHandle();
|
info.renderPass = renderPass.getDefaultHandle();
|
||||||
info.subpass = 0;
|
info.subpass = 0;
|
||||||
info.basePipelineHandle = baseHandle;
|
info.basePipelineHandle = VK_NULL_HANDLE;
|
||||||
info.basePipelineIndex = -1;
|
info.basePipelineIndex = -1;
|
||||||
|
|
||||||
info.flags |= baseHandle == VK_NULL_HANDLE
|
|
||||||
? VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT
|
|
||||||
: VK_PIPELINE_CREATE_DERIVATIVE_BIT;
|
|
||||||
|
|
||||||
if (tsInfo.patchControlPoints == 0)
|
if (tsInfo.patchControlPoints == 0)
|
||||||
info.pTessellationState = nullptr;
|
info.pTessellationState = nullptr;
|
||||||
|
|
||||||
|
@ -273,17 +273,13 @@ namespace dxvk {
|
|||||||
alignas(CACHE_LINE_SIZE) sync::Spinlock m_mutex;
|
alignas(CACHE_LINE_SIZE) sync::Spinlock m_mutex;
|
||||||
std::vector<DxvkGraphicsPipelineInstance> m_pipelines;
|
std::vector<DxvkGraphicsPipelineInstance> m_pipelines;
|
||||||
|
|
||||||
// Pipeline handles used for derivative pipelines
|
|
||||||
VkPipeline m_basePipeline = VK_NULL_HANDLE;
|
|
||||||
|
|
||||||
const DxvkGraphicsPipelineInstance* findInstance(
|
const DxvkGraphicsPipelineInstance* findInstance(
|
||||||
const DxvkGraphicsPipelineStateInfo& state,
|
const DxvkGraphicsPipelineStateInfo& state,
|
||||||
VkRenderPass renderPass) const;
|
VkRenderPass renderPass) const;
|
||||||
|
|
||||||
VkPipeline compilePipeline(
|
VkPipeline compilePipeline(
|
||||||
const DxvkGraphicsPipelineStateInfo& state,
|
const DxvkGraphicsPipelineStateInfo& state,
|
||||||
const DxvkRenderPass& renderPass,
|
const DxvkRenderPass& renderPass) const;
|
||||||
VkPipeline baseHandle) const;
|
|
||||||
|
|
||||||
void destroyPipeline(
|
void destroyPipeline(
|
||||||
VkPipeline pipeline) const;
|
VkPipeline pipeline) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user