skia2/gn/sksl.gni
Brian Osman dd49617f92 Reland "Untangle dependency cycle in sksl dehydration"
Explanation: The sksl standalone compiler is used to convert the raw
(text) SkSL pre-includes into a "dehydrated" binary format. It also
(previously) depended on those files, as they were #included and used,
unless a special #define was changed. This created a dependency cycle
that we hid from GN (by lying about the outputs of the dehydrate step).
As a result, builds would never reach steady-state, because the compiler
would be rebuilt (due to the newer dehydrated files), and then the
dehydrated files would be rebuilt (due to the newer compiler).

This CL changes the logic so that the standalone compiler always uses
the textual pre-includes, and no longer depends on the dehydrated binary
files. Thus, to make any kind of change to the dehydrated files (whether
due to pre-include changes, or the encoding format itself), you just
need skia_compile_processors enabled. The dependencies are now honestly
communicated to GN, and we reach steady state after one build.

The NOTE above is because GN/ninja cache the dependencies of each
target, and will still think that the SkSLCompiler.obj linked into the
standalone compiler depends on the dehydrated files, at least until one
successful build, when it will realize that's no longer true.

Reland notes:

The bots originally rejected this CL, because SkSLCompiler was
hard-coded to load the text files from a relative path that assumed the
executable was in "<skia_checkout>/out/<some_dir>". That's not true for
bots, and it was fragile, even for users. Now, we use GN to directly
generate sksl_fp.sksl, and copy all of the other pre-includes to the
root out dir (working directory when running skslc). This means we
no longer need to generate the sksl_fp.sksl file into the src tree, and
the compiler can more safely assume that the files will be in the
working directory.

Bug: skia:10571
Change-Id: Id7837a9aba7ee0c3f7fa82eb84f7761e24b9c705
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308896
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-08-10 15:47:43 +00:00

115 lines
4.2 KiB
Plaintext

# 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/SkSLContext.h",
"$_src/sksl/SkSLDefines.h",
"$_src/sksl/SkSLDehydrator.cpp",
"$_src/sksl/SkSLErrorReporter.h",
"$_src/sksl/SkSLExternalValue.h",
"$_src/sksl/SkSLFileOutputStream.h",
"$_src/sksl/SkSLIRGenerator.cpp",
"$_src/sksl/SkSLIRGenerator.h",
"$_src/sksl/SkSLLexer.cpp",
"$_src/sksl/SkSLLexer.h",
"$_src/sksl/SkSLMemoryLayout.h",
"$_src/sksl/SkSLOutputStream.h",
"$_src/sksl/SkSLParser.cpp",
"$_src/sksl/SkSLParser.h",
"$_src/sksl/SkSLPosition.h",
"$_src/sksl/SkSLRehydrator.cpp",
"$_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/ir/SkSLSetting.cpp",
"$_src/sksl/ir/SkSLSetting.h",
"$_src/sksl/ir/SkSLSymbolTable.cpp",
"$_src/sksl/ir/SkSLSymbolTable.h",
"$_src/sksl/ir/SkSLType.cpp",
"$_src/sksl/ir/SkSLType.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/SkSLOutputStream.cpp",
"$_src/sksl/SkSLOutputStream.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",
"$_src/gpu/gradients/GrLinearGradientLayout.fp",
"$_src/gpu/gradients/GrRadialGradientLayout.fp",
"$_src/gpu/gradients/GrSingleIntervalGradientColorizer.fp",
"$_src/gpu/gradients/GrSweepGradientLayout.fp",
"$_src/gpu/gradients/GrTiledGradientEffect.fp",
"$_src/gpu/gradients/GrTwoPointConicalGradientLayout.fp",
"$_src/gpu/gradients/GrUnrolledBinaryGradientColorizer.fp",
]