mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
VideoCommon: Defer creating TextureInfo
TextureCacheBase::LoadImpl has a hot path where the passed-in TextureInfo never gets used. Instead of passing in a TextureInfo, let's pass in the stage and create the TextureInfo from the stage if needed. This unlocks somewhere above an additional 4% performance boost in the Hoth level of Rogue Squadron 2 on my PC. Performance varies, making it difficult for me to measure, so treat this as a very approximate number.
This commit is contained in:
@@ -36,7 +36,6 @@
|
||||
#include "VideoCommon/PixelShaderManager.h"
|
||||
#include "VideoCommon/Statistics.h"
|
||||
#include "VideoCommon/TextureCacheBase.h"
|
||||
#include "VideoCommon/TextureInfo.h"
|
||||
#include "VideoCommon/VertexLoaderManager.h"
|
||||
#include "VideoCommon/VertexShaderManager.h"
|
||||
#include "VideoCommon/VideoBackendBase.h"
|
||||
@@ -569,7 +568,7 @@ void VertexManagerBase::Flush()
|
||||
{
|
||||
for (const u32 i : used_textures)
|
||||
{
|
||||
const auto cache_entry = g_texture_cache->Load(TextureInfo::FromStage(i));
|
||||
const auto cache_entry = g_texture_cache->Load(i);
|
||||
if (!cache_entry)
|
||||
continue;
|
||||
const float custom_tex_scale = cache_entry->GetWidth() / float(cache_entry->native_width);
|
||||
@@ -581,7 +580,7 @@ void VertexManagerBase::Flush()
|
||||
{
|
||||
for (const u32 i : used_textures)
|
||||
{
|
||||
const auto cache_entry = g_texture_cache->Load(TextureInfo::FromStage(i));
|
||||
const auto cache_entry = g_texture_cache->Load(i);
|
||||
if (cache_entry)
|
||||
{
|
||||
if (!Common::Contains(texture_names, cache_entry->texture_info_name))
|
||||
|
||||
Reference in New Issue
Block a user