GPU/HW: Remove unnecessary reference to backend in texture cache

pull/3745/head
Stenzek 4 months ago
parent fc72f17a5c
commit 8f818af6d2
No known key found for this signature in database

@ -322,7 +322,7 @@ bool GPU_HW::Initialize(bool upload_vram, Error* error)
if (m_use_texture_cache)
{
if (!GPUTextureCache::Initialize(this, error))
if (!GPUTextureCache::Initialize(error))
return false;
}
else
@ -681,7 +681,7 @@ bool GPU_HW::UpdateSettings(const GPUSettings& old_settings, Error* error)
if (m_use_texture_cache && !old_settings.gpu_texture_cache)
{
if (!GPUTextureCache::Initialize(this, error))
if (!GPUTextureCache::Initialize(error))
{
Error::AddPrefix(error, "Failed to initialize texture cache: ");
return false;

@ -540,7 +540,6 @@ struct GPUTextureCacheState
GPUTextureFormat hash_cache_texture_format = GPUTextureFormat::Unknown;
HashCache hash_cache;
GPU_HW* hw_backend = nullptr; // TODO:FIXME: remove me
/// List of candidates for purging when the hash cache gets too large.
std::vector<std::pair<HashCache::iterator, s32>> hash_cache_purge_list;
@ -597,10 +596,8 @@ bool GPUTextureCache::IsDumpingVRAMWriteTextures()
return (g_gpu_settings.texture_replacements.dump_textures && !s_state.config.dump_texture_pages);
}
bool GPUTextureCache::Initialize(GPU_HW* backend, Error* error)
bool GPUTextureCache::Initialize(Error* error)
{
s_state.hw_backend = backend;
SetHashCacheTextureFormat();
// note: safe because the CPU thread is waiting for the GPU thread to finish initializing
@ -828,7 +825,6 @@ void GPUTextureCache::Shutdown()
s_state.hash_cache_purge_list = {};
s_state.temp_vram_write_list = {};
s_state.track_vram_writes = false;
s_state.hw_backend = nullptr;
for (auto it = s_state.gpu_replacement_image_cache.begin(); it != s_state.gpu_replacement_image_cache.end();)
{
@ -3895,5 +3891,5 @@ void GPUTextureCache::ApplyTextureReplacements(SourceKey key, HashType tex_hash,
g_gpu_device->RecycleTexture(std::move(entry->texture));
entry->texture = std::move(replacement_tex);
s_state.hw_backend->RestoreDeviceContext();
}
static_cast<GPU_HW*>(VideoThread::GetGPUBackend())->RestoreDeviceContext();
}

@ -106,7 +106,7 @@ struct Source
TListNode<Source> hash_cache_ref;
};
bool Initialize(GPU_HW* backend, Error* error);
bool Initialize(Error* error);
bool UpdateSettings(bool use_texture_cache, const GPUSettings& old_settings, Error* error);
bool GetStateSize(StateWrapper& sw, u32* size);

Loading…
Cancel
Save