diff --git a/src/Cafe/HW/Latte/Core/LatteTextureLoader.h b/src/Cafe/HW/Latte/Core/LatteTextureLoader.h index 656d8a3a..0f558945 100644 --- a/src/Cafe/HW/Latte/Core/LatteTextureLoader.h +++ b/src/Cafe/HW/Latte/Core/LatteTextureLoader.h @@ -594,7 +594,7 @@ public: } }; -class TextureDecoder_R4_G4_UNORM_To_RGBA4_vk : public TextureDecoder, public SingletonClass +class TextureDecoder_R4_G4_UNORM_To_ABGR4 : public TextureDecoder, public SingletonClass { public: sint32 getBytesPerTexel(LatteTextureLoaderCtx* textureLoader) override @@ -632,47 +632,6 @@ public: } }; -class TextureDecoder_R4_G4_UNORM_To_ABGR4 : public TextureDecoder, public SingletonClass -{ -public: - sint32 getBytesPerTexel(LatteTextureLoaderCtx* textureLoader) override - { - return 2; - } - - void decode(LatteTextureLoaderCtx* textureLoader, uint8* outputData) override - { - for (sint32 y = 0; y < textureLoader->height; y += textureLoader->stepY) - { - sint32 yc = y; - for (sint32 x = 0; x < textureLoader->width; x += textureLoader->stepX) - { - uint8* blockData = LatteTextureLoader_GetInput(textureLoader, x, y); - sint32 pixelOffset = (x + yc * textureLoader->width) * 2; - uint8 v = (*(uint8*)(blockData + 0)); - uint8 c0 = (v & 0xF); - uint8 c1 = (v >> 4) & 0xF; - v = (c0 << 4) | c1; - *(uint8*)(outputData + pixelOffset + 0) = v; - *(uint8*)(outputData + pixelOffset + 1) = 0; - } - } - } - - void decodePixelToRGBA(uint8* blockData, uint8* outputPixel, uint8 blockOffsetX, uint8 blockOffsetY) override - { - uint8 v0 = *(blockData + 0); - uint8 c0 = (v0 & 0xF); - uint8 c1 = (v0 >> 4) & 0xF; - c0 = (c0 << 4) | c0; - c1 = (c1 << 4) | c1; - *(outputPixel + 0) = c0; - *(outputPixel + 1) = c1; - *(outputPixel + 2) = 0; - *(outputPixel + 3) = 255; - } -}; - class TextureDecoder_R4G4_UNORM_To_RGBA8 : public TextureDecoder, public SingletonClass { public: diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp index f966a612..2f776f7a 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp @@ -2283,7 +2283,7 @@ void VulkanRenderer::GetTextureFormatInfoVK(Latte::E_GX2SURFFMT format, bool isD } else { formatInfoOut->vkImageFormat = VK_FORMAT_R4G4B4A4_UNORM_PACK16; - formatInfoOut->decoder = TextureDecoder_R4_G4_UNORM_To_RGBA4_vk::getInstance(); + formatInfoOut->decoder = TextureDecoder_R4_G4_UNORM_To_ABGR4::getInstance(); } } else