1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +01:00

[dxvk] Expose a way to increment stat counters

In case the counters come from external sources.
This commit is contained in:
Philip Rebohle 2022-02-12 19:50:52 +01:00
parent b6121c84aa
commit 52666a33c6
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 25 additions and 1 deletions

View File

@ -102,7 +102,7 @@ namespace dxvk {
* \param [in] ctr The counter to increment
* \param [in] val The value to add
*/
void addStatCtr(DxvkStatCounter ctr, uint32_t val) {
void addStatCtr(DxvkStatCounter ctr, uint64_t val) {
m_statCounters.addCtr(ctr, val);
}

View File

@ -1068,6 +1068,19 @@ namespace dxvk {
*/
void insertDebugLabel(VkDebugUtilsLabelEXT *label);
/**
* \brief Increments a given stat counter
*
* The stat counters will be merged into the global
* stat counters upon execution of the command list.
* \param [in] counter Stat counter to increment
* \param [in] value Increment value
*/
void addStatCtr(DxvkStatCounter counter, uint64_t value) {
if (m_cmd != nullptr)
m_cmd->addStatCtr(counter, value);
}
private:
Rc<DxvkDevice> m_device;

View File

@ -456,6 +456,17 @@ namespace dxvk {
return m_submissionQueue.pendingSubmissions();
}
/**
* \brief Increments a given stat counter
*
* \param [in] counter Stat counter to increment
* \param [in] value Increment value
*/
void addStatCtr(DxvkStatCounter counter, uint64_t value) {
std::lock_guard<sync::Spinlock> lock(m_statLock);
m_statCounters.addCtr(counter, value);
}
/**
* \brief Waits for a given submission
*