D3D9 crashfix (flare doesn't render correctly though)

This commit is contained in:
Henrik Rydgård 2022-09-15 17:22:09 +02:00
parent 5d4075376d
commit e8aaf22163
2 changed files with 19 additions and 1 deletions

View file

@ -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();

View file

@ -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) {