HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RV_OGLInteropTextureBase Class Referenceabstract

#include <RV_OGLInteropTextureBase.h>

Classes

struct  SemaphoreSet
 

Public Types

enum  RV_OGLInteropOwner { RV_VULKAN, RV_OPENGL }
 

Public Member Functions

 RV_OGLInteropTextureBase ()
 
virtual ~RV_OGLInteropTextureBase ()
 
void setCurrentState (RV_OGLInteropOwner owner)
 
RV_VKImagegetRvImage ()
 
const RV_VKImagegetRvImage () const
 
virtual RE_TexturegetRe ()=0
 
RV_OGLInteropOwner getCurrentRenderType () const
 
bool isValidAlloc () const
 
SemaphoreSet getGLToVkSemaphore ()
 
SemaphoreSet getVkToGLSemaphore ()
 
bool beginTransferToVk (RE_Render *r)
 
bool finishTransferToVk (RV_Render *r)
 
bool beginTransferToGL (RV_Render *r)
 
bool finishTransferToGL (RE_Render *r)
 
bool submitTransferToGL (RE_RenderContext r)
 
bool submitTransferToVk (RE_RenderContext r)
 
bool allocateImage (RV_Instance *inst, RV_ImageDim image_type, VkFormat format, size_t width, size_t height, size_t depth=1, int levels=1, int layers=1, int samples=1)
 
bool checkImageParams (RV_Instance *inst, RV_ImageDim image_type, VkFormat format, size_t width, size_t height, size_t depth=1, int levels=1, int layers=1, int samples=1)
 

Static Public Member Functions

static RV_OGLInteropTexturePtr create (RE_TextureDimension dim)
 

Public Attributes

enum
RV_OGLInteropTextureBase::RV_OGLInteropOwner 
myCurOwner
 

Protected Member Functions

bool assignMemory (RV_Instance *inst, VE_Memory *mem)
 
void deleteImage (RV_Instance *inst)
 
bool allocateSemaphores (RV_Instance *inst)
 
void deleteSemaphores (RV_Instance *inst)
 
bool importMemory (RE_Render *r)
 
bool importOglSemaphores (RE_Render *r)
 
void deleteMemory (RE_Render *r)
 
void deleteOglSemaphores (RE_Render *r)
 
void deleteMemoryHandle ()
 
void deleteSemaphoreHandles ()
 

Static Protected Member Functions

static bool queryMemoryHandleValid (RV_Instance *inst, RV_VKInteropImageCreateInfo *info)
 

Protected Attributes

UT_UniquePtr< RV_VKImagemyRvImg
 
VE_MemorymyRvMem
 
VkDeviceMemory myVkMem = VK_NULL_HANDLE
 
VkDeviceSize myMemSize = 0
 
VkDeviceSize myMemOffset = 0
 
VkImage myVkImg = VK_NULL_HANDLE
 
VkImageLayout myLastLayout = VK_IMAGE_LAYOUT_UNDEFINED
 
VkAccessFlags myLastAccess = 0
 
VkPipelineStageFlags myLastStage = 0
 
std::atomic_bool myIsTransferToGLWaiting = false
 
VkSemaphore myVkSemVkToGL = VK_NULL_HANDLE
 
VkSemaphore myVkSemGLToVk = VK_NULL_HANDLE
 
int myRERenderID = -1
 
handle myShareSemVkToGL = 0
 
handle myShareSemGLToVk = 0
 
GLuint myOglSemVkToGL = 0
 
GLuint myOglSemGLToVk = 0
 
handle myShareMem = 0
 
GLuint myOglMem = 0
 
GLuint myOglID = 0
 
UT_Array< uint8myTransferBuffer
 

Detailed Description

Set of resources needed to share a texture between OpenGL and Vulkan. Can create a vulkan image, or recieve an alloacted memory. Creates semaphores for sync, and exports the handles for the memory and semaphores then imports them into an openGL context.

