ShaderId: Safer way to check for backend.

This commit is contained in:
Henrik Rydgård 2023-09-18 16:25:00 +02:00
parent 946d4b6251
commit f4b0cddda3
3 changed files with 3 additions and 2 deletions

View File

@ -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);
}

View File

@ -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),

View File

@ -290,6 +290,7 @@ u32 GPU_Vulkan::CheckGPUFeatures() const {
features &= ~GPU_USE_LIGHT_UBERSHADER;
}
features |= GPU_USE_FRAMEBUFFER_ARRAYS;
return CheckGPUFeaturesLate(features);
}