コード例 #1
0
        public override string VisitStruct(ShaderInputsParser.StructContext context)
        {
            string name = context.NAME().GetText();

            MembersVisitor visitor = new MembersVisitor();

            visitor.Visit(context);

            AnnotationsVisitor annotVisitor = new AnnotationsVisitor();

            annotVisitor.Visit(context);

            Structure structure = new Structure(name, visitor.Members);

            structure.Annotations = new List <Annotation>(annotVisitor.Annotations);

            if (structure.IsCommon)
            {
                m_globalCtx.Structures.Add(structure);
            }
            else
            {
                OutputContext.Structures.Add(structure);
            }

            return(name);
        }
コード例 #2
0
        public override string VisitCbuffer(ShaderInputsParser.CbufferContext context)
        {
            string name = context.NAME().GetText();

            MembersVisitor visitor = new MembersVisitor();

            visitor.Visit(context);

            AnnotationsVisitor annotVisitor = new AnnotationsVisitor();

            annotVisitor.Visit(context);

            ConstantBuffer buffer = new ConstantBuffer(name, visitor.Members);

            buffer.Annotations = new List <Annotation>(annotVisitor.Annotations);
            OutputContext.ConstantBuffers.Add(buffer);

            return(name);
        }