diff --git a/rpcs3/Emu/RSX/GL/GLGSRender.cpp b/rpcs3/Emu/RSX/GL/GLGSRender.cpp index 5e6cdc0cf5..77586d16de 100644 --- a/rpcs3/Emu/RSX/GL/GLGSRender.cpp +++ b/rpcs3/Emu/RSX/GL/GLGSRender.cpp @@ -38,6 +38,7 @@ GLGSRender::GLGSRender() : GSRender() m_vertex_cache = std::make_unique(); backend_config.supports_hw_a2c = false; + backend_config.supports_hw_a2one = false; backend_config.supports_multidraw = true; } diff --git a/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h index 2899a73c67..a83e7983c4 100644 --- a/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -469,6 +469,7 @@ namespace rsx bool supports_multidraw; // Draw call batching bool supports_hw_a2c; // Alpha to coverage bool supports_hw_renormalization; // Should be true on NV hardware which matches PS3 texture renormalization behaviour + bool supports_hw_a2one; // Alpha to one }; struct sampled_image_descriptor_base; diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 6532774e99..66686711b7 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -529,7 +529,11 @@ VKGSRender::VKGSRender() : GSRender() // NOTE: We do not actually need multiple sample support for A2C to work // This is here for visual consistency - will be removed when AA problems due to mipmaps are fixed - backend_config.supports_hw_a2c = (g_cfg.video.antialiasing_level != msaa_level::none); + if (g_cfg.video.antialiasing_level != msaa_level::none) + { + backend_config.supports_hw_a2c = VK_TRUE; + backend_config.supports_hw_a2one = m_device->get_alpha_to_one_support(); + } // NOTE: On NVIDIA cards going back decades (including the PS3) there is a slight normalization inaccuracy in compressed formats. // Confirmed in BLES01916 (The Evil Within) which uses RGB565 for some virtual texturing data. @@ -2587,12 +2591,14 @@ bool VKGSRender::load_program() const auto rasterization_samples = u8((m_current_renderpass_key >> 16) & 0xF); if (backend_config.supports_hw_a2c || rasterization_samples > 1) { + const bool alpha_to_one_enable = rsx::method_registers.msaa_alpha_to_one_enabled() && backend_config.supports_hw_a2one; + properties.state.set_multisample_state( rasterization_samples, rsx::method_registers.msaa_sample_mask(), rsx::method_registers.msaa_enabled(), rsx::method_registers.msaa_alpha_to_coverage_enabled(), - rsx::method_registers.msaa_alpha_to_one_enabled()); + alpha_to_one_enable); } properties.renderpass_key = m_current_renderpass_key; diff --git a/rpcs3/Emu/RSX/VK/VKHelpers.h b/rpcs3/Emu/RSX/VK/VKHelpers.h index d673f6dc3d..3458494b16 100644 --- a/rpcs3/Emu/RSX/VK/VKHelpers.h +++ b/rpcs3/Emu/RSX/VK/VKHelpers.h @@ -809,6 +809,13 @@ private: enabled_features.depthBounds = VK_FALSE; } + if (!pgpu->features.alphaToOne && enabled_features.alphaToOne) + { + // AMD proprietary drivers do not expose alphaToOne support + LOG_ERROR(RSX, "Your GPU does not support alpha-to-one for multisampling. Graphics may be inaccurate when MSAA is enabled."); + enabled_features.alphaToOne = VK_FALSE; + } + VkDeviceCreateInfo device = {}; device.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; device.pNext = nullptr; @@ -931,6 +938,11 @@ private: return pgpu->features.depthBounds != VK_FALSE; } + bool get_alpha_to_one_support() const + { + return pgpu->features.alphaToOne != VK_FALSE; + } + mem_allocator_base* get_allocator() const { return m_allocator.get();