summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PostProcessing.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2021-07-05 16:30:54 -0400
committerGitHub <noreply@github.com>2021-07-05 16:30:54 -0400
commit6cc195e02f3398a56a6ff6b02f65bf23da7c0127 (patch)
tree1fa09b19731bcedc1a8325d8d2ccaf5fdd9d554e /Source/Core/VideoCommon/PostProcessing.cpp
parent4808241648b729e9640c19ffe9936a50e55c4fce (diff)
parentb3b1518f91f66a4c471ec41a1a40170c6795e847 (diff)
Merge pull request #9640 from v1993/patch-1
Allow post-processing shaders to query reciprocal of window resolution
Diffstat (limited to 'Source/Core/VideoCommon/PostProcessing.cpp')
-rw-r--r--Source/Core/VideoCommon/PostProcessing.cpp8
1 files changed, 7 insertions, 1 deletions
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<int>& src,
{static_cast<float>(src_tex->GetWidth()), static_cast<float>(src_tex->GetHeight()),
rcp_src_width, rcp_src_height},
{static_cast<float>(window_rect.GetWidth()), static_cast<float>(window_rect.GetHeight()),
- 0.0f, 0.0f},
+ 1.0f / static_cast<float>(window_rect.GetWidth()),
+ 1.0f / static_cast<float>(window_rect.GetHeight())},
{static_cast<float>(src.left) * rcp_src_width, static_cast<float>(src.top) * rcp_src_height,
static_cast<float>(src.GetWidth()) * rcp_src_width,
static_cast<float>(src.GetHeight()) * rcp_src_height},