Make texture node threaded

Quite trivial idea -- just pass tread ID to the texture sampling function.

Implemented as a TLS to avoid passing huge amount of extra contexts around.
Should be working on all platforms, but compilation test is required.

Reviewers: juicyfruit, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1831
This commit is contained in:
2016-03-03 15:59:20 +05:00
parent ba7eb0c7b9
commit 8c113a95e3
10 changed files with 81 additions and 28 deletions

View File

@@ -22,6 +22,12 @@
#include "COM_CPUDevice.h"
CPUDevice::CPUDevice(int thread_id)
: Device(),
m_thread_id(thread_id)
{
}
void CPUDevice::execute(WorkPackage *work)
{
const unsigned int chunkNumber = work->getChunkNumber();