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:
Pokechu22
2021-08-01 17:31:40 -07:00
parent 93eea7cb13
commit bdcfb31187
4 changed files with 93 additions and 4 deletions

View File

@ -170,6 +170,7 @@ union ShaderHostConfig
BitField<22, 1, bool, u32> backend_palette_conversion;
BitField<23, 1, bool, u32> enable_validation_layer;
BitField<24, 1, bool, u32> manual_texture_sampling;
BitField<25, 1, bool, u32> manual_texture_sampling_custom_texture_sizes;
static ShaderHostConfig GetCurrent();
};