Fix palette conversions for 4 bit efb copies.

Fixes purple shadow in THPS4 and many other things.
This commit is contained in:
Scott Mansell 2015-09-06 21:02:51 +12:00
parent e745748c3e
commit 137856bd00
2 changed files with 2 additions and 2 deletions

View File

@ -337,7 +337,7 @@ void TextureCache::ConvertTexture(TCacheEntryBase* entry, TCacheEntryBase* uncon
D3D::stateman->SetTexture(1, palette_buf_srv); D3D::stateman->SetTexture(1, palette_buf_srv);
// TODO: Add support for C14X2 format. (Different multiplier, more palette entries.) // TODO: Add support for C14X2 format. (Different multiplier, more palette entries.)
float params[4] = { unconverted->format == 0 ? 15.f : 255.f }; float params[4] = { (unconverted->format & 0xf) == 0 ? 15.f : 255.f };
D3D::context->UpdateSubresource(palette_uniform, 0, nullptr, &params, 0, 0); D3D::context->UpdateSubresource(palette_uniform, 0, nullptr, &params, 0, 0);
D3D::stateman->SetPixelConstants(palette_uniform); D3D::stateman->SetPixelConstants(palette_uniform);

View File

@ -560,7 +560,7 @@ void TextureCache::ConvertTexture(TCacheEntryBase* _entry, TCacheEntryBase* _unc
memcpy(buffer.first, palette, size); memcpy(buffer.first, palette, size);
s_palette_stream_buffer->Unmap(size); s_palette_stream_buffer->Unmap(size);
glUniform1i(s_palette_buffer_offset_uniform[format], buffer.second / 2); glUniform1i(s_palette_buffer_offset_uniform[format], buffer.second / 2);
glUniform1f(s_palette_multiplier_uniform[format], unconverted->format == 0 ? 15.0f : 255.0f); glUniform1f(s_palette_multiplier_uniform[format], (unconverted->format & 0xf) == 0 ? 15.0f : 255.0f);
glUniform4f(s_palette_copy_position_uniform[format], 0.0f, 0.0f, (float)unconverted->config.width, (float)unconverted->config.height); glUniform4f(s_palette_copy_position_uniform[format], 0.0f, 0.0f, (float)unconverted->config.width, (float)unconverted->config.height);
glActiveTexture(GL_TEXTURE10); glActiveTexture(GL_TEXTURE10);