![]() |
PeriDyno 1.0.0
|
#include <VulkanTexture.h>
Public Member Functions | |
void | loadFromFile (std::string filename, VkFormat format, VkImageUsageFlags imageUsageFlags=VK_IMAGE_USAGE_SAMPLED_BIT, VkImageLayout imageLayout=VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, bool forceLinear=false) |
void | fromBuffer (void *buffer, VkDeviceSize bufferSize, VkFormat format, uint32_t texWidth, uint32_t texHeight, VkFilter filter=VK_FILTER_LINEAR, VkImageUsageFlags imageUsageFlags=VK_IMAGE_USAGE_SAMPLED_BIT, VkImageLayout imageLayout=VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL) |
![]() | |
Texture () | |
void | updateDescriptor () |
void | destroy () |
ktxResult | loadKTXFile (std::string filename, ktxTexture **target) |
VkDescriptorImageInfo & | descriptorInfo () |
Additional Inherited Members | |
![]() | |
dyno::VkContext * | ctx |
VkImage | image |
VkImageLayout | imageLayout |
VkDeviceMemory | deviceMemory |
VkImageView | view |
uint32_t | width |
uint32_t | height |
uint32_t | mipLevels |
uint32_t | layerCount |
VkDescriptorImageInfo | descriptor |
VkSampler | sampler |
Definition at line 55 of file VulkanTexture.h.
void vks::Texture2D::fromBuffer | ( | void * | buffer, |
VkDeviceSize | bufferSize, | ||
VkFormat | format, | ||
uint32_t | texWidth, | ||
uint32_t | texHeight, | ||
VkFilter | filter = VK_FILTER_LINEAR, | ||
VkImageUsageFlags | imageUsageFlags = VK_IMAGE_USAGE_SAMPLED_BIT, | ||
VkImageLayout | imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL ) |
Creates a 2D texture from a buffer
buffer | Buffer containing texture data to upload |
bufferSize | Size of the buffer in machine units |
width | Width of the texture to create |
height | Height of the texture to create |
format | Vulkan format of the image data stored in the file |
device | Vulkan device to create the texture on |
copyQueue | Queue used for the texture staging copy commands (must support transfer) |
(Optional) | filter Texture filtering for the sampler (defaults to VK_FILTER_LINEAR) |
(Optional) | imageUsageFlags Usage flags for the texture's image (defaults to VK_IMAGE_USAGE_SAMPLED_BIT) |
(Optional) | imageLayout Usage layout for the texture (defaults VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL) |
Definition at line 358 of file VulkanTexture.cpp.
void vks::Texture2D::loadFromFile | ( | std::string | filename, |
VkFormat | format, | ||
VkImageUsageFlags | imageUsageFlags = VK_IMAGE_USAGE_SAMPLED_BIT, | ||
VkImageLayout | imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, | ||
bool | forceLinear = false ) |
Load a 2D texture including all mip levels
filename | File to load (supports .ktx) |
format | Vulkan format of the image data stored in the file |
device | Vulkan device to create the texture on |
copyQueue | Queue used for the texture staging copy commands (must support transfer) |
(Optional) | imageUsageFlags Usage flags for the texture's image (defaults to VK_IMAGE_USAGE_SAMPLED_BIT) |
(Optional) | imageLayout Usage layout for the texture (defaults VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL) |
(Optional) | forceLinear Force linear tiling (not advised, defaults to false) |
Definition at line 78 of file VulkanTexture.cpp.