mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
Fixes a few bottlenecks that were encountered in the Cascading Shadow Maps demo from the Microsoft SDK. Performance is now slightly better than wined3d with CSMT, MESA_NO_ERROR and mesa_glthread enabled.
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
#include "dxvk_stats.h"
|
|
|
|
namespace dxvk {
|
|
|
|
DxvkStatCounters:: DxvkStatCounters() { }
|
|
DxvkStatCounters::~DxvkStatCounters() { }
|
|
|
|
|
|
DxvkStatCounters::DxvkStatCounters(const DxvkStatCounters& other) {
|
|
for (size_t i = 0; i < m_counters.size(); i++)
|
|
m_counters[i] = other.m_counters[i].load();
|
|
}
|
|
|
|
|
|
DxvkStatCounters& DxvkStatCounters::operator = (const DxvkStatCounters& other) {
|
|
for (size_t i = 0; i < m_counters.size(); i++)
|
|
m_counters[i] = other.m_counters[i].load();
|
|
return *this;
|
|
}
|
|
|
|
|
|
DxvkStatCounters DxvkStatCounters::delta(const DxvkStatCounters& oldState) const {
|
|
DxvkStatCounters result;
|
|
for (size_t i = 0; i < m_counters.size(); i++)
|
|
result.m_counters[i] = m_counters[i] - oldState.m_counters[i];;
|
|
return result;
|
|
}
|
|
|
|
|
|
void DxvkStatCounters::addCounters(const DxvkStatCounters& counters) {
|
|
for (size_t i = 0; i < m_counters.size(); i++)
|
|
m_counters[i] += counters.m_counters[i];
|
|
}
|
|
|
|
|
|
void DxvkStatCounters::clear() {
|
|
for (size_t i = 0; i < m_counters.size(); i++)
|
|
m_counters[i] = 0;
|
|
}
|
|
|
|
}
|