Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
GPUTexture Class Reference

Store a texture data on the GPU. More...

#include <GPUObjects.hpp>

Classes

struct  MipViews
 Aggregate views for each view. More...
 

Public Member Functions

 GPUTexture (const Layout &layoutFormat)
 
void clean ()
 
GPUTextureoperator= (const GPUTexture &)=delete
 
 GPUTexture (const GPUTexture &)=delete
 
GPUTextureoperator= (GPUTexture &&)=delete
 
 GPUTexture (GPUTexture &&)=delete
 

Static Public Member Functions

static unsigned int getChannelsCount (const Layout &format)
 
static bool isSRGB (const Layout &format)
 

Public Attributes

VkFormat format
 Texture native format.
 
VkImageAspectFlags aspect
 Texture aspects.
 
uint channels
 Number of channels.
 
VkImage image = VK_NULL_HANDLE
 Native image handle.
 
VkImageView view = VK_NULL_HANDLE
 Native main image view (all mips).
 
std::vector< MipViewsviews
 Per-mip image views.
 
VmaAllocation data = VK_NULL_HANDLE
 Internal allocation.
 
ImTextureID imgui = (ImTextureID)VK_NULL_HANDLE
 ImGui compatible handle (internally a descriptor set).
 
std::vector< std::vector< VkImageLayout > > layouts
 Per-mip per-layer image layout.
 
VkImageLayout defaultLayout
 Default layout to restore to in some cases.
 
bool owned = true
 Do we own our Vulkan data (not the case for swapchain images).
 

Detailed Description

Store a texture data on the GPU.

Constructor & Destructor Documentation

◆ GPUTexture() [1/3]

GPUTexture::GPUTexture ( const Layout layoutFormat)

Constructor from a layout format.

Parameters
layoutFormatthe layout format

◆ GPUTexture() [2/3]

GPUTexture::GPUTexture ( const GPUTexture )
delete

Copy constructor (disabled).

◆ GPUTexture() [3/3]

GPUTexture::GPUTexture ( GPUTexture &&  )
delete

Move constructor.

Member Function Documentation

◆ clean()

void GPUTexture::clean ( )

Clean internal GPU buffer.

◆ getChannelsCount()

unsigned int GPUTexture::getChannelsCount ( const Layout format)
static

Retrieve the number of channels of a texture format.

Parameters
formatthe texture format
Returns
the number of channels

◆ isSRGB()

bool GPUTexture::isSRGB ( const Layout format)
static

Check if a format represents sRGB colors.

Parameters
formatthe texture format
Returns
true if sRGB

◆ operator=() [1/2]

GPUTexture & GPUTexture::operator= ( const GPUTexture )
delete

Copy assignment operator (disabled).

Returns
a reference to the object assigned to

◆ operator=() [2/2]

GPUTexture & GPUTexture::operator= ( GPUTexture &&  )
delete

Move assignment operator .

Returns
a reference to the object assigned to

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