Don't try to texture from depth if not supported by backend. Works around #13621

This commit is contained in:
Henrik Rydgård 2020-11-10 23:36:09 +01:00
parent 34efa1281b
commit 575ae376a9
4 changed files with 7 additions and 1 deletions

View file

@ -569,6 +569,10 @@ std::vector<AttachCandidate> TextureCacheCommon::GetFramebufferCandidates(const
std::vector<AttachCandidate> candidates;
FramebufferNotificationChannel channel = Memory::IsDepthTexVRAMAddress(entry.addr) ? FramebufferNotificationChannel::NOTIFY_FB_DEPTH : FramebufferNotificationChannel::NOTIFY_FB_COLOR;
if (channel == FramebufferNotificationChannel::NOTIFY_FB_DEPTH && !gstate_c.Supports(GPU_SUPPORTS_DEPTH_TEXTURE)) {
// Depth texture not supported. Don't try to match it, fall back to the memory behind..
return std::vector<AttachCandidate>();
}
const std::vector<VirtualFramebuffer *> &framebuffers = framebufferManager_->Framebuffers();

View file

@ -140,6 +140,7 @@ void GPU_D3D11::CheckGPUFeatures() {
features |= GPU_SUPPORTS_ANISOTROPY;
#endif
features |= GPU_SUPPORTS_DEPTH_TEXTURE;
features |= GPU_SUPPORTS_OES_TEXTURE_NPOT;
if (draw_->GetDeviceCaps().dualSourceBlend)
features |= GPU_SUPPORTS_DUALSOURCE_BLEND;

View file

@ -480,7 +480,7 @@ enum {
GPU_SUPPORTS_16BIT_FORMATS = FLAG_BIT(13),
GPU_SUPPORTS_DEPTH_CLAMP = FLAG_BIT(14),
GPU_SUPPORTS_32BIT_INT_FSHADER = FLAG_BIT(15),
// Free bit: 16
GPU_SUPPORTS_DEPTH_TEXTURE = FLAG_BIT(16),
GPU_SUPPORTS_ACCURATE_DEPTH = FLAG_BIT(17),
GPU_SUPPORTS_VAO = FLAG_BIT(18),
GPU_SUPPORTS_COPY_IMAGE = FLAG_BIT(19),

View file

@ -231,6 +231,7 @@ void GPU_Vulkan::CheckGPUFeatures() {
features |= GPU_SUPPORTS_INSTANCE_RENDERING;
features |= GPU_SUPPORTS_VERTEX_TEXTURE_FETCH;
features |= GPU_SUPPORTS_TEXTURE_FLOAT;
features |= GPU_SUPPORTS_DEPTH_TEXTURE;
if (vulkan_->GetDeviceInfo().canBlitToPreferredDepthStencilFormat) {
features |= GPU_SUPPORTS_FRAMEBUFFER_BLIT_TO_DEPTH;