Compositor: Use atomics to update finished tiles progress
Integer is not safe for incremental by multiple threads and if one is unlucky enough that could cause progress re[reports to go totally nuts.
This commit is contained in:
parent
bb5e46f105
commit
a6803bf564
|
@ -41,6 +41,7 @@ set(INC
|
|||
../render/intern/include
|
||||
../../../extern/clew/include
|
||||
../../../intern/guardedalloc
|
||||
../../../intern/atomic
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
|
|
@ -50,6 +50,7 @@ incs = [
|
|||
'../render/intern/include',
|
||||
'../windowmanager',
|
||||
'../../../intern/guardedalloc',
|
||||
'../../../intern/atomic',
|
||||
|
||||
# data files
|
||||
env['DATA_HEADERS'],
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
#include "WM_api.h"
|
||||
#include "WM_types.h"
|
||||
|
||||
#include "atomic_ops.h"
|
||||
|
||||
ExecutionGroup::ExecutionGroup()
|
||||
{
|
||||
this->m_isOutput = false;
|
||||
|
@ -382,7 +384,7 @@ void ExecutionGroup::finalizeChunkExecution(int chunkNumber, MemoryBuffer **memo
|
|||
if (this->m_chunkExecutionStates[chunkNumber] == COM_ES_SCHEDULED)
|
||||
this->m_chunkExecutionStates[chunkNumber] = COM_ES_EXECUTED;
|
||||
|
||||
this->m_chunksFinished++;
|
||||
atomic_add_u(&this->m_chunksFinished, 0);
|
||||
if (memoryBuffers) {
|
||||
for (unsigned int index = 0; index < this->m_cachedMaxReadBufferOffset; index++) {
|
||||
MemoryBuffer *buffer = memoryBuffers[index];
|
||||
|
|
Loading…
Reference in New Issue