Lines Matching +full:is +full:- +full:builtin +full:- +full:module
4 * Use of this source code is governed by a BSD-style license that can be
95 // This mutex is taken when ModuleLoader::Get is called, and released when the returned
100 std::unique_ptr<const Module> fRootModule;
102 std::unique_ptr<const Module> fSharedModule; // [Root] + Public intrinsics
103 std::unique_ptr<const Module> fGPUModule; // [Shared] + Non-public intrinsics/
105 std::unique_ptr<const Module> fVertexModule; // [GPU] + Vertex stage decls
106 std::unique_ptr<const Module> fFragmentModule; // [GPU] + Fragment stage decls
107 std::unique_ptr<const Module> fComputeModule; // [GPU] + Compute stage decls
108 std::unique_ptr<const Module> fGraphiteVertexModule; // [Vert] + Graphite vertex helpers
109 std::unique_ptr<const Module> fGraphiteFragmentModule; // [Frag] + Graphite fragment helpers
110 std::unique_ptr<const Module> fGraphiteVertexES2Module; // [Vert] + Graphite vertex ES2 helpers
111 std::unique_ptr<const Module> fGraphiteFragmentES2Module;//[Frag] + Graphite fragment ES2 " "
113 std::unique_ptr<const Module> fPublicModule; // [Shared] minus Private types +
115 std::unique_ptr<const Module> fRuntimeShaderModule; // [Public] + Runtime shader decls
144 this->makeRootSymbolTable(); in Impl()
147 static std::unique_ptr<Module> compile_and_shrink(SkSL::Compiler* compiler, in compile_and_shrink()
151 const Module* parent) { in compile_and_shrink()
152 std::unique_ptr<Module> m = compiler->compileModule(kind, in compile_and_shrink()
158 SK_ABORT("Unable to load module %s", moduleName); in compile_and_shrink()
161 // We can eliminate FunctionPrototypes without changing the meaning of the module; the function in compile_and_shrink()
162 // declaration is still safely in the symbol table. This only impacts our ability to recreate in compile_and_shrink()
164 m->fElements.erase(std::remove_if(m->fElements.begin(), m->fElements.end(), in compile_and_shrink()
166 switch (element->kind()) { in compile_and_shrink()
181 element->description().c_str()); in compile_and_shrink()
185 m->fElements.end()); in compile_and_shrink()
187 m->fElements.shrink_to_fit(); in compile_and_shrink()
195 const Module* ModuleLoader::rootModule() { in rootModule()
199 void ModuleLoader::addPublicTypeAliases(const SkSL::Module* module) { in addPublicTypeAliases() argument
200 const SkSL::BuiltinTypes& types = this->builtinTypes(); in addPublicTypeAliases()
201 SymbolTable* symbols = module->fSymbols.get(); in addPublicTypeAliases()
204 symbols->addWithoutOwnershipOrDie(types.fVec2.get()); in addPublicTypeAliases()
205 symbols->addWithoutOwnershipOrDie(types.fVec3.get()); in addPublicTypeAliases()
206 symbols->addWithoutOwnershipOrDie(types.fVec4.get()); in addPublicTypeAliases()
208 symbols->addWithoutOwnershipOrDie(types.fIVec2.get()); in addPublicTypeAliases()
209 symbols->addWithoutOwnershipOrDie(types.fIVec3.get()); in addPublicTypeAliases()
210 symbols->addWithoutOwnershipOrDie(types.fIVec4.get()); in addPublicTypeAliases()
212 symbols->addWithoutOwnershipOrDie(types.fUVec2.get()); in addPublicTypeAliases()
213 symbols->addWithoutOwnershipOrDie(types.fUVec3.get()); in addPublicTypeAliases()
214 symbols->addWithoutOwnershipOrDie(types.fUVec4.get()); in addPublicTypeAliases()
216 symbols->addWithoutOwnershipOrDie(types.fBVec2.get()); in addPublicTypeAliases()
217 symbols->addWithoutOwnershipOrDie(types.fBVec3.get()); in addPublicTypeAliases()
218 symbols->addWithoutOwnershipOrDie(types.fBVec4.get()); in addPublicTypeAliases()
220 symbols->addWithoutOwnershipOrDie(types.fMat2.get()); in addPublicTypeAliases()
221 symbols->addWithoutOwnershipOrDie(types.fMat3.get()); in addPublicTypeAliases()
222 symbols->addWithoutOwnershipOrDie(types.fMat4.get()); in addPublicTypeAliases()
224 symbols->addWithoutOwnershipOrDie(types.fMat2x2.get()); in addPublicTypeAliases()
225 symbols->addWithoutOwnershipOrDie(types.fMat2x3.get()); in addPublicTypeAliases()
226 symbols->addWithoutOwnershipOrDie(types.fMat2x4.get()); in addPublicTypeAliases()
227 symbols->addWithoutOwnershipOrDie(types.fMat3x2.get()); in addPublicTypeAliases()
228 symbols->addWithoutOwnershipOrDie(types.fMat3x3.get()); in addPublicTypeAliases()
229 symbols->addWithoutOwnershipOrDie(types.fMat3x4.get()); in addPublicTypeAliases()
230 symbols->addWithoutOwnershipOrDie(types.fMat4x2.get()); in addPublicTypeAliases()
231 symbols->addWithoutOwnershipOrDie(types.fMat4x3.get()); in addPublicTypeAliases()
232 symbols->addWithoutOwnershipOrDie(types.fMat4x4.get()); in addPublicTypeAliases()
235 // using built-in names like `sampler2D` as variable names. in addPublicTypeAliases()
237 symbols->inject(Type::MakeAliasType((types.*privateType)->name(), *types.fInvalid)); in addPublicTypeAliases()
241 const Module* ModuleLoader::loadPublicModule(SkSL::Compiler* compiler) { in loadPublicModule()
243 const Module* sharedModule = this->loadSharedModule(compiler); in loadPublicModule()
248 this->addPublicTypeAliases(fModuleLoader.fPublicModule.get()); in loadPublicModule()
253 const Module* ModuleLoader::loadPrivateRTShaderModule(SkSL::Compiler* compiler) { in loadPrivateRTShaderModule()
255 const Module* publicModule = this->loadPublicModule(compiler); in loadPrivateRTShaderModule()
264 const Module* ModuleLoader::loadSharedModule(SkSL::Compiler* compiler) { in loadSharedModule()
266 const Module* rootModule = this->rootModule(); in loadSharedModule()
275 const Module* ModuleLoader::loadGPUModule(SkSL::Compiler* compiler) { in loadGPUModule()
277 const Module* sharedModule = this->loadSharedModule(compiler); in loadGPUModule()
286 const Module* ModuleLoader::loadFragmentModule(SkSL::Compiler* compiler) { in loadFragmentModule()
288 const Module* gpuModule = this->loadGPUModule(compiler); in loadFragmentModule()
297 const Module* ModuleLoader::loadVertexModule(SkSL::Compiler* compiler) { in loadVertexModule()
299 const Module* gpuModule = this->loadGPUModule(compiler); in loadVertexModule()
308 const Module* ModuleLoader::loadComputeModule(SkSL::Compiler* compiler) { in loadComputeModule()
310 const Module* gpuModule = this->loadGPUModule(compiler); in loadComputeModule()
319 const Module* ModuleLoader::loadGraphiteFragmentModule(SkSL::Compiler* compiler) { in loadGraphiteFragmentModule()
322 const Module* fragmentModule = this->loadFragmentModule(compiler); in loadGraphiteFragmentModule()
330 return this->loadFragmentModule(compiler); in loadGraphiteFragmentModule()
334 const Module* ModuleLoader::loadGraphiteFragmentES2Module(SkSL::Compiler* compiler) { in loadGraphiteFragmentES2Module()
337 const Module* fragmentModule = this->loadFragmentModule(compiler); in loadGraphiteFragmentES2Module()
346 return this->loadFragmentModule(compiler); in loadGraphiteFragmentES2Module()
350 const Module* ModuleLoader::loadGraphiteVertexModule(SkSL::Compiler* compiler) { in loadGraphiteVertexModule()
353 const Module* vertexModule = this->loadVertexModule(compiler); in loadGraphiteVertexModule()
361 return this->loadVertexModule(compiler); in loadGraphiteVertexModule()
365 const Module* ModuleLoader::loadGraphiteVertexES2Module(SkSL::Compiler* compiler) { in loadGraphiteVertexES2Module()
368 const Module* vertexModule = this->loadVertexModule(compiler); in loadGraphiteVertexES2Module()
377 return this->loadVertexModule(compiler); in loadGraphiteVertexES2Module()
382 auto rootModule = std::make_unique<Module>(); in makeRootSymbolTable()
383 rootModule->fSymbols = std::make_unique<SymbolTable>(/*builtin=*/true); in makeRootSymbolTable()
386 rootModule->fSymbols->addWithoutOwnershipOrDie((fBuiltinTypes.*rootType).get()); in makeRootSymbolTable()
390 rootModule->fSymbols->addWithoutOwnershipOrDie((fBuiltinTypes.*privateType).get()); in makeRootSymbolTable()
393 // sk_Caps is "builtin", but all references to it are resolved to Settings, so we don't need to in makeRootSymbolTable()
394 // treat it as builtin (ie, no need to clone it into the Program). in makeRootSymbolTable()
395 rootModule->fSymbols->addOrDie(Variable::Make(/*pos=*/Position(), in makeRootSymbolTable()
402 /*builtin=*/false, in makeRootSymbolTable()