Definition at line 87 of file RV_OGLInteropTextureBase.h.

Member Enumeration Documentation

Enumerator
RV_VULKAN 
RV_OPENGL 

Definition at line 97 of file RV_OGLInteropTextureBase.h.

Constructor & Destructor Documentation

RV_OGLInteropTextureBase::RV_OGLInteropTextureBase ( )
virtual RV_OGLInteropTextureBase::~RV_OGLInteropTextureBase ( )
virtual

Member Function Documentation

bool RV_OGLInteropTextureBase::allocateImage ( RV_Instance inst,
RV_ImageDim  image_type,
VkFormat  format,
size_t  width,
size_t  height,
size_t  depth = 1,
int  levels = 1,
int  layers = 1,
int  samples = 1 
)
bool RV_OGLInteropTextureBase::allocateSemaphores ( RV_Instance inst)
protected
bool RV_OGLInteropTextureBase::assignMemory ( RV_Instance inst,
VE_Memory mem 
)
protected
bool RV_OGLInteropTextureBase::beginTransferToGL ( RV_Render r)
bool RV_OGLInteropTextureBase::beginTransferToVk ( RE_Render r)
bool RV_OGLInteropTextureBase::checkImageParams ( RV_Instance inst,
RV_ImageDim  image_type,
VkFormat  format,
size_t  width,
size_t  height,
size_t  depth = 1,
int  levels = 1,
int  layers = 1,
int  samples = 1 
)
static RV_OGLInteropTexturePtr RV_OGLInteropTextureBase::create ( RE_TextureDimension  dim)
static
void RV_OGLInteropTextureBase::deleteImage ( RV_Instance inst)
protected
void RV_OGLInteropTextureBase::deleteMemory ( RE_Render r)
protected
void RV_OGLInteropTextureBase::deleteMemoryHandle ( )
protected
void RV_OGLInteropTextureBase::deleteOglSemaphores ( RE_Render r)
protected
void RV_OGLInteropTextureBase::deleteSemaphoreHandles ( )
protected
void RV_OGLInteropTextureBase::deleteSemaphores ( RV_Instance inst)
protected
bool RV_OGLInteropTextureBase::finishTransferToGL ( RE_Render r)
bool RV_OGLInteropTextureBase::finishTransferToVk ( RV_Render r)
RV_OGLInteropOwner RV_OGLInteropTextureBase::getCurrentRenderType ( ) const
inline

Definition at line 126 of file RV_OGLInteropTextureBase.h.

SemaphoreSet RV_OGLInteropTextureBase::getGLToVkSemaphore ( )
inline

Definition at line 130 of file RV_OGLInteropTextureBase.h.

virtual RE_Texture* RV_OGLInteropTextureBase::getRe ( )
pure virtual
RV_VKImage* RV_OGLInteropTextureBase::getRvImage ( )
inline

Definition at line 114 of file RV_OGLInteropTextureBase.h.

const RV_VKImage* RV_OGLInteropTextureBase::getRvImage ( ) const
inline

Definition at line 119 of file RV_OGLInteropTextureBase.h.

SemaphoreSet RV_OGLInteropTextureBase::getVkToGLSemaphore ( )
inline

Definition at line 139 of file RV_OGLInteropTextureBase.h.

bool RV_OGLInteropTextureBase::importMemory ( RE_Render r)
protected
bool RV_OGLInteropTextureBase::importOglSemaphores ( RE_Render r)
protected
bool RV_OGLInteropTextureBase::isValidAlloc ( ) const
inline

Definition at line 128 of file RV_OGLInteropTextureBase.h.

static bool RV_OGLInteropTextureBase::queryMemoryHandleValid ( RV_Instance inst,
RV_VKInteropImageCreateInfo info 
)
staticprotected
void RV_OGLInteropTextureBase::setCurrentState ( RV_OGLInteropOwner  owner)
inline

