From dbb181923894fb8e4c5d598622a9b94ea8a94402 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 25 May 2020 21:17:28 +0200 Subject: [PATCH] - fixed setup for translated textures in Vulkan. It was passing the wrong IDs to high level code. --- src/common/rendering/vulkan/textures/vk_hwtexture.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/rendering/vulkan/textures/vk_hwtexture.cpp b/src/common/rendering/vulkan/textures/vk_hwtexture.cpp index cac4985ef4..aac0185180 100644 --- a/src/common/rendering/vulkan/textures/vk_hwtexture.cpp +++ b/src/common/rendering/vulkan/textures/vk_hwtexture.cpp @@ -369,7 +369,8 @@ VulkanDescriptorSet* VkMaterial::GetDescriptorSet(const FMaterialState& state) int translation = state.mTranslation; auto remap = translation <= 0 ? nullptr : GPalette.TranslationToTable(translation); - if (remap) translation = remap->Index; + if (remap) + translation = remap->Index; clampmode = base->GetClampMode(clampmode); @@ -389,8 +390,8 @@ VulkanDescriptorSet* VkMaterial::GetDescriptorSet(const FMaterialState& state) WriteDescriptors update; MaterialLayerInfo *layer; - auto systex = static_cast(GetLayer(0, translation, &layer)); - update.addCombinedImageSampler(descriptor.get(), 0, systex->GetImage(layer->layerTexture, translation, layer->scaleFlags)->View.get(), sampler, systex->mImage.Layout); + auto systex = static_cast(GetLayer(0, state.mTranslation, &layer)); + update.addCombinedImageSampler(descriptor.get(), 0, systex->GetImage(layer->layerTexture, state.mTranslation, layer->scaleFlags)->View.get(), sampler, systex->mImage.Layout); for (int i = 1; i < numLayers; i++) { auto systex = static_cast(GetLayer(i, 0, &layer));