mirror of
https://github.com/libretro/Play-.git
synced 2025-03-04 09:17:50 +00:00
Changed GsTextureCache interface to allow to work with uniquely owned objects.
This commit is contained in:
parent
76b9142e9a
commit
c9df382661
@ -58,7 +58,7 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Insert(const CGSHandler::TEX0& tex0, TextureHandleType& textureHandle)
|
||||
void Insert(const CGSHandler::TEX0& tex0, TextureHandleType textureHandle)
|
||||
{
|
||||
auto texture = *m_textureCache.rbegin();
|
||||
texture->Reset();
|
||||
@ -66,7 +66,7 @@ public:
|
||||
texture->m_cachedArea.SetArea(tex0.nPsm, tex0.GetBufPtr(), tex0.GetBufWidth(), tex0.GetHeight());
|
||||
|
||||
texture->m_tex0 = static_cast<uint64>(tex0) & TEX0_CLUTINFO_MASK;
|
||||
texture->m_textureHandle = textureHandle;
|
||||
texture->m_textureHandle = std::move(textureHandle);
|
||||
texture->m_live = true;
|
||||
|
||||
m_textureCache.pop_back();
|
||||
|
@ -80,13 +80,14 @@ CGSH_Direct3D9::TEXTURE_INFO CGSH_Direct3D9::LoadTexture(const TEX0& tex0, uint3
|
||||
break;
|
||||
}
|
||||
|
||||
resultCode = m_device->CreateTexture(width, height, 1 + maxMip, D3DUSAGE_DYNAMIC, textureFormat, D3DPOOL_DEFAULT, &result.texture, NULL);
|
||||
assert(SUCCEEDED(resultCode));
|
||||
{
|
||||
TexturePtr textureHandle;
|
||||
resultCode = m_device->CreateTexture(width, height, 1 + maxMip, D3DUSAGE_DYNAMIC, textureFormat, D3DPOOL_DEFAULT, &textureHandle, NULL);
|
||||
assert(SUCCEEDED(resultCode));
|
||||
m_textureCache.Insert(tex0, std::move(textureHandle));
|
||||
}
|
||||
|
||||
m_textureCache.Insert(tex0, result.texture);
|
||||
texture = m_textureCache.Search(tex0);
|
||||
assert(result.texture == texture->m_textureHandle);
|
||||
|
||||
texture->m_cachedArea.Invalidate(0, RAMSIZE);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user