OWL
OptiX7 Wrapper Library
|
#include <Buffer.h>
Classes | |
struct | DeviceData |
Public Types | |
typedef std::shared_ptr< Buffer > | SP |
![]() | |
typedef std::shared_ptr< ContextObject > | SP |
![]() | |
typedef std::shared_ptr< Object > | SP |
Public Member Functions | |
Buffer (Context *const context, OWLDataType type) | |
virtual | ~Buffer () |
std::string | toString () const override |
Buffer::DeviceData & | getDD (const DeviceContext::SP &device) const |
const void * | getPointer (const DeviceContext::SP &device) const |
size_t | getElementCount () const |
size_t | sizeInBytes () const |
virtual void | resize (size_t newElementCount)=0 |
virtual void | upload (const void *hostPtr)=0 |
virtual void | upload (const int deviceID, const void *hostPtr)=0 |
RegisteredObject::DeviceData::SP | createOn (const DeviceContext::SP &device) override |
void | destroy () |
![]() | |
RegisteredObject (Context *const context, ObjectRegistry ®istry) | |
~RegisteredObject () | |
![]() | |
ContextObject (Context *const context) | |
std::string | toString () const override |
![]() | |
Object () | |
virtual DeviceData::SP | createOn (const std::shared_ptr< DeviceContext > &device) |
void | createDeviceData (const std::vector< std::shared_ptr< DeviceContext >> &devices) |
template<typename T > | |
std::shared_ptr< T > | as () |
Public Attributes | |
const OWLDataType | type |
size_t | elementCount { 0 } |
![]() | |
int | ID |
ObjectRegistry & | registry |
![]() | |
Context *const | context |
![]() | |
const size_t | uniqueID |
std::vector< DeviceData::SP > | deviceData |
Additional Inherited Members | |
![]() | |
static std::atomic< uint64_t > | nextAvailableID |
base class for any sort of buffer type - pinned, device, managed, ...
typedef std::shared_ptr<Buffer> owl::Buffer::SP |
owl::Buffer::Buffer | ( | Context *const | context, |
OWLDataType | type | ||
) |
construct a new buffer of given type - actual implementation of 'construct' done in derives class
|
virtual |
destructor - free device data, de-regsiter, and destruct
|
override |
creates the device-specific data for this group
void owl::Buffer::destroy | ( | ) |
destroy whatever resouces this buffer may own on the device, but do NOT destroy this class itself. baiscally that's a resize(0), but that buffer can not - and shoult not - be used any more after that
destroy whatever resouces this buffer's ll-layer handle this may refer to; this will not destruct the current object itself, but should already release all its references
|
inline |
get reference to given device-specific data for this object
|
inline |
return number of elements - number of bytes will depend on data type
|
inline |
get device pointer for given buffer
|
pure virtual |
resize buffer to new num elements
Implemented in owl::GraphicsBuffer, owl::ManagedMemoryBuffer, owl::HostPinnedBuffer, and owl::DeviceBuffer.
|
inline |
return the number of bytes in this buffer (coiuted in size of device types)
|
overridevirtual |
pretty-printer, for printf-debugging
Reimplemented from owl::Object.
Reimplemented in owl::GraphicsBuffer, owl::ManagedMemoryBuffer, owl::HostPinnedBuffer, and owl::DeviceBuffer.
|
pure virtual |
upload data from host, to only given device ID
Implemented in owl::GraphicsBuffer, owl::ManagedMemoryBuffer, owl::HostPinnedBuffer, and owl::DeviceBuffer.
|
pure virtual |
upload data from host, using as many bytes as required by elemnetCount and dataSize
Implemented in owl::GraphicsBuffer, owl::ManagedMemoryBuffer, owl::HostPinnedBuffer, and owl::DeviceBuffer.
size_t owl::Buffer::elementCount { 0 } |
number of elements
const OWLDataType owl::Buffer::type |
data type of elements contained in this buffer