From 41a683133341ee2d206ca4ba0d4bbec0f2861d1b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 29 Sep 2019 18:10:55 -0700 Subject: [PATCH] Vulkan: Add a setting for hardware scaling. --- Core/Config.cpp | 1 + Core/Config.h | 1 + GPU/Vulkan/TextureCacheVulkan.cpp | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 200c316029..521f983f1e 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -751,6 +751,7 @@ static ConfigSetting graphicsSettings[] = { ReportedConfigSetting("TexScalingLevel", &g_Config.iTexScalingLevel, 1, true, true), ReportedConfigSetting("TexScalingType", &g_Config.iTexScalingType, 0, true, true), ReportedConfigSetting("TexDeposterize", &g_Config.bTexDeposterize, false, true, true), + ReportedConfigSetting("TexHardwareScaling", &g_Config.bTexHardwareScaling, false, true, true), ConfigSetting("VSyncInterval", &g_Config.bVSync, false, true, true), ReportedConfigSetting("BloomHack", &g_Config.iBloomHack, 0, true, true), diff --git a/Core/Config.h b/Core/Config.h index 2b04bf222d..c90cf64b35 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -170,6 +170,7 @@ public: int iTexScalingLevel; // 0 = auto, 1 = off, 2 = 2x, ..., 5 = 5x int iTexScalingType; // 0 = xBRZ, 1 = Hybrid bool bTexDeposterize; + bool bTexHardwareScaling; int iFpsLimit1; int iFpsLimit2; int iMaxRecent; diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index 75e2c2aaa7..fdb11048d0 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -1033,14 +1033,14 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) { // Don't scale the PPGe texture. if (entry->addr > 0x05000000 && entry->addr < PSP_GetKernelMemoryEnd()) scaleFactor = 1; - if ((entry->status & TexCacheEntry::STATUS_CHANGE_FREQUENT) != 0 && scaleFactor != 1) { + if ((entry->status & TexCacheEntry::STATUS_CHANGE_FREQUENT) != 0 && scaleFactor != 1 && !g_Config.bTexHardwareScaling) { // Remember for later that we /wanted/ to scale this texture. entry->status |= TexCacheEntry::STATUS_TO_SCALE; scaleFactor = 1; } if (scaleFactor != 1) { - if (texelsScaledThisFrame_ >= TEXCACHE_MAX_TEXELS_SCALED) { + if (texelsScaledThisFrame_ >= TEXCACHE_MAX_TEXELS_SCALED && !g_Config.bTexHardwareScaling) { entry->status |= TexCacheEntry::STATUS_TO_SCALE; scaleFactor = 1; } else { @@ -1092,7 +1092,7 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) { // If we want to use the GE debugger, we should add VK_IMAGE_USAGE_TRANSFER_SRC_BIT too... // Compute experiment - if (actualFmt == VULKAN_8888_FORMAT) { + if (actualFmt == VULKAN_8888_FORMAT && scaleFactor > 1 && g_Config.bTexHardwareScaling) { // Enable the experiment you want. // computeCopy = true; computeUpload = true;