Mangle function names in GLSL.

This will be implemented in Metal and SPIR-V in followup CLs.

Change-Id: I397b4db40b15dd54cf1d8a17f414c3fe184b48d2
Bug: skia:10851
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387638
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
John Stiles 2021-03-22 11:43:11 -04:00 committed by Skia Commit-Bot
parent 70842aea4a
commit ece1d794b9
71 changed files with 836 additions and 615 deletions

View File

@ -257,6 +257,7 @@ sksl_shared_tests = [
"/sksl/intrinsics/Cos.sksl",
"/sksl/intrinsics/Cosh.sksl",
"/sksl/intrinsics/Cross.sksl",
"/sksl/intrinsics/CrossNoInline.sksl",
"/sksl/intrinsics/Degrees.sksl",
"/sksl/intrinsics/Determinant.sksl",
"/sksl/intrinsics/DFdx.sksl",

View File

@ -1 +1,6 @@
uniform half2 a, b; void main() { sk_FragColor.x = cross(a, b); }
uniform half2 ah, bh;
uniform float2 af, bf;
void main() {
sk_FragColor.x = cross(ah, bh);
sk_FragColor.y = half(cross(af, bf));
}

View File

@ -0,0 +1,8 @@
/*#pragma settings NoInline*/
uniform half2 ah, bh;
uniform float2 af, bf;
void main() {
sk_FragColor.x = cross(ah, bh);
sk_FragColor.y = half(cross(af, bf));
}

View File

@ -703,7 +703,7 @@ void GLSLCodeGenerator::writeFunctionCall(const FunctionCall& c) {
}
}
if (!nameWritten) {
this->write(function.name());
this->write(function.mangledName());
}
this->write("(");
const char* separator = "";
@ -997,7 +997,7 @@ void GLSLCodeGenerator::writeSetting(const Setting& s) {
void GLSLCodeGenerator::writeFunctionDeclaration(const FunctionDeclaration& f) {
this->writeTypePrecision(f.returnType());
this->writeType(f.returnType());
this->write(" " + f.name() + "(");
this->write(" " + f.mangledName() + "(");
const char* separator = "";
for (const auto& param : f.parameters()) {
this->write(separator);

View File

@ -61,10 +61,25 @@ public:
return fBuiltin;
}
String mangledName() const {
if ((this->isBuiltin() && !this->definition()) || this->name() == "main") {
// Builtins without a definition (like `sin` or `sqrt`) must use their real names.
return this->name();
}
// GLSL forbids two underscores in a row; add an extra character if necessary to avoid this.
const char* splitter = this->name().endsWith("_") ? "x_" : "_";
// Rename function to `funcname_returntypeparamtypes`.
String result = this->name() + splitter + this->returnType().abbreviatedName();
for (const Variable* p : this->parameters()) {
result += p->type().abbreviatedName();
}
return result;
}
String description() const override {
String result = this->returnType().displayName() + " " + this->name() + "(";
String separator;
for (auto p : this->parameters()) {
for (const Variable* p : this->parameters()) {
result += separator;
separator = ", ";
result += p->type().displayName();

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
vec3 _blend_set_color_luminance_h3h3hh3(vec3 hueSatColor, float alpha, vec3 lumColor) {
float lum = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
vec3 result = (lum - dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor)) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
@ -20,5 +20,5 @@ void main() {
float _0_alpha = dst.w * src.w;
vec3 _1_sda = src.xyz * dst.w;
vec3 _2_dsa = dst.xyz * src.w;
sk_FragColor = vec4((((_blend_set_color_luminance(_1_sda, _0_alpha, _2_dsa) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
sk_FragColor = vec4((((_blend_set_color_luminance_h3h3hh3(_1_sda, _0_alpha, _2_dsa) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _color_burn_component(vec2 s, vec2 d) {
float _color_burn_component_hh2h2(vec2 s, vec2 d) {
if (d.y == d.x) {
return (s.y * d.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
} else if (s.x == 0.0) {
@ -13,5 +13,5 @@ float _color_burn_component(vec2 s, vec2 d) {
}
}
void main() {
sk_FragColor = vec4(_color_burn_component(src.xw, dst.xw), _color_burn_component(src.yw, dst.yw), _color_burn_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = vec4(_color_burn_component_hh2h2(src.xw, dst.xw), _color_burn_component_hh2h2(src.yw, dst.yw), _color_burn_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _color_burn_component(vec2 s, vec2 d) {
float _color_burn_component_hh2h2(vec2 s, vec2 d) {
if (d.y == d.x) {
return (s.y * d.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
} else if (s.x == 0.0) {
@ -13,5 +13,5 @@ float _color_burn_component(vec2 s, vec2 d) {
}
}
void main() {
sk_FragColor = vec4(_color_burn_component(src.xw, dst.xw), _color_burn_component(src.yw, dst.yw), _color_burn_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = vec4(_color_burn_component_hh2h2(src.xw, dst.xw), _color_burn_component_hh2h2(src.yw, dst.yw), _color_burn_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _color_dodge_component(vec2 s, vec2 d) {
float _color_dodge_component_hh2h2(vec2 s, vec2 d) {
if (d.x == 0.0) {
return s.x * (1.0 - d.y);
} else {
@ -16,5 +16,5 @@ float _color_dodge_component(vec2 s, vec2 d) {
}
}
void main() {
sk_FragColor = vec4(_color_dodge_component(src.xw, dst.xw), _color_dodge_component(src.yw, dst.yw), _color_dodge_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = vec4(_color_dodge_component_hh2h2(src.xw, dst.xw), _color_dodge_component_hh2h2(src.yw, dst.yw), _color_dodge_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _color_dodge_component(vec2 s, vec2 d) {
float _color_dodge_component_hh2h2(vec2 s, vec2 d) {
if (d.x == 0.0) {
return s.x * (1.0 - d.y);
} else {
@ -16,5 +16,5 @@ float _color_dodge_component(vec2 s, vec2 d) {
}
}
void main() {
sk_FragColor = vec4(_color_dodge_component(src.xw, dst.xw), _color_dodge_component(src.yw, dst.yw), _color_dodge_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = vec4(_color_dodge_component_hh2h2(src.xw, dst.xw), _color_dodge_component_hh2h2(src.yw, dst.yw), _color_dodge_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
vec3 _blend_set_color_luminance_h3h3hh3(vec3 hueSatColor, float alpha, vec3 lumColor) {
float lum = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
vec3 result = (lum - dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor)) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
@ -20,5 +20,5 @@ void main() {
float _0_alpha = dst.w * src.w;
vec3 _1_sda = src.xyz * dst.w;
vec3 _2_dsa = dst.xyz * src.w;
sk_FragColor = vec4((((_blend_set_color_luminance(_1_sda, _0_alpha, _2_dsa) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
sk_FragColor = vec4((((_blend_set_color_luminance_h3h3hh3(_1_sda, _0_alpha, _2_dsa) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
}

View File

@ -2,15 +2,15 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _blend_overlay_component(vec2 s, vec2 d) {
float _blend_overlay_component_hh2h2(vec2 s, vec2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
vec4 blend_overlay(vec4 src, vec4 dst) {
vec4 result = vec4(_blend_overlay_component(src.xw, dst.xw), _blend_overlay_component(src.yw, dst.yw), _blend_overlay_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
vec4 blend_overlay_h4h4h4(vec4 src, vec4 dst) {
vec4 result = vec4(_blend_overlay_component_hh2h2(src.xw, dst.xw), _blend_overlay_component_hh2h2(src.yw, dst.yw), _blend_overlay_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
return result;
}
float _color_dodge_component(vec2 s, vec2 d) {
float _color_dodge_component_hh2h2(vec2 s, vec2 d) {
if (d.x == 0.0) {
return s.x * (1.0 - d.y);
} else {
@ -23,7 +23,7 @@ float _color_dodge_component(vec2 s, vec2 d) {
}
}
}
float _color_burn_component(vec2 s, vec2 d) {
float _color_burn_component_hh2h2(vec2 s, vec2 d) {
if (d.y == d.x) {
return (s.y * d.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
} else if (s.x == 0.0) {
@ -33,7 +33,7 @@ float _color_burn_component(vec2 s, vec2 d) {
return (delta * s.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
}
}
float _soft_light_component(vec2 s, vec2 d) {
float _soft_light_component_hh2h2(vec2 s, vec2 d) {
if (2.0 * s.x <= s.y) {
return (((d.x * d.x) * (s.y - 2.0 * s.x)) / d.y + (1.0 - d.y) * s.x) + d.x * ((-s.y + 2.0 * s.x) + 1.0);
} else if (4.0 * d.x <= d.y) {
@ -46,7 +46,7 @@ float _soft_light_component(vec2 s, vec2 d) {
return ((d.x * ((s.y - 2.0 * s.x) + 1.0) + s.x) - sqrt(d.y * d.x) * (s.y - 2.0 * s.x)) - d.y * s.x;
}
}
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
vec3 _blend_set_color_luminance_h3h3hh3(vec3 hueSatColor, float alpha, vec3 lumColor) {
float lum = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
vec3 result = (lum - dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor)) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
@ -60,32 +60,32 @@ vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
return result;
}
}
vec3 _blend_set_color_saturation_helper(vec3 minMidMax, float sat) {
vec3 _blend_set_color_saturation_helper_h3h3h(vec3 minMidMax, float sat) {
if (minMidMax.x < minMidMax.z) {
return vec3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat);
} else {
return vec3(0.0);
}
}
vec3 _blend_set_color_saturation(vec3 hueLumColor, vec3 satColor) {
vec3 _blend_set_color_saturation_h3h3h3(vec3 hueLumColor, vec3 satColor) {
float sat = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor, sat);
return _blend_set_color_saturation_helper_h3h3h(hueLumColor, sat);
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.xzy, sat).xzy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.xzy, sat).xzy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zxy, sat).yzx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zxy, sat).yzx;
}
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yxz, sat).yxz;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yxz, sat).yxz;
} else if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yzx, sat).zxy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yzx, sat).zxy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zyx, sat).zyx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zyx, sat).zyx;
}
}
vec4 blend(int mode, vec4 src, vec4 dst) {
vec4 blend_h4eh4h4(int mode, vec4 src, vec4 dst) {
switch (mode) {
case 0:
return vec4(0.0);
@ -118,7 +118,7 @@ vec4 blend(int mode, vec4 src, vec4 dst) {
case 14:
return src + (1.0 - src) * dst;
case 15:
return blend_overlay(src, dst);
return blend_overlay_h4h4h4(src, dst);
case 16:
vec4 _0_result = src + (1.0 - src.w) * dst;
_0_result.xyz = min(_0_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
@ -128,13 +128,13 @@ vec4 blend(int mode, vec4 src, vec4 dst) {
_1_result.xyz = max(_1_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
return _1_result;
case 18:
return vec4(_color_dodge_component(src.xw, dst.xw), _color_dodge_component(src.yw, dst.yw), _color_dodge_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
return vec4(_color_dodge_component_hh2h2(src.xw, dst.xw), _color_dodge_component_hh2h2(src.yw, dst.yw), _color_dodge_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
case 19:
return vec4(_color_burn_component(src.xw, dst.xw), _color_burn_component(src.yw, dst.yw), _color_burn_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
return vec4(_color_burn_component_hh2h2(src.xw, dst.xw), _color_burn_component_hh2h2(src.yw, dst.yw), _color_burn_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
case 20:
return blend_overlay(dst, src);
return blend_overlay_h4h4h4(dst, src);
case 21:
return dst.w == 0.0 ? src : vec4(_soft_light_component(src.xw, dst.xw), _soft_light_component(src.yw, dst.yw), _soft_light_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
return dst.w == 0.0 ? src : vec4(_soft_light_component_hh2h2(src.xw, dst.xw), _soft_light_component_hh2h2(src.yw, dst.yw), _soft_light_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
case 22:
return vec4((src.xyz + dst.xyz) - 2.0 * min(src.xyz * dst.w, dst.xyz * src.w), src.w + (1.0 - src.w) * dst.w);
case 23:
@ -145,26 +145,26 @@ vec4 blend(int mode, vec4 src, vec4 dst) {
float _2_alpha = dst.w * src.w;
vec3 _3_sda = src.xyz * dst.w;
vec3 _4_dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_blend_set_color_saturation(_3_sda, _4_dsa), _2_alpha, _4_dsa) + dst.xyz) - _4_dsa) + src.xyz) - _3_sda, (src.w + dst.w) - _2_alpha);
return vec4((((_blend_set_color_luminance_h3h3hh3(_blend_set_color_saturation_h3h3h3(_3_sda, _4_dsa), _2_alpha, _4_dsa) + dst.xyz) - _4_dsa) + src.xyz) - _3_sda, (src.w + dst.w) - _2_alpha);
case 26:
float _5_alpha = dst.w * src.w;
vec3 _6_sda = src.xyz * dst.w;
vec3 _7_dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_blend_set_color_saturation(_7_dsa, _6_sda), _5_alpha, _7_dsa) + dst.xyz) - _7_dsa) + src.xyz) - _6_sda, (src.w + dst.w) - _5_alpha);
return vec4((((_blend_set_color_luminance_h3h3hh3(_blend_set_color_saturation_h3h3h3(_7_dsa, _6_sda), _5_alpha, _7_dsa) + dst.xyz) - _7_dsa) + src.xyz) - _6_sda, (src.w + dst.w) - _5_alpha);
case 27:
float _8_alpha = dst.w * src.w;
vec3 _9_sda = src.xyz * dst.w;
vec3 _10_dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_9_sda, _8_alpha, _10_dsa) + dst.xyz) - _10_dsa) + src.xyz) - _9_sda, (src.w + dst.w) - _8_alpha);
return vec4((((_blend_set_color_luminance_h3h3hh3(_9_sda, _8_alpha, _10_dsa) + dst.xyz) - _10_dsa) + src.xyz) - _9_sda, (src.w + dst.w) - _8_alpha);
case 28:
float _11_alpha = dst.w * src.w;
vec3 _12_sda = src.xyz * dst.w;
vec3 _13_dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_13_dsa, _11_alpha, _12_sda) + dst.xyz) - _13_dsa) + src.xyz) - _12_sda, (src.w + dst.w) - _11_alpha);
return vec4((((_blend_set_color_luminance_h3h3hh3(_13_dsa, _11_alpha, _12_sda) + dst.xyz) - _13_dsa) + src.xyz) - _12_sda, (src.w + dst.w) - _11_alpha);
default:
return vec4(0.0);
}
}
void main() {
sk_FragColor = blend(13, src, dst);
sk_FragColor = blend_h4eh4h4(13, src, dst);
}

View File

@ -2,15 +2,15 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _blend_overlay_component(vec2 s, vec2 d) {
float _blend_overlay_component_hh2h2(vec2 s, vec2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
vec4 blend_overlay(vec4 src, vec4 dst) {
vec4 result = vec4(_blend_overlay_component(src.xw, dst.xw), _blend_overlay_component(src.yw, dst.yw), _blend_overlay_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
vec4 blend_overlay_h4h4h4(vec4 src, vec4 dst) {
vec4 result = vec4(_blend_overlay_component_hh2h2(src.xw, dst.xw), _blend_overlay_component_hh2h2(src.yw, dst.yw), _blend_overlay_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
return result;
}
float _color_dodge_component(vec2 s, vec2 d) {
float _color_dodge_component_hh2h2(vec2 s, vec2 d) {
if (d.x == 0.0) {
return s.x * (1.0 - d.y);
} else {
@ -23,7 +23,7 @@ float _color_dodge_component(vec2 s, vec2 d) {
}
}
}
float _color_burn_component(vec2 s, vec2 d) {
float _color_burn_component_hh2h2(vec2 s, vec2 d) {
if (d.y == d.x) {
return (s.y * d.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
} else if (s.x == 0.0) {
@ -33,7 +33,7 @@ float _color_burn_component(vec2 s, vec2 d) {
return (delta * s.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
}
}
float _soft_light_component(vec2 s, vec2 d) {
float _soft_light_component_hh2h2(vec2 s, vec2 d) {
if (2.0 * s.x <= s.y) {
return (((d.x * d.x) * (s.y - 2.0 * s.x)) / d.y + (1.0 - d.y) * s.x) + d.x * ((-s.y + 2.0 * s.x) + 1.0);
} else if (4.0 * d.x <= d.y) {
@ -46,7 +46,7 @@ float _soft_light_component(vec2 s, vec2 d) {
return ((d.x * ((s.y - 2.0 * s.x) + 1.0) + s.x) - sqrt(d.y * d.x) * (s.y - 2.0 * s.x)) - d.y * s.x;
}
}
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
vec3 _blend_set_color_luminance_h3h3hh3(vec3 hueSatColor, float alpha, vec3 lumColor) {
float lum = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
vec3 result = (lum - dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor)) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
@ -60,32 +60,32 @@ vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
return result;
}
}
vec3 _blend_set_color_saturation_helper(vec3 minMidMax, float sat) {
vec3 _blend_set_color_saturation_helper_h3h3h(vec3 minMidMax, float sat) {
if (minMidMax.x < minMidMax.z) {
return vec3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat);
} else {
return vec3(0.0);
}
}
vec3 _blend_set_color_saturation(vec3 hueLumColor, vec3 satColor) {
vec3 _blend_set_color_saturation_h3h3h3(vec3 hueLumColor, vec3 satColor) {
float sat = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor, sat);
return _blend_set_color_saturation_helper_h3h3h(hueLumColor, sat);
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.xzy, sat).xzy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.xzy, sat).xzy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zxy, sat).yzx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zxy, sat).yzx;
}
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yxz, sat).yxz;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yxz, sat).yxz;
} else if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yzx, sat).zxy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yzx, sat).zxy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zyx, sat).zyx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zyx, sat).zyx;
}
}
vec4 blend(int mode, vec4 src, vec4 dst) {
vec4 blend_h4eh4h4(int mode, vec4 src, vec4 dst) {
switch (mode) {
case 0:
return vec4(0.0);
@ -118,7 +118,7 @@ vec4 blend(int mode, vec4 src, vec4 dst) {
case 14:
return src + (1.0 - src) * dst;
case 15:
return blend_overlay(src, dst);
return blend_overlay_h4h4h4(src, dst);
case 16:
vec4 _0_result = src + (1.0 - src.w) * dst;
_0_result.xyz = min(_0_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
@ -128,13 +128,13 @@ vec4 blend(int mode, vec4 src, vec4 dst) {
_1_result.xyz = max(_1_result.xyz, (1.0 - dst.w) * src.xyz + dst.xyz);
return _1_result;
case 18:
return vec4(_color_dodge_component(src.xw, dst.xw), _color_dodge_component(src.yw, dst.yw), _color_dodge_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
return vec4(_color_dodge_component_hh2h2(src.xw, dst.xw), _color_dodge_component_hh2h2(src.yw, dst.yw), _color_dodge_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
case 19:
return vec4(_color_burn_component(src.xw, dst.xw), _color_burn_component(src.yw, dst.yw), _color_burn_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
return vec4(_color_burn_component_hh2h2(src.xw, dst.xw), _color_burn_component_hh2h2(src.yw, dst.yw), _color_burn_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
case 20:
return blend_overlay(dst, src);
return blend_overlay_h4h4h4(dst, src);
case 21:
return dst.w == 0.0 ? src : vec4(_soft_light_component(src.xw, dst.xw), _soft_light_component(src.yw, dst.yw), _soft_light_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
return dst.w == 0.0 ? src : vec4(_soft_light_component_hh2h2(src.xw, dst.xw), _soft_light_component_hh2h2(src.yw, dst.yw), _soft_light_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
case 22:
return vec4((src.xyz + dst.xyz) - 2.0 * min(src.xyz * dst.w, dst.xyz * src.w), src.w + (1.0 - src.w) * dst.w);
case 23:
@ -145,26 +145,26 @@ vec4 blend(int mode, vec4 src, vec4 dst) {
float _2_alpha = dst.w * src.w;
vec3 _3_sda = src.xyz * dst.w;
vec3 _4_dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_blend_set_color_saturation(_3_sda, _4_dsa), _2_alpha, _4_dsa) + dst.xyz) - _4_dsa) + src.xyz) - _3_sda, (src.w + dst.w) - _2_alpha);
return vec4((((_blend_set_color_luminance_h3h3hh3(_blend_set_color_saturation_h3h3h3(_3_sda, _4_dsa), _2_alpha, _4_dsa) + dst.xyz) - _4_dsa) + src.xyz) - _3_sda, (src.w + dst.w) - _2_alpha);
case 26:
float _5_alpha = dst.w * src.w;
vec3 _6_sda = src.xyz * dst.w;
vec3 _7_dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_blend_set_color_saturation(_7_dsa, _6_sda), _5_alpha, _7_dsa) + dst.xyz) - _7_dsa) + src.xyz) - _6_sda, (src.w + dst.w) - _5_alpha);
return vec4((((_blend_set_color_luminance_h3h3hh3(_blend_set_color_saturation_h3h3h3(_7_dsa, _6_sda), _5_alpha, _7_dsa) + dst.xyz) - _7_dsa) + src.xyz) - _6_sda, (src.w + dst.w) - _5_alpha);
case 27:
float _8_alpha = dst.w * src.w;
vec3 _9_sda = src.xyz * dst.w;
vec3 _10_dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_9_sda, _8_alpha, _10_dsa) + dst.xyz) - _10_dsa) + src.xyz) - _9_sda, (src.w + dst.w) - _8_alpha);
return vec4((((_blend_set_color_luminance_h3h3hh3(_9_sda, _8_alpha, _10_dsa) + dst.xyz) - _10_dsa) + src.xyz) - _9_sda, (src.w + dst.w) - _8_alpha);
case 28:
float _11_alpha = dst.w * src.w;
vec3 _12_sda = src.xyz * dst.w;
vec3 _13_dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_13_dsa, _11_alpha, _12_sda) + dst.xyz) - _13_dsa) + src.xyz) - _12_sda, (src.w + dst.w) - _11_alpha);
return vec4((((_blend_set_color_luminance_h3h3hh3(_13_dsa, _11_alpha, _12_sda) + dst.xyz) - _13_dsa) + src.xyz) - _12_sda, (src.w + dst.w) - _11_alpha);
default:
return vec4(0.0);
}
}
void main() {
sk_FragColor = blend(13, src, dst);
sk_FragColor = blend_h4eh4h4(13, src, dst);
}

View File

@ -2,14 +2,14 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _blend_overlay_component(vec2 s, vec2 d) {
float _blend_overlay_component_hh2h2(vec2 s, vec2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
vec4 blend_overlay(vec4 src, vec4 dst) {
vec4 result = vec4(_blend_overlay_component(src.xw, dst.xw), _blend_overlay_component(src.yw, dst.yw), _blend_overlay_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
vec4 blend_overlay_h4h4h4(vec4 src, vec4 dst) {
vec4 result = vec4(_blend_overlay_component_hh2h2(src.xw, dst.xw), _blend_overlay_component_hh2h2(src.yw, dst.yw), _blend_overlay_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
return result;
}
void main() {
sk_FragColor = blend_overlay(dst, src);
sk_FragColor = blend_overlay_h4h4h4(dst, src);
}

View File

@ -2,14 +2,14 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _blend_overlay_component(vec2 s, vec2 d) {
float _blend_overlay_component_hh2h2(vec2 s, vec2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
vec4 blend_overlay(vec4 src, vec4 dst) {
vec4 result = vec4(_blend_overlay_component(src.xw, dst.xw), _blend_overlay_component(src.yw, dst.yw), _blend_overlay_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
vec4 blend_overlay_h4h4h4(vec4 src, vec4 dst) {
vec4 result = vec4(_blend_overlay_component_hh2h2(src.xw, dst.xw), _blend_overlay_component_hh2h2(src.yw, dst.yw), _blend_overlay_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
return result;
}
void main() {
sk_FragColor = blend_overlay(dst, src);
sk_FragColor = blend_overlay_h4h4h4(dst, src);
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
vec3 _blend_set_color_luminance_h3h3hh3(vec3 hueSatColor, float alpha, vec3 lumColor) {
float lum = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
vec3 result = (lum - dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor)) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
@ -16,34 +16,34 @@ vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
return result;
}
}
vec3 _blend_set_color_saturation_helper(vec3 minMidMax, float sat) {
vec3 _blend_set_color_saturation_helper_h3h3h(vec3 minMidMax, float sat) {
if (minMidMax.x < minMidMax.z) {
return vec3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat);
} else {
return vec3(0.0);
}
}
vec3 _blend_set_color_saturation(vec3 hueLumColor, vec3 satColor) {
vec3 _blend_set_color_saturation_h3h3h3(vec3 hueLumColor, vec3 satColor) {
float sat = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor, sat);
return _blend_set_color_saturation_helper_h3h3h(hueLumColor, sat);
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.xzy, sat).xzy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.xzy, sat).xzy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zxy, sat).yzx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zxy, sat).yzx;
}
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yxz, sat).yxz;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yxz, sat).yxz;
} else if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yzx, sat).zxy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yzx, sat).zxy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zyx, sat).zyx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zyx, sat).zyx;
}
}
void main() {
float _0_alpha = dst.w * src.w;
vec3 _1_sda = src.xyz * dst.w;
vec3 _2_dsa = dst.xyz * src.w;
sk_FragColor = vec4((((_blend_set_color_luminance(_blend_set_color_saturation(_1_sda, _2_dsa), _0_alpha, _2_dsa) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
sk_FragColor = vec4((((_blend_set_color_luminance_h3h3hh3(_blend_set_color_saturation_h3h3h3(_1_sda, _2_dsa), _0_alpha, _2_dsa) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
vec3 _blend_set_color_luminance_h3h3hh3(vec3 hueSatColor, float alpha, vec3 lumColor) {
float lum = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
vec3 result = (lum - dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor)) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
@ -16,34 +16,34 @@ vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
return result;
}
}
vec3 _blend_set_color_saturation_helper(vec3 minMidMax, float sat) {
vec3 _blend_set_color_saturation_helper_h3h3h(vec3 minMidMax, float sat) {
if (minMidMax.x < minMidMax.z) {
return vec3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat);
} else {
return vec3(0.0);
}
}
vec3 _blend_set_color_saturation(vec3 hueLumColor, vec3 satColor) {
vec3 _blend_set_color_saturation_h3h3h3(vec3 hueLumColor, vec3 satColor) {
float sat = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor, sat);
return _blend_set_color_saturation_helper_h3h3h(hueLumColor, sat);
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.xzy, sat).xzy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.xzy, sat).xzy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zxy, sat).yzx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zxy, sat).yzx;
}
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yxz, sat).yxz;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yxz, sat).yxz;
} else if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yzx, sat).zxy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yzx, sat).zxy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zyx, sat).zyx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zyx, sat).zyx;
}
}
void main() {
float _0_alpha = dst.w * src.w;
vec3 _1_sda = src.xyz * dst.w;
vec3 _2_dsa = dst.xyz * src.w;
sk_FragColor = vec4((((_blend_set_color_luminance(_blend_set_color_saturation(_1_sda, _2_dsa), _0_alpha, _2_dsa) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
sk_FragColor = vec4((((_blend_set_color_luminance_h3h3hh3(_blend_set_color_saturation_h3h3h3(_1_sda, _2_dsa), _0_alpha, _2_dsa) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
vec3 _blend_set_color_luminance_h3h3hh3(vec3 hueSatColor, float alpha, vec3 lumColor) {
float lum = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
vec3 result = (lum - dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor)) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
@ -20,5 +20,5 @@ void main() {
float _0_alpha = dst.w * src.w;
vec3 _1_sda = src.xyz * dst.w;
vec3 _2_dsa = dst.xyz * src.w;
sk_FragColor = vec4((((_blend_set_color_luminance(_2_dsa, _0_alpha, _1_sda) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
sk_FragColor = vec4((((_blend_set_color_luminance_h3h3hh3(_2_dsa, _0_alpha, _1_sda) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
vec3 _blend_set_color_luminance_h3h3hh3(vec3 hueSatColor, float alpha, vec3 lumColor) {
float lum = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
vec3 result = (lum - dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor)) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
@ -20,5 +20,5 @@ void main() {
float _0_alpha = dst.w * src.w;
vec3 _1_sda = src.xyz * dst.w;
vec3 _2_dsa = dst.xyz * src.w;
sk_FragColor = vec4((((_blend_set_color_luminance(_2_dsa, _0_alpha, _1_sda) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
sk_FragColor = vec4((((_blend_set_color_luminance_h3h3hh3(_2_dsa, _0_alpha, _1_sda) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
}

View File

@ -2,11 +2,11 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _blend_overlay_component(vec2 s, vec2 d) {
float _blend_overlay_component_hh2h2(vec2 s, vec2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
void main() {
vec4 _0_result = vec4(_blend_overlay_component(src.xw, dst.xw), _blend_overlay_component(src.yw, dst.yw), _blend_overlay_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
vec4 _0_result = vec4(_blend_overlay_component_hh2h2(src.xw, dst.xw), _blend_overlay_component_hh2h2(src.yw, dst.yw), _blend_overlay_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
_0_result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
sk_FragColor = _0_result;
}

View File

@ -2,11 +2,11 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _blend_overlay_component(vec2 s, vec2 d) {
float _blend_overlay_component_hh2h2(vec2 s, vec2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
void main() {
vec4 _0_result = vec4(_blend_overlay_component(src.xw, dst.xw), _blend_overlay_component(src.yw, dst.yw), _blend_overlay_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
vec4 _0_result = vec4(_blend_overlay_component_hh2h2(src.xw, dst.xw), _blend_overlay_component_hh2h2(src.yw, dst.yw), _blend_overlay_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
_0_result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
sk_FragColor = _0_result;
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
vec3 _blend_set_color_luminance_h3h3hh3(vec3 hueSatColor, float alpha, vec3 lumColor) {
float lum = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
vec3 result = (lum - dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor)) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
@ -16,34 +16,34 @@ vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
return result;
}
}
vec3 _blend_set_color_saturation_helper(vec3 minMidMax, float sat) {
vec3 _blend_set_color_saturation_helper_h3h3h(vec3 minMidMax, float sat) {
if (minMidMax.x < minMidMax.z) {
return vec3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat);
} else {
return vec3(0.0);
}
}
vec3 _blend_set_color_saturation(vec3 hueLumColor, vec3 satColor) {
vec3 _blend_set_color_saturation_h3h3h3(vec3 hueLumColor, vec3 satColor) {
float sat = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor, sat);
return _blend_set_color_saturation_helper_h3h3h(hueLumColor, sat);
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.xzy, sat).xzy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.xzy, sat).xzy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zxy, sat).yzx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zxy, sat).yzx;
}
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yxz, sat).yxz;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yxz, sat).yxz;
} else if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yzx, sat).zxy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yzx, sat).zxy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zyx, sat).zyx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zyx, sat).zyx;
}
}
void main() {
float _0_alpha = dst.w * src.w;
vec3 _1_sda = src.xyz * dst.w;
vec3 _2_dsa = dst.xyz * src.w;
sk_FragColor = vec4((((_blend_set_color_luminance(_blend_set_color_saturation(_2_dsa, _1_sda), _0_alpha, _2_dsa) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
sk_FragColor = vec4((((_blend_set_color_luminance_h3h3hh3(_blend_set_color_saturation_h3h3h3(_2_dsa, _1_sda), _0_alpha, _2_dsa) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
vec3 _blend_set_color_luminance_h3h3hh3(vec3 hueSatColor, float alpha, vec3 lumColor) {
float lum = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
vec3 result = (lum - dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor)) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
@ -16,34 +16,34 @@ vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
return result;
}
}
vec3 _blend_set_color_saturation_helper(vec3 minMidMax, float sat) {
vec3 _blend_set_color_saturation_helper_h3h3h(vec3 minMidMax, float sat) {
if (minMidMax.x < minMidMax.z) {
return vec3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat);
} else {
return vec3(0.0);
}
}
vec3 _blend_set_color_saturation(vec3 hueLumColor, vec3 satColor) {
vec3 _blend_set_color_saturation_h3h3h3(vec3 hueLumColor, vec3 satColor) {
float sat = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor, sat);
return _blend_set_color_saturation_helper_h3h3h(hueLumColor, sat);
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.xzy, sat).xzy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.xzy, sat).xzy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zxy, sat).yzx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zxy, sat).yzx;
}
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yxz, sat).yxz;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yxz, sat).yxz;
} else if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yzx, sat).zxy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yzx, sat).zxy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zyx, sat).zyx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zyx, sat).zyx;
}
}
void main() {
float _0_alpha = dst.w * src.w;
vec3 _1_sda = src.xyz * dst.w;
vec3 _2_dsa = dst.xyz * src.w;
sk_FragColor = vec4((((_blend_set_color_luminance(_blend_set_color_saturation(_2_dsa, _1_sda), _0_alpha, _2_dsa) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
sk_FragColor = vec4((((_blend_set_color_luminance_h3h3hh3(_blend_set_color_saturation_h3h3h3(_2_dsa, _1_sda), _0_alpha, _2_dsa) + dst.xyz) - _2_dsa) + src.xyz) - _1_sda, (src.w + dst.w) - _0_alpha);
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _soft_light_component(vec2 s, vec2 d) {
float _soft_light_component_hh2h2(vec2 s, vec2 d) {
if (2.0 * s.x <= s.y) {
return (((d.x * d.x) * (s.y - 2.0 * s.x)) / d.y + (1.0 - d.y) * s.x) + d.x * ((-s.y + 2.0 * s.x) + 1.0);
} else if (4.0 * d.x <= d.y) {
@ -16,5 +16,5 @@ float _soft_light_component(vec2 s, vec2 d) {
}
}
void main() {
sk_FragColor = dst.w == 0.0 ? src : vec4(_soft_light_component(src.xw, dst.xw), _soft_light_component(src.yw, dst.yw), _soft_light_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = dst.w == 0.0 ? src : vec4(_soft_light_component_hh2h2(src.xw, dst.xw), _soft_light_component_hh2h2(src.yw, dst.yw), _soft_light_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _soft_light_component(vec2 s, vec2 d) {
float _soft_light_component_hh2h2(vec2 s, vec2 d) {
if (2.0 * s.x <= s.y) {
return (((d.x * d.x) * (s.y - 2.0 * s.x)) / d.y + (1.0 - d.y) * s.x) + d.x * ((-s.y + 2.0 * s.x) + 1.0);
} else if (4.0 * d.x <= d.y) {
@ -16,5 +16,5 @@ float _soft_light_component(vec2 s, vec2 d) {
}
}
void main() {
sk_FragColor = dst.w == 0.0 ? src : vec4(_soft_light_component(src.xw, dst.xw), _soft_light_component(src.yw, dst.yw), _soft_light_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = dst.w == 0.0 ? src : vec4(_soft_light_component_hh2h2(src.xw, dst.xw), _soft_light_component_hh2h2(src.yw, dst.yw), _soft_light_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}

View File

@ -1,5 +1,5 @@
void call_after_return() {
void call_after_return_v() {
return;
call_after_return();
call_after_return_v();
}

View File

@ -3,7 +3,7 @@ out vec4 sk_FragColor;
uniform vec4 colorRed;
uniform vec4 colorGreen;
uniform float unknownInput;
bool test_int() {
bool test_int_b() {
bool ok = true;
ivec4 x = ivec4(6, 6, 7, 8);
ok = ok && x == ivec4(6, 6, 7, 8);
@ -143,5 +143,5 @@ vec4 main() {
_1_x = _1_x + 1.0;
_1_x = _1_x - 1.0;
_0_ok = _0_ok && _1_x == vec4(_2_unknown);
return _0_ok && test_int() ? colorGreen : colorRed;
return _0_ok && test_int_b() ? colorGreen : colorRed;
}

View File

@ -3,7 +3,7 @@ out vec4 sk_FragColor;
uniform float unknownInput;
uniform vec4 colorRed;
uniform vec4 colorGreen;
bool test_int() {
bool test_int_b() {
int unknown = int(unknownInput);
bool ok = true;
ivec4 val = ivec4(unknown);
@ -33,5 +33,5 @@ vec4 main() {
_2_val = _2_val * vec4(2.0);
_2_val = _2_val / vec4(2.0);
_1_ok = _1_ok && _2_val == vec4(_0_unknown);
return _1_ok && test_int() ? colorGreen : colorRed;
return _1_ok && test_int_b() ? colorGreen : colorRed;
}

View File

@ -1,11 +1,11 @@
out vec4 sk_FragColor;
bool shouldLoop(vec4 v) {
bool shouldLoop_bh4(vec4 v) {
return v.x < 0.5;
}
void main() {
sk_FragColor = vec4(0.0);
do {
sk_FragColor += vec4(0.125);
} while (shouldLoop(sk_FragColor));
} while (shouldLoop_bh4(sk_FragColor));
}

View File

@ -1,10 +1,10 @@
out vec4 sk_FragColor;
vec4 helper();
vec4 helper_h4();
void main() {
sk_FragColor = helper();
sk_FragColor = helper_h4();
}
vec4 helper() {
vec4 helper_h4() {
int temp = 1;
switch (temp) {
case 0:

View File

@ -1,6 +1,6 @@
out vec4 sk_FragColor;
void fn6() {
void fn6_v() {
sk_FragColor.x = 0.0;
sk_FragColor.x = 0.0;
sk_FragColor.x = 0.0;
@ -248,7 +248,7 @@ void fn6() {
sk_FragColor.x = 0.0;
false;
}
void fn7() {
void fn7_v() {
sk_FragColor.x = 0.0;
sk_FragColor.x = 0.0;
sk_FragColor.x = 0.0;
@ -493,89 +493,89 @@ void fn7() {
sk_FragColor.x = 0.0;
sk_FragColor.x = 0.0;
false;
fn6();
fn6();
fn6_v();
fn6_v();
}
void fn8() {
fn7();
fn7();
fn7();
void fn8_v() {
fn7_v();
fn7_v();
fn7_v();
}
void fn9() {
fn8();
fn8();
fn8();
void fn9_v() {
fn8_v();
fn8_v();
fn8_v();
}
void fnA() {
fn9();
fn9();
fn9();
void fnA_v() {
fn9_v();
fn9_v();
fn9_v();
}
void fnB() {
fnA();
fnA();
fnA();
void fnB_v() {
fnA_v();
fnA_v();
fnA_v();
}
void fnC() {
fnB();
fnB();
fnB();
void fnC_v() {
fnB_v();
fnB_v();
fnB_v();
}
void fnD() {
fnC();
fnC();
fnC();
void fnD_v() {
fnC_v();
fnC_v();
fnC_v();
}
void fnE() {
fnD();
fnD();
fnD();
void fnE_v() {
fnD_v();
fnD_v();
fnD_v();
}
void fnF() {
fnE();
fnE();
fnE();
void fnF_v() {
fnE_v();
fnE_v();
fnE_v();
}
void fnG() {
fnF();
fnF();
fnF();
void fnG_v() {
fnF_v();
fnF_v();
fnF_v();
}
void fnH() {
fnG();
fnG();
fnG();
void fnH_v() {
fnG_v();
fnG_v();
fnG_v();
}
void fnI() {
fnH();
fnH();
fnH();
void fnI_v() {
fnH_v();
fnH_v();
fnH_v();
}
void fnJ() {
fnI();
fnI();
fnI();
void fnJ_v() {
fnI_v();
fnI_v();
fnI_v();
}
void fnK() {
fnJ();
fnJ();
fnJ();
void fnK_v() {
fnJ_v();
fnJ_v();
fnJ_v();
}
void fnL() {
fnK();
fnK();
fnK();
void fnL_v() {
fnK_v();
fnK_v();
fnK_v();
}
void fnM() {
fnL();
fnL();
fnL();
void fnM_v() {
fnL_v();
fnL_v();
fnL_v();
}
void fnN() {
fnM();
fnM();
fnM();
void fnN_v() {
fnM_v();
fnM_v();
fnM_v();
}
void main() {
fnN();
fnN_v();
}

View File

@ -1,6 +1,6 @@
out vec4 sk_FragColor;
void fn6() {
void fn6_v() {
sk_FragColor.x = 0.0;
sk_FragColor.x = 0.0;
sk_FragColor.x = 0.0;
@ -248,7 +248,7 @@ void fn6() {
sk_FragColor.x = 0.0;
false;
}
void fn7() {
void fn7_v() {
sk_FragColor.x = 0.0;
sk_FragColor.x = 0.0;
sk_FragColor.x = 0.0;
@ -493,89 +493,89 @@ void fn7() {
sk_FragColor.x = 0.0;
sk_FragColor.x = 0.0;
false;
fn6();
fn6();
fn6_v();
fn6_v();
}
void fn8() {
fn7();
fn7();
fn7();
void fn8_v() {
fn7_v();
fn7_v();
fn7_v();
}
void fn9() {
fn8();
fn8();
fn8();
void fn9_v() {
fn8_v();
fn8_v();
fn8_v();
}
void fnA() {
fn9();
fn9();
fn9();
void fnA_v() {
fn9_v();
fn9_v();
fn9_v();
}
void fnB() {
fnA();
fnA();
fnA();
void fnB_v() {
fnA_v();
fnA_v();
fnA_v();
}
void fnC() {
fnB();
fnB();
fnB();
void fnC_v() {
fnB_v();
fnB_v();
fnB_v();
}
void fnD() {
fnC();
fnC();
fnC();
void fnD_v() {
fnC_v();
fnC_v();
fnC_v();
}
void fnE() {
fnD();
fnD();
fnD();
void fnE_v() {
fnD_v();
fnD_v();
fnD_v();
}
void fnF() {
fnE();
fnE();
fnE();
void fnF_v() {
fnE_v();
fnE_v();
fnE_v();
}
void fnG() {
fnF();
fnF();
fnF();
void fnG_v() {
fnF_v();
fnF_v();
fnF_v();
}
void fnH() {
fnG();
fnG();
fnG();
void fnH_v() {
fnG_v();
fnG_v();
fnG_v();
}
void fnI() {
fnH();
fnH();
fnH();
void fnI_v() {
fnH_v();
fnH_v();
fnH_v();
}
void fnJ() {
fnI();
fnI();
fnI();
void fnJ_v() {
fnI_v();
fnI_v();
fnI_v();
}
void fnK() {
fnJ();
fnJ();
fnJ();
void fnK_v() {
fnJ_v();
fnJ_v();
fnJ_v();
}
void fnL() {
fnK();
fnK();
fnK();
void fnL_v() {
fnK_v();
fnK_v();
fnK_v();
}
void fnM() {
fnL();
fnL();
fnL();
void fnM_v() {
fnL_v();
fnL_v();
fnL_v();
}
void fnN() {
fnM();
fnM();
fnM();
void fnN_v() {
fnM_v();
fnM_v();
fnM_v();
}
void main() {
fnN();
fnN_v();
}

View File

@ -1,12 +1,12 @@
out vec4 sk_FragColor;
bool shouldLoop(vec4 v) {
bool shouldLoop_bh4(vec4 v) {
return v.x < 0.5;
}
vec4 grow(vec4 v) {
vec4 grow_h4h4(vec4 v) {
return v + vec4(0.125);
}
void main() {
for (sk_FragColor = vec4(0.0625);shouldLoop(sk_FragColor); sk_FragColor = grow(sk_FragColor)) {
for (sk_FragColor = vec4(0.0625);shouldLoop_bh4(sk_FragColor); sk_FragColor = grow_h4h4(sk_FragColor)) {
}
}

View File

@ -1,12 +1,12 @@
out vec4 sk_FragColor;
uniform int value;
vec4 loopy(int v) {
vec4 loopy_h4i(int v) {
for (int x = 0;x < 5; ++x) {
if (x == v) return vec4(0.5);
}
return vec4(1.0);
}
void main() {
sk_FragColor = loopy(value);
sk_FragColor = loopy_h4i(value);
}

View File

@ -1,5 +1,5 @@
void tooBig(inout int x) {
void tooBig_vi(inout int x) {
++x;
++x;
++x;
@ -37,6 +37,6 @@ void tooBig(inout int x) {
}
void main() {
int x = 0;
tooBig(x);
tooBig(x);
tooBig_vi(x);
tooBig_vi(x);
}

View File

@ -1,10 +1,10 @@
out vec4 sk_FragColor;
void outParameter(inout float x) {
void outParameter_vh(inout float x) {
x *= 2.0;
}
void main() {
float x = 1.0;
outParameter(x);
outParameter_vh(x);
sk_FragColor.x = x;
}

View File

@ -1,13 +1,13 @@
out vec4 sk_FragColor;
uniform vec4 color;
vec4 blend_src_in(vec4 src, vec4 dst) {
vec4 blend_src_in_h4h4h4(vec4 src, vec4 dst) {
return src * dst.w;
}
vec4 blend_dst_in(vec4 src, vec4 dst) {
vec4 blend_dst_in_h4h4h4(vec4 src, vec4 dst) {
return dst * src.w;
}
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
vec3 _blend_set_color_luminance_h3h3hh3(vec3 hueSatColor, float alpha, vec3 lumColor) {
float lum = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
vec3 result = (lum - dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor)) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
@ -21,55 +21,55 @@ vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
return result;
}
}
vec3 _blend_set_color_saturation_helper(vec3 minMidMax, float sat) {
vec3 _blend_set_color_saturation_helper_h3h3h(vec3 minMidMax, float sat) {
if (minMidMax.x < minMidMax.z) {
return vec3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat);
} else {
return vec3(0.0);
}
}
vec3 _blend_set_color_saturation(vec3 hueLumColor, vec3 satColor) {
vec3 _blend_set_color_saturation_h3h3h3(vec3 hueLumColor, vec3 satColor) {
float sat = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor, sat);
return _blend_set_color_saturation_helper_h3h3h(hueLumColor, sat);
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.xzy, sat).xzy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.xzy, sat).xzy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zxy, sat).yzx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zxy, sat).yzx;
}
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yxz, sat).yxz;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yxz, sat).yxz;
} else if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yzx, sat).zxy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yzx, sat).zxy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zyx, sat).zyx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zyx, sat).zyx;
}
}
vec4 blend_hue(vec4 src, vec4 dst) {
vec4 blend_hue_h4h4h4(vec4 src, vec4 dst) {
float alpha = dst.w * src.w;
vec3 sda = src.xyz * dst.w;
vec3 dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_blend_set_color_saturation(sda, dsa), alpha, dsa) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
return vec4((((_blend_set_color_luminance_h3h3hh3(_blend_set_color_saturation_h3h3h3(sda, dsa), alpha, dsa) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
float singleuse() {
float singleuse_h() {
return 1.25;
}
float add(float a, float b) {
float add_hhh(float a, float b) {
float c = a + b;
return c;
}
float mul(float a, float b) {
float mul_hhh(float a, float b) {
return a * b;
}
float fma(float a, float b, float c) {
return add(mul(a, b), c);
float fma_hhhh(float a, float b, float c) {
return add_hhh(mul_hhh(a, b), c);
}
void main() {
sk_FragColor = vec4(fma(color.x, color.y, color.z));
sk_FragColor *= singleuse();
sk_FragColor *= blend_src_in(color.xxyy, color.zzww);
sk_FragColor *= blend_dst_in(color.xxyy, color.zzww);
sk_FragColor *= blend_hue(color, color.wwww);
sk_FragColor *= blend_hue(color, color.wzyx);
sk_FragColor = vec4(fma_hhhh(color.x, color.y, color.z));
sk_FragColor *= singleuse_h();
sk_FragColor *= blend_src_in_h4h4h4(color.xxyy, color.zzww);
sk_FragColor *= blend_dst_in_h4h4h4(color.xxyy, color.zzww);
sk_FragColor *= blend_hue_h4h4h4(color, color.wwww);
sk_FragColor *= blend_hue_h4h4h4(color, color.wzyx);
}

View File

@ -1,7 +1,7 @@
out vec4 sk_FragColor;
uniform vec4 color;
vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
vec3 _blend_set_color_luminance_h3h3hh3(vec3 hueSatColor, float alpha, vec3 lumColor) {
float lum = dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), lumColor);
vec3 result = (lum - dot(vec3(0.30000001192092896, 0.5899999737739563, 0.10999999940395355), hueSatColor)) + hueSatColor;
float minComp = min(min(result.x, result.y), result.z);
@ -15,36 +15,36 @@ vec3 _blend_set_color_luminance(vec3 hueSatColor, float alpha, vec3 lumColor) {
return result;
}
}
vec3 _blend_set_color_saturation_helper(vec3 minMidMax, float sat) {
vec3 _blend_set_color_saturation_helper_h3h3h(vec3 minMidMax, float sat) {
if (minMidMax.x < minMidMax.z) {
return vec3(0.0, (sat * (minMidMax.y - minMidMax.x)) / (minMidMax.z - minMidMax.x), sat);
} else {
return vec3(0.0);
}
}
vec3 _blend_set_color_saturation(vec3 hueLumColor, vec3 satColor) {
vec3 _blend_set_color_saturation_h3h3h3(vec3 hueLumColor, vec3 satColor) {
float sat = max(max(satColor.x, satColor.y), satColor.z) - min(min(satColor.x, satColor.y), satColor.z);
if (hueLumColor.x <= hueLumColor.y) {
if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor, sat);
return _blend_set_color_saturation_helper_h3h3h(hueLumColor, sat);
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.xzy, sat).xzy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.xzy, sat).xzy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zxy, sat).yzx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zxy, sat).yzx;
}
} else if (hueLumColor.x <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yxz, sat).yxz;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yxz, sat).yxz;
} else if (hueLumColor.y <= hueLumColor.z) {
return _blend_set_color_saturation_helper(hueLumColor.yzx, sat).zxy;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.yzx, sat).zxy;
} else {
return _blend_set_color_saturation_helper(hueLumColor.zyx, sat).zyx;
return _blend_set_color_saturation_helper_h3h3h(hueLumColor.zyx, sat).zyx;
}
}
vec4 blend_hue(vec4 src, vec4 dst) {
vec4 blend_hue_h4h4h4(vec4 src, vec4 dst) {
float alpha = dst.w * src.w;
vec3 sda = src.xyz * dst.w;
vec3 dsa = dst.xyz * src.w;
return vec4((((_blend_set_color_luminance(_blend_set_color_saturation(sda, dsa), alpha, dsa) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
return vec4((((_blend_set_color_luminance_h3h3hh3(_blend_set_color_saturation_h3h3h3(sda, dsa), alpha, dsa) + dst.xyz) - dsa) + src.xyz) - sda, (src.w + dst.w) - alpha);
}
void main() {
float _1_c = color.x * color.y + color.z;
@ -52,6 +52,6 @@ void main() {
sk_FragColor *= 1.25;
sk_FragColor *= color.xxyy * color.w;
sk_FragColor *= color.zzww * color.y;
sk_FragColor *= blend_hue(color, color.wwww);
sk_FragColor *= blend_hue(color, color.wzyx);
sk_FragColor *= blend_hue_h4h4h4(color, color.wwww);
sk_FragColor *= blend_hue_h4h4h4(color, color.wzyx);
}

View File

@ -2,12 +2,12 @@
out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
bool out_params_are_distinct(out float x, out float y) {
bool out_params_are_distinct_bhh(out float x, out float y) {
x = 1.0;
y = 2.0;
return x == 1.0 && y == 2.0;
}
vec4 main() {
float x = 0.0;
return out_params_are_distinct(x, x) ? colorGreen : colorRed;
return out_params_are_distinct_bhh(x, x) ? colorGreen : colorRed;
}

View File

@ -1,20 +1,20 @@
out vec4 sk_FragColor;
uniform vec4 color;
float singleuse() {
float singleuse_h() {
return 1.25;
}
float add(float a, float b) {
float add_hhh(float a, float b) {
float c = a + b;
return c;
}
float mul(float a, float b) {
float mul_hhh(float a, float b) {
return a * b;
}
float fma(float a, float b, float c) {
return add(mul(a, b), c);
float fma_hhhh(float a, float b, float c) {
return add_hhh(mul_hhh(a, b), c);
}
void main() {
sk_FragColor = vec4(fma(color.x, color.y, color.z));
sk_FragColor *= singleuse();
sk_FragColor = vec4(fma_hhhh(color.x, color.y, color.z));
sk_FragColor *= singleuse_h();
}

View File

@ -1,18 +1,18 @@
out vec4 sk_FragColor;
uniform vec4 color;
bool testA(vec4 v) {
bool testA_bh4(vec4 v) {
return v.x <= 0.5;
}
bool testB(vec4 v) {
bool testB_bh4(vec4 v) {
return v.x > 0.5;
}
void main() {
sk_FragColor = vec4(0.0);
if (color.x <= 0.5 && testB(color)) {
if (color.x <= 0.5 && testB_bh4(color)) {
sk_FragColor = vec4(0.5);
}
if (color.x > 0.5 || testA(color)) {
if (color.x > 0.5 || testA_bh4(color)) {
sk_FragColor = vec4(1.0);
}
}

View File

@ -2,13 +2,13 @@
out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
float get() {
float get_f() {
{
return abs(2.0);
}
return abs(5.0);
}
vec4 main() {
float result = get();
float result = get_f();
return result == 2.0 ? colorGreen : colorRed;
}

View File

@ -1,6 +1,6 @@
out vec4 sk_FragColor;
vec4 helper();
vec4 helper_h4();
struct Color {
float red;
float green;

View File

@ -2,15 +2,15 @@
out vec4 sk_FragColor;
uniform vec4 color;
float count = 0.0;
vec4 trueSide(vec4 v) {
vec4 trueSide_h4h4(vec4 v) {
count += 1.0;
return vec4(sin(v.x), sin(v.y), sin(v.z), sin(v.w));
}
vec4 falseSide(vec4 v) {
vec4 falseSide_h4h4(vec4 v) {
count += 1.0;
return vec4(cos(v.y), cos(v.z), cos(v.w), cos(v.z));
}
void main() {
sk_FragColor = color.x <= 0.5 ? trueSide(color) : falseSide(color);
sk_FragColor = color.x <= 0.5 ? trueSide_h4h4(color) : falseSide_h4h4(color);
sk_FragColor *= count;
}

View File

@ -1,11 +1,11 @@
out vec4 sk_FragColor;
bool shouldLoop(vec4 v) {
bool shouldLoop_bh4(vec4 v) {
return v.x < 0.5;
}
void main() {
sk_FragColor = vec4(0.0);
while (shouldLoop(sk_FragColor)) {
while (shouldLoop_bh4(sk_FragColor)) {
sk_FragColor += vec4(0.125);
}
}

View File

@ -6,8 +6,10 @@ OpExecutionMode %main OriginUpperLeft
OpName %sk_FragColor "sk_FragColor"
OpName %sk_Clockwise "sk_Clockwise"
OpName %_UniformBuffer "_UniformBuffer"
OpMemberName %_UniformBuffer 0 "a"
OpMemberName %_UniformBuffer 1 "b"
OpMemberName %_UniformBuffer 0 "ah"
OpMemberName %_UniformBuffer 1 "bh"
OpMemberName %_UniformBuffer 2 "af"
OpMemberName %_UniformBuffer 3 "bf"
OpName %main "main"
OpDecorate %sk_FragColor RelaxedPrecision
OpDecorate %sk_FragColor Location 0
@ -17,6 +19,8 @@ OpMemberDecorate %_UniformBuffer 0 Offset 0
OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
OpMemberDecorate %_UniformBuffer 1 Offset 8
OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
OpMemberDecorate %_UniformBuffer 2 Offset 16
OpMemberDecorate %_UniformBuffer 3 Offset 24
OpDecorate %_UniformBuffer Block
OpDecorate %10 Binding 0
OpDecorate %10 DescriptorSet 0
@ -35,7 +39,7 @@ OpDecorate %35 RelaxedPrecision
%_ptr_Input_bool = OpTypePointer Input %bool
%sk_Clockwise = OpVariable %_ptr_Input_bool Input
%v2float = OpTypeVector %float 2
%_UniformBuffer = OpTypeStruct %v2float %v2float
%_UniformBuffer = OpTypeStruct %v2float %v2float %v2float %v2float
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%10 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%void = OpTypeVoid
@ -45,6 +49,8 @@ OpDecorate %35 RelaxedPrecision
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%_ptr_Output_float = OpTypePointer Output %float
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%main = OpFunction %void None %15
%16 = OpLabel
%17 = OpAccessChain %_ptr_Uniform_v2float %10 %int_0
@ -64,5 +70,22 @@ OpDecorate %35 RelaxedPrecision
%35 = OpFSub %float %27 %34
%36 = OpAccessChain %_ptr_Output_float %sk_FragColor %int_0
OpStore %36 %35
%38 = OpAccessChain %_ptr_Uniform_v2float %10 %int_2
%40 = OpLoad %v2float %38
%41 = OpCompositeExtract %float %40 0
%42 = OpAccessChain %_ptr_Uniform_v2float %10 %int_3
%44 = OpLoad %v2float %42
%45 = OpCompositeExtract %float %44 1
%46 = OpFMul %float %41 %45
%47 = OpAccessChain %_ptr_Uniform_v2float %10 %int_2
%48 = OpLoad %v2float %47
%49 = OpCompositeExtract %float %48 1
%50 = OpAccessChain %_ptr_Uniform_v2float %10 %int_3
%51 = OpLoad %v2float %50
%52 = OpCompositeExtract %float %51 0
%53 = OpFMul %float %49 %52
%54 = OpFSub %float %46 %53
%55 = OpAccessChain %_ptr_Output_float %sk_FragColor %int_1
OpStore %55 %54
OpReturn
OpFunctionEnd

View File

@ -1,7 +1,10 @@
out vec4 sk_FragColor;
uniform vec2 a;
uniform vec2 b;
uniform vec2 ah;
uniform vec2 bh;
uniform vec2 af;
uniform vec2 bf;
void main() {
sk_FragColor.x = a.x * b.y - a.y * b.x;
sk_FragColor.x = ah.x * bh.y - ah.y * bh.x;
sk_FragColor.y = af.x * bf.y - af.y * bf.x;
}

View File

@ -2,8 +2,10 @@
#include <simd/simd.h>
using namespace metal;
struct Uniforms {
float2 a;
float2 b;
float2 ah;
float2 bh;
float2 af;
float2 bf;
};
struct Inputs {
};
@ -14,6 +16,7 @@ struct Outputs {
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _out;
(void)_out;
_out.sk_FragColor.x = _uniforms.a.x * _uniforms.b.y - _uniforms.a.y * _uniforms.b.x;
_out.sk_FragColor.x = _uniforms.ah.x * _uniforms.bh.y - _uniforms.ah.y * _uniforms.bh.x;
_out.sk_FragColor.y = _uniforms.af.x * _uniforms.bf.y - _uniforms.af.y * _uniforms.bf.x;
return _out;
}

View File

@ -0,0 +1,119 @@
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %sk_FragColor %sk_Clockwise
OpExecutionMode %main OriginUpperLeft
OpName %sk_FragColor "sk_FragColor"
OpName %sk_Clockwise "sk_Clockwise"
OpName %_UniformBuffer "_UniformBuffer"
OpMemberName %_UniformBuffer 0 "ah"
OpMemberName %_UniformBuffer 1 "bh"
OpMemberName %_UniformBuffer 2 "af"
OpMemberName %_UniformBuffer 3 "bf"
OpName %cross "cross"
OpName %cross_0 "cross"
OpName %main "main"
OpDecorate %sk_FragColor RelaxedPrecision
OpDecorate %sk_FragColor Location 0
OpDecorate %sk_FragColor Index 0
OpDecorate %sk_Clockwise BuiltIn FrontFacing
OpMemberDecorate %_UniformBuffer 0 Offset 0
OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
OpMemberDecorate %_UniformBuffer 1 Offset 8
OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
OpMemberDecorate %_UniformBuffer 2 Offset 16
OpMemberDecorate %_UniformBuffer 3 Offset 24
OpDecorate %_UniformBuffer Block
OpDecorate %12 Binding 0
OpDecorate %12 DescriptorSet 0
OpDecorate %21 RelaxedPrecision
OpDecorate %23 RelaxedPrecision
OpDecorate %25 RelaxedPrecision
OpDecorate %26 RelaxedPrecision
OpDecorate %28 RelaxedPrecision
OpDecorate %30 RelaxedPrecision
OpDecorate %31 RelaxedPrecision
OpDecorate %53 RelaxedPrecision
OpDecorate %57 RelaxedPrecision
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%sk_FragColor = OpVariable %_ptr_Output_v4float Output
%bool = OpTypeBool
%_ptr_Input_bool = OpTypePointer Input %bool
%sk_Clockwise = OpVariable %_ptr_Input_bool Input
%v2float = OpTypeVector %float 2
%_UniformBuffer = OpTypeStruct %v2float %v2float %v2float %v2float
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%12 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%_ptr_Function_v2float = OpTypePointer Function %v2float
%16 = OpTypeFunction %float %_ptr_Function_v2float %_ptr_Function_v2float
%void = OpTypeVoid
%47 = OpTypeFunction %void
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%_ptr_Output_float = OpTypePointer Output %float
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%cross = OpFunction %float None %16
%18 = OpFunctionParameter %_ptr_Function_v2float
%19 = OpFunctionParameter %_ptr_Function_v2float
%20 = OpLabel
%21 = OpLoad %v2float %18
%22 = OpCompositeExtract %float %21 0
%23 = OpLoad %v2float %19
%24 = OpCompositeExtract %float %23 1
%25 = OpFMul %float %22 %24
%26 = OpLoad %v2float %18
%27 = OpCompositeExtract %float %26 1
%28 = OpLoad %v2float %19
%29 = OpCompositeExtract %float %28 0
%30 = OpFMul %float %27 %29
%31 = OpFSub %float %25 %30
OpReturnValue %31
OpFunctionEnd
%cross_0 = OpFunction %float None %16
%32 = OpFunctionParameter %_ptr_Function_v2float
%33 = OpFunctionParameter %_ptr_Function_v2float
%34 = OpLabel
%35 = OpLoad %v2float %32
%36 = OpCompositeExtract %float %35 0
%37 = OpLoad %v2float %33
%38 = OpCompositeExtract %float %37 1
%39 = OpFMul %float %36 %38
%40 = OpLoad %v2float %32
%41 = OpCompositeExtract %float %40 1
%42 = OpLoad %v2float %33
%43 = OpCompositeExtract %float %42 0
%44 = OpFMul %float %41 %43
%45 = OpFSub %float %39 %44
OpReturnValue %45
OpFunctionEnd
%main = OpFunction %void None %47
%48 = OpLabel
%54 = OpVariable %_ptr_Function_v2float Function
%58 = OpVariable %_ptr_Function_v2float Function
%65 = OpVariable %_ptr_Function_v2float Function
%69 = OpVariable %_ptr_Function_v2float Function
%49 = OpAccessChain %_ptr_Uniform_v2float %12 %int_0
%53 = OpLoad %v2float %49
OpStore %54 %53
%55 = OpAccessChain %_ptr_Uniform_v2float %12 %int_1
%57 = OpLoad %v2float %55
OpStore %58 %57
%59 = OpFunctionCall %float %cross %54 %58
%60 = OpAccessChain %_ptr_Output_float %sk_FragColor %int_0
OpStore %60 %59
%62 = OpAccessChain %_ptr_Uniform_v2float %12 %int_2
%64 = OpLoad %v2float %62
OpStore %65 %64
%66 = OpAccessChain %_ptr_Uniform_v2float %12 %int_3
%68 = OpLoad %v2float %66
OpStore %69 %68
%70 = OpFunctionCall %float %cross_0 %65 %69
%71 = OpAccessChain %_ptr_Output_float %sk_FragColor %int_1
OpStore %71 %70
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,16 @@
out vec4 sk_FragColor;
uniform vec2 ah;
uniform vec2 bh;
uniform vec2 af;
uniform vec2 bf;
float cross_hh2h2(vec2 a, vec2 b) {
return a.x * b.y - a.y * b.x;
}
float cross_ff2f2(vec2 a, vec2 b) {
return a.x * b.y - a.y * b.x;
}
void main() {
sk_FragColor.x = cross_hh2h2(ah, bh);
sk_FragColor.y = cross_ff2f2(af, bf);
}

View File

@ -0,0 +1,28 @@
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct Uniforms {
float2 ah;
float2 bh;
float2 af;
float2 bf;
};
struct Inputs {
};
struct Outputs {
float4 sk_FragColor [[color(0)]];
};
float cross(float2 a, float2 b) {
return a.x * b.y - a.y * b.x;
}
float cross(float2 a, float2 b) {
return a.x * b.y - a.y * b.x;
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _out;
(void)_out;
_out.sk_FragColor.x = cross(_uniforms.ah, _uniforms.bh);
_out.sk_FragColor.y = cross(_uniforms.af, _uniforms.bf);
return _out;
}

View File

@ -4,7 +4,7 @@ uniform vec4 colorRed;
uniform vec4 colorGreen;
uniform vec4 colorWhite;
uniform vec4 colorBlack;
void setToColorBlack(out vec4 x) {
void setToColorBlack_vh4(out vec4 x) {
x = colorBlack;
}
vec4 main() {
@ -13,7 +13,7 @@ vec4 main() {
vec4 c;
vec4 d;
(b = colorRed , c = colorGreen);
a = (setToColorBlack(d) , colorWhite);
a = (setToColorBlack_vh4(d) , colorWhite);
a *= a;
b *= b;
c *= c;

View File

@ -2,20 +2,20 @@
out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
vec4 unpremul(vec4 color) {
vec4 unpremul_h4h4(vec4 color) {
return vec4(color.xyz / max(color.w, 9.9999997473787516e-05), color.w);
}
vec4 live_fn(vec4 a, vec4 b) {
vec4 live_fn_h4h4h4(vec4 a, vec4 b) {
return a + b;
}
vec4 main() {
vec4 a;
vec4 b;
{
a = live_fn(vec4(3.0), vec4(-5.0));
a = live_fn_h4h4h4(vec4(3.0), vec4(-5.0));
}
{
b = unpremul(vec4(1.0));
b = unpremul_h4h4(vec4(1.0));
}
return a != vec4(0.0) && b != vec4(0.0) ? colorGreen : colorRed;
}

View File

@ -2,69 +2,69 @@
out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
bool takes_float2(vec2 x) {
bool takes_float2_bf2(vec2 x) {
return true;
}
bool takes_float3(vec3 x) {
bool takes_float3_bf3(vec3 x) {
return true;
}
bool takes_float4(vec4 x) {
bool takes_float4_bf4(vec4 x) {
return true;
}
bool takes_float2x2(mat2 x) {
bool takes_float2x2_bf22(mat2 x) {
return true;
}
bool takes_float3x3(mat3 x) {
bool takes_float3x3_bf33(mat3 x) {
return true;
}
bool takes_float4x4(mat4 x) {
bool takes_float4x4_bf44(mat4 x) {
return true;
}
bool takes_half(float x) {
bool takes_half_bh(float x) {
return true;
}
bool takes_half2(vec2 x) {
bool takes_half2_bh2(vec2 x) {
return true;
}
bool takes_half3(vec3 x) {
bool takes_half3_bh3(vec3 x) {
return true;
}
bool takes_half4(vec4 x) {
bool takes_half4_bh4(vec4 x) {
return true;
}
bool takes_half2x2(mat2 x) {
bool takes_half2x2_bh22(mat2 x) {
return true;
}
bool takes_half3x3(mat3 x) {
bool takes_half3x3_bh33(mat3 x) {
return true;
}
bool takes_half4x4(mat4 x) {
bool takes_half4x4_bh44(mat4 x) {
return true;
}
bool takes_bool(bool x) {
bool takes_bool_bb(bool x) {
return true;
}
bool takes_bool2(bvec2 x) {
bool takes_bool2_bb2(bvec2 x) {
return true;
}
bool takes_bool3(bvec3 x) {
bool takes_bool3_bb3(bvec3 x) {
return true;
}
bool takes_bool4(bvec4 x) {
bool takes_bool4_bb4(bvec4 x) {
return true;
}
bool takes_int(int x) {
bool takes_int_bi(int x) {
return true;
}
bool takes_int2(ivec2 x) {
bool takes_int2_bi2(ivec2 x) {
return true;
}
bool takes_int3(ivec3 x) {
bool takes_int3_bi3(ivec3 x) {
return true;
}
bool takes_int4(ivec4 x) {
bool takes_int4_bi4(ivec4 x) {
return true;
}
vec4 main() {
return ((((((((((((((((((((true && takes_float2(vec2(2.0))) && takes_float3(vec3(3.0))) && takes_float4(vec4(4.0))) && takes_float2x2(mat2(2.0))) && takes_float3x3(mat3(3.0))) && takes_float4x4(mat4(4.0))) && takes_half(1.0)) && takes_half2(vec2(2.0))) && takes_half3(vec3(3.0))) && takes_half4(vec4(4.0))) && takes_half2x2(mat2(2.0))) && takes_half3x3(mat3(3.0))) && takes_half4x4(mat4(4.0))) && takes_bool(true)) && takes_bool2(bvec2(true))) && takes_bool3(bvec3(true))) && takes_bool4(bvec4(true))) && takes_int(1)) && takes_int2(ivec2(2))) && takes_int3(ivec3(3))) && takes_int4(ivec4(4)) ? colorGreen : colorRed;
return ((((((((((((((((((((true && takes_float2_bf2(vec2(2.0))) && takes_float3_bf3(vec3(3.0))) && takes_float4_bf4(vec4(4.0))) && takes_float2x2_bf22(mat2(2.0))) && takes_float3x3_bf33(mat3(3.0))) && takes_float4x4_bf44(mat4(4.0))) && takes_half_bh(1.0)) && takes_half2_bh2(vec2(2.0))) && takes_half3_bh3(vec3(3.0))) && takes_half4_bh4(vec4(4.0))) && takes_half2x2_bh22(mat2(2.0))) && takes_half3x3_bh33(mat3(3.0))) && takes_half4x4_bh44(mat4(4.0))) && takes_bool_bb(true)) && takes_bool2_bb2(bvec2(true))) && takes_bool3_bb3(bvec3(true))) && takes_bool4_bb4(bvec4(true))) && takes_int_bi(1)) && takes_int2_bi2(ivec2(2))) && takes_int3_bi3(ivec3(3))) && takes_int4_bi4(ivec4(4)) ? colorGreen : colorRed;
}

View File

@ -1,11 +1,11 @@
out vec4 sk_FragColor;
uniform vec4 colorGreen;
float this_function_is_prototyped_at_the_start_and_never_defined();
vec4 this_function_is_defined_before_use(vec4 x);
vec4 this_function_is_defined_after_use(vec4 x);
bool this_function_is_prototyped_in_the_middle_and_never_defined(mat4 a);
ivec3 this_function_is_prototyped_at_the_very_end_and_never_defined(mat2 x, bvec2 y);
float this_function_is_prototyped_at_the_start_and_never_defined_f();
vec4 this_function_is_defined_before_use_h4h4(vec4 x);
vec4 this_function_is_defined_after_use_h4h4(vec4 x);
bool this_function_is_prototyped_in_the_middle_and_never_defined_bf44(mat4 a);
ivec3 this_function_is_prototyped_at_the_very_end_and_never_defined_i3h22b2(mat2 x, bvec2 y);
vec4 main() {
return colorGreen;
}

View File

@ -2,67 +2,67 @@
out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
vec2 returns_float2() {
vec2 returns_float2_f2() {
return vec2(2.0);
}
vec3 returns_float3() {
vec3 returns_float3_f3() {
return vec3(3.0);
}
vec4 returns_float4() {
vec4 returns_float4_f4() {
return vec4(4.0);
}
mat2 returns_float2x2() {
mat2 returns_float2x2_f22() {
return mat2(2.0);
}
mat3 returns_float3x3() {
mat3 returns_float3x3_f33() {
return mat3(3.0);
}
mat4 returns_float4x4() {
mat4 returns_float4x4_f44() {
return mat4(4.0);
}
float returns_half() {
float returns_half_h() {
return 1.0;
}
vec2 returns_half2() {
vec2 returns_half2_h2() {
return vec2(2.0);
}
vec3 returns_half3() {
vec3 returns_half3_h3() {
return vec3(3.0);
}
vec4 returns_half4() {
vec4 returns_half4_h4() {
return vec4(4.0);
}
mat2 returns_half2x2() {
mat2 returns_half2x2_h22() {
return mat2(2.0);
}
mat3 returns_half3x3() {
mat3 returns_half3x3_h33() {
return mat3(3.0);
}
mat4 returns_half4x4() {
mat4 returns_half4x4_h44() {
return mat4(4.0);
}
bool returns_bool() {
bool returns_bool_b() {
return true;
}
bvec2 returns_bool2() {
bvec2 returns_bool2_b2() {
return bvec2(true);
}
bvec3 returns_bool3() {
bvec3 returns_bool3_b3() {
return bvec3(true);
}
bvec4 returns_bool4() {
bvec4 returns_bool4_b4() {
return bvec4(true);
}
int returns_int() {
int returns_int_i() {
return 1;
}
ivec2 returns_int2() {
ivec2 returns_int2_i2() {
return ivec2(2);
}
ivec3 returns_int3() {
ivec3 returns_int3_i3() {
return ivec3(3);
}
ivec4 returns_int4() {
ivec4 returns_int4_i4() {
return ivec4(4);
}
vec4 main() {
@ -88,5 +88,5 @@ vec4 main() {
ivec2 x20 = ivec2(2);
ivec3 x21 = ivec3(3);
ivec4 x22 = ivec4(4);
return ((((((((((((((((((((x1 == 1.0 && x2 == returns_float2()) && x3 == returns_float3()) && x4 == returns_float4()) && x5 == returns_float2x2()) && x6 == returns_float3x3()) && x7 == returns_float4x4()) && x8 == returns_half()) && x9 == returns_half2()) && x10 == returns_half3()) && x11 == returns_half4()) && x12 == returns_half2x2()) && x13 == returns_half3x3()) && x14 == returns_half4x4()) && x15 == returns_bool()) && x16 == returns_bool2()) && x17 == returns_bool3()) && x18 == returns_bool4()) && x19 == returns_int()) && x20 == returns_int2()) && x21 == returns_int3()) && x22 == returns_int4() ? colorGreen : colorRed;
return ((((((((((((((((((((x1 == 1.0 && x2 == returns_float2_f2()) && x3 == returns_float3_f3()) && x4 == returns_float4_f4()) && x5 == returns_float2x2_f22()) && x6 == returns_float3x3_f33()) && x7 == returns_float4x4_f44()) && x8 == returns_half_h()) && x9 == returns_half2_h2()) && x10 == returns_half3_h3()) && x11 == returns_half4_h4()) && x12 == returns_half2x2_h22()) && x13 == returns_half3x3_h33()) && x14 == returns_half4x4_h44()) && x15 == returns_bool_b()) && x16 == returns_bool2_b2()) && x17 == returns_bool3_b3()) && x18 == returns_bool4_b4()) && x19 == returns_int_i()) && x20 == returns_int2_i2()) && x21 == returns_int3_i3()) && x22 == returns_int4_i4() ? colorGreen : colorRed;
}

View File

@ -2,17 +2,17 @@
out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
float foo(vec2 v) {
float foo_ff2(vec2 v) {
return v.x * v.y;
}
void bar(inout float x) {
void bar_vf(inout float x) {
float y[2];
y[0] = x;
y[1] = x * 2.0;
x = foo(vec2(y[0], y[1]));
x = foo_ff2(vec2(y[0], y[1]));
}
vec4 main() {
float x = 10.0;
bar(x);
bar_vf(x);
return x == 200.0 ? colorGreen : colorRed;
}

View File

@ -11,7 +11,7 @@ layout (binding = 0) uniform uniformBuffer {
layout (offset = 224) vec4 unorm_Stage1_c0_c0_c0;
};
layout (location = 0) in vec2 vLocalCoord_Stage0;
vec4 MatrixEffect_Stage1_c0_c0(vec4 _input, vec2 _coords) {
vec4 MatrixEffect_Stage1_c0_c0_h4h4f2(vec4 _input, vec2 _coords) {
vec2 _1_inCoord = (umatrix_Stage1_c0_c0 * vec3(_coords, 1.0)).xy;
_1_inCoord *= unorm_Stage1_c0_c0_c0.xy;
vec2 _2_subsetCoord;
@ -39,79 +39,79 @@ void main() {
vec2 _7_coord = vLocalCoord_Stage0 - 12.0 * uIncrement_Stage1_c0;
vec2 _8_coordSampled = vec2(0.0, 0.0);
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[0].x;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[0].x;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[0].y;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[0].y;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[0].z;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[0].z;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[0].w;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[0].w;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[1].x;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[1].x;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[1].y;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[1].y;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[1].z;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[1].z;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[1].w;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[1].w;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[2].x;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[2].x;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[2].y;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[2].y;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[2].z;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[2].z;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[2].w;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[2].w;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[3].x;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[3].x;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[3].y;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[3].y;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[3].z;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[3].z;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[3].w;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[3].w;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[4].x;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[4].x;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[4].y;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[4].y;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[4].z;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[4].z;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[4].w;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[4].w;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[5].x;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[5].x;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[5].y;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[5].y;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[5].z;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[5].z;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[5].w;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[5].w;
_7_coord += uIncrement_Stage1_c0;
_8_coordSampled = _7_coord;
_6_output += MatrixEffect_Stage1_c0_c0(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[6].x;
_6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[6].x;
_7_coord += uIncrement_Stage1_c0;
_6_output *= outputColor_Stage0;
output_Stage1 = _6_output;

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
bool test_half() {
bool test_half_b() {
mat2 m1 = mat2(1.0, 2.0, 3.0, 4.0);
mat2 m3 = m1;
mat2 m4 = mat2(1.0);
@ -26,5 +26,5 @@ vec4 main() {
mat4 _10_m10 = mat4(1.0);
mat4 _11_m11 = mat4(2.0);
_11_m11 -= _10_m10;
return true && test_half() ? colorGreen : colorRed;
return true && test_half_b() ? colorGreen : colorRed;
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
bool test_half() {
bool test_half_b() {
mat2x3 m23 = mat2x3(23.0);
mat2x4 m24 = mat2x4(24.0);
mat3x2 m32 = mat3x2(32.0);
@ -30,5 +30,5 @@ vec4 main() {
_7_m33 *= _7_m33;
mat4 _8_m44 = _1_m24 * _4_m42;
_8_m44 *= _8_m44;
return true && test_half() ? colorGreen : colorRed;
return true && test_half_b() ? colorGreen : colorRed;
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
bool test_int() {
bool test_int_b() {
int one = 1;
const int two = 2;
ivec4 result;
@ -20,5 +20,5 @@ vec4 main() {
_2_result.y = 1.0;
_2_result.z = float(-vec4(_1_two) == vec4(-_1_two, vec3(-_1_two)) ? 1 : 0);
_2_result.w = float(vec2(1.0, -2.0) == -vec2(_0_one - _1_two, _1_two) ? 1 : 0);
return bool(((_2_result.x * _2_result.y) * _2_result.z) * _2_result.w) && test_int() ? colorGreen : colorRed;
return bool(((_2_result.x * _2_result.y) * _2_result.z) * _2_result.w) && test_int_b() ? colorGreen : colorRed;
}

View File

@ -3,130 +3,130 @@ out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
uniform vec4 colorWhite;
void out_half(out float v) {
void out_half_vh(out float v) {
v = colorWhite.x;
}
void out_half2(out vec2 v) {
void out_half2_vh2(out vec2 v) {
v = vec2(colorWhite.y);
}
void out_half3(out vec3 v) {
void out_half3_vh3(out vec3 v) {
v = vec3(colorWhite.z);
}
void out_half4(out vec4 v) {
void out_half4_vh4(out vec4 v) {
v = vec4(colorWhite.w);
}
void out_half2x2(out mat2 v) {
void out_half2x2_vh22(out mat2 v) {
v = mat2(colorWhite.x);
}
void out_half3x3(out mat3 v) {
void out_half3x3_vh33(out mat3 v) {
v = mat3(colorWhite.y);
}
void out_half4x4(out mat4 v) {
void out_half4x4_vh44(out mat4 v) {
v = mat4(colorWhite.z);
}
void out_int(out int v) {
void out_int_vi(out int v) {
v = int(colorWhite.x);
}
void out_int2(out ivec2 v) {
void out_int2_vi2(out ivec2 v) {
v = ivec2(int(colorWhite.y));
}
void out_int3(out ivec3 v) {
void out_int3_vi3(out ivec3 v) {
v = ivec3(int(colorWhite.z));
}
void out_int4(out ivec4 v) {
void out_int4_vi4(out ivec4 v) {
v = ivec4(int(colorWhite.w));
}
void out_float(out float v) {
void out_float_vf(out float v) {
v = colorWhite.x;
}
void out_float2(out vec2 v) {
void out_float2_vf2(out vec2 v) {
v = vec2(colorWhite.y);
}
void out_float3(out vec3 v) {
void out_float3_vf3(out vec3 v) {
v = vec3(colorWhite.z);
}
void out_float4(out vec4 v) {
void out_float4_vf4(out vec4 v) {
v = vec4(colorWhite.w);
}
void out_float2x2(out mat2 v) {
void out_float2x2_vf22(out mat2 v) {
v = mat2(colorWhite.x);
}
void out_float3x3(out mat3 v) {
void out_float3x3_vf33(out mat3 v) {
v = mat3(colorWhite.y);
}
void out_float4x4(out mat4 v) {
void out_float4x4_vf44(out mat4 v) {
v = mat4(colorWhite.z);
}
void out_bool(out bool v) {
void out_bool_vb(out bool v) {
v = bool(colorWhite.x);
}
void out_bool2(out bvec2 v) {
void out_bool2_vb2(out bvec2 v) {
v = bvec2(bool(colorWhite.y));
}
void out_bool3(out bvec3 v) {
void out_bool3_vb3(out bvec3 v) {
v = bvec3(bool(colorWhite.z));
}
void out_bool4(out bvec4 v) {
void out_bool4_vb4(out bvec4 v) {
v = bvec4(bool(colorWhite.w));
}
vec4 main() {
float h;
out_half(h);
out_half_vh(h);
vec2 h2;
out_half2(h2);
out_half2_vh2(h2);
vec3 h3;
out_half3(h3);
out_half3_vh3(h3);
vec4 h4;
out_half4(h4);
out_half(h3.y);
out_half2(h3.xz);
out_half4(h4.zwxy);
out_half4_vh4(h4);
out_half_vh(h3.y);
out_half2_vh2(h3.xz);
out_half4_vh4(h4.zwxy);
mat2 h2x2;
out_half2x2(h2x2);
out_half2x2_vh22(h2x2);
mat3 h3x3;
out_half3x3(h3x3);
out_half3x3_vh33(h3x3);
mat4 h4x4;
out_half4x4(h4x4);
out_half3(h3x3[1]);
out_half(h4x4[3].w);
out_half(h2x2[0].x);
out_half4x4_vh44(h4x4);
out_half3_vh3(h3x3[1]);
out_half_vh(h4x4[3].w);
out_half_vh(h2x2[0].x);
int i;
out_int(i);
out_int_vi(i);
ivec2 i2;
out_int2(i2);
out_int2_vi2(i2);
ivec3 i3;
out_int3(i3);
out_int3_vi3(i3);
ivec4 i4;
out_int4(i4);
out_int3(i4.xyz);
out_int(i2.y);
out_int4_vi4(i4);
out_int3_vi3(i4.xyz);
out_int_vi(i2.y);
float f;
out_float(f);
out_float_vf(f);
vec2 f2;
out_float2(f2);
out_float2_vf2(f2);
vec3 f3;
out_float3(f3);
out_float3_vf3(f3);
vec4 f4;
out_float4(f4);
out_float2(f3.xy);
out_float(f2.x);
out_float4_vf4(f4);
out_float2_vf2(f3.xy);
out_float_vf(f2.x);
mat2 f2x2;
out_float2x2(f2x2);
out_float2x2_vf22(f2x2);
mat3 f3x3;
out_float3x3(f3x3);
out_float3x3_vf33(f3x3);
mat4 f4x4;
out_float4x4(f4x4);
out_float(f2x2[0].x);
out_float4x4_vf44(f4x4);
out_float_vf(f2x2[0].x);
bool b;
out_bool(b);
out_bool_vb(b);
bvec2 b2;
out_bool2(b2);
out_bool2_vb2(b2);
bvec3 b3;
out_bool3(b3);
out_bool3_vb3(b3);
bvec4 b4;
out_bool4(b4);
out_bool2(b4.xw);
out_bool(b3.z);
out_bool4_vb4(b4);
out_bool2_vb2(b4.xw);
out_bool_vb(b3.z);
bool ok = true;
ok = ok && 1.0 == (((((h * h2.x) * h3.x) * h4.x) * h2x2[0].x) * h3x3[0].x) * h4x4[0].x;
ok = ok && 1.0 == (((((f * f2.x) * f3.x) * f4.x) * f2x2[0].x) * f3x3[0].x) * f4x4[0].x;

View File

@ -3,130 +3,130 @@ out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
uniform vec4 colorWhite;
void out_half(out float v) {
void out_half_vh(out float v) {
v = colorWhite.x;
}
void out_half2(out vec2 v) {
void out_half2_vh2(out vec2 v) {
v = vec2(colorWhite.y);
}
void out_half3(out vec3 v) {
void out_half3_vh3(out vec3 v) {
v = vec3(colorWhite.z);
}
void out_half4(out vec4 v) {
void out_half4_vh4(out vec4 v) {
v = vec4(colorWhite.w);
}
void out_half2x2(out mat2 v) {
void out_half2x2_vh22(out mat2 v) {
v = mat2(colorWhite.x);
}
void out_half3x3(out mat3 v) {
void out_half3x3_vh33(out mat3 v) {
v = mat3(colorWhite.y);
}
void out_half4x4(out mat4 v) {
void out_half4x4_vh44(out mat4 v) {
v = mat4(colorWhite.z);
}
void out_int(out int v) {
void out_int_vi(out int v) {
v = int(colorWhite.x);
}
void out_int2(out ivec2 v) {
void out_int2_vi2(out ivec2 v) {
v = ivec2(int(colorWhite.y));
}
void out_int3(out ivec3 v) {
void out_int3_vi3(out ivec3 v) {
v = ivec3(int(colorWhite.z));
}
void out_int4(out ivec4 v) {
void out_int4_vi4(out ivec4 v) {
v = ivec4(int(colorWhite.w));
}
void out_float(out float v) {
void out_float_vf(out float v) {
v = colorWhite.x;
}
void out_float2(out vec2 v) {
void out_float2_vf2(out vec2 v) {
v = vec2(colorWhite.y);
}
void out_float3(out vec3 v) {
void out_float3_vf3(out vec3 v) {
v = vec3(colorWhite.z);
}
void out_float4(out vec4 v) {
void out_float4_vf4(out vec4 v) {
v = vec4(colorWhite.w);
}
void out_float2x2(out mat2 v) {
void out_float2x2_vf22(out mat2 v) {
v = mat2(colorWhite.x);
}
void out_float3x3(out mat3 v) {
void out_float3x3_vf33(out mat3 v) {
v = mat3(colorWhite.y);
}
void out_float4x4(out mat4 v) {
void out_float4x4_vf44(out mat4 v) {
v = mat4(colorWhite.z);
}
void out_bool(out bool v) {
void out_bool_vb(out bool v) {
v = bool(colorWhite.x);
}
void out_bool2(out bvec2 v) {
void out_bool2_vb2(out bvec2 v) {
v = bvec2(bool(colorWhite.y));
}
void out_bool3(out bvec3 v) {
void out_bool3_vb3(out bvec3 v) {
v = bvec3(bool(colorWhite.z));
}
void out_bool4(out bvec4 v) {
void out_bool4_vb4(out bvec4 v) {
v = bvec4(bool(colorWhite.w));
}
vec4 main() {
float h;
out_half(h);
out_half_vh(h);
vec2 h2;
out_half2(h2);
out_half2_vh2(h2);
vec3 h3;
out_half3(h3);
out_half3_vh3(h3);
vec4 h4;
out_half4(h4);
out_half(h3.y);
out_half2(h3.xz);
out_half4(h4.zwxy);
out_half4_vh4(h4);
out_half_vh(h3.y);
out_half2_vh2(h3.xz);
out_half4_vh4(h4.zwxy);
mat2 h2x2;
out_half2x2(h2x2);
out_half2x2_vh22(h2x2);
mat3 h3x3;
out_half3x3(h3x3);
out_half3x3_vh33(h3x3);
mat4 h4x4;
out_half4x4(h4x4);
out_half3(h3x3[1]);
out_half(h4x4[3].w);
out_half(h2x2[0].x);
out_half4x4_vh44(h4x4);
out_half3_vh3(h3x3[1]);
out_half_vh(h4x4[3].w);
out_half_vh(h2x2[0].x);
int i;
out_int(i);
out_int_vi(i);
ivec2 i2;
out_int2(i2);
out_int2_vi2(i2);
ivec3 i3;
out_int3(i3);
out_int3_vi3(i3);
ivec4 i4;
out_int4(i4);
out_int3(i4.xyz);
out_int(i2.y);
out_int4_vi4(i4);
out_int3_vi3(i4.xyz);
out_int_vi(i2.y);
float f;
out_float(f);
out_float_vf(f);
vec2 f2;
out_float2(f2);
out_float2_vf2(f2);
vec3 f3;
out_float3(f3);
out_float3_vf3(f3);
vec4 f4;
out_float4(f4);
out_float2(f3.xy);
out_float(f2.x);
out_float4_vf4(f4);
out_float2_vf2(f3.xy);
out_float_vf(f2.x);
mat2 f2x2;
out_float2x2(f2x2);
out_float2x2_vf22(f2x2);
mat3 f3x3;
out_float3x3(f3x3);
out_float3x3_vf33(f3x3);
mat4 f4x4;
out_float4x4(f4x4);
out_float(f2x2[0].x);
out_float4x4_vf44(f4x4);
out_float_vf(f2x2[0].x);
bool b;
out_bool(b);
out_bool_vb(b);
bvec2 b2;
out_bool2(b2);
out_bool2_vb2(b2);
bvec3 b3;
out_bool3(b3);
out_bool3_vb3(b3);
bvec4 b4;
out_bool4(b4);
out_bool2(b4.xw);
out_bool(b3.z);
out_bool4_vb4(b4);
out_bool2_vb2(b4.xw);
out_bool_vb(b3.z);
bool ok = true;
ok = ok && 1.0 == (((((h * h2.x) * h3.x) * h4.x) * h2x2[0].x) * h3x3[0].x) * h4x4[0].x;
ok = ok && 1.0 == (((((f * f2.x) * f3.x) * f4.x) * f2x2[0].x) * f3x3[0].x) * f4x4[0].x;

View File

@ -2,16 +2,16 @@
out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
vec2 tricky(float x, float y, inout vec2 color, float z) {
vec2 tricky_h2hhh2h(float x, float y, inout vec2 color, float z) {
color = color.yx;
return vec2(x + y, z);
}
void func(inout vec4 color) {
vec2 t = tricky(1.0, 2.0, color.xz, 5.0);
void func_vh4(inout vec4 color) {
vec2 t = tricky_h2hhh2h(1.0, 2.0, color.xz, 5.0);
color.yw = t;
}
vec4 main() {
vec4 result = vec4(0.0, 1.0, 2.0, 3.0);
func(result);
func_vh4(result);
return result == vec4(2.0, 3.0, 0.0, 5.0) ? colorGreen : colorRed;
}

View File

@ -3,28 +3,28 @@ out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
uniform float unknownInput;
bool return_on_both_sides() {
bool return_on_both_sides_b() {
if (unknownInput == 1.0) return true; else return true;
}
bool for_inside_body() {
bool for_inside_body_b() {
for (int x = 0;x <= 10; ++x) {
return true;
}
}
bool after_for_body() {
bool after_for_body_b() {
for (int x = 0;x <= 10; ++x) {
true;
}
return true;
}
bool for_with_double_sided_conditional_return() {
bool for_with_double_sided_conditional_return_b() {
for (int x = 0;x <= 10; ++x) {
if (unknownInput == 1.0) return true; else return true;
}
}
bool if_else_chain() {
bool if_else_chain_b() {
if (unknownInput == 1.0) return true; else if (unknownInput == 2.0) return false; else if (unknownInput == 3.0) return true; else if (unknownInput == 4.0) return false; else return true;
}
vec4 main() {
return ((((true && return_on_both_sides()) && for_inside_body()) && after_for_body()) && for_with_double_sided_conditional_return()) && if_else_chain() ? colorGreen : colorRed;
return ((((true && return_on_both_sides_b()) && for_inside_body_b()) && after_for_body_b()) && for_with_double_sided_conditional_return_b()) && if_else_chain_b() ? colorGreen : colorRed;
}

View File

@ -3,56 +3,56 @@ out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
uniform float unknownInput;
bool return_on_both_sides() {
bool return_on_both_sides_b() {
if (unknownInput == 1.0) return true; else return true;
}
bool for_inside_body() {
bool for_inside_body_b() {
for (int x = 0;x <= 10; ++x) {
return true;
}
}
bool after_for_body() {
bool after_for_body_b() {
for (int x = 0;x <= 10; ++x) {
true;
}
return true;
}
bool for_with_double_sided_conditional_return() {
bool for_with_double_sided_conditional_return_b() {
for (int x = 0;x <= 10; ++x) {
if (unknownInput == 1.0) return true; else return true;
}
}
bool if_else_chain() {
bool if_else_chain_b() {
if (unknownInput == 1.0) return true; else if (unknownInput == 2.0) return false; else if (unknownInput == 3.0) return true; else if (unknownInput == 4.0) return false; else return true;
}
bool conditional_inside_while_loop() {
bool conditional_inside_while_loop_b() {
while (unknownInput == 123.0) {
return true;
}
}
bool inside_do_loop() {
bool inside_do_loop_b() {
do {
return true;
} while (true);
}
bool inside_while_loop() {
bool inside_while_loop_b() {
while (true) {
return true;
}
}
bool after_do_loop() {
bool after_do_loop_b() {
do {
break;
} while (true);
return true;
}
bool after_while_loop() {
bool after_while_loop_b() {
while (true) {
break;
}
return true;
}
bool switch_with_all_returns() {
bool switch_with_all_returns_b() {
switch (int(unknownInput)) {
case 1:
return true;
@ -62,13 +62,13 @@ bool switch_with_all_returns() {
return true;
}
}
bool switch_only_default() {
bool switch_only_default_b() {
switch (int(unknownInput)) {
default:
return true;
}
}
bool switch_fallthrough() {
bool switch_fallthrough_b() {
switch (int(unknownInput)) {
case 1:
return true;
@ -77,7 +77,7 @@ bool switch_fallthrough() {
return true;
}
}
bool switch_fallthrough_twice() {
bool switch_fallthrough_twice_b() {
switch (int(unknownInput)) {
case 1:
case 2:
@ -85,7 +85,7 @@ bool switch_fallthrough_twice() {
return true;
}
}
bool switch_with_break_in_loop() {
bool switch_with_break_in_loop_b() {
switch (int(unknownInput)) {
case 1:
for (int x = 0;x <= 10; ++x) {
@ -95,7 +95,7 @@ bool switch_with_break_in_loop() {
return true;
}
}
bool switch_with_continue_in_loop() {
bool switch_with_continue_in_loop_b() {
switch (int(unknownInput)) {
case 1:
for (int x = 0;x <= 10; ++x) {
@ -105,7 +105,7 @@ bool switch_with_continue_in_loop() {
return true;
}
}
bool switch_with_if_that_returns() {
bool switch_with_if_that_returns_b() {
switch (int(unknownInput)) {
case 1:
if (unknownInput == 123.0) return true; else return true;
@ -113,7 +113,7 @@ bool switch_with_if_that_returns() {
return true;
}
}
bool switch_with_one_sided_if_then_fallthrough() {
bool switch_with_one_sided_if_then_fallthrough_b() {
switch (int(unknownInput)) {
case 1:
if (unknownInput == 123.0) return true;
@ -122,5 +122,5 @@ bool switch_with_one_sided_if_then_fallthrough() {
}
}
vec4 main() {
return (((((((((((((((((true && return_on_both_sides()) && for_inside_body()) && after_for_body()) && for_with_double_sided_conditional_return()) && if_else_chain()) && conditional_inside_while_loop()) && inside_do_loop()) && inside_while_loop()) && after_do_loop()) && after_while_loop()) && switch_with_all_returns()) && switch_only_default()) && switch_fallthrough()) && switch_fallthrough_twice()) && switch_with_break_in_loop()) && switch_with_continue_in_loop()) && switch_with_if_that_returns()) && switch_with_one_sided_if_then_fallthrough() ? colorGreen : colorRed;
return (((((((((((((((((true && return_on_both_sides_b()) && for_inside_body_b()) && after_for_body_b()) && for_with_double_sided_conditional_return_b()) && if_else_chain_b()) && conditional_inside_while_loop_b()) && inside_do_loop_b()) && inside_while_loop_b()) && after_do_loop_b()) && after_while_loop_b()) && switch_with_all_returns_b()) && switch_only_default_b()) && switch_fallthrough_b()) && switch_fallthrough_twice_b()) && switch_with_break_in_loop_b()) && switch_with_continue_in_loop_b()) && switch_with_if_that_returns_b()) && switch_with_one_sided_if_then_fallthrough_b() ? colorGreen : colorRed;
}

View File

@ -6,23 +6,23 @@ struct S {
float x;
int y;
};
S returns_a_struct() {
S returns_a_struct_S() {
S s;
s.x = 1.0;
s.y = 2;
return s;
}
float accepts_a_struct(S s) {
float accepts_a_struct_fS(S s) {
return s.x + float(s.y);
}
void modifies_a_struct(inout S s) {
void modifies_a_struct_vS(inout S s) {
s.x++;
s.y++;
}
vec4 main() {
S s = returns_a_struct();
float x = accepts_a_struct(s);
modifies_a_struct(s);
S s = returns_a_struct_S();
float x = accepts_a_struct_fS(s);
modifies_a_struct_vS(s);
bool valid = (x == 3.0 && s.x == 2.0) && s.y == 3;
return valid ? colorGreen : colorRed;
}

View File

@ -3,7 +3,7 @@ out vec4 sk_FragColor;
uniform vec4 colorRed;
uniform vec4 colorGreen;
uniform vec4 testInputs;
float fn(vec4 v) {
float fn_hh4(vec4 v) {
for (int x = 1;x <= 2; ++x) {
return v.x;
}
@ -16,12 +16,12 @@ vec4 main() {
v = vec4(v.zy, 1.0, 1.0);
v = vec4(v.xx, 1.0, 1.0);
v = v.wzwz;
v = vec3(fn(v), 123.0, 456.0).yyzz;
v = vec3(fn(v), 123.0, 456.0).yyzz;
v = vec4(123.0, 456.0, 456.0, fn(v));
v = vec4(123.0, 456.0, 456.0, fn(v));
v = vec3(fn(v), 123.0, 456.0).yxxz;
v = vec3(fn(v), 123.0, 456.0).yxxz;
v = vec3(fn_hh4(v), 123.0, 456.0).yyzz;
v = vec3(fn_hh4(v), 123.0, 456.0).yyzz;
v = vec4(123.0, 456.0, 456.0, fn_hh4(v));
v = vec4(123.0, 456.0, 456.0, fn_hh4(v));
v = vec3(fn_hh4(v), 123.0, 456.0).yxxz;
v = vec3(fn_hh4(v), 123.0, 456.0).yxxz;
v = vec4(1.0, 1.0, 2.0, 3.0);
v = vec4(colorRed.xyz, 1.0);
v = vec4(colorRed.x, 1.0, colorRed.yz);

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
bool check(vec2 v1, vec2 v2, vec2 v3, vec3 v4, ivec2 v5, ivec2 v6, vec2 v7, vec2 v8, vec4 v9, ivec2 v10, bvec4 v11, vec2 v12, vec2 v13, vec2 v14, bvec2 v15, bvec2 v16, bvec3 v17) {
bool check_bf2f2f2f3i2i2f2f2f4i2b4f2f2f2b2b2b3(vec2 v1, vec2 v2, vec2 v3, vec3 v4, ivec2 v5, ivec2 v6, vec2 v7, vec2 v8, vec4 v9, ivec2 v10, bvec4 v11, vec2 v12, vec2 v13, vec2 v14, bvec2 v15, bvec2 v16, bvec3 v17) {
return (((((((((((((((v1.x + v2.x) + v3.x) + v4.x) + float(v5.x)) + float(v6.x)) + v7.x) + v8.x) + v9.x) + float(v10.x)) + float(v11.x)) + v12.x) + v13.x) + v14.x) + float(v15.x)) + float(v16.x)) + float(v17.x) == 17.0;
}
vec4 main() {
@ -23,5 +23,5 @@ vec4 main() {
bvec2 v15 = bvec2(true);
bvec2 v16 = bvec2(vec2(1.0));
bvec3 v17 = bvec3(true, bvec2(ivec2(77)));
return check(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) ? colorGreen : colorRed;
return check_bf2f2f2f3i2i2f2f2f4i2b4f2f2f2b2b2b3(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) ? colorGreen : colorRed;
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
in vec4 src;
in vec4 dst;
float _color_dodge_component(vec2 s, vec2 d) {
float _color_dodge_component_hh2h2(vec2 s, vec2 d) {
if (d.x == 0.0) {
return s.x * (1.0 - d.y);
} else {
@ -15,7 +15,7 @@ float _color_dodge_component(vec2 s, vec2 d) {
}
}
}
float _color_burn_component(vec2 s, vec2 d) {
float _color_burn_component_hh2h2(vec2 s, vec2 d) {
if (d.y == d.x) {
return (s.y * d.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
} else if (s.x == 0.0) {
@ -25,7 +25,7 @@ float _color_burn_component(vec2 s, vec2 d) {
return (delta * s.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
}
}
float _soft_light_component(vec2 s, vec2 d) {
float _soft_light_component_hh2h2(vec2 s, vec2 d) {
if (2.0 * s.x <= s.y) {
return (((d.x * d.x) * (s.y - 2.0 * s.x)) / (d.y + 9.9999999392252903e-09) + (1.0 - d.y) * s.x) + d.x * ((-s.y + 2.0 * s.x) + 1.0);
} else if (4.0 * d.x <= d.y) {
@ -39,7 +39,7 @@ float _soft_light_component(vec2 s, vec2 d) {
}
}
void main() {
sk_FragColor = vec4(_color_dodge_component(src.xw, dst.xw), _color_dodge_component(src.yw, dst.yw), _color_dodge_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = vec4(_color_burn_component(src.xw, dst.xw), _color_burn_component(src.yw, dst.yw), _color_burn_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = dst.w == 0.0 ? src : vec4(_soft_light_component(src.xw, dst.xw), _soft_light_component(src.yw, dst.yw), _soft_light_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = vec4(_color_dodge_component_hh2h2(src.xw, dst.xw), _color_dodge_component_hh2h2(src.yw, dst.yw), _color_dodge_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = vec4(_color_burn_component_hh2h2(src.xw, dst.xw), _color_burn_component_hh2h2(src.yw, dst.yw), _color_burn_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = dst.w == 0.0 ? src : vec4(_soft_light_component_hh2h2(src.xw, dst.xw), _soft_light_component_hh2h2(src.yw, dst.yw), _soft_light_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}

View File

@ -2,7 +2,7 @@
out vec4 sk_FragColor;
in vec4 src;
in vec4 dst;
float _color_dodge_component(vec2 s, vec2 d) {
float _color_dodge_component_hh2h2(vec2 s, vec2 d) {
if (d.x == 0.0) {
return s.x * (1.0 - d.y);
} else {
@ -15,7 +15,7 @@ float _color_dodge_component(vec2 s, vec2 d) {
}
}
}
float _color_burn_component(vec2 s, vec2 d) {
float _color_burn_component_hh2h2(vec2 s, vec2 d) {
if (d.y == d.x) {
return (s.y * d.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
} else if (s.x == 0.0) {
@ -25,7 +25,7 @@ float _color_burn_component(vec2 s, vec2 d) {
return (delta * s.y + s.x * (1.0 - d.y)) + d.x * (1.0 - s.y);
}
}
float _soft_light_component(vec2 s, vec2 d) {
float _soft_light_component_hh2h2(vec2 s, vec2 d) {
if (2.0 * s.x <= s.y) {
return (((d.x * d.x) * (s.y - 2.0 * s.x)) / d.y + (1.0 - d.y) * s.x) + d.x * ((-s.y + 2.0 * s.x) + 1.0);
} else if (4.0 * d.x <= d.y) {
@ -39,7 +39,7 @@ float _soft_light_component(vec2 s, vec2 d) {
}
}
void main() {
sk_FragColor = vec4(_color_dodge_component(src.xw, dst.xw), _color_dodge_component(src.yw, dst.yw), _color_dodge_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = vec4(_color_burn_component(src.xw, dst.xw), _color_burn_component(src.yw, dst.yw), _color_burn_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = dst.w == 0.0 ? src : vec4(_soft_light_component(src.xw, dst.xw), _soft_light_component(src.yw, dst.yw), _soft_light_component(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = vec4(_color_dodge_component_hh2h2(src.xw, dst.xw), _color_dodge_component_hh2h2(src.yw, dst.yw), _color_dodge_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = vec4(_color_burn_component_hh2h2(src.xw, dst.xw), _color_burn_component_hh2h2(src.yw, dst.yw), _color_burn_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
sk_FragColor = dst.w == 0.0 ? src : vec4(_soft_light_component_hh2h2(src.xw, dst.xw), _soft_light_component_hh2h2(src.yw, dst.yw), _soft_light_component_hh2h2(src.zw, dst.zw), src.w + (1.0 - src.w) * dst.w);
}