mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-21 22:54:16 +01:00
[dxvk] Add context methods for submission splitting
This commit is contained in:
parent
6f2ff2562d
commit
07a1045ffb
@ -66,54 +66,15 @@ namespace dxvk {
|
|||||||
m_cmd = cmdList;
|
m_cmd = cmdList;
|
||||||
m_cmd->init();
|
m_cmd->init();
|
||||||
|
|
||||||
// Mark all resources as untracked
|
|
||||||
m_vbTracked.clear();
|
|
||||||
m_rcTracked.clear();
|
|
||||||
|
|
||||||
// The current state of the internal command buffer is
|
|
||||||
// undefined, so we have to bind and set up everything
|
|
||||||
// before any draw or dispatch command is recorded.
|
|
||||||
m_flags.clr(
|
|
||||||
DxvkContextFlag::GpRenderPassBound,
|
|
||||||
DxvkContextFlag::GpXfbActive,
|
|
||||||
DxvkContextFlag::GpIndependentSets);
|
|
||||||
|
|
||||||
m_flags.set(
|
|
||||||
DxvkContextFlag::GpDirtyFramebuffer,
|
|
||||||
DxvkContextFlag::GpDirtyPipeline,
|
|
||||||
DxvkContextFlag::GpDirtyPipelineState,
|
|
||||||
DxvkContextFlag::GpDirtyVertexBuffers,
|
|
||||||
DxvkContextFlag::GpDirtyIndexBuffer,
|
|
||||||
DxvkContextFlag::GpDirtyXfbBuffers,
|
|
||||||
DxvkContextFlag::GpDirtyBlendConstants,
|
|
||||||
DxvkContextFlag::GpDirtyStencilRef,
|
|
||||||
DxvkContextFlag::GpDirtyRasterizerState,
|
|
||||||
DxvkContextFlag::GpDirtyViewport,
|
|
||||||
DxvkContextFlag::GpDirtyDepthBias,
|
|
||||||
DxvkContextFlag::GpDirtyDepthBounds,
|
|
||||||
DxvkContextFlag::GpDirtyDepthStencilState,
|
|
||||||
DxvkContextFlag::CpDirtyPipelineState,
|
|
||||||
DxvkContextFlag::DirtyDrawBuffer);
|
|
||||||
|
|
||||||
m_descriptorState.dirtyStages(
|
|
||||||
VK_SHADER_STAGE_ALL_GRAPHICS |
|
|
||||||
VK_SHADER_STAGE_COMPUTE_BIT);
|
|
||||||
|
|
||||||
m_state.gp.pipeline = nullptr;
|
|
||||||
m_state.cp.pipeline = nullptr;
|
|
||||||
|
|
||||||
if (m_descriptorPool == nullptr)
|
if (m_descriptorPool == nullptr)
|
||||||
m_descriptorPool = m_descriptorManager->getDescriptorPool();
|
m_descriptorPool = m_descriptorManager->getDescriptorPool();
|
||||||
|
|
||||||
|
this->beginCurrentCommands();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Rc<DxvkCommandList> DxvkContext::endRecording() {
|
Rc<DxvkCommandList> DxvkContext::endRecording() {
|
||||||
this->spillRenderPass(true);
|
this->endCurrentCommands();
|
||||||
this->flushSharedImages();
|
|
||||||
|
|
||||||
m_sdmaBarriers.recordCommands(m_cmd);
|
|
||||||
m_initBarriers.recordCommands(m_cmd);
|
|
||||||
m_execBarriers.recordCommands(m_cmd);
|
|
||||||
|
|
||||||
if (m_descriptorPool->shouldSubmit(false)) {
|
if (m_descriptorPool->shouldSubmit(false)) {
|
||||||
m_cmd->trackDescriptorPool(m_descriptorPool, m_descriptorManager);
|
m_cmd->trackDescriptorPool(m_descriptorPool, m_descriptorManager);
|
||||||
@ -5831,4 +5792,65 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxvkContext::beginCurrentCommands() {
|
||||||
|
// Mark all resources as untracked
|
||||||
|
m_vbTracked.clear();
|
||||||
|
m_rcTracked.clear();
|
||||||
|
|
||||||
|
// The current state of the internal command buffer is
|
||||||
|
// undefined, so we have to bind and set up everything
|
||||||
|
// before any draw or dispatch command is recorded.
|
||||||
|
m_flags.clr(
|
||||||
|
DxvkContextFlag::GpRenderPassBound,
|
||||||
|
DxvkContextFlag::GpXfbActive,
|
||||||
|
DxvkContextFlag::GpIndependentSets);
|
||||||
|
|
||||||
|
m_flags.set(
|
||||||
|
DxvkContextFlag::GpDirtyFramebuffer,
|
||||||
|
DxvkContextFlag::GpDirtyPipeline,
|
||||||
|
DxvkContextFlag::GpDirtyPipelineState,
|
||||||
|
DxvkContextFlag::GpDirtyVertexBuffers,
|
||||||
|
DxvkContextFlag::GpDirtyIndexBuffer,
|
||||||
|
DxvkContextFlag::GpDirtyXfbBuffers,
|
||||||
|
DxvkContextFlag::GpDirtyBlendConstants,
|
||||||
|
DxvkContextFlag::GpDirtyStencilRef,
|
||||||
|
DxvkContextFlag::GpDirtyRasterizerState,
|
||||||
|
DxvkContextFlag::GpDirtyViewport,
|
||||||
|
DxvkContextFlag::GpDirtyDepthBias,
|
||||||
|
DxvkContextFlag::GpDirtyDepthBounds,
|
||||||
|
DxvkContextFlag::GpDirtyDepthStencilState,
|
||||||
|
DxvkContextFlag::CpDirtyPipelineState,
|
||||||
|
DxvkContextFlag::DirtyDrawBuffer);
|
||||||
|
|
||||||
|
m_descriptorState.dirtyStages(
|
||||||
|
VK_SHADER_STAGE_ALL_GRAPHICS |
|
||||||
|
VK_SHADER_STAGE_COMPUTE_BIT);
|
||||||
|
|
||||||
|
m_state.gp.pipeline = nullptr;
|
||||||
|
m_state.cp.pipeline = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxvkContext::endCurrentCommands() {
|
||||||
|
this->spillRenderPass(true);
|
||||||
|
this->flushSharedImages();
|
||||||
|
|
||||||
|
m_sdmaBarriers.recordCommands(m_cmd);
|
||||||
|
m_initBarriers.recordCommands(m_cmd);
|
||||||
|
m_execBarriers.recordCommands(m_cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxvkContext::splitCommands() {
|
||||||
|
// This behaves the same as a pair of endRecording and
|
||||||
|
// beginRecording calls, except that we keep the same
|
||||||
|
// command list object for subsequent commands.
|
||||||
|
this->endCurrentCommands();
|
||||||
|
|
||||||
|
m_cmd->next();
|
||||||
|
|
||||||
|
this->beginCurrentCommands();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1588,6 +1588,12 @@ namespace dxvk {
|
|||||||
void resizeDescriptorArrays(
|
void resizeDescriptorArrays(
|
||||||
uint32_t bindingCount);
|
uint32_t bindingCount);
|
||||||
|
|
||||||
|
void beginCurrentCommands();
|
||||||
|
|
||||||
|
void endCurrentCommands();
|
||||||
|
|
||||||
|
void splitCommands();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user