diff --git a/core/rend/dx11/dx11_texture.cpp b/core/rend/dx11/dx11_texture.cpp index 5056be283..1d7c59be7 100644 --- a/core/rend/dx11/dx11_texture.cpp +++ b/core/rend/dx11/dx11_texture.cpp @@ -18,6 +18,7 @@ */ #include "dx11_texture.h" #include "dx11context.h" +#include void DX11Texture::UploadToGPU(int width, int height, u8* temp_tex_buffer, bool mipmapped, bool mipmapsIncluded) { @@ -108,6 +109,15 @@ void DX11Texture::UploadToGPU(int width, int height, u8* temp_tex_buffer, bool m theDX11Context.getDeviceContext()->GenerateMips(textureView); } +bool DX11Texture::Force32BitTexture(TextureType type) const +{ + if (IsWindows8OrGreater()) + return false; + // DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM and DXGI_FORMAT_B5G6R5_UNORM + // are not supported on Windows 7 + return type == TextureType::_565 || type == TextureType::_5551 || type == TextureType::_4444; +} + bool DX11Texture::Delete() { if (!BaseTextureCacheData::Delete()) diff --git a/core/rend/dx11/dx11_texture.h b/core/rend/dx11/dx11_texture.h index c109c641d..689583ba2 100644 --- a/core/rend/dx11/dx11_texture.h +++ b/core/rend/dx11/dx11_texture.h @@ -33,6 +33,7 @@ public: bool mipmapsIncluded = false) override; bool Delete() override; void loadCustomTexture(); + bool Force32BitTexture(TextureType type) const override; }; class DX11TextureCache final : public BaseTextureCache