From 2245052015c834ee69eddeea18222b54d469e20c Mon Sep 17 00:00:00 2001 From: nfp0 Date: Thu, 19 May 2022 20:58:27 +0100 Subject: [PATCH] handheld borders - removed unnecessary calculation --- handheld/console-border/shader-files/border-auto-scale.slang | 4 ++-- handheld/console-border/shader-files/gb-pass-5.slang | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/handheld/console-border/shader-files/border-auto-scale.slang b/handheld/console-border/shader-files/border-auto-scale.slang index b718fd2..d3e2e79 100644 --- a/handheld/console-border/shader-files/border-auto-scale.slang +++ b/handheld/console-border/shader-files/border-auto-scale.slang @@ -11,7 +11,7 @@ layout(push_constant) uniform Push #pragma parameter border_texture_scale "Border Scale" 4.0 1.0 20.0 0.005 vec2 middle = vec2(0.5, 0.5); -vec2 screen_scale = params.OutputSize.xy * params.SourceSize.zw; +vec2 screen_ratio = params.OutputSize.xy * params.SourceSize.zw; vec2 border_scale = vec2(3200, 1600) * (params.SourceSize.y / params.OriginalSize.y) / params.border_texture_scale; layout(std140, set = 0, binding = 0) uniform UBO @@ -30,7 +30,7 @@ void main() gl_Position = global.MVP * Position; vec2 diff = TexCoord.xy - middle; - vTexCoord = middle + diff * screen_scale; + vTexCoord = middle + diff * screen_ratio; tex_border = middle + diff * params.OutputSize.xy / border_scale; } diff --git a/handheld/console-border/shader-files/gb-pass-5.slang b/handheld/console-border/shader-files/gb-pass-5.slang index 619bbad..935ad29 100644 --- a/handheld/console-border/shader-files/gb-pass-5.slang +++ b/handheld/console-border/shader-files/gb-pass-5.slang @@ -13,7 +13,6 @@ layout(push_constant) uniform Push #pragma parameter border_texture_scale "Border Scale" 4.0 1.0 20.0 0.005 vec2 middle = vec2(0.5, 0.5); -vec2 screen_scale = params.OutputSize.xy * params.SourceSize.zw; vec2 border_scale = vec2(3200, 1600) * params.video_scale / params.border_texture_scale; layout(std140, set = 0, binding = 0) uniform UBO @@ -31,8 +30,9 @@ void main() { gl_Position = global.MVP * Position; + vTexCoord = TexCoord.xy; + vec2 diff = TexCoord.xy - middle; - vTexCoord = middle + diff * screen_scale; tex_border = middle + diff * params.OutputSize.xy / border_scale; }