From f4b0cddda371ed0a0cf47dc61dc4751f0aba6410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 18 Sep 2023 16:25:00 +0200 Subject: [PATCH] ShaderId: Safer way to check for backend. --- GPU/Common/ShaderId.cpp | 2 +- GPU/GPUState.h | 2 +- GPU/Vulkan/GPU_Vulkan.cpp | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GPU/Common/ShaderId.cpp b/GPU/Common/ShaderId.cpp index 7dadda15e8..3e9b771111 100644 --- a/GPU/Common/ShaderId.cpp +++ b/GPU/Common/ShaderId.cpp @@ -392,7 +392,7 @@ void ComputeFragmentShaderID(FShaderID *id_out, const ComputedPipelineState &pip id.SetBit(FS_BIT_COLOR_WRITEMASK, colorWriteMask); // All framebuffers are array textures in Vulkan now. - if (gstate_c.textureIsArray && g_Config.iGPUBackend == (int)GPUBackend::VULKAN) { + if (gstate_c.textureIsArray && gstate_c.Use(GPU_USE_FRAMEBUFFER_ARRAYS)) { id.SetBit(FS_BIT_SAMPLE_ARRAY_TEXTURE); } diff --git a/GPU/GPUState.h b/GPU/GPUState.h index 6a1f14b81f..6b1446c5e8 100644 --- a/GPU/GPUState.h +++ b/GPU/GPUState.h @@ -491,7 +491,7 @@ enum { GPU_USE_DEPTH_TEXTURE = FLAG_BIT(16), GPU_USE_ACCURATE_DEPTH = FLAG_BIT(17), GPU_USE_GS_CULLING = FLAG_BIT(18), // Geometry shader - // Bit 19 free. + GPU_USE_FRAMEBUFFER_ARRAYS = FLAG_BIT(19), GPU_USE_FRAMEBUFFER_FETCH = FLAG_BIT(20), GPU_SCALE_DEPTH_FROM_24BIT_TO_16BIT = FLAG_BIT(21), GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT = FLAG_BIT(22), diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index b4734dc2d3..9d62212092 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -290,6 +290,7 @@ u32 GPU_Vulkan::CheckGPUFeatures() const { features &= ~GPU_USE_LIGHT_UBERSHADER; } + features |= GPU_USE_FRAMEBUFFER_ARRAYS; return CheckGPUFeaturesLate(features); }