skia2/gn/sksl.gni

71 lines
2.7 KiB
Plaintext
Raw Normal View History

# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Things are easiest for everyone if these source paths are absolute.
_src = get_path_info("../src", "abspath")
skia_sksl_sources = [
"$_src/sksl/SkSLASTNode.cpp",
"$_src/sksl/SkSLByteCodeGenerator.cpp",
"$_src/sksl/SkSLCFGGenerator.cpp",
"$_src/sksl/SkSLCompiler.cpp",
"$_src/sksl/SkSLIRGenerator.cpp",
"$_src/sksl/SkSLLexer.cpp",
"$_src/sksl/SkSLParser.cpp",
"$_src/sksl/SkSLSectionAndParameterHelper.cpp",
"$_src/sksl/SkSLString.cpp",
"$_src/sksl/SkSLUtil.cpp",
"$_src/sksl/ir/SkSLSetting.cpp",
"$_src/sksl/ir/SkSLSymbolTable.cpp",
"$_src/sksl/ir/SkSLType.cpp",
"$_src/sksl/ir/SkSLVariableReference.cpp",
]
skia_sksl_gpu_sources = [
"$_src/sksl/SkSLCPPCodeGenerator.cpp",
"$_src/sksl/SkSLCPPUniformCTypes.cpp",
"$_src/sksl/SkSLGLSLCodeGenerator.cpp",
"$_src/sksl/SkSLHCodeGenerator.cpp",
"$_src/sksl/SkSLMetalCodeGenerator.cpp",
"$_src/sksl/SkSLOutputStream.cpp",
"$_src/sksl/SkSLPipelineStageCodeGenerator.cpp",
"$_src/sksl/SkSLSPIRVCodeGenerator.cpp",
"$_src/sksl/SkSLSPIRVtoHLSL.cpp",
]
skia_gpu_processor_sources = [
"$_src/gpu/effects/GrAARectEffect.fp",
"$_src/gpu/effects/GrAlphaThresholdFragmentProcessor.fp",
"$_src/gpu/effects/GrBlurredEdgeFragmentProcessor.fp",
"$_src/gpu/effects/GrCircleBlurFragmentProcessor.fp",
"$_src/gpu/effects/GrCircleEffect.fp",
"$_src/gpu/effects/GrClampFragmentProcessor.fp",
"$_src/gpu/effects/GrComposeLerpEffect.fp",
"$_src/gpu/effects/GrConfigConversionEffect.fp",
"$_src/gpu/effects/GrConstColorProcessor.fp",
"$_src/gpu/effects/GrColorMatrixFragmentProcessor.fp",
"$_src/gpu/effects/GrDeviceSpaceEffect.fp",
"$_src/gpu/effects/GrEllipseEffect.fp",
"$_src/gpu/effects/GrHSLToRGBFilterEffect.fp",
"$_src/gpu/effects/GrLumaColorFilterEffect.fp",
"$_src/gpu/effects/GrMagnifierEffect.fp",
"$_src/gpu/effects/GrMixerEffect.fp",
"$_src/gpu/effects/GrOverrideInputFragmentProcessor.fp",
"$_src/gpu/effects/GrPremulInputFragmentProcessor.fp",
"$_src/gpu/effects/GrRectBlurEffect.fp",
"$_src/gpu/effects/GrRGBToHSLFilterEffect.fp",
"$_src/gpu/effects/GrRRectBlurEffect.fp",
"$_src/gpu/gradients/GrDualIntervalGradientColorizer.fp",
Reland "Base Gradient FP Refactor" This reverts commit 1ea5656a285bcfef445d6f69eaab477e68595b54. Reason for revert: Fixed google3 build failure Original change's description: > Revert "Base Gradient FP Refactor" > > This reverts commit 10f7a1e07554a362aef979d32ba288a009bdff90. > > Reason for revert: broke google3 roll > Original change's description: > > Base Gradient FP Refactor > > > > -- > > > > Redefines how gradients will be written in the GPU back-end: > > > > They are split into three fragment processor components: master, layout, and colorizer. > > The layout FP is responsible for converting the fragment position into an interpolant value, t. > > Each high-level gradient--such as linear, radial, etc.--are implemented solely in a layout FP. > > The colorizer FP is responsible for converting t into a color. > > The master FP invokes the layout, clamps t into the proper domain, and then invokes the colorizer. > > GrGradientShader provides factory functions to create FP graphs from SkGradientShader instances. > > This pattern is documented in gpu/gradients/README.md. > > > > Goals for current CL > > ==================== > > > > Outline the FP components by providing .fp implementations for the simplest gradients. > > Defines a two-color single interval colorizer and a linear gradient layout, and the master effect. > > A MakeLinear() factory function is provided that can convert SkGradientShaders that fit these constraints. > > SkLinearGradient first attempts to use the new system, falling back to the original GrGradientEffect. > > > > Future CLs > > ========== > > > > To keep the CL reviews manageable, additional dependent CLs will be added that gradually replace past functionality. > > A CL for each layout will be defined. > > CLs for the different analytic colorizer cases and the textured gradient case will be defined. > > Once the new system supports all current layouts and colorizer capabilities, all old GPU gradient code will be removed. > > After this clean-up, analytic colorization can hopefully be expanded to reduce the usage of textured gradients. > > > > Bug: skia: > > Change-Id: Iafe7b8b4071491a71c473babcd7bedda659150c1 > > Reviewed-on: https://skia-review.googlesource.com/148120 > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,michaelludwig@google.com > > Change-Id: Ib735e323795ac8874cb00b007a915786b50517a6 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/153600 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=bsalomon@google.com,caryclark@google.com,michaelludwig@google.com Change-Id: Ibf6ffbcb1af0dfbdac7317151aeb08f18f84c7fd No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/153887 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2018-09-12 19:22:16 +00:00
"$_src/gpu/gradients/GrSingleIntervalGradientColorizer.fp",
"$_src/gpu/gradients/GrTextureGradientColorizer.fp",
Reland "Reland "Implement an explicit binary search-based analytic gradient colorizer"" This is a reland of f065907ccc0ae5e9258443b5a1bbabeef181e965 3rd time's the charm: The new analytic gradient shader was sporadically triggering violations of the coverage as alpha compatibility optimization. Unfortunately, even when using the same device and random seed for the test, the bots did not always reproduce the error. However, we identified the likely cause of the violation. The test requires that all output channels are less than the input alpha, which it uses to validate whether or not the shader is modulating its values by the input alpha. This test does not pass if the RGB values are greater than 1. The original version of the analytic gradient shader used half4s for its scale and bias values. Given the threshold limit for hardstops of 0.00024 (SkNearlyZero), a very small interval that is not treated as a hardstop can create a scale or bias of over 4000. This moves into the very imprecise region of 16-bit floats, making it plausible that the gradient outputs colors greater than 1, due to rounding. The kicker is that the random test generation for stop locations does not use a uniform distribution, but is instead biased towards the remaining interval, which increases the likelihood of generating a small interval that is not treated as a hard stop. We are keeping this behavior since ill-conditioned gradients are useful in testing. Original change's description: > Reland "Implement an explicit binary search-based analytic gradient colorizer" > > This reverts commit 9461dcf1306a9a9517e1545cf6d16bde05261280. > > Reason for revert: Fixes for ANGLE's incorrect shader behavior > > Original change's description: > > Revert "Implement an explicit binary search-based analytic gradient colorizer" > > > > This reverts commit dcc85fc61008f61daef4313846bdd62877fd596d. > > > > Reason for revert: ANGLE is frequently corrupted, particularly radial_gradient4 and mixershader > > > > Original change's description: > > > Implement an explicit binary search-based analytic gradient colorizer > > > > > > Provides a reasonably flexible fragment processor that defines another > > > colorizer implementation for gradients. It can support up to 8 > > > interpolation intervals (which is 16 colors if every stop is a hard stop > > > or 9 colors if every stop is a smooth transition). It > > > supports mixtures of hard and smooth stops. It is conditionally compiled > > > into versions specific to the interval count (so it can produce up to > > > 8 shader variants). > > > > > > The GrGradientShader controller does not remove the single and dual > > > interval colorizers, which are useful specializations of this explicit > > > binary search colorizer. Similarly, since it can only handle up to 8 > > > intervals, the texture colorizer is still used as a fallback. > > > > > > Currently it does not employ capabilities detection to determine if the > > > hardware can support the number of required uniforms, which can become > > > substantial for the larger gradient configurations. > > > > > > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254 > > > Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b > > > Reviewed-on: https://skia-review.googlesource.com/155080 > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > Reviewed-by: Brian Osman <brianosman@google.com> > > > > TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com > > > > Change-Id: I351a387f0528e4c2db2d47ab2e5d6b336991fb98 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254 > > Reviewed-on: https://skia-review.googlesource.com/156541 > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com > > Change-Id: I2aca36307d88c26905d860ec29417ec68c6037cc > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254 > Reviewed-on: https://skia-review.googlesource.com/156542 > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > Commit-Queue: Michael Ludwig <michaelludwig@google.com> Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254 Change-Id: I2d050624781c77cdd160291cadbadac602b48bde Reviewed-on: https://skia-review.googlesource.com/c/157569 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-28 15:53:32 +00:00
"$_src/gpu/gradients/GrUnrolledBinaryGradientColorizer.fp",
Reland "Base Gradient FP Refactor" This reverts commit 1ea5656a285bcfef445d6f69eaab477e68595b54. Reason for revert: Fixed google3 build failure Original change's description: > Revert "Base Gradient FP Refactor" > > This reverts commit 10f7a1e07554a362aef979d32ba288a009bdff90. > > Reason for revert: broke google3 roll > Original change's description: > > Base Gradient FP Refactor > > > > -- > > > > Redefines how gradients will be written in the GPU back-end: > > > > They are split into three fragment processor components: master, layout, and colorizer. > > The layout FP is responsible for converting the fragment position into an interpolant value, t. > > Each high-level gradient--such as linear, radial, etc.--are implemented solely in a layout FP. > > The colorizer FP is responsible for converting t into a color. > > The master FP invokes the layout, clamps t into the proper domain, and then invokes the colorizer. > > GrGradientShader provides factory functions to create FP graphs from SkGradientShader instances. > > This pattern is documented in gpu/gradients/README.md. > > > > Goals for current CL > > ==================== > > > > Outline the FP components by providing .fp implementations for the simplest gradients. > > Defines a two-color single interval colorizer and a linear gradient layout, and the master effect. > > A MakeLinear() factory function is provided that can convert SkGradientShaders that fit these constraints. > > SkLinearGradient first attempts to use the new system, falling back to the original GrGradientEffect. > > > > Future CLs > > ========== > > > > To keep the CL reviews manageable, additional dependent CLs will be added that gradually replace past functionality. > > A CL for each layout will be defined. > > CLs for the different analytic colorizer cases and the textured gradient case will be defined. > > Once the new system supports all current layouts and colorizer capabilities, all old GPU gradient code will be removed. > > After this clean-up, analytic colorization can hopefully be expanded to reduce the usage of textured gradients. > > > > Bug: skia: > > Change-Id: Iafe7b8b4071491a71c473babcd7bedda659150c1 > > Reviewed-on: https://skia-review.googlesource.com/148120 > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,michaelludwig@google.com > > Change-Id: Ib735e323795ac8874cb00b007a915786b50517a6 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/153600 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=bsalomon@google.com,caryclark@google.com,michaelludwig@google.com Change-Id: Ibf6ffbcb1af0dfbdac7317151aeb08f18f84c7fd No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/153887 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2018-09-12 19:22:16 +00:00
"$_src/gpu/gradients/GrLinearGradientLayout.fp",
"$_src/gpu/gradients/GrRadialGradientLayout.fp",
"$_src/gpu/gradients/GrSweepGradientLayout.fp",
"$_src/gpu/gradients/GrTwoPointConicalGradientLayout.fp",
Reland "Base Gradient FP Refactor" This reverts commit 1ea5656a285bcfef445d6f69eaab477e68595b54. Reason for revert: Fixed google3 build failure Original change's description: > Revert "Base Gradient FP Refactor" > > This reverts commit 10f7a1e07554a362aef979d32ba288a009bdff90. > > Reason for revert: broke google3 roll > Original change's description: > > Base Gradient FP Refactor > > > > -- > > > > Redefines how gradients will be written in the GPU back-end: > > > > They are split into three fragment processor components: master, layout, and colorizer. > > The layout FP is responsible for converting the fragment position into an interpolant value, t. > > Each high-level gradient--such as linear, radial, etc.--are implemented solely in a layout FP. > > The colorizer FP is responsible for converting t into a color. > > The master FP invokes the layout, clamps t into the proper domain, and then invokes the colorizer. > > GrGradientShader provides factory functions to create FP graphs from SkGradientShader instances. > > This pattern is documented in gpu/gradients/README.md. > > > > Goals for current CL > > ==================== > > > > Outline the FP components by providing .fp implementations for the simplest gradients. > > Defines a two-color single interval colorizer and a linear gradient layout, and the master effect. > > A MakeLinear() factory function is provided that can convert SkGradientShaders that fit these constraints. > > SkLinearGradient first attempts to use the new system, falling back to the original GrGradientEffect. > > > > Future CLs > > ========== > > > > To keep the CL reviews manageable, additional dependent CLs will be added that gradually replace past functionality. > > A CL for each layout will be defined. > > CLs for the different analytic colorizer cases and the textured gradient case will be defined. > > Once the new system supports all current layouts and colorizer capabilities, all old GPU gradient code will be removed. > > After this clean-up, analytic colorization can hopefully be expanded to reduce the usage of textured gradients. > > > > Bug: skia: > > Change-Id: Iafe7b8b4071491a71c473babcd7bedda659150c1 > > Reviewed-on: https://skia-review.googlesource.com/148120 > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,michaelludwig@google.com > > Change-Id: Ib735e323795ac8874cb00b007a915786b50517a6 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/153600 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=bsalomon@google.com,caryclark@google.com,michaelludwig@google.com Change-Id: Ibf6ffbcb1af0dfbdac7317151aeb08f18f84c7fd No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/153887 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2018-09-12 19:22:16 +00:00
"$_src/gpu/gradients/GrClampedGradientEffect.fp",
"$_src/gpu/gradients/GrTiledGradientEffect.fp",
]