mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[dxvk] Add DXVK context method to transparently flush the command list
This is identical to what the D3D11 function did, but having it in this place will allow us to potentially implement better flush heuristics based on work done on the CS thread.
This commit is contained in:
parent
36ccd46ae7
commit
8054e4a772
@ -101,13 +101,8 @@ namespace dxvk {
|
||||
if (m_csIsBusy || m_csChunk->commandCount() != 0) {
|
||||
// Add commands to flush the threaded
|
||||
// context, then flush the command list
|
||||
EmitCs([dev = m_device] (DxvkContext* ctx) {
|
||||
dev->submitCommandList(
|
||||
ctx->endRecording(),
|
||||
nullptr, nullptr);
|
||||
|
||||
ctx->beginRecording(
|
||||
dev->createCommandList());
|
||||
EmitCs([] (DxvkContext* ctx) {
|
||||
ctx->flushCommandList();
|
||||
});
|
||||
|
||||
FlushCsChunk();
|
||||
|
@ -63,6 +63,16 @@ namespace dxvk {
|
||||
m_cmd->endRecording();
|
||||
return std::exchange(m_cmd, nullptr);
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::flushCommandList() {
|
||||
m_device->submitCommandList(
|
||||
this->endRecording(),
|
||||
nullptr, nullptr);
|
||||
|
||||
this->beginRecording(
|
||||
m_device->createCommandList());
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::beginQuery(const DxvkQueryRevision& query) {
|
||||
|
@ -62,6 +62,14 @@ namespace dxvk {
|
||||
* \returns Active command list
|
||||
*/
|
||||
Rc<DxvkCommandList> endRecording();
|
||||
|
||||
/**
|
||||
* \brief Flushes command buffer
|
||||
*
|
||||
* Transparently submits the current command
|
||||
* buffer and allocates a new one.
|
||||
*/
|
||||
void flushCommandList();
|
||||
|
||||
/**
|
||||
* \brief Begins generating query data
|
||||
|
Loading…
x
Reference in New Issue
Block a user