1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 13:08:50 +01:00

[dxvk] Add submission feedback to command submissions

This commit is contained in:
Philip Rebohle 2023-03-16 12:44:58 +01:00
parent 27f3648a44
commit da32453b42
13 changed files with 29 additions and 19 deletions

View File

@ -895,7 +895,7 @@ namespace dxvk {
cSubmissionId = submissionId
] (DxvkContext* ctx) {
ctx->signal(cSubmissionFence, cSubmissionId);
ctx->flushCommandList();
ctx->flushCommandList(nullptr);
});
FlushCsChunk();

View File

@ -278,7 +278,7 @@ namespace dxvk {
void D3D11Initializer::FlushInternal() {
m_context->flushCommandList();
m_context->flushCommandList(nullptr);
m_transferCommands = 0;
m_transferMemory = 0;

View File

@ -415,7 +415,7 @@ namespace dxvk {
cCommandList = m_context->endRecording()
] (DxvkContext* ctx) {
cCommandList->setWsiSemaphores(cSync);
m_device->submitCommandList(cCommandList);
m_device->submitCommandList(cCommandList, nullptr);
if (cHud != nullptr && !cFrameId)
cHud->update();
@ -630,7 +630,8 @@ namespace dxvk {
subresources, VK_IMAGE_LAYOUT_UNDEFINED);
m_device->submitCommandList(
m_context->endRecording());
m_context->endRecording(),
nullptr);
}

View File

@ -5253,7 +5253,7 @@ namespace dxvk {
// Add commands to flush the threaded
// context, then flush the command list
EmitCs([](DxvkContext* ctx) {
ctx->flushCommandList();
ctx->flushCommandList(nullptr);
});
FlushCsChunk();

View File

@ -142,7 +142,7 @@ namespace dxvk {
void D3D9FormatHelper::FlushInternal() {
m_context->flushCommandList();
m_context->flushCommandList(nullptr);
m_transferCommands = 0;
}

View File

@ -153,7 +153,7 @@ namespace dxvk {
void D3D9Initializer::FlushInternal() {
m_context->flushCommandList();
m_context->flushCommandList(nullptr);
m_transferCommands = 0;
m_transferMemory = 0;

View File

@ -730,7 +730,7 @@ namespace dxvk {
cCommandList = m_context->endRecording()
] (DxvkContext* ctx) {
cCommandList->setWsiSemaphores(cSync);
m_device->submitCommandList(cCommandList);
m_device->submitCommandList(cCommandList, nullptr);
if (cHud != nullptr && !cFrameId)
cHud->update();
@ -927,7 +927,8 @@ namespace dxvk {
}
m_device->submitCommandList(
m_context->endRecording());
m_context->endRecording(),
nullptr);
}

View File

@ -101,9 +101,9 @@ namespace dxvk {
}
void DxvkContext::flushCommandList() {
void DxvkContext::flushCommandList(DxvkSubmitStatus* status) {
m_device->submitCommandList(
this->endRecording());
this->endRecording(), status);
this->beginRecording(
m_device->createCommandList());

View File

@ -6,6 +6,7 @@
#include "dxvk_context_state.h"
#include "dxvk_data.h"
#include "dxvk_objects.h"
#include "dxvk_queue.h"
#include "dxvk_resource.h"
#include "dxvk_util.h"
#include "dxvk_marker.h"
@ -63,8 +64,9 @@ namespace dxvk {
*
* Transparently submits the current command
* buffer and allocates a new one.
* \param [out] status Submission feedback
*/
void flushCommandList();
void flushCommandList(DxvkSubmitStatus* status);
/**
* \brief Begins generating query data

View File

@ -256,10 +256,11 @@ namespace dxvk {
void DxvkDevice::submitCommandList(
const Rc<DxvkCommandList>& commandList) {
const Rc<DxvkCommandList>& commandList,
DxvkSubmitStatus* status) {
DxvkSubmitInfo submitInfo = { };
submitInfo.cmdList = commandList;
m_submissionQueue.submit(submitInfo);
m_submissionQueue.submit(submitInfo, status);
std::lock_guard<sync::Spinlock> statLock(m_statLock);
m_statCounters.merge(commandList->statCounters());

View File

@ -452,9 +452,11 @@ namespace dxvk {
* Submits the given command list to the device using
* the given set of optional synchronization primitives.
* \param [in] commandList The command list to submit
* \param [out] status Submission feedback
*/
void submitCommandList(
const Rc<DxvkCommandList>& commandList);
const Rc<DxvkCommandList>& commandList,
DxvkSubmitStatus* status);
/**
* \brief Locks submission queue

View File

@ -26,7 +26,7 @@ namespace dxvk {
}
void DxvkSubmissionQueue::submit(DxvkSubmitInfo submitInfo) {
void DxvkSubmissionQueue::submit(DxvkSubmitInfo submitInfo, DxvkSubmitStatus* status) {
std::unique_lock<dxvk::mutex> lock(m_mutex);
m_finishCond.wait(lock, [this] {
@ -34,6 +34,7 @@ namespace dxvk {
});
DxvkSubmitEntry entry = { };
entry.status = status;
entry.submit = std::move(submitInfo);
m_pending += 1;

View File

@ -111,9 +111,11 @@ namespace dxvk {
* dedicated submission thread. Use this to take
* the submission overhead off the calling thread.
* \param [in] submitInfo Submission parameters
* \param [out] status Submission feedback
*/
void submit(
DxvkSubmitInfo submitInfo);
DxvkSubmitInfo submitInfo,
DxvkSubmitStatus* status);
/**
* \brief Presents an image synchronously
@ -122,7 +124,7 @@ namespace dxvk {
* and then presents the current swap chain image
* of the presenter. May stall the calling thread.
* \param [in] present Present parameters
* \returns Status of the operation
* \param [out] status Submission feedback
*/
void present(
DxvkPresentInfo presentInfo,