skia2/gn/sksl.gni

185 lines
6.8 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")
_include = get_path_info("../include", "abspath")
skia_sksl_sources = [
"$_include/private/SkSLSampleUsage.h",
"$_src/sksl/SkSLASTFile.h",
"$_src/sksl/SkSLASTNode.cpp",
"$_src/sksl/SkSLASTNode.h",
"$_src/sksl/SkSLAnalysis.cpp",
"$_src/sksl/SkSLAnalysis.h",
"$_src/sksl/SkSLByteCode.cpp",
"$_src/sksl/SkSLByteCode.h",
"$_src/sksl/SkSLByteCodeGenerator.cpp",
"$_src/sksl/SkSLByteCodeGenerator.h",
"$_src/sksl/SkSLCFGGenerator.cpp",
"$_src/sksl/SkSLCFGGenerator.h",
"$_src/sksl/SkSLCompiler.cpp",
"$_src/sksl/SkSLCompiler.h",
"$_src/sksl/SkSLConstantFolder.cpp",
"$_src/sksl/SkSLConstantFolder.h",
"$_src/sksl/SkSLContext.cpp",
"$_src/sksl/SkSLContext.h",
"$_src/sksl/SkSLDefines.h",
"$_src/sksl/SkSLDehydrator.cpp",
"$_src/sksl/SkSLDehydrator.h",
"$_src/sksl/SkSLErrorReporter.h",
"$_src/sksl/SkSLExternalFunction.h",
"$_src/sksl/SkSLFileOutputStream.h",
"$_src/sksl/SkSLIRGenerator.cpp",
"$_src/sksl/SkSLIRGenerator.h",
"$_src/sksl/SkSLInliner.cpp",
"$_src/sksl/SkSLInliner.h",
"$_src/sksl/SkSLLexer.cpp",
"$_src/sksl/SkSLLexer.h",
"$_src/sksl/SkSLMangler.cpp",
"$_src/sksl/SkSLMemoryLayout.h",
"$_src/sksl/SkSLMemoryPool.h",
"$_src/sksl/SkSLOutputStream.cpp",
"$_src/sksl/SkSLOutputStream.h",
"$_src/sksl/SkSLParser.cpp",
"$_src/sksl/SkSLParser.h",
Reland "Create a basic IRNode pooling system." This is a reland of e16eca95f5c08c2bdf72cc0b04af62a1071afd8d This fixes the no-op (iOS) implementation of CreatePoolOnThread. Original change's description: > Create a basic IRNode pooling system. > > Allocations are redirected by overriding `operator new` and `operator > delete` on the IRNode class. This allows us to use our existing > `unique_ptr` and `make_unique` calls as-is. The Pool class is simple; > it holds a fixed number of nodes and recycles them as they are returned. > > A fixed pool size of 2000 nodes was chosen. That is large enough to hold > the contents of `sksl_large` during compilation, but it can be > overflowed by very large shaders, or if multiple programs are converted > at the same time. Exhausting the pool is not a problem; if this happens, > additional nodes will be allocated via the system allocator as usual. > More elaborate schemes are possible but might not add a lot of value. > > Thread safety is accomplished by placing the pool in a `thread_local` > static during a Program's creation and destruction; the pool is freed > when the program is destroyed. One important consequence of this > strategy is that a program must free every node that it allocated during > its creation, or else the node will be leaked. In debug, leaking a node > will be detected and causes a DEBUGFAIL. In release, the pool will be > freed despite having a live node in it, and if that node is later freed, > that pointer will be passed to the system `free` (which is likely to > cause a crash). > > In this CL, iOS does not support pooling, since support for > `thread_local` was only added on iOS 9. This is fixed in the followup > CL, http://review.skia.org/328837, which uses pthread keys on iOS. > > Nanobench shows ~15% improvement: > (last week) http://screen/5CNBhTaZApcDA8h > (today) http://screen/8ti5Rymvf6LUs8i > > Change-Id: I559de73606ee1be54e5eae7f82129dc928a63e3c > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326876 > Commit-Queue: John Stiles <johnstiles@google.com> > Reviewed-by: Ethan Nicholas <ethannicholas@google.com> > Auto-Submit: John Stiles <johnstiles@google.com> Change-Id: I8623a574a7e92332ff00b83982497863c8953929 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329171 Commit-Queue: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-22 15:09:15 +00:00
"$_src/sksl/SkSLPool.cpp",
"$_src/sksl/SkSLPool.h",
"$_src/sksl/SkSLPosition.h",
"$_src/sksl/SkSLRehydrator.cpp",
"$_src/sksl/SkSLRehydrator.h",
"$_src/sksl/SkSLSampleUsage.cpp",
"$_src/sksl/SkSLSectionAndParameterHelper.cpp",
"$_src/sksl/SkSLSectionAndParameterHelper.h",
"$_src/sksl/SkSLString.cpp",
"$_src/sksl/SkSLString.h",
"$_src/sksl/SkSLStringStream.h",
"$_src/sksl/SkSLUtil.cpp",
"$_src/sksl/SkSLUtil.h",
"$_src/sksl/SkSLVMGenerator.cpp",
"$_src/sksl/SkSLVMGenerator.h",
"$_src/sksl/dsl/DSLCore.cpp",
"$_src/sksl/dsl/DSLExpression.cpp",
"$_src/sksl/dsl/DSLType.cpp",
"$_src/sksl/dsl/DSLVar.cpp",
"$_src/sksl/dsl/priv/DSLWriter.cpp",
"$_src/sksl/ir/SkSLBinaryExpression.h",
"$_src/sksl/ir/SkSLBlock.h",
"$_src/sksl/ir/SkSLBoolLiteral.h",
"$_src/sksl/ir/SkSLBreakStatement.h",
"$_src/sksl/ir/SkSLConstructor.cpp",
"$_src/sksl/ir/SkSLConstructor.h",
"$_src/sksl/ir/SkSLContinueStatement.h",
"$_src/sksl/ir/SkSLDiscardStatement.h",
"$_src/sksl/ir/SkSLDoStatement.h",
"$_src/sksl/ir/SkSLEnum.h",
"$_src/sksl/ir/SkSLExpression.h",
"$_src/sksl/ir/SkSLExpressionStatement.h",
"$_src/sksl/ir/SkSLExtension.h",
"$_src/sksl/ir/SkSLExternalFunctionCall.h",
"$_src/sksl/ir/SkSLExternalFunctionReference.h",
"$_src/sksl/ir/SkSLField.h",
"$_src/sksl/ir/SkSLFieldAccess.h",
"$_src/sksl/ir/SkSLFloatLiteral.h",
"$_src/sksl/ir/SkSLForStatement.h",
"$_src/sksl/ir/SkSLFunctionCall.h",
"$_src/sksl/ir/SkSLFunctionDeclaration.h",
"$_src/sksl/ir/SkSLFunctionDefinition.h",
"$_src/sksl/ir/SkSLFunctionPrototype.h",
"$_src/sksl/ir/SkSLFunctionReference.h",
"$_src/sksl/ir/SkSLIRNode.h",
"$_src/sksl/ir/SkSLIfStatement.h",
"$_src/sksl/ir/SkSLIndexExpression.h",
"$_src/sksl/ir/SkSLInlineMarker.h",
"$_src/sksl/ir/SkSLIntLiteral.h",
"$_src/sksl/ir/SkSLInterfaceBlock.h",
"$_src/sksl/ir/SkSLLayout.h",
"$_src/sksl/ir/SkSLModifiers.h",
"$_src/sksl/ir/SkSLModifiersDeclaration.h",
"$_src/sksl/ir/SkSLNop.h",
"$_src/sksl/ir/SkSLPostfixExpression.h",
"$_src/sksl/ir/SkSLPrefixExpression.cpp",
"$_src/sksl/ir/SkSLPrefixExpression.h",
"$_src/sksl/ir/SkSLProgram.h",
"$_src/sksl/ir/SkSLProgramElement.h",
"$_src/sksl/ir/SkSLReturnStatement.h",
"$_src/sksl/ir/SkSLSection.h",
"$_src/sksl/ir/SkSLSetting.cpp",
"$_src/sksl/ir/SkSLSetting.h",
"$_src/sksl/ir/SkSLStatement.h",
"$_src/sksl/ir/SkSLStructDefinition.h",
"$_src/sksl/ir/SkSLSwitchCase.h",
"$_src/sksl/ir/SkSLSwitchStatement.h",
"$_src/sksl/ir/SkSLSwizzle.h",
"$_src/sksl/ir/SkSLSymbol.h",
"$_src/sksl/ir/SkSLSymbolAlias.h",
"$_src/sksl/ir/SkSLSymbolTable.cpp",
"$_src/sksl/ir/SkSLSymbolTable.h",
"$_src/sksl/ir/SkSLTernaryExpression.h",
"$_src/sksl/ir/SkSLType.cpp",
"$_src/sksl/ir/SkSLType.h",
"$_src/sksl/ir/SkSLTypeReference.h",
"$_src/sksl/ir/SkSLUnresolvedFunction.h",
"$_src/sksl/ir/SkSLVarDeclarations.h",
"$_src/sksl/ir/SkSLVariable.h",
"$_src/sksl/ir/SkSLVariableReference.cpp",
"$_src/sksl/ir/SkSLVariableReference.h",
]
skia_sksl_gpu_sources = [
"$_src/sksl/SkSLCPPCodeGenerator.cpp",
"$_src/sksl/SkSLCPPCodeGenerator.h",
"$_src/sksl/SkSLCPPUniformCTypes.cpp",
"$_src/sksl/SkSLCPPUniformCTypes.h",
"$_src/sksl/SkSLCodeGenerator.h",
"$_src/sksl/SkSLGLSLCodeGenerator.cpp",
"$_src/sksl/SkSLGLSLCodeGenerator.h",
"$_src/sksl/SkSLHCodeGenerator.cpp",
"$_src/sksl/SkSLHCodeGenerator.h",
"$_src/sksl/SkSLMetalCodeGenerator.cpp",
"$_src/sksl/SkSLMetalCodeGenerator.h",
"$_src/sksl/SkSLPipelineStageCodeGenerator.cpp",
"$_src/sksl/SkSLPipelineStageCodeGenerator.h",
"$_src/sksl/SkSLSPIRVCodeGenerator.cpp",
"$_src/sksl/SkSLSPIRVCodeGenerator.h",
"$_src/sksl/SkSLSPIRVtoHLSL.cpp",
"$_src/sksl/SkSLSPIRVtoHLSL.h",
]
skia_gpu_processor_sources = [
"$_src/gpu/effects/GrAARectEffect.fp",
"$_src/gpu/effects/GrAlphaThresholdFragmentProcessor.fp",
"$_src/gpu/effects/GrArithmeticProcessor.fp",
"$_src/gpu/effects/GrBlurredEdgeFragmentProcessor.fp",
"$_src/gpu/effects/GrCircleBlurFragmentProcessor.fp",
"$_src/gpu/effects/GrCircleEffect.fp",
"$_src/gpu/effects/GrClampFragmentProcessor.fp",
"$_src/gpu/effects/GrColorMatrixFragmentProcessor.fp",
"$_src/gpu/effects/GrComposeLerpEffect.fp",
"$_src/gpu/effects/GrConfigConversionEffect.fp",
"$_src/gpu/effects/GrConstColorProcessor.fp",
"$_src/gpu/effects/GrDeviceSpaceEffect.fp",
"$_src/gpu/effects/GrDitherEffect.fp",
"$_src/gpu/effects/GrEllipseEffect.fp",
"$_src/gpu/effects/GrHSLToRGBFilterEffect.fp",
"$_src/gpu/effects/GrHighContrastFilterEffect.fp",
"$_src/gpu/effects/GrLumaColorFilterEffect.fp",
"$_src/gpu/effects/GrMagnifierEffect.fp",
"$_src/gpu/effects/GrMixerEffect.fp",
"$_src/gpu/effects/GrOverrideInputFragmentProcessor.fp",
"$_src/gpu/effects/GrRGBToHSLFilterEffect.fp",
"$_src/gpu/effects/GrRRectBlurEffect.fp",
"$_src/gpu/effects/GrRectBlurEffect.fp",
"$_src/gpu/gradients/GrClampedGradientEffect.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/GrLinearGradientLayout.fp",
"$_src/gpu/gradients/GrRadialGradientLayout.fp",
"$_src/gpu/gradients/GrSingleIntervalGradientColorizer.fp",
"$_src/gpu/gradients/GrSweepGradientLayout.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/GrTiledGradientEffect.fp",
"$_src/gpu/gradients/GrTwoPointConicalGradientLayout.fp",
"$_src/gpu/gradients/GrUnrolledBinaryGradientColorizer.fp",
]