mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-07 16:54:14 +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) {
|
if (m_csIsBusy || m_csChunk->commandCount() != 0) {
|
||||||
// Add commands to flush the threaded
|
// Add commands to flush the threaded
|
||||||
// context, then flush the command list
|
// context, then flush the command list
|
||||||
EmitCs([dev = m_device] (DxvkContext* ctx) {
|
EmitCs([] (DxvkContext* ctx) {
|
||||||
dev->submitCommandList(
|
ctx->flushCommandList();
|
||||||
ctx->endRecording(),
|
|
||||||
nullptr, nullptr);
|
|
||||||
|
|
||||||
ctx->beginRecording(
|
|
||||||
dev->createCommandList());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
FlushCsChunk();
|
FlushCsChunk();
|
||||||
|
@ -65,6 +65,16 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxvkContext::flushCommandList() {
|
||||||
|
m_device->submitCommandList(
|
||||||
|
this->endRecording(),
|
||||||
|
nullptr, nullptr);
|
||||||
|
|
||||||
|
this->beginRecording(
|
||||||
|
m_device->createCommandList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkContext::beginQuery(const DxvkQueryRevision& query) {
|
void DxvkContext::beginQuery(const DxvkQueryRevision& query) {
|
||||||
query.query->beginRecording(query.revision);
|
query.query->beginRecording(query.revision);
|
||||||
m_queries.enableQuery(m_cmd, query);
|
m_queries.enableQuery(m_cmd, query);
|
||||||
|
@ -63,6 +63,14 @@ namespace dxvk {
|
|||||||
*/
|
*/
|
||||||
Rc<DxvkCommandList> endRecording();
|
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
|
* \brief Begins generating query data
|
||||||
* \param [in] query The query to end
|
* \param [in] query The query to end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user