From 56c63170b9c4fc757be064b766760d84fb0a57ab Mon Sep 17 00:00:00 2001 From: kd-11 Date: Mon, 10 Aug 2020 22:18:44 +0300 Subject: [PATCH] vk: Warn if GPU does not support RGBA8 natively --- rpcs3/Emu/RSX/VK/VKFormats.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rpcs3/Emu/RSX/VK/VKFormats.cpp b/rpcs3/Emu/RSX/VK/VKFormats.cpp index e5ff0edbfb..6912e0f308 100644 --- a/rpcs3/Emu/RSX/VK/VKFormats.cpp +++ b/rpcs3/Emu/RSX/VK/VKFormats.cpp @@ -28,6 +28,16 @@ namespace vk vkGetPhysicalDeviceFormatProperties(dev, VK_FORMAT_B8G8R8A8_UNORM, &props); result.bgra8_linear = !!(props.linearTilingFeatures & VK_FORMAT_FEATURE_BLIT_SRC_BIT); + // Check if device supports RGBA8 format + vkGetPhysicalDeviceFormatProperties(dev, VK_FORMAT_R8G8B8A8_UNORM, &props); + if (!(props.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) || + !(props.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) || + !(props.optimalTilingFeatures & VK_FORMAT_FEATURE_BLIT_SRC_BIT)) + { + // Non-fatal. Most games use BGRA layout due to legacy reasons as old GPUs typically supported BGRA and RGBA was emulated. + rsx_log.error("Your GPU and/or driver does not support RGBA8 format. This can cause problems in some rare games that use this memory layout."); + } + return result; }