1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-27 22:54:16 +01:00

[dxvk] Don't track command count in CS chunks

We weren't using this at all, and it's not necessary
to check whether the chunk is empty either.
This commit is contained in:
Philip Rebohle 2019-07-17 12:52:25 +02:00
parent 11b7fc8914
commit b6c395c013
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 9 additions and 16 deletions

View File

@ -860,7 +860,7 @@ namespace dxvk {
} }
void FlushCsChunk() { void FlushCsChunk() {
if (likely(m_csChunk->commandCount())) { if (likely(!m_csChunk->empty())) {
EmitCsChunk(std::move(m_csChunk)); EmitCsChunk(std::move(m_csChunk));
m_csChunk = AllocCsChunk(); m_csChunk = AllocCsChunk();
m_cmdData = nullptr; m_cmdData = nullptr;

View File

@ -114,7 +114,7 @@ namespace dxvk {
D3D10DeviceLock lock = LockContext(); D3D10DeviceLock lock = LockContext();
if (m_csIsBusy || m_csChunk->commandCount() != 0) { if (m_csIsBusy || !m_csChunk->empty()) {
// 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([] (DxvkContext* ctx) { EmitCs([] (DxvkContext* ctx) {

View File

@ -21,7 +21,6 @@ namespace dxvk {
auto cmd = m_head; auto cmd = m_head;
if (m_flags.test(DxvkCsChunkFlag::SingleUse)) { if (m_flags.test(DxvkCsChunkFlag::SingleUse)) {
m_commandCount = 0;
m_commandOffset = 0; m_commandOffset = 0;
while (cmd != nullptr) { while (cmd != nullptr) {
@ -44,10 +43,7 @@ namespace dxvk {
void DxvkCsChunk::reset() { void DxvkCsChunk::reset() {
auto cmd = m_head; auto cmd = m_head;
m_commandCount = 0;
m_commandOffset = 0;
while (cmd != nullptr) { while (cmd != nullptr) {
auto next = cmd->next(); auto next = cmd->next();
cmd->~DxvkCsCmd(); cmd->~DxvkCsCmd();
@ -56,6 +52,8 @@ namespace dxvk {
m_head = nullptr; m_head = nullptr;
m_tail = nullptr; m_tail = nullptr;
m_commandOffset = 0;
} }

View File

@ -143,13 +143,11 @@ namespace dxvk {
~DxvkCsChunk(); ~DxvkCsChunk();
/** /**
* \brief Number of commands recorded to the chunk * \brief Checks whether the chunk is empty
* * \returns \c true if the chunk is empty
* Can be used to check whether the chunk needs to
* be dispatched or just to keep track of statistics.
*/ */
size_t commandCount() const { bool empty() const {
return m_commandCount; return m_commandOffset == 0;
} }
/** /**
@ -179,7 +177,6 @@ namespace dxvk {
else else
m_head = m_tail; m_head = m_tail;
m_commandCount += 1;
m_commandOffset += sizeof(FuncType); m_commandOffset += sizeof(FuncType);
return true; return true;
} }
@ -207,7 +204,6 @@ namespace dxvk {
m_head = func; m_head = func;
m_tail = func; m_tail = func;
m_commandCount += 1;
m_commandOffset += sizeof(FuncType); m_commandOffset += sizeof(FuncType);
return func->data(); return func->data();
} }
@ -238,7 +234,6 @@ namespace dxvk {
private: private:
size_t m_commandCount = 0;
size_t m_commandOffset = 0; size_t m_commandOffset = 0;
DxvkCsCmd* m_head = nullptr; DxvkCsCmd* m_head = nullptr;