From 315992f254114716574e55828a86f8918abd586e Mon Sep 17 00:00:00 2001 From: Filoppi Date: Mon, 18 Dec 2023 00:33:00 +0200 Subject: [PATCH] Fix sharp bilinear using ceil instead of floor --- Data/Sys/Shaders/default_pre_post_process.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/Sys/Shaders/default_pre_post_process.glsl b/Data/Sys/Shaders/default_pre_post_process.glsl index f6854d11fd..5df2de9986 100644 --- a/Data/Sys/Shaders/default_pre_post_process.glsl +++ b/Data/Sys/Shaders/default_pre_post_process.glsl @@ -173,7 +173,7 @@ float4 SharpBilinearSample(float3 uvw, float gamma) float2 texel = uvw.xy * source_size; float2 texel_floored = floor(texel); float2 s = fract(texel); - float scale = ceil(max(target_size.x * inverted_source_size.x, target_size.y * inverted_source_size.y)); + float scale = max(floor(max(target_size.x * inverted_source_size.x, target_size.y * inverted_source_size.y)), 1.f); float region_range = 0.5 - (0.5 / scale); // Figure out where in the texel to sample to get correct pre-scaled bilinear.