jGL
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
jGL::Vulkan::vkTexture Class Reference

#include <vkTexture.h>

Inheritance diagram for jGL::Vulkan::vkTexture:
Inheritance graph
[legend]
Collaboration diagram for jGL::Vulkan::vkTexture:
Collaboration graph
[legend]

Public Member Functions

 vkTexture (const Device &device)
 
 vkTexture (const Device &device, const Command &command, std::filesystem::path imageFile, Texture::Type type, VkSampleCountFlagBits msaaSamples=VK_SAMPLE_COUNT_1_BIT)
 
 vkTexture (const Device &device, const Command &command, uint32_t width, uint32_t height, uint32_t channels, VkFormat format, VkSampleCountFlagBits msaaSamples=VK_SAMPLE_COUNT_1_BIT)
 
 vkTexture (const Device &device, const Command &command, uint32_t width, uint32_t height, uint32_t channels, VkFormat format, std::vector< std::byte > pixels, VkSampleCountFlagBits msaaSamples=VK_SAMPLE_COUNT_1_BIT)
 
const VkImageView & getVkImageView () const
 
 ~vkTexture ()
 
void bind (unsigned unit)
 
void replace (const Command &command, uint32_t width, uint32_t height, uint32_t channels, VkFormat format, std::vector< std::byte > pixels)
 
- Public Member Functions inherited from jGL::Texture
 Texture ()
 
virtual ~Texture ()=default
 
bool operator== (const Texture &rhs) const
 
const IdgetId () const
 
const glm::ivec3 size () const
 

Protected Member Functions

void transitionImageLayout (const Command &command, VkFormat format, VkImageLayout oldLayout, VkImageLayout newLayout)
 
void copyBufferToImage (const Command &command, Buffer &buffer, uint32_t width, uint32_t height)
 
void uploadImage (const Command &command, std::vector< std::byte > pixels, VkFormat format, uint32_t width, uint32_t height, uint32_t channels)
 

Protected Attributes

const Devicedevice
 
VkImage image
 
VkImageView imageView
 
VkDeviceMemory imageMemory
 
VkFormat format
 
uint32_t width
 
uint32_t height
 
uint32_t channels
 
VkSampleCountFlagBits msaaSamples
 
- Protected Attributes inherited from jGL::Texture
int width
 
int height
 
int channels
 
Id id
 

Additional Inherited Members

- Public Types inherited from jGL::Texture
enum class  Type { RGB , RGBA }
 

Constructor & Destructor Documentation

◆ vkTexture() [1/4]

jGL::Vulkan::vkTexture::vkTexture ( const Device device)

◆ vkTexture() [2/4]

jGL::Vulkan::vkTexture::vkTexture ( const Device device,
const Command command,
std::filesystem::path  imageFile,
Texture::Type  type,
VkSampleCountFlagBits  msaaSamples = VK_SAMPLE_COUNT_1_BIT 
)

◆ vkTexture() [3/4]

jGL::Vulkan::vkTexture::vkTexture ( const Device device,
const Command command,
uint32_t  width,
uint32_t  height,
uint32_t  channels,
VkFormat  format,
VkSampleCountFlagBits  msaaSamples = VK_SAMPLE_COUNT_1_BIT 
)

◆ vkTexture() [4/4]

jGL::Vulkan::vkTexture::vkTexture ( const Device device,
const Command command,
uint32_t  width,
uint32_t  height,
uint32_t  channels,
VkFormat  format,
std::vector< std::byte >  pixels,
VkSampleCountFlagBits  msaaSamples = VK_SAMPLE_COUNT_1_BIT 
)

◆ ~vkTexture()

jGL::Vulkan::vkTexture::~vkTexture ( )
inline

Member Function Documentation

◆ bind()

void jGL::Vulkan::vkTexture::bind ( unsigned  unit)
inlinevirtual

Implements jGL::Texture.

◆ copyBufferToImage()

void jGL::Vulkan::vkTexture::copyBufferToImage ( const Command command,
Buffer buffer,
uint32_t  width,
uint32_t  height 
)
protected

◆ getVkImageView()

const VkImageView & jGL::Vulkan::vkTexture::getVkImageView ( ) const
inline

◆ replace()

void jGL::Vulkan::vkTexture::replace ( const Command command,
uint32_t  width,
uint32_t  height,
uint32_t  channels,
VkFormat  format,
std::vector< std::byte >  pixels 
)

◆ transitionImageLayout()

void jGL::Vulkan::vkTexture::transitionImageLayout ( const Command command,
VkFormat  format,
VkImageLayout  oldLayout,
VkImageLayout  newLayout 
)
protected

◆ uploadImage()

void jGL::Vulkan::vkTexture::uploadImage ( const Command command,
std::vector< std::byte >  pixels,
VkFormat  format,
uint32_t  width,
uint32_t  height,
uint32_t  channels 
)
protected

Member Data Documentation

◆ channels

uint32_t jGL::Vulkan::vkTexture::channels
protected

◆ device

const Device& jGL::Vulkan::vkTexture::device
protected

◆ format

VkFormat jGL::Vulkan::vkTexture::format
protected

◆ height

uint32_t jGL::Vulkan::vkTexture::height
protected

◆ image

VkImage jGL::Vulkan::vkTexture::image
protected

◆ imageMemory

VkDeviceMemory jGL::Vulkan::vkTexture::imageMemory
protected

◆ imageView

VkImageView jGL::Vulkan::vkTexture::imageView
protected

◆ msaaSamples

VkSampleCountFlagBits jGL::Vulkan::vkTexture::msaaSamples
protected

◆ width

uint32_t jGL::Vulkan::vkTexture::width
protected

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