From e8aaf221635e68c72ab92b35aa1e98f1aa96cfb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 15 Sep 2022 17:22:09 +0200 Subject: [PATCH] D3D9 crashfix (flare doesn't render correctly though) --- Common/GPU/D3D9/thin3d_d3d9.cpp | 11 +++++++++++ GPU/Common/DepalettizeShaderCommon.cpp | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Common/GPU/D3D9/thin3d_d3d9.cpp b/Common/GPU/D3D9/thin3d_d3d9.cpp index c47d8235a1..a84d42f64e 100644 --- a/Common/GPU/D3D9/thin3d_d3d9.cpp +++ b/Common/GPU/D3D9/thin3d_d3d9.cpp @@ -443,6 +443,17 @@ void D3D9Texture::SetImageData(int x, int y, int z, int width, int height, int d if (data != rect.pBits) memcpy(dest, source, sizeof(uint32_t) * width); break; + + case DataFormat::R8_UNORM: + if (data != rect.pBits) + memcpy(dest, source, width); + break; + + case DataFormat::R16_UNORM: + if (data != rect.pBits) + memcpy(dest, source, sizeof(uint16_t) * width); + break; + default: // Unhandled data format copy. DebugBreak(); diff --git a/GPU/Common/DepalettizeShaderCommon.cpp b/GPU/Common/DepalettizeShaderCommon.cpp index ee62064d3d..a1e593e626 100644 --- a/GPU/Common/DepalettizeShaderCommon.cpp +++ b/GPU/Common/DepalettizeShaderCommon.cpp @@ -172,7 +172,14 @@ void GenerateDepalShaderFloat(ShaderWriter &writer, const DepalConfig &config) { bool formatOK = true; switch (config.bufferFormat) { case GE_FORMAT_CLUT8: - _dbg_assert_(false); // to be implemented + if (shift == 0 && mask == 0xFF) { + // Easy peasy. + sprintf(lookupMethod, "index.r"); + formatOK = true; + } else { + // Deal with this if we find it. + formatOK = false; + } break; case GE_FORMAT_8888: if ((mask & (mask + 1)) == 0) {