31#define MODULE_DATA(name) #name, GetModuleData(ModuleName::name, #name ".sksl")
35#define TYPE(t) &BuiltinTypes::f ## t
76 TYPE(Sampler2D),
TYPE(SamplerExternalOES),
TYPE(Sampler2DRect),
78 TYPE(SubpassInput),
TYPE(SubpassInputMS),
81 TYPE(Texture2D_sample),
82 TYPE(Texture2D),
TYPE(ReadOnlyTexture2D),
TYPE(WriteOnlyTexture2D),
83 TYPE(GenTexture2D),
TYPE(ReadableTexture2D),
TYPE(WritableTexture2D),
124 fModuleLoader.
fMutex.acquire();
128 fModuleLoader.
fMutex.release();
150 std::string moduleSource,
152 std::unique_ptr<Module>
m =
compiler->compileModule(kind,
154 std::move(moduleSource),
164 m->fElements.erase(std::remove_if(
m->fElements.begin(),
m->fElements.end(),
165 [](
const std::unique_ptr<ProgramElement>& element) {
166 switch (element->kind()) {
167 case ProgramElement::Kind::kFunction:
168 case ProgramElement::Kind::kGlobalVar:
169 case ProgramElement::Kind::kInterfaceBlock:
170 case ProgramElement::Kind::kStructDefinition:
174 case ProgramElement::Kind::kFunctionPrototype:
180 SkDEBUGFAILF(
"Unsupported element: %s\n",
181 element->description().c_str());
187 m->fElements.shrink_to_fit();
320#if defined(SK_GRAPHITE)
335#if defined(SK_GRAPHITE)
351#if defined(SK_GRAPHITE)
366#if defined(SK_GRAPHITE)
#define SK_ABORT(message,...)
#define MODULE_DATA(name)
const std::unique_ptr< Type > fUVec3
const std::unique_ptr< Type > fMat4x4
const std::unique_ptr< Type > fMat4x2
const std::unique_ptr< Type > fSkCaps
const std::unique_ptr< Type > fUVec2
const std::unique_ptr< Type > fMat2x4
const std::unique_ptr< Type > fMat2
const std::unique_ptr< Type > fBVec2
const std::unique_ptr< Type > fMat4
const std::unique_ptr< Type > fMat4x3
const std::unique_ptr< Type > fMat2x2
const std::unique_ptr< Type > fInvalid
const std::unique_ptr< Type > fBVec3
const std::unique_ptr< Type > fBVec4
const std::unique_ptr< Type > fVec4
const std::unique_ptr< Type > fVec3
const std::unique_ptr< Type > fIVec3
const std::unique_ptr< Type > fIVec4
const std::unique_ptr< Type > fUVec4
const std::unique_ptr< Type > fIVec2
const std::unique_ptr< Type > fMat3
const std::unique_ptr< Type > fMat3x4
const std::unique_ptr< Type > fMat3x3
const std::unique_ptr< Type > fMat2x3
const std::unique_ptr< Type > fMat3x2
const std::unique_ptr< Type > fVec2
const Module * loadComputeModule(SkSL::Compiler *compiler)
const Module * loadPublicModule(SkSL::Compiler *compiler)
const Module * loadGPUModule(SkSL::Compiler *compiler)
const Module * loadSharedModule(SkSL::Compiler *compiler)
const Module * rootModule()
const Module * loadPrivateRTShaderModule(SkSL::Compiler *compiler)
const BuiltinTypes & builtinTypes()
const Module * loadGraphiteFragmentES2Module(SkSL::Compiler *compiler)
void addPublicTypeAliases(const SkSL::Module *module)
const Module * loadGraphiteFragmentModule(SkSL::Compiler *compiler)
const Module * loadGraphiteVertexModule(SkSL::Compiler *compiler)
static ModuleLoader Get()
const Module * loadFragmentModule(SkSL::Compiler *compiler)
const Module * loadGraphiteVertexES2Module(SkSL::Compiler *compiler)
ModuleLoader(ModuleLoader::Impl &)
const Module * loadVertexModule(SkSL::Compiler *compiler)
static std::unique_ptr< Type > MakeAliasType(std::string_view name, const Type &targetType)
static std::unique_ptr< Variable > Make(Position pos, Position modifiersPosition, const Layout &layout, ModifierFlags flags, const Type *type, std::string_view name, std::string mangledName, bool builtin, Storage storage)
const std::unique_ptr< Type > BuiltinTypes::* BuiltinTypePtr
static constexpr BuiltinTypePtr kPrivateTypes[]
static std::unique_ptr< Module > compile_and_shrink(SkSL::Compiler *compiler, ProgramKind kind, const char *moduleName, std::string moduleSource, const Module *parent)
static constexpr BuiltinTypePtr kRootTypes[]
std::function< ProfileSample(void)> Sampler
Sampler is run during SamplingProfiler::SampleRepeatedly. Each platform should implement its version ...
SK_API sk_sp< PrecompileShader > ColorFilter(SkSpan< const sk_sp< PrecompileShader > > shaders, SkSpan< const sk_sp< PrecompileColorFilter > > colorFilters)
std::unique_ptr< const Module > fGraphiteVertexModule
std::unique_ptr< const Module > fGraphiteFragmentModule
std::unique_ptr< const Module > fGPUModule
std::unique_ptr< const Module > fGraphiteVertexES2Module
std::unique_ptr< const Module > fGraphiteFragmentES2Module
std::unique_ptr< const Module > fComputeModule
std::unique_ptr< const Module > fFragmentModule
std::unique_ptr< const Module > fVertexModule
std::unique_ptr< const Module > fPublicModule
std::unique_ptr< const Module > fSharedModule
void makeRootSymbolTable()
const BuiltinTypes fBuiltinTypes
std::unique_ptr< const Module > fRootModule
std::unique_ptr< const Module > fRuntimeShaderModule
std::unique_ptr< SymbolTable > fSymbols