Skip to content

Commit

Permalink
Fix LODBias update bug when using bindless textures
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas committed Feb 7, 2024
1 parent ead8a29 commit e3aefd7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions VulkanDrv/TextureManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ void TextureManager::ClearCache()
}
}

void TextureManager::ClearAllBindlessIndexes()
{
for (auto& cache : TextureCache)
{
for (auto& it : cache)
{
for (int& index : it.second->BindlessIndex)
index = -1;
}
}
}

void TextureManager::CreateNullTexture()
{
auto cmdbuffer = renderer->Commands->GetTransferCommands();
Expand Down
1 change: 1 addition & 0 deletions VulkanDrv/TextureManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class TextureManager
CachedTexture* GetTexture(FTextureInfo* info, bool masked);

void ClearCache();
void ClearAllBindlessIndexes();

std::unique_ptr<VulkanImage> NullTexture;
std::unique_ptr<VulkanImageView> NullTextureView;
Expand Down
1 change: 1 addition & 0 deletions VulkanDrv/UVulkanRenderDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ void UVulkanRenderDevice::Unlock(UBOOL Blit)
if (Samplers->LODBias != LODBias)
{
DescriptorSets->ClearCache();
Textures->ClearAllBindlessIndexes();
Samplers->CreateSceneSamplers();
}

Expand Down

0 comments on commit e3aefd7

Please sign in to comment.