mirror of https://github.com/PCSX2/pcsx2.git
gs-hw: fix invalid reference to target texture.
if the target texture changes after the source lookup, correctly propagate the texture update. fixes tales of abyss fullscreen blur when upscaling.
This commit is contained in:
parent
4f20a68b33
commit
73eea20fcc
|
@ -1626,6 +1626,12 @@ void GSRendererHW::Draw()
|
|||
}
|
||||
}
|
||||
|
||||
if (m_src && m_src->m_shared_texture && m_src->m_texture != *m_src->m_from_target)
|
||||
{
|
||||
// Target texture changed, update reference.
|
||||
m_src->m_texture = *m_src->m_from_target;
|
||||
}
|
||||
|
||||
if (s_dump)
|
||||
{
|
||||
const u64 frame = g_perfmon.GetFrame();
|
||||
|
@ -2160,7 +2166,7 @@ void GSRendererHW::EmulateChannelShuffle(const GSTextureCache::Source* tex)
|
|||
GL_INS("Gran Turismo RGB Channel");
|
||||
m_conf.ps.channel = ChannelFetch_RGB;
|
||||
m_context->TEX0.TFX = TFX_DECAL;
|
||||
m_conf.rt = tex->m_from_target;
|
||||
m_conf.rt = *tex->m_from_target;
|
||||
}
|
||||
else if (m_game.title == CRC::Tekken5)
|
||||
{
|
||||
|
@ -2173,7 +2179,7 @@ void GSRendererHW::EmulateChannelShuffle(const GSTextureCache::Source* tex)
|
|||
// 12 pages: 2 calls by channel, 3 channels, 1 blit
|
||||
// Minus current draw call
|
||||
m_skip = 12 * (3 + 3 + 1) - 1;
|
||||
m_conf.rt = tex->m_from_target;
|
||||
m_conf.rt = *tex->m_from_target;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2279,7 +2285,7 @@ void GSRendererHW::EmulateChannelShuffle(const GSTextureCache::Source* tex)
|
|||
// Effect is really a channel shuffle effect so let's cheat a little
|
||||
if (m_channel_shuffle)
|
||||
{
|
||||
m_conf.tex = tex->m_from_target;
|
||||
m_conf.tex = *tex->m_from_target;
|
||||
if (m_conf.tex)
|
||||
{
|
||||
if (m_conf.tex == m_conf.rt)
|
||||
|
|
|
@ -145,7 +145,7 @@ GSTextureCache::Source* GSTextureCache::LookupDepthSource(const GIFRegTEX0& TEX0
|
|||
src->m_texture = dst->m_texture;
|
||||
src->m_shared_texture = true;
|
||||
src->m_target = true; // So renderer can check if a conversion is required
|
||||
src->m_from_target = dst->m_texture; // avoid complex condition on the renderer
|
||||
src->m_from_target = &dst->m_texture; // avoid complex condition on the renderer
|
||||
src->m_from_target_TEX0 = dst->m_TEX0;
|
||||
src->m_32_bits_fmt = dst->m_32_bits_fmt;
|
||||
src->m_valid_rect = dst->m_valid;
|
||||
|
@ -1258,7 +1258,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
|
|||
// Keep a trace of origin of the texture
|
||||
src->m_texture = dTex;
|
||||
src->m_target = true;
|
||||
src->m_from_target = dst->m_texture;
|
||||
src->m_from_target = &dst->m_texture;
|
||||
src->m_from_target_TEX0 = dst->m_TEX0;
|
||||
src->m_texture->SetScale(scale);
|
||||
src->m_end_block = dst->m_end_block;
|
||||
|
@ -1287,7 +1287,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
|
|||
// Keep a trace of origin of the texture
|
||||
src->m_texture = dTex;
|
||||
src->m_target = true;
|
||||
src->m_from_target = dst->m_texture;
|
||||
src->m_from_target = &dst->m_texture;
|
||||
src->m_from_target_TEX0 = dst->m_TEX0;
|
||||
src->m_end_block = dst->m_end_block;
|
||||
|
||||
|
@ -1323,7 +1323,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
|
|||
|
||||
// Keep a trace of origin of the texture
|
||||
src->m_target = true;
|
||||
src->m_from_target = dst->m_texture;
|
||||
src->m_from_target = &dst->m_texture;
|
||||
src->m_from_target_TEX0 = dst->m_TEX0;
|
||||
src->m_valid_rect = dst->m_valid;
|
||||
src->m_end_block = dst->m_end_block;
|
||||
|
|
|
@ -164,7 +164,7 @@ public:
|
|||
// Keep a trace of the target origin. There is no guarantee that pointer will
|
||||
// still be valid on future. However it ought to be good when the source is created
|
||||
// so it can be used to access un-converted data for the current draw call.
|
||||
GSTexture* m_from_target;
|
||||
GSTexture** m_from_target;
|
||||
GIFRegTEX0 m_from_target_TEX0; // TEX0 of the target texture, if any, else equal to texture TEX0
|
||||
GIFRegTEX0 m_layer_TEX0[7]; // Detect already loaded value
|
||||
HashType m_layer_hash[7];
|
||||
|
|
Loading…
Reference in New Issue