From b3b1518f91f66a4c471ec41a1a40170c6795e847 Mon Sep 17 00:00:00 2001 From: Valeri Date: Tue, 13 Apr 2021 20:14:17 +0300 Subject: [PATCH] Allow shaders to query reciprocal of window resolution --- Source/Core/VideoCommon/PostProcessing.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/PostProcessing.cpp b/Source/Core/VideoCommon/PostProcessing.cpp index e21b474f0b..c5dbe2bf20 100644 --- a/Source/Core/VideoCommon/PostProcessing.cpp +++ b/Source/Core/VideoCommon/PostProcessing.cpp @@ -544,6 +544,11 @@ float2 GetWindowResolution() return window_resolution.xy; } +float2 GetInvWindowResolution() +{ + return window_resolution.zw; +} + float2 GetResolution() { return resolution.xy; @@ -673,7 +678,8 @@ void PostProcessing::FillUniformBuffer(const MathUtil::Rectangle& src, {static_cast(src_tex->GetWidth()), static_cast(src_tex->GetHeight()), rcp_src_width, rcp_src_height}, {static_cast(window_rect.GetWidth()), static_cast(window_rect.GetHeight()), - 0.0f, 0.0f}, + 1.0f / static_cast(window_rect.GetWidth()), + 1.0f / static_cast(window_rect.GetHeight())}, {static_cast(src.left) * rcp_src_width, static_cast(src.top) * rcp_src_height, static_cast(src.GetWidth()) * rcp_src_width, static_cast(src.GetHeight()) * rcp_src_height},