Render resource handling for textures

This commit is contained in:
Georg Hagen
2024-08-21 13:13:43 +02:00
parent 33c8b74342
commit 3940a72084
7 changed files with 57 additions and 47 deletions

View File

@@ -174,7 +174,7 @@ namespace OpenVulkano::Vulkan
void ResourceManager::PrepareMaterial(Scene::Material* material)
{
if (material->texture && !material->texture->renderTexture)
if (material->texture && !material->texture->HasRenderResource())
{
PrepareTexture(material->texture);
}
@@ -318,7 +318,7 @@ namespace OpenVulkano::Vulkan
VulkanTexture* ResourceManager::PrepareTexture(Scene::Texture* texture)
{
const std::unique_lock lock(mutex);
if (texture->renderTexture) return static_cast<VulkanTexture*>(texture->renderTexture);
if (texture->HasRenderResource()) return static_cast<VulkanTexture*>(texture->GetRenderResource());
VulkanTexture* vkTexture;
if (texture->updateFrequency == Scene::UpdateFrequency::Never)
vkTexture = new VulkanTexture();