mirror of https://github.com/PCSX2/pcsx2.git
GS: Move osd log for unsupported cas in Renderer code.
This commit is contained in:
parent
774d0326c7
commit
07c09f255d
|
@ -687,13 +687,23 @@ void GSRenderer::VSync(u32 field, bool registers_written)
|
||||||
src_rect, current->GetSize(), g_host_display->GetDisplayAlignment(), g_host_display->UsesLowerLeftOrigin(),
|
src_rect, current->GetSize(), g_host_display->GetDisplayAlignment(), g_host_display->UsesLowerLeftOrigin(),
|
||||||
GetVideoMode() == GSVideoMode::SDTV_480P || (GSConfig.PCRTCOverscan && GSConfig.PCRTCOffsets));
|
GetVideoMode() == GSVideoMode::SDTV_480P || (GSConfig.PCRTCOverscan && GSConfig.PCRTCOffsets));
|
||||||
|
|
||||||
if (GSConfig.CASMode != GSCASMode::Disabled && g_gs_device->Features().cas_sharpening)
|
if (GSConfig.CASMode != GSCASMode::Disabled)
|
||||||
{
|
{
|
||||||
// sharpen only if the IR is higher than the display resolution
|
static bool cas_log_once = false;
|
||||||
const bool sharpen_only = (GSConfig.CASMode == GSCASMode::SharpenOnly ||
|
if (g_gs_device->Features().cas_sharpening)
|
||||||
(current->GetWidth() > g_host_display->GetWindowWidth() &&
|
{
|
||||||
current->GetHeight() > g_host_display->GetWindowHeight()));
|
// sharpen only if the IR is higher than the display resolution
|
||||||
g_gs_device->CAS(current, src_rect, src_uv, draw_rect, sharpen_only);
|
const bool sharpen_only = (GSConfig.CASMode == GSCASMode::SharpenOnly ||
|
||||||
|
(current->GetWidth() > g_host_display->GetWindowWidth() &&
|
||||||
|
current->GetHeight() > g_host_display->GetWindowHeight()));
|
||||||
|
g_gs_device->CAS(current, src_rect, src_uv, draw_rect, sharpen_only);
|
||||||
|
}
|
||||||
|
else if (!cas_log_once)
|
||||||
|
{
|
||||||
|
Host::AddIconOSDMessage("CASUnsupported", ICON_FA_EXCLAMATION_TRIANGLE,
|
||||||
|
"CAS is not available, your graphics driver does not support the required functionality.", 10.0f);
|
||||||
|
cas_log_once = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -414,11 +414,8 @@ bool GSDeviceOGL::Create()
|
||||||
m_shadeboost.ps.SetName("Shadeboost pipe");
|
m_shadeboost.ps.SetName("Shadeboost pipe");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CreateCASPrograms() && GSConfig.CASMode != GSCASMode::Disabled)
|
// Image load store and GLSL 420pack is core in GL4.2, no need to check.
|
||||||
{
|
m_features.cas_sharpening = ((GLAD_GL_VERSION_4_2 && GLAD_GL_ARB_compute_shader) || GLAD_GL_ES_VERSION_3_2) && CreateCASPrograms();
|
||||||
Host::AddIconOSDMessage("CASUnsupported", ICON_FA_EXCLAMATION_TRIANGLE,
|
|
||||||
"CAS is not available, your graphics driver does not supported the required functionality.", 10.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ****************************************************************
|
// ****************************************************************
|
||||||
// rasterization configuration
|
// rasterization configuration
|
||||||
|
@ -1543,14 +1540,6 @@ void GSDeviceOGL::ClearSamplerCache()
|
||||||
|
|
||||||
bool GSDeviceOGL::CreateCASPrograms()
|
bool GSDeviceOGL::CreateCASPrograms()
|
||||||
{
|
{
|
||||||
// Image load store and GLSL 420pack is core in GL4.2, no need to check.
|
|
||||||
m_features.cas_sharpening = (GLAD_GL_VERSION_4_2 && GLAD_GL_ARB_compute_shader) || GLAD_GL_ES_VERSION_3_2;
|
|
||||||
if (!m_features.cas_sharpening)
|
|
||||||
{
|
|
||||||
Console.Warning("Compute shaders not supported, CAS is unavailable.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<std::string> cas_source(Host::ReadResourceFileToString("shaders/opengl/cas.glsl"));
|
std::optional<std::string> cas_source(Host::ReadResourceFileToString("shaders/opengl/cas.glsl"));
|
||||||
if (!cas_source.has_value() || !GetCASShaderSource(&cas_source.value()))
|
if (!cas_source.has_value() || !GetCASShaderSource(&cas_source.value()))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue