mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
VideoCommon: Handle custom texture sizes correctly
Specifically, when using Manual Texture Sampling, if textures sizes don't match the size the game specifies, things previously broke. That can happen with custom textures, and also with scaled EFB copies at non-native IRs. It breaks most obviously by not scaling the texture coordinates (so only part of the texture shows up), but the hardware wrapping functionality also assumes texture sizes are a power of 2 (or else it will behave weirdly in a way that matches how hardware behaves weirdly). The fix is to provide alternative texture wrapping logic when custom texture sizes are possible.
This commit is contained in:
@ -245,6 +245,16 @@ struct VideoConfig final
|
||||
return backend_info.bSupportsGPUTextureDecoding && bEnableGPUTextureDecoding;
|
||||
}
|
||||
bool UseVertexRounding() const { return bVertexRounding && iEFBScale != 1; }
|
||||
bool ManualTextureSamplingWithHiResTextures() const
|
||||
{
|
||||
// Hi-res textures (including hi-res EFB copies, but not native-resolution EFB copies at higher
|
||||
// internal resolutions) breaks the wrapping logic used by manual texture sampling.
|
||||
if (bFastTextureSampling)
|
||||
return false;
|
||||
if (iEFBScale != 1 && bCopyEFBScaled)
|
||||
return true;
|
||||
return bHiresTextures;
|
||||
}
|
||||
bool UsingUberShaders() const;
|
||||
u32 GetShaderCompilerThreads() const;
|
||||
u32 GetShaderPrecompilerThreads() const;
|
||||
|
Reference in New Issue
Block a user