public override void VisitMethodDeclaration(MethodDeclarationSyntax node) { var shaderFunction = VisitMethod(node); if (shaderFunction != null && shaderFunction.mMeta.mAttributes.Contains(typeof(Shader.EntryPoint))) { EntryPointGeneration.Generate(mFrontEnd, mContext.mCurrentType, shaderFunction); } }
public void CreateDummyEntryPoint(TypeDependencyCollector typeCollector, ShaderLibrary library, FrontEndTranslator frontEnd, ShaderType shaderType) { var context = new FrontEndContext(); context.mCurrentType = shaderType; if (shaderType.mEntryPoints.Count != 0) { return; } ShaderEntryPointInfo entryPoint = null; if (shaderType.mFragmentType == FragmentType.Pixel || shaderType.mFragmentType == FragmentType.None) { entryPoint = EntryPointGeneration.GeneratePixel(frontEnd, shaderType, null); } else if (shaderType.mFragmentType == FragmentType.Vertex) { entryPoint = EntryPointGeneration.GenerateVertex(frontEnd, shaderType, null); } typeCollector.Visit(entryPoint); }