HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HgiGLBuffer Class Referencefinal

#include <buffer.h>

+ Inheritance diagram for HgiGLBuffer:

Public Member Functions

HGIGL_API ~HgiGLBuffer () override
 
HGIGL_API size_t GetByteSizeOfResource () const override
 
HGIGL_API uint64_t GetRawResource () const override
 
HGIGL_API voidGetCPUStagingAddress () override
 
uint32_t GetBufferId () const
 
HGIGL_API uint64_t GetBindlessGPUAddress ()
 Returns the bindless gpu address (caller must verify extension support) More...
 
- Public Member Functions inherited from HgiBuffer
virtual HGI_API ~HgiBuffer ()
 
HGI_API HgiBufferDesc const & GetDescriptor () const
 The descriptor describes the object. More...
 

Protected Member Functions

HGIGL_API HgiGLBuffer (HgiBufferDesc const &desc)
 
- Protected Member Functions inherited from HgiBuffer
HGI_API HgiBuffer (HgiBufferDesc const &desc)
 

Friends

class HgiGL
 

Additional Inherited Members

- Protected Attributes inherited from HgiBuffer
HgiBufferDesc _descriptor
 

Detailed Description

Represents an OpenGL GPU buffer resource.

Definition at line 38 of file buffer.h.

Constructor & Destructor Documentation

HGIGL_API HgiGLBuffer::~HgiGLBuffer ( )
override
HGIGL_API HgiGLBuffer::HgiGLBuffer ( HgiBufferDesc const &  desc)
protected

Member Function Documentation

HGIGL_API uint64_t HgiGLBuffer::GetBindlessGPUAddress ( )

Returns the bindless gpu address (caller must verify extension support)

uint32_t HgiGLBuffer::GetBufferId ( ) const
inline

Definition at line 53 of file buffer.h.

HGIGL_API size_t HgiGLBuffer::GetByteSizeOfResource ( ) const
overridevirtual

Returns the byte size of the GPU buffer. This can be helpful if the application wishes to tally up memory usage.

Implements HgiBuffer.

HGIGL_API void* HgiGLBuffer::GetCPUStagingAddress ( )
overridevirtual

Returns the 'staging area' in which new buffer data is copied before it is flushed to GPU. Some implementations (e.g. Metal) may have build in support for queueing up CPU->GPU copies. Those implementations can return the CPU pointer to the buffer's content directly. The caller should not assume that the data from the CPU staging area is automatically flushed to the GPU. Instead, after copying is finished, the caller should use BlitCmds CopyBufferCpuToGpu to ensure the transfer from the staging area to the GPU is scheduled.

Implements HgiBuffer.

HGIGL_API uint64_t HgiGLBuffer::GetRawResource ( ) const
overridevirtual

This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t. Clients should avoid using this function and instead use Hgi base classes so that client code works with any Hgi platform. For transitioning code to Hgi, it can however we useful to directly access a platform's internal resource handles. There is no safety provided in using this. If you by accident pass a HgiMetal resource into an OpenGL call, bad things may happen. In OpenGL this returns the GLuint resource name. In Metal this returns the id<MTLBuffer> as uint64_t. In Vulkan this returns the VkBuffer as uint64_t. In DX12 this returns the ID3D12Resource pointer as uint64_t.

Implements HgiBuffer.

Friends And Related Function Documentation

friend class HgiGL
friend

Definition at line 60 of file buffer.h.


The documentation for this class was generated from the following file: