handheld borders - removed unnecessary calculation

This commit is contained in:
nfp0 2022-05-19 20:58:27 +01:00
parent cb29629a2a
commit 2245052015
2 changed files with 4 additions and 4 deletions

View file

@ -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;
}

View file

@ -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;
}