From 795b1c04a90583f9e06d4853095814d8d6abd824 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 30 Jul 2022 18:18:51 -0700 Subject: [PATCH] GPU: Small scaling variable cleanup. --- GPU/Common/TextureScalerCommon.cpp | 7 +++---- GPU/Common/TextureScalerCommon.h | 2 +- GPU/Vulkan/TextureCacheVulkan.cpp | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/GPU/Common/TextureScalerCommon.cpp b/GPU/Common/TextureScalerCommon.cpp index 46d80f0aad..0ecce4c72d 100644 --- a/GPU/Common/TextureScalerCommon.cpp +++ b/GPU/Common/TextureScalerCommon.cpp @@ -499,11 +499,10 @@ TextureScalerCommon::TextureScalerCommon() { TextureScalerCommon::~TextureScalerCommon() { } -bool TextureScalerCommon::IsEmptyOrFlat(u32* data, int pixels) { - int pixelsPerWord = 1; +bool TextureScalerCommon::IsEmptyOrFlat(const u32 *data, int pixels) const { u32 ref = data[0]; - // TODO: SIMD-ify this (although, for most textures we'll get our very early) - for (int i = 0; i < pixels; ++i) { + // TODO: SIMD-ify this (although, for most textures we'll get out very early) + for (int i = 1; i < pixels; ++i) { if (data[i] != ref) return false; } diff --git a/GPU/Common/TextureScalerCommon.h b/GPU/Common/TextureScalerCommon.h index 80ce86d6e4..ee5b2f550c 100644 --- a/GPU/Common/TextureScalerCommon.h +++ b/GPU/Common/TextureScalerCommon.h @@ -45,7 +45,7 @@ protected: void DePosterize(u32* source, u32* dest, int width, int height); - bool IsEmptyOrFlat(u32* data, int pixels); + bool IsEmptyOrFlat(const u32 *data, int pixels) const; // depending on the factor and texture sizes, these can get pretty large // maximum is (100 MB total for a 512 by 512 texture with scaling factor 5 and hybrid scaling) diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index 42a74b02d8..f396c57769 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -581,7 +581,7 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) { BuildTexturePlan plan; plan.hardwareScaling = g_Config.bTexHardwareScaling && uploadCS_ != VK_NULL_HANDLE; - plan.slowScaler = !plan.hardwareScaling || vulkan->DevicePerfClass() == PerfClass::SLOW; // Or the GPU is slow - TODO add check! + plan.slowScaler = !plan.hardwareScaling || vulkan->DevicePerfClass() == PerfClass::SLOW; if (!PrepareBuildTexture(plan, entry)) { // We're screwed? return;