#include <Texture.h>
Definition at line 25 of file Texture.h.
◆ RuntimeTexture() [1/6]
| Engine::Assets::RuntimeTexture::RuntimeTexture |
( |
| ) |
|
|
default |
◆ RuntimeTexture() [2/6]
Construct a texture with explicit type for correct format selection.
This constructor uses the TextureType to determine the correct VkFormat:
- BaseColor/Emissive use SRGB formats for gamma-correct rendering
- Normal/MetallicRoughness use LINEAR formats for correct data interpretation
- Lightmap uses floating-point formats for HDR data
- Parameters
-
| imageData | The image data from tinygltf |
| type | The semantic texture type (determines VkFormat) |
| context | The application context for Vulkan operations |
References context, and imageData.
◆ RuntimeTexture() [3/6]
Construct a texture from KTX2 data with pre-computed mipmaps.
Used for BC6H-compressed lightmaps loaded from KTX2 files. Skips dilation and padding since data is already compressed.
- Parameters
-
| ktx2Data | The loaded KTX2 texture data including all mip levels |
| type | The semantic texture type |
| context | The application context for Vulkan operations |
References context.
◆ RuntimeTexture() [4/6]
| Engine::Assets::RuntimeTexture::RuntimeTexture |
( |
const tinygltf::Image & | imageData, |
|
|
Core::ApplicationContext * | context ) |
Construct a texture with default type (BaseColor/SRGB)
- Deprecated
- Use the constructor with explicit TextureType for correct format selection. This constructor defaults to SRGB which is incorrect for normal maps and other linear data textures.
References context, and imageData.
◆ ~RuntimeTexture()
| Engine::Assets::RuntimeTexture::~RuntimeTexture |
( |
| ) |
|
|
default |
◆ RuntimeTexture() [5/6]
| Engine::Assets::RuntimeTexture::RuntimeTexture |
( |
const RuntimeTexture & | | ) |
|
|
delete |
◆ RuntimeTexture() [6/6]
| Engine::Assets::RuntimeTexture::RuntimeTexture |
( |
RuntimeTexture && | other | ) |
|
|
noexcept |
◆ addPaddingHelper()
template<typename T>
| void Engine::Assets::RuntimeTexture::addPaddingHelper |
( |
| ) |
|
|
private |
◆ addPaddingToImage()
| void Engine::Assets::RuntimeTexture::addPaddingToImage |
( |
| ) |
|
|
private |
◆ calculateMipLevels()
| uint32_t Engine::Assets::RuntimeTexture::calculateMipLevels |
( |
uint32_t | width, |
|
|
uint32_t | height ) |
|
static |
◆ cleanup()
| void Engine::Assets::RuntimeTexture::cleanup |
( |
| ) |
const |
|
private |
◆ createDataUploadCommand()
| void Engine::Assets::RuntimeTexture::createDataUploadCommand |
( |
VkCommandBuffer | commandBuffer, |
|
|
Rendering::Renderer * | renderer ) const |
◆ createResources()
| void Engine::Assets::RuntimeTexture::createResources |
( |
| ) |
|
Create Vulkan resources (VkImage, VkImageView, VkSampler) for this texture. Safe to call from worker threads when VMA is configured for thread safety.
◆ dilateLightmapImage()
| void Engine::Assets::RuntimeTexture::dilateLightmapImage |
( |
| ) |
|
|
private |
◆ discardPreparedResources()
| void Engine::Assets::RuntimeTexture::discardPreparedResources |
( |
| ) |
|
Destroy Vulkan resources without registering the texture.
Used when async preparation completes after the owning scene has been unloaded.
◆ generateMipmaps()
| void Engine::Assets::RuntimeTexture::generateMipmaps |
( |
VkCommandBuffer | commandBuffer | ) |
const |
Generate mipmaps for this texture using vkCmdBlitImage.
Must be called after the base mip level has been uploaded. All mip levels must be in VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL before calling. After calling, mip levels 0..N-2 are in TRANSFER_SRC_OPTIMAL and mip level N-1 is in TRANSFER_DST_OPTIMAL.
- Parameters
-
| commandBuffer | The graphics command buffer to record blit commands into |
- Author
- Konstantin Passig
- Date
- 2026-02-12
◆ getDescriptorIndex()
| uint32_t Engine::Assets::RuntimeTexture::getDescriptorIndex |
( |
| ) |
const |
|
nodiscard |
◆ getMipLevels()
| uint32_t Engine::Assets::RuntimeTexture::getMipLevels |
( |
| ) |
const |
|
inlinenodiscard |
◆ getSourceBaseMip()
| uint32_t Engine::Assets::RuntimeTexture::getSourceBaseMip |
( |
| ) |
const |
|
inlinenodiscard |
◆ getSourceHeight()
| uint32_t Engine::Assets::RuntimeTexture::getSourceHeight |
( |
| ) |
const |
|
inlinenodiscard |
◆ getSourceMipLevels()
| uint32_t Engine::Assets::RuntimeTexture::getSourceMipLevels |
( |
| ) |
const |
|
inlinenodiscard |
◆ getSourceWidth()
| uint32_t Engine::Assets::RuntimeTexture::getSourceWidth |
( |
| ) |
const |
|
inlinenodiscard |
◆ getTextureFormat()
| VkFormat Engine::Assets::RuntimeTexture::getTextureFormat |
( |
| ) |
const |
|
nodiscard |
◆ getTextureType()
| TextureType Engine::Assets::RuntimeTexture::getTextureType |
( |
| ) |
const |
|
inlinenodiscard |
◆ getVkImage()
| VkImage Engine::Assets::RuntimeTexture::getVkImage |
( |
| ) |
const |
|
nodiscard |
◆ getVkImageMemory()
| VkDeviceMemory Engine::Assets::RuntimeTexture::getVkImageMemory |
( |
| ) |
const |
|
nodiscard |
◆ getVkImageSampler()
| VkSampler Engine::Assets::RuntimeTexture::getVkImageSampler |
( |
| ) |
const |
|
nodiscard |
◆ getVkImageView()
| VkImageView Engine::Assets::RuntimeTexture::getVkImageView |
( |
| ) |
const |
|
nodiscard |
◆ hasPrecomputedMipmaps()
| bool Engine::Assets::RuntimeTexture::hasPrecomputedMipmaps |
( |
| ) |
const |
|
inlinenodiscard |
◆ isDescriptorIndexInitialized()
| bool Engine::Assets::RuntimeTexture::isDescriptorIndexInitialized |
( |
| ) |
const |
|
nodiscard |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ reset()
| void Engine::Assets::RuntimeTexture::reset |
( |
| ) |
|
|
private |
◆ setDebugName()
| void Engine::Assets::RuntimeTexture::setDebugName |
( |
const std::string & | debugName | ) |
const |
|
private |
◆ setupImageFormat()
| void Engine::Assets::RuntimeTexture::setupImageFormat |
( |
const tinygltf::Image & | imageData | ) |
|
◆ context
◆ descriptorIndex
| uint32_t Engine::Assets::RuntimeTexture::descriptorIndex = std::numeric_limits<uint32_t>::max() |
|
private |
◆ format
| VkFormat Engine::Assets::RuntimeTexture::format = VK_FORMAT_R8G8B8A8_SRGB |
|
private |
◆ hasPrecomputedMipmaps_
| bool Engine::Assets::RuntimeTexture::hasPrecomputedMipmaps_ = false |
|
private |
◆ imageData
| tinygltf::Image Engine::Assets::RuntimeTexture::imageData |
|
private |
◆ ktx2Data_
◆ mipLevels_
| uint32_t Engine::Assets::RuntimeTexture::mipLevels_ = 1 |
|
private |
◆ sourceBaseMip_
| uint32_t Engine::Assets::RuntimeTexture::sourceBaseMip_ = 0 |
|
private |
◆ sourceHeight_
| uint32_t Engine::Assets::RuntimeTexture::sourceHeight_ = 1 |
|
private |
◆ sourceMipLevels_
| uint32_t Engine::Assets::RuntimeTexture::sourceMipLevels_ = 1 |
|
private |
◆ sourceWidth_
| uint32_t Engine::Assets::RuntimeTexture::sourceWidth_ = 1 |
|
private |
◆ textureAllocation_
| VmaAllocation Engine::Assets::RuntimeTexture::textureAllocation_ = VK_NULL_HANDLE |
|
private |
VMA allocation for texture memory.
Definition at line 174 of file Texture.h.
◆ textureType_
◆ vkTexture
| VkImage Engine::Assets::RuntimeTexture::vkTexture {} |
|
private |
◆ vkTextureSampler
| VkSampler Engine::Assets::RuntimeTexture::vkTextureSampler {} |
|
private |
◆ vkTextureView
| VkImageView Engine::Assets::RuntimeTexture::vkTextureView {} |
|
private |
The documentation for this class was generated from the following file:
- /home/magerbeton/Documents/gl3-vulkan/Engine/include/Engine/Texture/Texture.h