skia2/resources/sksl/workarounds/NegatedLdexp.sksl
Chris Dalton 155c33c859 Add a workaround for "ldexp(..., -x)" on Mac/Radeon/GLSL
Bug: skia:12076
Change-Id: Ia7aabe2e048a05475d25811af657228ea39d75ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416561
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-06-08 01:39:38 +00:00

13 lines
313 B
Plaintext

/*#pragma settings MustForceNegatedLdexpParamToMultiply*/
uniform float unknownFloat;
uniform int unknownInt;
void main() {
float m = unknownFloat;
int x = unknownInt;
sk_FragColor.r = half(ldexp(m, -x));
sk_FragColor.g = half(ldexp(m, -(x + 1)));
sk_FragColor.b = half(ldexp(m, -x - 1));
}