VideoBackends: Move max texture size to VideoConfig

This stops the virtual method call from within the Renderer constructor.

The initialization here for GL had to be moved to VideoBackend, as the
Renderer constructor will not have been executed before the value is
required.
This commit is contained in:
Stenzek
2017-03-10 00:01:23 +10:00
parent 4012166085
commit 2cd240af0d
24 changed files with 79 additions and 83 deletions

View File

@ -217,7 +217,7 @@ bool Renderer::CalculateTargetSize()
m_efb_scale_numeratorX = m_efb_scale_numeratorY = m_last_efb_scale - 3;
m_efb_scale_denominatorX = m_efb_scale_denominatorY = 1;
const u32 max_size = GetMaxTextureSize();
const u32 max_size = g_ActiveConfig.backend_info.MaxTextureSize;
if (max_size < EFB_WIDTH * m_efb_scale_numeratorX / m_efb_scale_denominatorX)
{
m_efb_scale_numeratorX = m_efb_scale_numeratorY = (max_size / EFB_WIDTH);

View File

@ -137,9 +137,6 @@ public:
PEControl::PixelFormat GetPrevPixelFormat() { return m_prev_efb_format; }
void StorePixelFormat(PEControl::PixelFormat new_format) { m_prev_efb_format = new_format; }
PostProcessingShaderImplementation* GetPostProcessor() { return m_post_processor.get(); }
// Max height/width
virtual u32 GetMaxTextureSize() = 0;
// Final surface changing
// This is called when the surface is resized (WX) or the window changes (Android).
virtual void ChangeSurface(void* new_surface_handle) {}

View File

@ -242,7 +242,7 @@ void TextureCacheBase::ScaleTextureCacheEntryTo(TextureCacheBase::TCacheEntryBas
return;
}
u32 max = g_renderer->GetMaxTextureSize();
const u32 max = g_ActiveConfig.backend_info.MaxTextureSize;
if (max < new_width || max < new_height)
{
ERROR_LOG(VIDEO, "Texture too big, width = %d, height = %d", new_width, new_height);

View File

@ -37,6 +37,7 @@ VideoConfig::VideoConfig()
// disable all features by default
backend_info.api_type = APIType::Nothing;
backend_info.MaxTextureSize = 16384;
backend_info.bSupportsExclusiveFullscreen = false;
backend_info.bSupportsMultithreading = false;
backend_info.bSupportsInternalResolutionFrameDumps = false;

View File

@ -173,6 +173,8 @@ struct VideoConfig final
// TODO: merge AdapterName and Adapters array
std::string AdapterName; // for OpenGL
u32 MaxTextureSize;
bool bSupportsExclusiveFullscreen;
bool bSupportsDualSourceBlend;
bool bSupportsPrimitiveRestart;