HDK
|
#include <RV_VKImage.h>
Public Member Functions | |
const RV_VKImageCreateInfo & | getInfo () const |
The image properties. More... | |
VkImage | getVkImage () |
RV_VKMemory & | getMemory () |
RV_VKSampler * | getSampler () |
VkImageLayout | getLayout () const |
const RV_ResourceID & | getID () const |
const UT_StringHolder & | getName () const |
VE_Result< SYS_Handle > | getExternalHandle () |
RV_VKImageView & | getFullView () |
RV_VKImageView & | getPrimaryView () |
RV_VKImageView | createView () |
Create new VkImageView for whole VkImage range. More... | |
RV_VKImageView | createView (const VkImageSubresourceRange &subres) |
Create new VkImageView for specific VkImage subresource range. More... | |
RV_VKImageView | createView (const VkImageSubresourceRange &subres, VkImageViewType type) |
Create new VkImageView for specific VkImage subresource range, with type. More... | |
RV_VKImageView | createView (VkImageViewType type) |
Create new VkImageView for specific type, trying to use full subresource range. More... | |
void | transitionImage (RV_VKCommandBuffer *cb, VkImageLayout new_layout, VkImageUsageFlags new_usage, bool keep_data=true, VkImageSubresourceRange subres=VkImageSubresourceRange{}) |
Record a command to transition image into new layout. More... | |
void | transitionToSampling (RV_VKCommandBuffer *cb, bool force=false) |
Record a command to transition the image for sampling in a shader. More... | |
template<typename T , typename std::enable_if<!std::is_pointer< T >::value, int >::type = 0> | |
bool | uploadData (RV_Render *r, const T &data, int level=0, int index=0) |
Upload data to the image. Must be in a state for upload. More... | |
bool | uploadData (RV_Render *r, const void *data, exint data_size, int level=0, int index=0) |
bool | uploadData (RV_Instance *inst, RV_VKCommandBuffer *cb, const void *data, exint data_size, int level=0, int index=0) |
bool | uploadData (RV_Render *r, RV_VKBuffer *buf, int level=0, int index=0, exint buf_offset=0, exint buf_size=-1) |
Copy image data to this image from buffer . More... | |
bool | uploadData (RV_Instance *inst, RV_VKCommandBuffer *cb, RV_VKBuffer *buf, int level=0, int index=0, exint buf_offset=0, exint buf_size=-1) |
bool | copyData (RV_Render *r, RV_VKImage *other) |
bool | resolveData (RV_Render *r, RV_VKImage *other) |
void | generateMipmaps (RV_Render *r) |
Generate higher mipmap levels from the base level. More... | |
bool | downloadData (RV_Render *r, void *data, exint data_size, int level=0, int index=0, bool primary_aspect=true) |
Download image data into data . More... | |
bool | downloadData (RV_Render *r, RV_VKBuffer *buf, int level=0, int index=0, bool primary_aspect=true) |
Download image data into buf . More... | |
virtual | ~RV_VKImage () |
void | print () const |
Debug print out of image properties (not image data). More... | |
Static Public Member Functions | |
static RV_VKImagePtr | allocateImage (RV_Instance *inst, RV_VKImageCreateInfo *info, const char *name=nullptr) |
Creates new Image based on create info. More... | |
static RV_VKImagePtr | createFromImage (RV_Instance *inst, VkImage vk_image, const VkImageCreateInfo *info, const char *name=nullptr) |
static UT_UniquePtr< RV_VKSampler > | allocateSampler (RV_Instance *inst, const RV_VKImageCreateInfo *img_info) |
static bool | queryIsUsable (RV_Instance *inst, RV_VKImageCreateInfo *info) |
Public Attributes | |
UT_StringHolder | myName |
VkImageLayout | myLastLayout = VK_IMAGE_LAYOUT_UNDEFINED |
VkAccessFlags | myLastAccess = 0 |
VkImageUsageFlags | myLastUsage = 0 |
VkPipelineStageFlags | myLastStage = 0 |
uint32_t | myLastQueueFam = 0 |
RV_StageGroup | myWaitingBarrierStage = RV_STAGE_NONE |
Protected Member Functions | |
RV_VKImage (RV_Instance *inst, const RV_VKImageCreateInfo *img_info, VkImage vk_img, RV_VKMemoryPtr mem, RV_VKImageViewPtr view, RV_VKImageViewPtr primary_view, RV_VKSamplerPtr sampler) | |
Static Protected Member Functions | |
static RV_VKImagePtr | createRVImage (RV_Instance *inst, VkImage vk_img, RV_VKMemoryPtr mem, const RV_VKImageCreateInfo *info, const char *name=nullptr) |
static void | deleteImage (RV_Instance *inst, VkImage *img, VkDeviceMemory *mem) |
Protected Attributes | |
RV_Instance * | myInst = nullptr |
VkImage | myVkImg = VK_NULL_HANDLE |
RV_ResourceID | myId |
UT_UniquePtr< const RV_VKImageCreateInfo > | myCreateInfo |
UT_UniquePtr< RV_VKImageView > | myView |
UT_UniquePtr< RV_VKImageView > | myPrimaryView |
UT_UniquePtr< RV_VKMemory > | myMemory |
UT_UniquePtr< RV_VKSampler > | mySampler |
Friends | |
class | RV_VKImageCreateInfo |
Class hodling VkImage handle and bound Memory allocation cleans up resources on destruction
Definition at line 386 of file RV_VKImage.h.
|
virtual |
|
protected |
|
static |
Creates new Image based on create info.
|
static |
Allocate a new Image Sampler using parameters from img_info, ignoring non-sampler parameters
bool RV_VKImage::copyData | ( | RV_Render * | r, |
RV_VKImage * | other | ||
) |
Copy image data from other
into this image. images MUST have same size and format
|
static |
Creates an image from an already existing VkImage, and takes ownership of the VkImage but not the memory object
|
staticprotected |
RV_VKImageView RV_VKImage::createView | ( | ) |
Create new VkImageView for whole VkImage range.
RV_VKImageView RV_VKImage::createView | ( | const VkImageSubresourceRange & | subres | ) |
Create new VkImageView for specific VkImage subresource range.
RV_VKImageView RV_VKImage::createView | ( | const VkImageSubresourceRange & | subres, |
VkImageViewType | type | ||
) |
Create new VkImageView for specific VkImage subresource range, with type.
RV_VKImageView RV_VKImage::createView | ( | VkImageViewType | type | ) |
Create new VkImageView for specific type, trying to use full subresource range.
|
staticprotected |
bool RV_VKImage::downloadData | ( | RV_Render * | r, |
void * | data, | ||
exint | data_size, | ||
int | level = 0 , |
||
int | index = 0 , |
||
bool | primary_aspect = true |
||
) |
Download image data into data
.
bool RV_VKImage::downloadData | ( | RV_Render * | r, |
RV_VKBuffer * | buf, | ||
int | level = 0 , |
||
int | index = 0 , |
||
bool | primary_aspect = true |
||
) |
Download image data into buf
.
Generate higher mipmap levels from the base level.
VE_Result<SYS_Handle> RV_VKImage::getExternalHandle | ( | ) |
On linux, the returned handle is owned by the caller. The caller can either use it to import the texture into another API; or they must close it when they're done with it. On windows, the returned handle can only be used to import the texture into another API–the caller must never close it themself! See documentation for VE_Memory::getExternalHandle() for more information.
|
inline |
Definition at line 436 of file RV_VKImage.h.
|
inline |
Definition at line 424 of file RV_VKImage.h.
|
inline |
The image properties.
Definition at line 417 of file RV_VKImage.h.
|
inline |
Definition at line 423 of file RV_VKImage.h.
|
inline |
Definition at line 421 of file RV_VKImage.h.
|
inline |
Definition at line 425 of file RV_VKImage.h.
|
inline |
Definition at line 437 of file RV_VKImage.h.
|
inline |
Definition at line 422 of file RV_VKImage.h.
|
inline |
Definition at line 420 of file RV_VKImage.h.
void RV_VKImage::print | ( | ) | const |
Debug print out of image properties (not image data).
|
static |
check whether the format info in pInfo can create a valid Vulkan image
bool RV_VKImage::resolveData | ( | RV_Render * | r, |
RV_VKImage * | other | ||
) |
Resolves image data from Multisample other
into this image. images MUST have same size and format, and MUST be color images, and this MUST be a single-sample image
void RV_VKImage::transitionImage | ( | RV_VKCommandBuffer * | cb, |
VkImageLayout | new_layout, | ||
VkImageUsageFlags | new_usage, | ||
bool | keep_data = true , |
||
VkImageSubresourceRange | subres = VkImageSubresourceRange{} |
||
) |
Record a command to transition image into new layout.
|
inline |
Record a command to transition the image for sampling in a shader.
Definition at line 462 of file RV_VKImage.h.
|
inline |
Upload data to the image. Must be in a state for upload.
Definition at line 471 of file RV_VKImage.h.
bool RV_VKImage::uploadData | ( | RV_Render * | r, |
const void * | data, | ||
exint | data_size, | ||
int | level = 0 , |
||
int | index = 0 |
||
) |
bool RV_VKImage::uploadData | ( | RV_Instance * | inst, |
RV_VKCommandBuffer * | cb, | ||
const void * | data, | ||
exint | data_size, | ||
int | level = 0 , |
||
int | index = 0 |
||
) |
bool RV_VKImage::uploadData | ( | RV_Render * | r, |
RV_VKBuffer * | buf, | ||
int | level = 0 , |
||
int | index = 0 , |
||
exint | buf_offset = 0 , |
||
exint | buf_size = -1 |
||
) |
Copy image data to this image from buffer
.
bool RV_VKImage::uploadData | ( | RV_Instance * | inst, |
RV_VKCommandBuffer * | cb, | ||
RV_VKBuffer * | buf, | ||
int | level = 0 , |
||
int | index = 0 , |
||
exint | buf_offset = 0 , |
||
exint | buf_size = -1 |
||
) |
|
friend |
Definition at line 604 of file RV_VKImage.h.
|
protected |
Definition at line 581 of file RV_VKImage.h.
|
protected |
Definition at line 580 of file RV_VKImage.h.
|
protected |
Definition at line 578 of file RV_VKImage.h.
VkAccessFlags RV_VKImage::myLastAccess = 0 |
Definition at line 597 of file RV_VKImage.h.
VkImageLayout RV_VKImage::myLastLayout = VK_IMAGE_LAYOUT_UNDEFINED |
Definition at line 596 of file RV_VKImage.h.
uint32_t RV_VKImage::myLastQueueFam = 0 |
Definition at line 600 of file RV_VKImage.h.
VkPipelineStageFlags RV_VKImage::myLastStage = 0 |
Definition at line 599 of file RV_VKImage.h.
VkImageUsageFlags RV_VKImage::myLastUsage = 0 |
Definition at line 598 of file RV_VKImage.h.
|
protected |
Definition at line 585 of file RV_VKImage.h.
UT_StringHolder RV_VKImage::myName |
Definition at line 593 of file RV_VKImage.h.
|
protected |
Definition at line 584 of file RV_VKImage.h.
|
protected |
Definition at line 586 of file RV_VKImage.h.
|
protected |
Definition at line 583 of file RV_VKImage.h.
|
protected |
Definition at line 579 of file RV_VKImage.h.
RV_StageGroup RV_VKImage::myWaitingBarrierStage = RV_STAGE_NONE |
Definition at line 602 of file RV_VKImage.h.