OWL
OptiX7 Wrapper Library
owl::GraphicsBuffer Struct Reference

#include <Buffer.h>

Inheritance diagram for owl::GraphicsBuffer:
owl::Buffer owl::RegisteredObject owl::ContextObject owl::Object

Public Types

typedef std::shared_ptr< GraphicsBufferSP
 
- Public Types inherited from owl::Buffer
typedef std::shared_ptr< BufferSP
 
- Public Types inherited from owl::ContextObject
typedef std::shared_ptr< ContextObjectSP
 
- Public Types inherited from owl::Object
typedef std::shared_ptr< ObjectSP
 

Public Member Functions

 GraphicsBuffer (Context *const context, OWLDataType type, cudaGraphicsResource_t resource)
 
void map (const int deviceID=0, CUstream stream=0)
 
void unmap (const int deviceID=0, CUstream stream=0)
 
void resize (size_t newElementCount) override
 
void upload (const void *hostPtr) override
 
void upload (const int deviceID, const void *hostPtr) override
 
std::string toString () const override
 
- Public Member Functions inherited from owl::Buffer
 Buffer (Context *const context, OWLDataType type)
 
virtual ~Buffer ()
 
Buffer::DeviceDatagetDD (const DeviceContext::SP &device) const
 
const void * getPointer (const DeviceContext::SP &device) const
 
size_t getElementCount () const
 
size_t sizeInBytes () const
 
RegisteredObject::DeviceData::SP createOn (const DeviceContext::SP &device) override
 
void destroy ()
 
- Public Member Functions inherited from owl::RegisteredObject
 RegisteredObject (Context *const context, ObjectRegistry &registry)
 
 ~RegisteredObject ()
 
- Public Member Functions inherited from owl::ContextObject
 ContextObject (Context *const context)
 
std::string toString () const override
 
- Public Member Functions inherited from owl::Object
 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

cudaGraphicsResource_t resource
 
- Public Attributes inherited from owl::Buffer
const OWLDataType type
 
size_t elementCount { 0 }
 
- Public Attributes inherited from owl::RegisteredObject
int ID
 
ObjectRegistryregistry
 
- Public Attributes inherited from owl::ContextObject
Context *const context
 
- Public Attributes inherited from owl::Object
const size_t uniqueID
 
std::vector< DeviceData::SPdeviceData
 

Additional Inherited Members

- Static Public Attributes inherited from owl::Object
static std::atomic< uint64_t > nextAvailableID
 

Detailed Description

a special graphics resource buffer that, upon mapping, will map that graphics resource

Member Typedef Documentation

◆ SP

typedef std::shared_ptr<GraphicsBuffer> owl::GraphicsBuffer::SP

Constructor & Destructor Documentation

◆ GraphicsBuffer()

owl::GraphicsBuffer::GraphicsBuffer ( Context *const  context,
OWLDataType  type,
cudaGraphicsResource_t  resource 
)

Member Function Documentation

◆ map()

void owl::GraphicsBuffer::map ( const int  deviceID = 0,
CUstream  stream = 0 
)

◆ resize()

void owl::GraphicsBuffer::resize ( size_t  newElementCount)
overridevirtual

resize buffer to new num elements

Implements owl::Buffer.

◆ toString()

std::string owl::GraphicsBuffer::toString ( ) const
overridevirtual

pretty-printer, for debugging

Reimplemented from owl::Buffer.

◆ unmap()

void owl::GraphicsBuffer::unmap ( const int  deviceID = 0,
CUstream  stream = 0 
)

◆ upload() [1/2]

void owl::GraphicsBuffer::upload ( const int  deviceID,
const void *  hostPtr 
)
overridevirtual

upload data from host, to only given device ID

Implements owl::Buffer.

◆ upload() [2/2]

void owl::GraphicsBuffer::upload ( const void *  hostPtr)
overridevirtual

upload data from host, using as many bytes as required by elemnetCount and dataSize

Implements owl::Buffer.

Member Data Documentation

◆ resource

cudaGraphicsResource_t owl::GraphicsBuffer::resource

the cuda graphics resource to map to - note that this is probably valid on only one GPU


The documentation for this struct was generated from the following files: