Merge pull request #15764 from unknownbrackets/gpu-minor

GPU: Small scaling variable cleanup
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2022-07-31 06:31:16 +02:00
commit 29befd3b27
3 files changed
+5 -6

No files matched your search

+3 -4
View File
@@ -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;
}
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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;