Merge pull request #12434 from Filoppi/fix_sharp_bilinear

Fix sharp bilinear using ceil instead of floor
This commit is contained in:
Admiral H. Curtiss 2023-12-27 21:53:15 +01:00 committed by GitHub
commit 3ba333fd34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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.