mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Fix a crash on DirextX 11 with Feature Level <= 9_3 hardware
Mobile usually uses 9_3 or lower hardware. The same issue happens on x64 as well, so it might be a universal one, not limited to ARM or UWP.
This commit is contained in:
parent
93fe9c413b
commit
010b07b2df
@ -85,16 +85,16 @@ ID3D11SamplerState *SamplerCacheD3D11::GetOrCreateSampler(ID3D11Device *device,
|
||||
samp.Filter = D3D11_FILTER_ANISOTROPIC;
|
||||
else
|
||||
samp.Filter = filters[filterKey];
|
||||
#if PPSSPP_PLATFORM(UWP) && PPSSPP_ARCH(ARM)
|
||||
// For some reason, can't set MaxLOD on mobile.
|
||||
samp.MaxLOD = FLT_MAX;
|
||||
samp.MinLOD = -FLT_MAX;
|
||||
samp.MipLODBias = 0.0f;
|
||||
#else
|
||||
samp.MaxLOD = key.maxLevel / 256.0f;
|
||||
samp.MinLOD = key.minLevel / 256.0f;
|
||||
samp.MipLODBias = key.lodBias / 256.0f;
|
||||
#endif
|
||||
// Can't set MaxLOD on Feature Level <= 9_3.
|
||||
if (device->GetFeatureLevel() <= D3D_FEATURE_LEVEL_9_3) {
|
||||
samp.MaxLOD = FLT_MAX;
|
||||
samp.MinLOD = -FLT_MAX;
|
||||
samp.MipLODBias = 0.0f;
|
||||
} else {
|
||||
samp.MaxLOD = key.maxLevel / 256.0f;
|
||||
samp.MinLOD = key.minLevel / 256.0f;
|
||||
samp.MipLODBias = key.lodBias / 256.0f;
|
||||
}
|
||||
samp.ComparisonFunc = D3D11_COMPARISON_NEVER;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
samp.BorderColor[i] = 1.0f;
|
||||
|
Loading…
Reference in New Issue
Block a user