KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::VulkanImageBuffer Class Reference

Vulkan specific implemetation of ImageBuffer class. More...

#include <VulkanBuffer.h>

Inheritance diagram for Karma::VulkanImageBuffer:
Karma::ImageBuffer

Public Member Functions

 VulkanImageBuffer (const char *filename)
 Creates a GPU memory buffer for storing image texture.
 VulkanImageBuffer (FVulkanDevice *InDevice, const char *filename)
 Creates GPU memory buffer for storing image texture with VulkanRHI support.
virtual ~VulkanImageBuffer ()
 Frees up device resources.
void CreateBuffer (VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, VkBuffer &buffer, VkDeviceMemory &bufferMemory)
 Creates Vulkan buffer (VKbuffer) for image texture's use and allocates device memory appropriately.
const VkBuffer & GetBuffer () const
int GetTextureWidth () const
 Getter for the width (in pixels?) of the image texture.
int GetTextureHeight () const
 Getter for the height (in pixels?) of the image texture.
int GetTextureChannels () const
 Getter for desired channels (if non-zero, # of image components requested in result).
Public Member Functions inherited from Karma::ImageBuffer
uint32_t GetBindingPointIndex () const

Additional Inherited Members

Static Public Member Functions inherited from Karma::ImageBuffer
static ImageBufferCreate (const char *filename)
Protected Attributes inherited from Karma::ImageBuffer
uint32_t m_BindingPoint

Detailed Description

Vulkan specific implemetation of ImageBuffer class.

Constructor & Destructor Documentation

◆ VulkanImageBuffer() [1/2]

Karma::VulkanImageBuffer::VulkanImageBuffer ( const char * filename)

Creates a GPU memory buffer for storing image texture.

Parameters
filenameThe path to the file, including filename, containing the image texture
Since
Karma 1.0.0

◆ VulkanImageBuffer() [2/2]

Karma::VulkanImageBuffer::VulkanImageBuffer ( FVulkanDevice * InDevice,
const char * filename )

Creates GPU memory buffer for storing image texture with VulkanRHI support.

Parameters
InDeviceThe FVulkanDevice object
filenameThe path to the file, including filename, containing the image texture
Since
Karma 1.0.0

◆ ~VulkanImageBuffer()

Karma::VulkanImageBuffer::~VulkanImageBuffer ( )
virtual

Frees up device resources.

Since
Karma 1.0.0

Member Function Documentation

◆ CreateBuffer()

void Karma::VulkanImageBuffer::CreateBuffer ( VkDeviceSize size,
VkBufferUsageFlags usage,
VkMemoryPropertyFlags properties,
VkBuffer & buffer,
VkDeviceMemory & bufferMemory )

Creates Vulkan buffer (VKbuffer) for image texture's use and allocates device memory appropriately.

Parameters
sizeThe size, in bytes, of the buffer to be created
propertiesThe demanded properties (https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkBufferUsageFlagBits.html). For instance (VK_BUFFER_USAGE_TRANSFER_SRC_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)
See also
VulkanUniformBuffer::BufferCreation()
Since
Karma 1.0.0

◆ GetTextureChannels()

int Karma::VulkanImageBuffer::GetTextureChannels ( ) const
inline

Getter for desired channels (if non-zero, # of image components requested in result).

See also
KarmaUtilities::GetImagePixelData
Since
Karma 1.0.0

◆ GetTextureHeight()

int Karma::VulkanImageBuffer::GetTextureHeight ( ) const
inline

Getter for the height (in pixels?) of the image texture.

Since
Karma 1.0.0

◆ GetTextureWidth()

int Karma::VulkanImageBuffer::GetTextureWidth ( ) const
inline

Getter for the width (in pixels?) of the image texture.

Since
Karma 1.0.0

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