skia2/gn/sksl.gni

265 lines
9.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")
_include = get_path_info("../include", "abspath")
skia_sksl_sources = [
"$_include/private/SkSLDefines.h",
"$_include/private/SkSLIRNode.h",
"$_include/private/SkSLLayout.h",
"$_include/private/SkSLModifiers.h",
"$_include/private/SkSLProgramElement.h",
"$_include/private/SkSLProgramKind.h",
"$_include/private/SkSLSampleUsage.h",
"$_include/private/SkSLStatement.h",
"$_include/private/SkSLString.h",
"$_include/private/SkSLSymbol.h",
"$_include/sksl/DSL.h",
"$_include/sksl/DSLBlock.h",
"$_include/sksl/DSLCase.h",
"$_include/sksl/DSLCore.h",
"$_include/sksl/DSLExpression.h",
"$_include/sksl/DSLFunction.h",
"$_include/sksl/DSLLayout.h",
"$_include/sksl/DSLModifiers.h",
"$_include/sksl/DSLRuntimeEffects.h",
"$_include/sksl/DSLStatement.h",
"$_include/sksl/DSLSymbols.h",
"$_include/sksl/DSLType.h",
"$_include/sksl/DSLVar.h",
"$_include/sksl/DSLWrapper.h",
"$_include/sksl/SkSLDebugTrace.h",
"$_include/sksl/SkSLErrorReporter.h",
"$_include/sksl/SkSLOperator.h",
"$_include/sksl/SkSLPosition.h",
"$_src/sksl/SkSLAnalysis.cpp",
"$_src/sksl/SkSLAnalysis.h",
"$_src/sksl/SkSLBuiltinMap.cpp",
"$_src/sksl/SkSLBuiltinMap.h",
"$_src/sksl/SkSLBuiltinTypes.cpp",
"$_src/sksl/SkSLBuiltinTypes.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/SkSLDSLParser.cpp",
"$_src/sksl/SkSLDSLParser.h",
"$_src/sksl/SkSLDehydrator.cpp",
"$_src/sksl/SkSLDehydrator.h",
"$_src/sksl/SkSLErrorReporter.cpp",
"$_src/sksl/SkSLFileOutputStream.h",
"$_src/sksl/SkSLGLSL.h",
"$_src/sksl/SkSLInliner.cpp",
"$_src/sksl/SkSLInliner.h",
"$_src/sksl/SkSLIntrinsicList.h",
"$_src/sksl/SkSLLexer.cpp",
"$_src/sksl/SkSLLexer.h",
"$_src/sksl/SkSLMangler.cpp",
"$_src/sksl/SkSLMangler.h",
"$_src/sksl/SkSLMemoryLayout.h",
"$_src/sksl/SkSLMemoryPool.h",
"$_src/sksl/SkSLModifiersPool.h",
"$_src/sksl/SkSLOperator.cpp",
"$_src/sksl/SkSLOutputStream.cpp",
"$_src/sksl/SkSLOutputStream.h",
"$_src/sksl/SkSLParsedModule.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.cpp",
"$_src/sksl/SkSLProgramSettings.h",
"$_src/sksl/SkSLRehydrator.cpp",
"$_src/sksl/SkSLRehydrator.h",
"$_src/sksl/SkSLSampleUsage.cpp",
"$_src/sksl/SkSLSharedCompiler.cpp",
"$_src/sksl/SkSLSharedCompiler.h",
"$_src/sksl/SkSLString.cpp",
"$_src/sksl/SkSLStringStream.h",
"$_src/sksl/SkSLThreadContext.cpp",
"$_src/sksl/SkSLThreadContext.h",
"$_src/sksl/SkSLUtil.cpp",
"$_src/sksl/SkSLUtil.h",
"$_src/sksl/analysis/SkSLCanExitWithoutReturningValue.cpp",
"$_src/sksl/analysis/SkSLCheckProgramStructure.cpp",
"$_src/sksl/analysis/SkSLFinalizationChecks.cpp",
"$_src/sksl/analysis/SkSLGetLoopUnrollInfo.cpp",
"$_src/sksl/analysis/SkSLIsConstantExpression.cpp",
"$_src/sksl/analysis/SkSLIsSameExpressionTree.cpp",
"$_src/sksl/analysis/SkSLNoOpErrorReporter.h",
"$_src/sksl/analysis/SkSLProgramUsage.cpp",
"$_src/sksl/analysis/SkSLProgramVisitor.h",
"$_src/sksl/analysis/SkSLSwitchCaseContainsExit.cpp",
"$_src/sksl/codegen/SkSLVMCodeGenerator.cpp",
"$_src/sksl/codegen/SkSLVMCodeGenerator.h",
"$_src/sksl/dsl/DSLBlock.cpp",
"$_src/sksl/dsl/DSLCase.cpp",
"$_src/sksl/dsl/DSLCore.cpp",
"$_src/sksl/dsl/DSLExpression.cpp",
"$_src/sksl/dsl/DSLFunction.cpp",
"$_src/sksl/dsl/DSLLayout.cpp",
"$_src/sksl/dsl/DSLRuntimeEffects.cpp",
"$_src/sksl/dsl/DSLStatement.cpp",
"$_src/sksl/dsl/DSLSymbols.cpp",
"$_src/sksl/dsl/DSLType.cpp",
"$_src/sksl/dsl/DSLVar.cpp",
"$_src/sksl/dsl/priv/DSLFPs.cpp",
"$_src/sksl/dsl/priv/DSLWriter.cpp",
"$_src/sksl/dsl/priv/DSLWriter.h",
"$_src/sksl/ir/SkSLBinaryExpression.cpp",
"$_src/sksl/ir/SkSLBinaryExpression.h",
"$_src/sksl/ir/SkSLBlock.cpp",
"$_src/sksl/ir/SkSLBlock.h",
"$_src/sksl/ir/SkSLBreakStatement.h",
"$_src/sksl/ir/SkSLChildCall.cpp",
"$_src/sksl/ir/SkSLChildCall.h",
"$_src/sksl/ir/SkSLConstructor.cpp",
"$_src/sksl/ir/SkSLConstructor.h",
"$_src/sksl/ir/SkSLConstructorArray.cpp",
"$_src/sksl/ir/SkSLConstructorArray.h",
"$_src/sksl/ir/SkSLConstructorArrayCast.cpp",
"$_src/sksl/ir/SkSLConstructorArrayCast.h",
"$_src/sksl/ir/SkSLConstructorCompound.cpp",
"$_src/sksl/ir/SkSLConstructorCompound.h",
"$_src/sksl/ir/SkSLConstructorCompoundCast.cpp",
"$_src/sksl/ir/SkSLConstructorCompoundCast.h",
"$_src/sksl/ir/SkSLConstructorDiagonalMatrix.cpp",
"$_src/sksl/ir/SkSLConstructorDiagonalMatrix.h",
"$_src/sksl/ir/SkSLConstructorMatrixResize.cpp",
"$_src/sksl/ir/SkSLConstructorMatrixResize.h",
"$_src/sksl/ir/SkSLConstructorScalarCast.cpp",
"$_src/sksl/ir/SkSLConstructorScalarCast.h",
"$_src/sksl/ir/SkSLConstructorSplat.cpp",
"$_src/sksl/ir/SkSLConstructorSplat.h",
"$_src/sksl/ir/SkSLConstructorStruct.cpp",
"$_src/sksl/ir/SkSLConstructorStruct.h",
"$_src/sksl/ir/SkSLContinueStatement.h",
"$_src/sksl/ir/SkSLDiscardStatement.h",
"$_src/sksl/ir/SkSLDoStatement.cpp",
"$_src/sksl/ir/SkSLDoStatement.h",
"$_src/sksl/ir/SkSLExpression.cpp",
"$_src/sksl/ir/SkSLExpression.h",
"$_src/sksl/ir/SkSLExpressionStatement.cpp",
"$_src/sksl/ir/SkSLExpressionStatement.h",
"$_src/sksl/ir/SkSLExtension.h",
"$_src/sksl/ir/SkSLExternalFunction.h",
"$_src/sksl/ir/SkSLExternalFunctionCall.h",
"$_src/sksl/ir/SkSLExternalFunctionReference.h",
"$_src/sksl/ir/SkSLField.h",
"$_src/sksl/ir/SkSLFieldAccess.cpp",
"$_src/sksl/ir/SkSLFieldAccess.h",
"$_src/sksl/ir/SkSLForStatement.cpp",
"$_src/sksl/ir/SkSLForStatement.h",
"$_src/sksl/ir/SkSLFunctionCall.cpp",
"$_src/sksl/ir/SkSLFunctionCall.h",
"$_src/sksl/ir/SkSLFunctionDeclaration.cpp",
"$_src/sksl/ir/SkSLFunctionDeclaration.h",
"$_src/sksl/ir/SkSLFunctionDefinition.cpp",
"$_src/sksl/ir/SkSLFunctionDefinition.h",
"$_src/sksl/ir/SkSLFunctionPrototype.h",
"$_src/sksl/ir/SkSLFunctionReference.h",
"$_src/sksl/ir/SkSLIfStatement.cpp",
"$_src/sksl/ir/SkSLIfStatement.h",
"$_src/sksl/ir/SkSLIndexExpression.cpp",
"$_src/sksl/ir/SkSLIndexExpression.h",
"$_src/sksl/ir/SkSLInlineMarker.h",
"$_src/sksl/ir/SkSLInterfaceBlock.h",
"$_src/sksl/ir/SkSLLiteral.h",
"$_src/sksl/ir/SkSLMethodReference.h",
"$_src/sksl/ir/SkSLModifiers.cpp",
"$_src/sksl/ir/SkSLModifiersDeclaration.h",
"$_src/sksl/ir/SkSLNop.h",
"$_src/sksl/ir/SkSLPoison.h",
"$_src/sksl/ir/SkSLPostfixExpression.cpp",
"$_src/sksl/ir/SkSLPostfixExpression.h",
"$_src/sksl/ir/SkSLPrefixExpression.cpp",
"$_src/sksl/ir/SkSLPrefixExpression.h",
"$_src/sksl/ir/SkSLProgram.h",
"$_src/sksl/ir/SkSLReturnStatement.h",
"$_src/sksl/ir/SkSLSetting.cpp",
"$_src/sksl/ir/SkSLSetting.h",
"$_src/sksl/ir/SkSLStructDefinition.h",
"$_src/sksl/ir/SkSLSwitchCase.h",
"$_src/sksl/ir/SkSLSwitchStatement.cpp",
"$_src/sksl/ir/SkSLSwitchStatement.h",
"$_src/sksl/ir/SkSLSwizzle.cpp",
"$_src/sksl/ir/SkSLSwizzle.h",
"$_src/sksl/ir/SkSLSymbolTable.cpp",
"$_src/sksl/ir/SkSLSymbolTable.h",
"$_src/sksl/ir/SkSLTernaryExpression.cpp",
"$_src/sksl/ir/SkSLTernaryExpression.h",
"$_src/sksl/ir/SkSLType.cpp",
"$_src/sksl/ir/SkSLType.h",
"$_src/sksl/ir/SkSLTypeReference.cpp",
"$_src/sksl/ir/SkSLTypeReference.h",
"$_src/sksl/ir/SkSLUnresolvedFunction.h",
"$_src/sksl/ir/SkSLVarDeclarations.cpp",
"$_src/sksl/ir/SkSLVarDeclarations.h",
"$_src/sksl/ir/SkSLVariable.cpp",
"$_src/sksl/ir/SkSLVariable.h",
"$_src/sksl/ir/SkSLVariableReference.cpp",
"$_src/sksl/ir/SkSLVariableReference.h",
"$_src/sksl/spirv.h",
"$_src/sksl/tracing/SkVMDebugTrace.cpp",
"$_src/sksl/tracing/SkVMDebugTrace.h",
"$_src/sksl/transform/SkSLBuiltinVariableScanner.cpp",
"$_src/sksl/transform/SkSLEliminateDeadFunctions.cpp",
"$_src/sksl/transform/SkSLEliminateDeadGlobalVariables.cpp",
"$_src/sksl/transform/SkSLEliminateDeadLocalVariables.cpp",
"$_src/sksl/transform/SkSLEliminateUnreachableCode.cpp",
"$_src/sksl/transform/SkSLTransform.h",
]
skia_sksl_tracing_sources = [
"$_src/sksl/tracing/SkVMDebugTracePlayer.cpp",
"$_src/sksl/tracing/SkVMDebugTracePlayer.h",
]
skia_sksl_gpu_sources = [
"$_src/sksl/codegen/SkSLCodeGenerator.h",
"$_src/sksl/codegen/SkSLGLSLCodeGenerator.cpp",
"$_src/sksl/codegen/SkSLGLSLCodeGenerator.h",
"$_src/sksl/codegen/SkSLMetalCodeGenerator.cpp",
"$_src/sksl/codegen/SkSLMetalCodeGenerator.h",
"$_src/sksl/codegen/SkSLPipelineStageCodeGenerator.cpp",
"$_src/sksl/codegen/SkSLPipelineStageCodeGenerator.h",
"$_src/sksl/codegen/SkSLSPIRVCodeGenerator.cpp",
"$_src/sksl/codegen/SkSLSPIRVCodeGenerator.h",
"$_src/sksl/codegen/SkSLSPIRVtoHLSL.cpp",
"$_src/sksl/codegen/SkSLSPIRVtoHLSL.h",
"$_src/sksl/codegen/SkSLWGSLCodeGenerator.cpp",
"$_src/sksl/codegen/SkSLWGSLCodeGenerator.h",
]
skslc_deps = [
"$_src/core/SkArenaAlloc.cpp",
"$_src/core/SkBlockAllocator.cpp",
"$_src/core/SkCpu.cpp",
"$_src/core/SkData.cpp",
"$_src/core/SkHalf.cpp",
"$_src/core/SkMalloc.cpp",
"$_src/core/SkMath.cpp",
"$_src/core/SkMatrixInvert.cpp",
"$_src/core/SkSemaphore.cpp",
"$_src/core/SkStream.cpp",
"$_src/core/SkString.cpp",
"$_src/core/SkStringUtils.cpp",
"$_src/core/SkThreadID.cpp",
"$_src/core/SkUtils.cpp",
"$_src/core/SkVM.cpp",
"$_src/gpu/ganesh/GrMemoryPool.cpp",
"$_src/ports/SkMemory_malloc.cpp",
"$_src/ports/SkOSFile_stdio.cpp",
"$_src/utils/SkJSON.cpp",
"$_src/utils/SkJSONWriter.cpp",
"$_src/utils/SkOSPath.cpp",
"$_src/utils/SkParse.cpp",
"$_src/utils/SkShaderUtils.cpp",
"$_src/utils/SkUTF.cpp",
"$_src/utils/SkVMVisualizer.cpp",
]