1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-30 04:24:11 +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() {
if (likely(m_csChunk->commandCount())) {
if (likely(!m_csChunk->empty())) {
EmitCsChunk(std::move(m_csChunk));
m_csChunk = AllocCsChunk();
m_cmdData = nullptr;

View File

@ -114,7 +114,7 @@ namespace dxvk {
D3D10DeviceLock lock = LockContext();
if (m_csIsBusy || m_csChunk->commandCount() != 0) {
if (m_csIsBusy || !m_csChunk->empty()) {
// Add commands to flush the threaded
// context, then flush the command list
EmitCs([] (DxvkContext* ctx) {

View File

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

View File

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