Definition at line 111 of file RV_OGLInteropTextureBase.h.

bool RV_OGLInteropTextureBase::submitTransferToGL ( RE_RenderContext  r)
bool RV_OGLInteropTextureBase::submitTransferToVk ( RE_RenderContext  r)

Member Data Documentation

enum RV_OGLInteropTextureBase::RV_OGLInteropOwner RV_OGLInteropTextureBase::myCurOwner
std::atomic_bool RV_OGLInteropTextureBase::myIsTransferToGLWaiting = false
protected

Definition at line 208 of file RV_OGLInteropTextureBase.h.

VkAccessFlags RV_OGLInteropTextureBase::myLastAccess = 0
protected

Definition at line 201 of file RV_OGLInteropTextureBase.h.

VkImageLayout RV_OGLInteropTextureBase::myLastLayout = VK_IMAGE_LAYOUT_UNDEFINED
protected

Definition at line 200 of file RV_OGLInteropTextureBase.h.

VkPipelineStageFlags RV_OGLInteropTextureBase::myLastStage = 0
protected

Definition at line 202 of file RV_OGLInteropTextureBase.h.

VkDeviceSize RV_OGLInteropTextureBase::myMemOffset = 0
protected

Definition at line 197 of file RV_OGLInteropTextureBase.h.

VkDeviceSize RV_OGLInteropTextureBase::myMemSize = 0
protected

Definition at line 196 of file RV_OGLInteropTextureBase.h.

GLuint RV_OGLInteropTextureBase::myOglID = 0
protected

Definition at line 240 of file RV_OGLInteropTextureBase.h.

GLuint RV_OGLInteropTextureBase::myOglMem = 0
protected

Definition at line 239 of file RV_OGLInteropTextureBase.h.

GLuint RV_OGLInteropTextureBase::myOglSemGLToVk = 0
protected

Definition at line 234 of file RV_OGLInteropTextureBase.h.

GLuint RV_OGLInteropTextureBase::myOglSemVkToGL = 0
protected

Definition at line 233 of file RV_OGLInteropTextureBase.h.

int RV_OGLInteropTextureBase::myRERenderID = -1
protected

Definition at line 226 of file RV_OGLInteropTextureBase.h.

UT_UniquePtr<RV_VKImage> RV_OGLInteropTextureBase::myRvImg
protected

Definition at line 192 of file RV_OGLInteropTextureBase.h.

VE_Memory* RV_OGLInteropTextureBase::myRvMem
protected

Definition at line 193 of file RV_OGLInteropTextureBase.h.

handle RV_OGLInteropTextureBase::myShareMem = 0
protected

Definition at line 236 of file RV_OGLInteropTextureBase.h.

handle RV_OGLInteropTextureBase::myShareSemGLToVk = 0
protected

Definition at line 230 of file RV_OGLInteropTextureBase.h.

handle RV_OGLInteropTextureBase::myShareSemVkToGL = 0
protected

Definition at line 229 of file RV_OGLInteropTextureBase.h.

UT_Array<uint8> RV_OGLInteropTextureBase::myTransferBuffer
protected

Definition at line 245 of file RV_OGLInteropTextureBase.h.

VkImage RV_OGLInteropTextureBase::myVkImg = VK_NULL_HANDLE
protected

Definition at line 198 of file RV_OGLInteropTextureBase.h.

VkDeviceMemory RV_OGLInteropTextureBase::myVkMem = VK_NULL_HANDLE
protected

Definition at line 195 of file RV_OGLInteropTextureBase.h.

VkSemaphore RV_OGLInteropTextureBase::myVkSemGLToVk = VK_NULL_HANDLE
protected

Definition at line 221 of file RV_OGLInteropTextureBase.h.

VkSemaphore RV_OGLInteropTextureBase::myVkSemVkToGL = VK_NULL_HANDLE
protected

Definition at line 220 of file RV_OGLInteropTextureBase.h.


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