Enforce stronger format and weaker dimension texture compat checks

Rather than using just bpb for format compat, additionally check that the exact component bit layout matches since many games end up reusing RTs for unrelated textures. The texture size requirements have also been weaked to only check the resulting layer size as opposed to width/height - this is somewhat hacky but it gets around the problem of blocklinear alignment.
This commit is contained in:
Billy Laws
2022-10-21 22:03:13 +01:00
parent 14af383238
commit ff57d2fbbf
3 changed files with 16 additions and 7 deletions

View File

@ -3,8 +3,9 @@
#include <gpu.h>
#include <kernel/memory.h>
#include <common/trace.h>
#include <kernel/types/KProcess.h>
#include <common/trace.h>
#include <common/settings.h>
#include "texture.h"
#include "layout.h"
#include "adreno_aliasing.h"
@ -20,7 +21,7 @@ namespace skyline::gpu {
return layerStride;
}
u32 GuestTexture::CalculateLayerSize() {
u32 GuestTexture::CalculateLayerSize() const {
switch (tileConfig.mode) {
case texture::TileMode::Linear:
return static_cast<u32>(format->GetSize(dimensions));