GPU/HW: Fix assert with accurate blending + true colour on

This commit is contained in:
Stenzek 2024-08-27 23:46:34 +10:00
parent d651c9f477
commit 63c7f4a893
No known key found for this signature in database
1 changed files with 10 additions and 9 deletions

View File

@ -24,6 +24,7 @@
#include "common/timer.h"
#include "IconsFontAwesome5.h"
#include "IconsEmoji.h"
#include "imgui.h"
#include <cmath>
@ -530,7 +531,7 @@ void GPU_HW::CheckSettings()
if (m_multisamples != g_settings.gpu_multisamples)
{
Host::AddIconOSDMessage("MSAAUnsupported", ICON_FA_EXCLAMATION_TRIANGLE,
Host::AddIconOSDMessage("MSAAUnsupported", ICON_EMOJI_WARNING,
fmt::format(TRANSLATE_FS("GPU_HW", "{}x MSAA is not supported, using {}x instead."),
g_settings.gpu_multisamples, m_multisamples),
Host::OSD_CRITICAL_ERROR_DURATION);
@ -542,7 +543,7 @@ void GPU_HW::CheckSettings()
if (g_settings.gpu_per_sample_shading && !features.per_sample_shading)
{
Host::AddIconOSDMessage("SSAAUnsupported", ICON_FA_EXCLAMATION_TRIANGLE,
Host::AddIconOSDMessage("SSAAUnsupported", ICON_EMOJI_WARNING,
TRANSLATE_STR("GPU_HW", "SSAA is not supported, using MSAA instead."),
Host::OSD_ERROR_DURATION);
}
@ -550,7 +551,7 @@ void GPU_HW::CheckSettings()
(IsBlendedTextureFiltering(m_texture_filtering) || IsBlendedTextureFiltering(m_sprite_texture_filtering)))
{
Host::AddIconOSDMessage(
"TextureFilterUnsupported", ICON_FA_EXCLAMATION_TRIANGLE,
"TextureFilterUnsupported", ICON_EMOJI_WARNING,
fmt::format(TRANSLATE_FS("GPU_HW", "Texture filter '{}/{}' is not supported with the current renderer."),
Settings::GetTextureFilterDisplayName(m_texture_filtering),
Settings::GetTextureFilterName(m_sprite_texture_filtering), Host::OSD_ERROR_DURATION));
@ -564,7 +565,7 @@ void GPU_HW::CheckSettings()
{
// m_allow_shader_blend/m_prefer_shader_blend will be cleared in pipeline compile.
Host::AddIconOSDMessage(
"AccurateBlendingUnsupported", ICON_FA_PAINT_BRUSH,
"AccurateBlendingUnsupported", ICON_EMOJI_WARNING,
TRANSLATE_STR("GPU_HW", "Accurate blending is not supported by your current GPU.\nIt requires framebuffer fetch, "
"feedback loops, or rasterizer order views."),
Host::OSD_WARNING_DURATION);
@ -574,7 +575,7 @@ void GPU_HW::CheckSettings()
(m_pgxp_depth_buffer && features.raster_order_views && !features.feedback_loops)))
{
Host::AddIconOSDMessage(
"AccurateBlendingUnsupported", ICON_FA_PAINT_BRUSH,
"AccurateBlendingUnsupported", ICON_EMOJI_WARNING,
TRANSLATE_STR("GPU_HW", "Multisample anti-aliasing is not supported when using ROV blending."),
Host::OSD_WARNING_DURATION);
m_multisamples = 1;
@ -583,7 +584,7 @@ void GPU_HW::CheckSettings()
if (m_pgxp_depth_buffer && !features.feedback_loops && !features.framebuffer_fetch && !features.raster_order_views)
{
Host::AddIconOSDMessage(
"AccurateBlendingUnsupported", ICON_FA_PAINT_BRUSH,
"AccurateBlendingUnsupported", ICON_EMOJI_WARNING,
TRANSLATE_STR("GPU_HW", "PGXP depth buffer is not supported by your current GPU or renderer.\nIt requires "
"framebuffer fetch, feedback loops, or rasterizer order views."),
Host::OSD_WARNING_DURATION);
@ -596,7 +597,7 @@ void GPU_HW::CheckSettings()
if (!features.geometry_shaders && m_wireframe_mode != GPUWireframeMode::Disabled)
{
Host::AddIconOSDMessage(
"GeometryShadersUnsupported", ICON_FA_EXCLAMATION_TRIANGLE,
"GeometryShadersUnsupported", ICON_EMOJI_WARNING,
TRANSLATE("GPU_HW", "Geometry shaders are not supported by your GPU, and are required for wireframe rendering."),
Host::OSD_CRITICAL_ERROR_DURATION);
m_wireframe_mode = GPUWireframeMode::Disabled;
@ -950,10 +951,10 @@ bool GPU_HW::CompilePipelines(Error* error)
// Abuse the depth buffer for the mask bit when it's free (FBFetch), or PGXP depth buffering is enabled.
m_allow_shader_blend = features.framebuffer_fetch ||
((features.feedback_loops || features.raster_order_views) &&
(m_pgxp_depth_buffer || g_settings.gpu_accurate_blending ||
(m_pgxp_depth_buffer || g_settings.IsUsingAccurateBlending() ||
(!m_supports_dual_source_blend && (IsBlendedTextureFiltering(m_texture_filtering) ||
IsBlendedTextureFiltering(m_sprite_texture_filtering)))));
m_prefer_shader_blend = (m_allow_shader_blend && g_settings.gpu_accurate_blending && !g_settings.gpu_true_color);
m_prefer_shader_blend = (m_allow_shader_blend && g_settings.IsUsingAccurateBlending());
m_use_rov_for_shader_blend = (m_allow_shader_blend && !features.framebuffer_fetch && features.raster_order_views &&
(m_prefer_shader_blend || !features.feedback_loops));
m_write_mask_as_depth = (!m_pgxp_depth_buffer && !features.framebuffer_fetch && !m_prefer_shader_blend);