|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
#include <Texture.h>
Public Member Functions | |
| Texture ()=default | |
| void | setupImageFormat (const tinygltf::Image &imageData) |
| Texture (const tinygltf::Image &imageData, TextureType type, ApplicationContext *context) | |
| Construct a texture with explicit type for correct format selection. | |
| Texture (const tinygltf::Image &imageData, ApplicationContext *context) | |
| Construct a texture with default type (BaseColor/SRGB) | |
| ~Texture () | |
| Texture (const Texture &)=delete | |
| Texture & | operator= (const Texture &)=delete |
| Texture (Texture &&other) noexcept | |
| Texture & | operator= (Texture &&other) noexcept |
| VkImage | getVkImage () const |
| VkDeviceMemory | getVkImageMemory () const |
| VkImageView | getVkImageView () const |
| VkSampler | getVkImageSampler () const |
| bool | isDescriptorIndexInitialized () const |
| uint32_t | getDescriptorIndex () const |
| void | createDataUploadCommand (VkCommandBuffer commandBuffer, Renderer *renderer) const |
| VkFormat | getTextureFormat () const |
| TextureType | getTextureType () const |
| Get the semantic texture type. | |
Static Public Member Functions | |
| static std::string | createTexturePath (const std::filesystem::path &assetPath, const GltfLoader::GltfMeshPrimitiveData &primitiveData) |
Public Attributes | |
| friend | AssetManager |
Private Member Functions | |
| void | addPaddingToImage () |
| template<typename T> | |
| void | addPaddingHelper () |
| void | setDebugName (const std::string &debugName) |
| void | createResources () |
| void | cleanup () const |
| void | reset () |
Private Attributes | |
| VkImage | vkTexture {} |
| VmaAllocation | textureAllocation_ = VK_NULL_HANDLE |
| VMA allocation for texture memory. | |
| VkImageView | vkTextureView {} |
| VkSampler | vkTextureSampler {} |
| uint32_t | descriptorIndex = std::numeric_limits<uint32_t>::max() |
| VkFormat | format = VK_FORMAT_R8G8B8A8_SRGB |
| TextureType | textureType_ = TextureType::BaseColor |
| tinygltf::Image | imageData |
| ApplicationContext * | context = nullptr |
|
default |
References context, and imageData.
Referenced by operator=(), operator=(), Texture(), and Texture().
| EngineCore::Texture::Texture | ( | const tinygltf::Image & | imageData, |
| TextureType | type, | ||
| ApplicationContext * | context ) |
Construct a texture with explicit type for correct format selection.
This constructor uses the TextureType to determine the correct VkFormat:
| imageData | The image data from tinygltf |
| type | The semantic texture type (determines VkFormat) |
| context | The application context for Vulkan operations |
Definition at line 44 of file Texture.cpp.
References addPaddingToImage(), context, format, EngineCore::getVkFormat(), imageData, and textureType_.
| EngineCore::Texture::Texture | ( | const tinygltf::Image & | imageData, |
| ApplicationContext * | context ) |
Construct a texture with default type (BaseColor/SRGB)
Definition at line 56 of file Texture.cpp.
References addPaddingToImage(), EngineCore::BaseColor, context, imageData, setupImageFormat(), and textureType_.
| EngineCore::Texture::~Texture | ( | ) |
Definition at line 218 of file Texture.cpp.
|
delete |
|
noexcept |
Definition at line 69 of file Texture.cpp.
References addPaddingToImage(), EngineCore::BaseColor, context, descriptorIndex, format, imageData, Texture(), textureAllocation_, textureType_, vkTexture, vkTextureSampler, and vkTextureView.
|
private |
Definition at line 109 of file Texture.h.
References imageData.
Referenced by addPaddingToImage().
|
private |
Definition at line 388 of file Texture.cpp.
References addPaddingHelper(), and imageData.
Referenced by Texture(), Texture(), and Texture().
|
private |
Definition at line 227 of file Texture.cpp.
References context, textureAllocation_, vkTexture, vkTextureSampler, and vkTextureView.
Referenced by operator=(), and reset().
| void EngineCore::Texture::createDataUploadCommand | ( | VkCommandBuffer | commandBuffer, |
| Renderer * | renderer ) const |
Definition at line 282 of file Texture.cpp.
References EngineCore::RenderProcess::addStagingBufferForCleanup(), context, EngineCore::VulkanBuffer::create(), EngineCore::VulkanBuffer::destroy(), EngineCore::VulkanBuffer::getBuffer(), EngineCore::Renderer::getCurrentRenderProcess(), imageData, EngineCore::VulkanBuffer::isMapped(), EngineCore::VulkanBuffer::map(), EngineCore::VulkanBuffer::setDebugName(), EngineCore::VulkanBuffer::unmap(), and vkTexture.
|
private |
Definition at line 127 of file Texture.cpp.
References context, format, imageData, setDebugName(), textureAllocation_, TRACY_ZONE_SCOPED_FUNCTION, vkTexture, vkTextureSampler, and vkTextureView.
Referenced by EngineCore::AssetManager::registerTexture().
|
static |
Definition at line 219 of file Texture.cpp.
References EngineCore::GltfLoader::GltfTextureData::getImage(), EngineCore::GltfLoader::GltfMeshPrimitiveData::getMaterialData(), and EngineCore::GltfLoader::GltfMaterialData::getTextureData().
|
nodiscard |
Definition at line 278 of file Texture.cpp.
References descriptorIndex.
Referenced by EngineCore::RenderingDataManager::onTextureLoaded().
|
nodiscard |
Definition at line 383 of file Texture.cpp.
References format.
|
inlinenodiscard |
Get the semantic texture type.
Definition at line 82 of file Texture.h.
References textureType_.
|
nodiscard |
Definition at line 249 of file Texture.cpp.
References vkTexture.
Referenced by EngineCore::Material::operator==().
|
nodiscard |
Definition at line 254 of file Texture.cpp.
References context, and textureAllocation_.
|
nodiscard |
Definition at line 270 of file Texture.cpp.
References vkTextureSampler.
|
nodiscard |
Definition at line 265 of file Texture.cpp.
References vkTextureView.
|
nodiscard |
Definition at line 274 of file Texture.cpp.
References descriptorIndex.
Definition at line 95 of file Texture.cpp.
References EngineCore::BaseColor, cleanup(), context, descriptorIndex, format, imageData, Texture(), textureAllocation_, textureType_, vkTexture, vkTextureSampler, and vkTextureView.
|
private |
Definition at line 239 of file Texture.cpp.
References cleanup(), descriptorIndex, textureAllocation_, vkTexture, vkTextureSampler, and vkTextureView.
|
private |
Definition at line 207 of file Texture.cpp.
References context, VulkanHelper::setObjectName(), textureAllocation_, vkTexture, vkTextureSampler, and vkTextureView.
Referenced by createResources().
| void EngineCore::Texture::setupImageFormat | ( | const tinygltf::Image & | imageData | ) |
Definition at line 13 of file Texture.cpp.
References format, and imageData.
Referenced by Texture().
|
private |
Definition at line 105 of file Texture.h.
Referenced by cleanup(), createDataUploadCommand(), createResources(), getVkImageMemory(), operator=(), setDebugName(), Texture(), Texture(), Texture(), and Texture().
|
private |
Definition at line 99 of file Texture.h.
Referenced by getDescriptorIndex(), isDescriptorIndexInitialized(), operator=(), EngineCore::AssetManager::registerTexture(), reset(), and Texture().
|
private |
Definition at line 101 of file Texture.h.
Referenced by createResources(), getTextureFormat(), operator=(), setupImageFormat(), Texture(), and Texture().
|
private |
Definition at line 104 of file Texture.h.
Referenced by addPaddingHelper(), addPaddingToImage(), createDataUploadCommand(), createResources(), operator=(), setupImageFormat(), Texture(), Texture(), Texture(), and Texture().
|
private |
VMA allocation for texture memory.
Definition at line 95 of file Texture.h.
Referenced by cleanup(), createResources(), getVkImageMemory(), operator=(), reset(), setDebugName(), and Texture().
|
private |
Definition at line 102 of file Texture.h.
Referenced by getTextureType(), operator=(), Texture(), Texture(), and Texture().
|
private |
Definition at line 94 of file Texture.h.
Referenced by cleanup(), createDataUploadCommand(), createResources(), getVkImage(), operator=(), reset(), setDebugName(), and Texture().
|
private |
Definition at line 97 of file Texture.h.
Referenced by cleanup(), createResources(), getVkImageSampler(), operator=(), reset(), setDebugName(), and Texture().
|
private |
Definition at line 96 of file Texture.h.
Referenced by cleanup(), createResources(), getVkImageView(), operator=(), reset(), setDebugName(), and Texture().