diff --git a/src/common/rendering/vulkan/textures/vk_hwtexture.cpp b/src/common/rendering/vulkan/textures/vk_hwtexture.cpp index 83733d6ec..15b2f7f26 100644 --- a/src/common/rendering/vulkan/textures/vk_hwtexture.cpp +++ b/src/common/rendering/vulkan/textures/vk_hwtexture.cpp @@ -380,12 +380,13 @@ VulkanDescriptorSet* VkMaterial::GetDescriptorSet(const FMaterialState& state) auto base = Source(); int clampmode = state.mClampMode; int translation = state.mTranslation; + auto translationp = IsLuminosityTranslation(translation)? translation : intptr_t(GPalette.GetTranslation(GetTranslationType(translation), GetTranslationIndex(translation))); clampmode = base->GetClampMode(clampmode); for (auto& set : mDescriptorSets) { - if (set.descriptor && set.clampmode == clampmode && set.flags == translation) return set.descriptor.get(); + if (set.descriptor && set.clampmode == clampmode && set.remap == translationp) return set.descriptor.get(); } int numLayers = NumLayers(); @@ -430,7 +431,7 @@ VulkanDescriptorSet* VkMaterial::GetDescriptorSet(const FMaterialState& state) } update.updateSets(fb->device); - mDescriptorSets.emplace_back(clampmode, translation, std::move(descriptor)); + mDescriptorSets.emplace_back(clampmode, translationp, std::move(descriptor)); return mDescriptorSets.back().descriptor.get(); } diff --git a/src/common/rendering/vulkan/textures/vk_hwtexture.h b/src/common/rendering/vulkan/textures/vk_hwtexture.h index 22958c494..91bc5e1b7 100644 --- a/src/common/rendering/vulkan/textures/vk_hwtexture.h +++ b/src/common/rendering/vulkan/textures/vk_hwtexture.h @@ -70,13 +70,13 @@ class VkMaterial : public FMaterial struct DescriptorEntry { int clampmode; - int flags; + intptr_t remap; std::unique_ptr descriptor; - DescriptorEntry(int cm, int f, std::unique_ptr&& d) + DescriptorEntry(int cm, intptr_t f, std::unique_ptr&& d) { clampmode = cm; - flags = f; + remap = f; descriptor = std::move(d); } };