Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2021-03-05 17:58:52 +0300
committerJeroen Bakker <jeroen@blender.org>2021-03-05 18:56:14 +0300
commit87842d63883664125177e8361b5f06e2e5eba344 (patch)
tree3b3c6f2c556388b80a54b3bd29d885b828cfb55f
parentfde150fee476e16ee6130618ed1ea2598913f1b6 (diff)
Cleanup: Use blender::Vector in ExecutionGroup.
-rw-r--r--source/blender/compositor/intern/COM_ExecutionGroup.cpp23
-rw-r--r--source/blender/compositor/intern/COM_ExecutionGroup.h9
2 files changed, 11 insertions, 21 deletions
diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp
index 63a278c2ecc..2427d3c4bd5 100644
--- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp
+++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp
@@ -107,7 +107,7 @@ bool ExecutionGroup::addOperation(NodeOperation *operation)
m_initialized = true;
}
- m_operations.push_back(operation);
+ m_operations.append(operation);
return true;
}
@@ -136,8 +136,8 @@ void ExecutionGroup::initExecution()
for (index = 0; index < this->m_operations.size(); index++) {
NodeOperation *operation = this->m_operations[index];
if (operation->isReadBufferOperation()) {
- ReadBufferOperation *readOperation = (ReadBufferOperation *)operation;
- this->m_cachedReadOperations.push_back(readOperation);
+ ReadBufferOperation *readOperation = static_cast<ReadBufferOperation *>(operation);
+ this->m_read_operations.append(readOperation);
maxNumber = MAX2(maxNumber, readOperation->getOffset());
}
}
@@ -151,7 +151,7 @@ void ExecutionGroup::deinitExecution()
this->m_numberOfChunks = 0;
this->m_numberOfXChunks = 0;
this->m_numberOfYChunks = 0;
- this->m_cachedReadOperations.clear();
+ this->m_read_operations.clear();
this->m_bTree = nullptr;
}
void ExecutionGroup::determineResolution(unsigned int resolution[2])
@@ -372,16 +372,13 @@ MemoryBuffer **ExecutionGroup::getInputBuffersOpenCL(int chunkNumber)
{
rcti rect;
std::vector<MemoryProxy *> memoryproxies;
- unsigned int index;
determineChunkRect(&rect, chunkNumber);
this->determineDependingMemoryProxies(&memoryproxies);
MemoryBuffer **memoryBuffers = (MemoryBuffer **)MEM_callocN(
sizeof(MemoryBuffer *) * this->m_cachedMaxReadBufferOffset, __func__);
rcti output;
- for (index = 0; index < this->m_cachedReadOperations.size(); index++) {
- ReadBufferOperation *readOperation =
- (ReadBufferOperation *)this->m_cachedReadOperations[index];
+ for (ReadBufferOperation *readOperation : m_read_operations) {
MemoryProxy *memoryProxy = readOperation->getMemoryProxy();
this->determineDependingAreaOfInterest(&rect, readOperation, &output);
MemoryBuffer *memoryBuffer = memoryProxy->getExecutor()->constructConsolidatedMemoryBuffer(
@@ -551,9 +548,8 @@ bool ExecutionGroup::scheduleChunkWhenPossible(ExecutionSystem *graph, int xChun
bool canBeExecuted = true;
rcti area;
- for (index = 0; index < this->m_cachedReadOperations.size(); index++) {
- ReadBufferOperation *readOperation =
- (ReadBufferOperation *)this->m_cachedReadOperations[index];
+ for (index = 0; index < m_read_operations.size(); index++) {
+ ReadBufferOperation *readOperation = m_read_operations[index];
BLI_rcti_init(&area, 0, 0, 0, 0);
MemoryProxy *memoryProxy = memoryProxies[index];
determineDependingAreaOfInterest(&rect, readOperation, &area);
@@ -585,10 +581,7 @@ void ExecutionGroup::determineDependingAreaOfInterest(rcti *input,
void ExecutionGroup::determineDependingMemoryProxies(std::vector<MemoryProxy *> *memoryProxies)
{
- unsigned int index;
- for (index = 0; index < this->m_cachedReadOperations.size(); index++) {
- ReadBufferOperation *readOperation =
- (ReadBufferOperation *)this->m_cachedReadOperations[index];
+ for (ReadBufferOperation *readOperation : m_read_operations) {
memoryProxies->push_back(readOperation->getMemoryProxy());
}
}
diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.h b/source/blender/compositor/intern/COM_ExecutionGroup.h
index 415505616bd..9a749e1a9ed 100644
--- a/source/blender/compositor/intern/COM_ExecutionGroup.h
+++ b/source/blender/compositor/intern/COM_ExecutionGroup.h
@@ -63,16 +63,13 @@ enum class eChunkExecutionState {
* \ingroup Execution
*/
class ExecutionGroup {
- public:
- typedef std::vector<NodeOperation *> Operations;
-
private:
// fields
/**
* \brief list of operations in this ExecutionGroup
*/
- Operations m_operations;
+ blender::Vector<NodeOperation *> m_operations;
/**
* \brief is this ExecutionGroup an input ExecutionGroup
@@ -134,9 +131,9 @@ class ExecutionGroup {
unsigned int m_cachedMaxReadBufferOffset;
/**
- * \brief a cached vector of all read operations in the execution group.
+ * \brief All read operations of this execution group.
*/
- Operations m_cachedReadOperations;
+ blender::Vector<ReadBufferOperation *> m_read_operations;
/**
* \brief reference to the original bNodeTree,