public Template Build()
            {
                var templateInternal = new TemplateInternal()
                {
                    m_NameHandle = container.AddString(Name),
                    m_AdditionalShaderIDStringHandle = container.AddString(AdditionalShaderID),
                    m_LinkerHandle = container.AddTemplateLinker(linker)
                };

                templateInternal.m_PassListHandle          = FixedHandleListInternal.Build(container, passes, (p) => (p.handle));
                templateInternal.m_TagDescriptorListHandle = FixedHandleListInternal.Build(container, tagDescriptors, (t) => (t.handle));

                var returnTypeHandle = container.AddTemplateInternal(templateInternal);

                return(new Template(container, returnTypeHandle));
            }
예제 #2
0
 internal extern FoundryHandle AddTemplateInternal(TemplateInternal templateInternal);
 // private
 internal Template(ShaderContainer container, FoundryHandle handle)
 {
     this.container = container;
     this.handle    = handle;
     this.template  = container?.GetTemplate(handle) ?? TemplateInternal.Invalid();
 }