GPU: Small scaling variable cleanup.

This commit is contained in:
Unknown W. Brackets 2022-07-30 18:18:51 -07:00
parent fc2e3f3db5
commit 795b1c04a9
3 changed files with 5 additions and 6 deletions

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;
}

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)

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;