OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::VulkanDynamicBuffer Class Reference

Vulkan maps per pool, thus mapping the same pool twice is a common occurrence. More...

#include <OgreVulkanDynamicBuffer.h>

Public Member Functions

 VulkanDynamicBuffer (VkDeviceMemory deviceMemory, size_t vboSize, const bool isCoherent, const bool hasReadAccess, VulkanDevice *device)
 
 ~VulkanDynamicBuffer ()
 
void flush (size_t ticket, size_t start, size_t count)
 Flushes the region of the given ticket. start is 0-based. More...
 
VkDeviceMemory getDeviceMemory ()
 
bool isCoherentMemory () const
 
void *RESTRICT_ALIAS_RETURN map (size_t start, size_t count, size_t &outTicket)
 Assumes mVboName is already bound to GL_COPY_WRITE_BUFFER!!! More...
 
void unmap (size_t ticket)
 Unmaps given ticket (got from. More...
 

Detailed Description

Vulkan maps per pool, thus mapping the same pool twice is a common occurrence.

This class takes care of mapping pools just once while allowing BufferInterface to map subregions of it as if they were separate buffers.
Remarks
Caller is responsible for flushing regions before unmapping. Caller is responsible for proper synchronization. No check is performed to see if two map calls overlap.

Constructor & Destructor Documentation

◆ VulkanDynamicBuffer()

Ogre::VulkanDynamicBuffer::VulkanDynamicBuffer ( VkDeviceMemory  deviceMemory,
size_t  vboSize,
const bool  isCoherent,
const bool  hasReadAccess,
VulkanDevice device 
)

◆ ~VulkanDynamicBuffer()

Ogre::VulkanDynamicBuffer::~VulkanDynamicBuffer ( )

Member Function Documentation

◆ flush()

void Ogre::VulkanDynamicBuffer::flush ( size_t  ticket,
size_t  start,
size_t  count 
)

Flushes the region of the given ticket. start is 0-based.

◆ getDeviceMemory()

VkDeviceMemory Ogre::VulkanDynamicBuffer::getDeviceMemory ( )
inline

◆ isCoherentMemory()

bool Ogre::VulkanDynamicBuffer::isCoherentMemory ( ) const
inline

◆ map()

void* RESTRICT_ALIAS_RETURN Ogre::VulkanDynamicBuffer::map ( size_t  start,
size_t  count,
size_t &  outTicket 
)

Assumes mVboName is already bound to GL_COPY_WRITE_BUFFER!!!

◆ unmap()

void Ogre::VulkanDynamicBuffer::unmap ( size_t  ticket)

Unmaps given ticket (got from.

See also
map). Assumes mVboName is already bound to GL_COPY_WRITE_BUFFER!!! The ticket becomes invalid after this.

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