Merge pull request #450 from fishcu/fishcu/fix-blur-fill-for-glcore

Fix bug with glcore driver of blur fill shader
This commit is contained in:
hizzlekizzle 2023-06-16 14:31:32 -05:00 committed by GitHub
commit 91a5ff8445
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -27,6 +27,7 @@
strength of the blur.
Changelog:
v1.1: Fix bug with glcore driver.
v1.0: Initial release.
*/

View file

@ -1,7 +1,7 @@
// See compose.slang for copyright and other information.
// clang-format off
#pragma parameter BLUR_FILL_SETTINGS "=== Blur fill v1.0 settings ===" 0.0 0.0 1.0 1.0
#pragma parameter BLUR_FILL_SETTINGS "=== Blur fill v1.1 settings ===" 0.0 0.0 1.0 1.0
#pragma parameter OS_CROP_TOP "Overscan crop top" 0.0 0.0 1024.0 1.0
#pragma parameter OS_CROP_BOTTOM "Overscan crop bottom" 0.0 0.0 1024.0 1.0
#pragma parameter OS_CROP_LEFT "Overscan crop left" 0.0 0.0 1024.0 1.0

View file

@ -43,12 +43,12 @@ layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 2) uniform sampler2D Input;
float min(vec4 i) { return min(min(i.x, i.y), min(i.z, i.w)); }
float min_of_vec4(vec4 i) { return min(min(i.x, i.y), min(i.z, i.w)); }
int argmin(vec4 i) {
const vec4 m = vec4(min(i));
const vec4 m = vec4(min_of_vec4(i));
const vec4 ma = step(i, m) * vec4(0.0, -1.0, -2.0, -3.0);
return -int(min(ma));
return -int(min_of_vec4(ma));
}
// Returns a coordinate in [0, w) when repeating that interval (and optionally