#include <pixeldevice.h>
Public Member Functions | |
| OpenCLPixelDevice (const Context *context, OpenCLDeviceDescription *desc, const unsigned int index) | |
| ~OpenCLPixelDevice () | |
| void | Init (const unsigned int w, const unsigned int h) |
| void | ClearFrameBuffer () |
| void | ClearSampleFrameBuffer () |
| void | SetGamma (const float gamma=2.2f) |
| void | Start () |
| void | Interrupt () |
| void | Stop () |
| SampleBuffer * | GetFreeSampleBuffer () |
| void | FreeSampleBuffer (SampleBuffer *sampleBuffer) |
| void | AddSampleBuffer (const FilterType type, SampleBuffer *sampleBuffer) |
| void | Merge (const SampleFrameBuffer *sfb) |
| const SampleFrameBuffer * | GetSampleFrameBuffer () const |
| void | UpdateFrameBuffer (const ToneMapParams ¶ms) |
| const FrameBuffer * | GetFrameBuffer () const |
| const OpenCLDeviceDescription * | GetDeviceDesc () const |
| unsigned int | GetFreeDevBufferCount () |
| unsigned int | GetTotalDevBufferCount () |
Static Public Attributes | |
| static size_t | SampleBufferSize = 65536 |
Private Member Functions | |
| void | CompileKernel (cl::Context &ctx, cl::Device &device, const std::string &src, const char *kernelName, cl::Kernel **kernel) |
Private Attributes | |
| OpenCLDeviceDescription * | deviceDesc |
| SampleFrameBuffer * | sampleFrameBuffer |
| FrameBuffer * | frameBuffer |
| boost::mutex | splatMutex |
| cl::CommandQueue * | oclQueue |
| cl::Kernel * | clearFBKernel |
| size_t | clearFBWorkGroupSize |
| cl::Kernel * | clearSampleFBKernel |
| cl::Kernel * | addSampleBufferKernel |
| cl::Kernel * | addSampleBufferPreviewKernel |
| cl::Kernel * | addSampleBufferGaussian2x2Kernel |
| cl::Kernel * | updateFrameBufferKernel |
| cl::Buffer * | sampleFrameBuff |
| cl::Buffer * | frameBuff |
| std::vector< OpenCLSampleBuffer * > | sampleBuffers |
| std::deque< OpenCLSampleBuffer * > | freeSampleBuffers |
| cl::Buffer * | gammaTableBuff |
| cl::Buffer * | filterTableBuff |
| float | gammaTable [GammaTableSize] |
| float | Gaussian2x2_filterTable [FilterTableSize *FilterTableSize] |
Static Private Attributes | |
| static const unsigned int | GammaTableSize = 1024 |
| static const unsigned int | FilterTableSize = 16 |
Friends | |
| class | Context |
| class | OpenCLSampleBuffer |
Definition at line 236 of file pixeldevice.h.
| OpenCLPixelDevice::OpenCLPixelDevice | ( | const Context * | context, | |
| OpenCLDeviceDescription * | desc, | |||
| const unsigned int | index | |||
| ) |
Definition at line 79 of file openclpdevice.cpp.
References addSampleBufferGaussian2x2Kernel, addSampleBufferKernel, addSampleBufferPreviewKernel, clearFBKernel, clearSampleFBKernel, CompileKernel(), luxrays::Device::deviceContext, deviceDesc, luxrays::Device::deviceName, filterTableBuff, FilterTableSize, frameBuff, frameBuffer, freeSampleBuffers, gammaTableBuff, GammaTableSize, Gaussian2x2_filterTable, luxrays::DeviceDescription::GetName(), luxrays::OpenCLDeviceDescription::GetOCLContext(), luxrays::OpenCLDeviceDescription::GetOCLDevice(), luxrays::KernelSource_Pixel_AddSampleBuffer, luxrays::KernelSource_Pixel_AddSampleBufferGaussian2x2, luxrays::KernelSource_Pixel_AddSampleBufferPreview, luxrays::KernelSource_Pixel_ClearFB, luxrays::KernelSource_Pixel_ClearSampleFB, luxrays::KernelSource_Pixel_UpdateFrameBuffer, LR_LOG, oclQueue, sampleBuffers, sampleFrameBuff, sampleFrameBuffer, SetGamma(), updateFrameBufferKernel, and luxrays::OpenCLDeviceDescription::usedMemory.
| OpenCLPixelDevice::~OpenCLPixelDevice | ( | ) |
Definition at line 150 of file openclpdevice.cpp.
References addSampleBufferGaussian2x2Kernel, addSampleBufferKernel, addSampleBufferPreviewKernel, clearFBKernel, clearSampleFBKernel, deviceDesc, filterTableBuff, frameBuff, frameBuffer, gammaTableBuff, oclQueue, sampleBuffers, sampleFrameBuff, sampleFrameBuffer, luxrays::Device::started, Stop(), updateFrameBufferKernel, and luxrays::OpenCLDeviceDescription::usedMemory.
| void OpenCLPixelDevice::AddSampleBuffer | ( | const FilterType | type, | |
| SampleBuffer * | sampleBuffer | |||
| ) | [virtual] |
Implements luxrays::PixelDevice.
Definition at line 333 of file openclpdevice.cpp.
References addSampleBufferGaussian2x2Kernel, addSampleBufferKernel, addSampleBufferPreviewKernel, luxrays::FILTER_GAUSSIAN, luxrays::FILTER_NONE, luxrays::FILTER_PREVIEW, filterTableBuff, freeSampleBuffers, luxrays::OpenCLSampleBuffer::GetOCLBuffer(), luxrays::OpenCLSampleBuffer::GetOCLEvent(), luxrays::SampleBuffer::GetSampleCount(), luxrays::SampleBuffer::GetSize(), luxrays::PixelDevice::height, oclQueue, sampleFrameBuff, splatMutex, luxrays::Device::started, luxrays::PixelDevice::width, and luxrays::OpenCLSampleBuffer::Write().
| void OpenCLPixelDevice::ClearFrameBuffer | ( | ) | [virtual] |
Implements luxrays::PixelDevice.
Definition at line 258 of file openclpdevice.cpp.
References clearFBKernel, frameBuff, luxrays::PixelDevice::height, oclQueue, and luxrays::PixelDevice::width.
Referenced by Init().
| void OpenCLPixelDevice::ClearSampleFrameBuffer | ( | ) | [virtual] |
Implements luxrays::PixelDevice.
Definition at line 250 of file openclpdevice.cpp.
References clearSampleFBKernel, luxrays::PixelDevice::height, oclQueue, sampleFrameBuff, and luxrays::PixelDevice::width.
Referenced by Init().
| void OpenCLPixelDevice::CompileKernel | ( | cl::Context & | ctx, | |
| cl::Device & | device, | |||
| const std::string & | src, | |||
| const char * | kernelName, | |||
| cl::Kernel ** | kernel | |||
| ) | [private] |
Definition at line 185 of file openclpdevice.cpp.
References luxrays::Device::deviceContext, luxrays::Device::deviceName, and LR_LOG.
Referenced by OpenCLPixelDevice().
| void OpenCLPixelDevice::FreeSampleBuffer | ( | SampleBuffer * | sampleBuffer | ) | [virtual] |
Implements luxrays::PixelDevice.
Definition at line 327 of file openclpdevice.cpp.
References freeSampleBuffers, and splatMutex.
| const OpenCLDeviceDescription* luxrays::OpenCLPixelDevice::GetDeviceDesc | ( | ) | const [inline] |
Definition at line 261 of file pixeldevice.h.
References deviceDesc.
| const FrameBuffer* luxrays::OpenCLPixelDevice::GetFrameBuffer | ( | ) | const [inline, virtual] |
Implements luxrays::PixelDevice.
Definition at line 259 of file pixeldevice.h.
References frameBuffer.
| unsigned int luxrays::OpenCLPixelDevice::GetFreeDevBufferCount | ( | ) | [inline] |
Definition at line 263 of file pixeldevice.h.
References freeSampleBuffers, and splatMutex.
| SampleBuffer * OpenCLPixelDevice::GetFreeSampleBuffer | ( | ) | [virtual] |
Implements luxrays::PixelDevice.
Definition at line 298 of file openclpdevice.cpp.
References luxrays::OpenCLSampleBuffer::CollectStats(), luxrays::Device::deviceContext, luxrays::Device::deviceName, freeSampleBuffers, LR_LOG, OpenCLSampleBuffer, luxrays::SampleBuffer::Reset(), sampleBuffers, SampleBufferSize, splatMutex, and luxrays::OpenCLSampleBuffer::Wait().
| const SampleFrameBuffer * OpenCLPixelDevice::GetSampleFrameBuffer | ( | ) | const [virtual] |
Implements luxrays::PixelDevice.
Definition at line 423 of file openclpdevice.cpp.
References sampleFrameBuffer.
| unsigned int luxrays::OpenCLPixelDevice::GetTotalDevBufferCount | ( | ) | [inline] |
Definition at line 268 of file pixeldevice.h.
References sampleBuffers, and splatMutex.
| void OpenCLPixelDevice::Init | ( | const unsigned int | w, | |
| const unsigned int | h | |||
| ) | [virtual] |
Reimplemented from luxrays::PixelDevice.
Definition at line 204 of file openclpdevice.cpp.
References ClearFrameBuffer(), ClearSampleFrameBuffer(), luxrays::Device::deviceContext, deviceDesc, luxrays::Device::deviceName, frameBuff, frameBuffer, luxrays::OpenCLDeviceDescription::GetOCLContext(), luxrays::PixelDevice::height, LR_LOG, sampleFrameBuff, sampleFrameBuffer, luxrays::OpenCLDeviceDescription::usedMemory, and luxrays::PixelDevice::width.
| void OpenCLPixelDevice::Interrupt | ( | ) | [virtual] |
Implements luxrays::Device.
Definition at line 286 of file openclpdevice.cpp.
References splatMutex, and luxrays::Device::started.
| void OpenCLPixelDevice::Merge | ( | const SampleFrameBuffer * | sfb | ) | [virtual] |
Implements luxrays::PixelDevice.
Definition at line 419 of file openclpdevice.cpp.
| void OpenCLPixelDevice::SetGamma | ( | const float | gamma = 2.2f |
) | [virtual] |
Implements luxrays::PixelDevice.
Definition at line 266 of file openclpdevice.cpp.
References luxrays::Clamp(), gammaTable, gammaTableBuff, GammaTableSize, and oclQueue.
Referenced by OpenCLPixelDevice().
| void OpenCLPixelDevice::Start | ( | ) | [virtual] |
Reimplemented from luxrays::PixelDevice.
Definition at line 280 of file openclpdevice.cpp.
References splatMutex.
| void OpenCLPixelDevice::Stop | ( | ) | [virtual] |
Reimplemented from luxrays::Device.
Definition at line 291 of file openclpdevice.cpp.
References oclQueue, and splatMutex.
Referenced by ~OpenCLPixelDevice().
| void OpenCLPixelDevice::UpdateFrameBuffer | ( | const ToneMapParams & | params | ) | [virtual] |
Implements luxrays::PixelDevice.
Definition at line 390 of file openclpdevice.cpp.
References frameBuff, frameBuffer, gammaTableBuff, luxrays::FrameBuffer::GetPixels(), luxrays::PixelDevice::height, oclQueue, sampleFrameBuff, splatMutex, updateFrameBufferKernel, and luxrays::PixelDevice::width.
friend class Context [friend] |
Reimplemented from luxrays::PixelDevice.
Definition at line 276 of file pixeldevice.h.
friend class OpenCLSampleBuffer [friend] |
Definition at line 277 of file pixeldevice.h.
Referenced by GetFreeSampleBuffer().
cl::Kernel* luxrays::OpenCLPixelDevice::addSampleBufferGaussian2x2Kernel [private] |
Definition at line 302 of file pixeldevice.h.
Referenced by AddSampleBuffer(), OpenCLPixelDevice(), and ~OpenCLPixelDevice().
cl::Kernel* luxrays::OpenCLPixelDevice::addSampleBufferKernel [private] |
Definition at line 300 of file pixeldevice.h.
Referenced by AddSampleBuffer(), OpenCLPixelDevice(), and ~OpenCLPixelDevice().
cl::Kernel* luxrays::OpenCLPixelDevice::addSampleBufferPreviewKernel [private] |
Definition at line 301 of file pixeldevice.h.
Referenced by AddSampleBuffer(), OpenCLPixelDevice(), and ~OpenCLPixelDevice().
cl::Kernel* luxrays::OpenCLPixelDevice::clearFBKernel [private] |
Definition at line 296 of file pixeldevice.h.
Referenced by ClearFrameBuffer(), OpenCLPixelDevice(), and ~OpenCLPixelDevice().
size_t luxrays::OpenCLPixelDevice::clearFBWorkGroupSize [private] |
Definition at line 297 of file pixeldevice.h.
cl::Kernel* luxrays::OpenCLPixelDevice::clearSampleFBKernel [private] |
Definition at line 299 of file pixeldevice.h.
Referenced by ClearSampleFrameBuffer(), OpenCLPixelDevice(), and ~OpenCLPixelDevice().
Definition at line 286 of file pixeldevice.h.
Referenced by GetDeviceDesc(), Init(), OpenCLPixelDevice(), luxrays::OpenCLSampleBuffer::OpenCLSampleBuffer(), ~OpenCLPixelDevice(), and luxrays::OpenCLSampleBuffer::~OpenCLSampleBuffer().
cl::Buffer* luxrays::OpenCLPixelDevice::filterTableBuff [private] |
Definition at line 313 of file pixeldevice.h.
Referenced by AddSampleBuffer(), OpenCLPixelDevice(), and ~OpenCLPixelDevice().
const unsigned int luxrays::OpenCLPixelDevice::FilterTableSize = 16 [static, private] |
Definition at line 281 of file pixeldevice.h.
Referenced by OpenCLPixelDevice().
cl::Buffer* luxrays::OpenCLPixelDevice::frameBuff [private] |
Definition at line 307 of file pixeldevice.h.
Referenced by ClearFrameBuffer(), Init(), OpenCLPixelDevice(), UpdateFrameBuffer(), and ~OpenCLPixelDevice().
Definition at line 288 of file pixeldevice.h.
Referenced by GetFrameBuffer(), Init(), OpenCLPixelDevice(), UpdateFrameBuffer(), and ~OpenCLPixelDevice().
std::deque<OpenCLSampleBuffer *> luxrays::OpenCLPixelDevice::freeSampleBuffers [private] |
Definition at line 310 of file pixeldevice.h.
Referenced by AddSampleBuffer(), FreeSampleBuffer(), GetFreeDevBufferCount(), GetFreeSampleBuffer(), and OpenCLPixelDevice().
float luxrays::OpenCLPixelDevice::gammaTable[GammaTableSize] [private] |
Definition at line 315 of file pixeldevice.h.
Referenced by SetGamma().
cl::Buffer* luxrays::OpenCLPixelDevice::gammaTableBuff [private] |
Definition at line 312 of file pixeldevice.h.
Referenced by OpenCLPixelDevice(), SetGamma(), UpdateFrameBuffer(), and ~OpenCLPixelDevice().
const unsigned int luxrays::OpenCLPixelDevice::GammaTableSize = 1024 [static, private] |
Definition at line 280 of file pixeldevice.h.
Referenced by OpenCLPixelDevice(), and SetGamma().
float luxrays::OpenCLPixelDevice::Gaussian2x2_filterTable[FilterTableSize *FilterTableSize] [private] |
Definition at line 316 of file pixeldevice.h.
Referenced by OpenCLPixelDevice().
cl::CommandQueue* luxrays::OpenCLPixelDevice::oclQueue [private] |
Definition at line 293 of file pixeldevice.h.
Referenced by AddSampleBuffer(), ClearFrameBuffer(), ClearSampleFrameBuffer(), OpenCLPixelDevice(), SetGamma(), Stop(), UpdateFrameBuffer(), luxrays::OpenCLSampleBuffer::Write(), and ~OpenCLPixelDevice().
std::vector<OpenCLSampleBuffer *> luxrays::OpenCLPixelDevice::sampleBuffers [private] |
Definition at line 309 of file pixeldevice.h.
Referenced by GetFreeSampleBuffer(), GetTotalDevBufferCount(), OpenCLPixelDevice(), and ~OpenCLPixelDevice().
size_t OpenCLPixelDevice::SampleBufferSize = 65536 [static] |
Definition at line 274 of file pixeldevice.h.
Referenced by GetFreeSampleBuffer(), luxrays::OpenCLSampleBuffer::OpenCLSampleBuffer(), and luxrays::OpenCLSampleBuffer::Write().
cl::Buffer* luxrays::OpenCLPixelDevice::sampleFrameBuff [private] |
Definition at line 306 of file pixeldevice.h.
Referenced by AddSampleBuffer(), ClearSampleFrameBuffer(), Init(), OpenCLPixelDevice(), UpdateFrameBuffer(), and ~OpenCLPixelDevice().
Definition at line 287 of file pixeldevice.h.
Referenced by GetSampleFrameBuffer(), Init(), OpenCLPixelDevice(), and ~OpenCLPixelDevice().
boost::mutex luxrays::OpenCLPixelDevice::splatMutex [private] |
Definition at line 290 of file pixeldevice.h.
Referenced by AddSampleBuffer(), FreeSampleBuffer(), GetFreeDevBufferCount(), GetFreeSampleBuffer(), GetTotalDevBufferCount(), Interrupt(), Start(), Stop(), and UpdateFrameBuffer().
cl::Kernel* luxrays::OpenCLPixelDevice::updateFrameBufferKernel [private] |
Definition at line 303 of file pixeldevice.h.
Referenced by OpenCLPixelDevice(), UpdateFrameBuffer(), and ~OpenCLPixelDevice().
1.6.3