示例#1
0
 public override Expression CopyExpression(CopyState state)
 {
     return(new NewVertexAttrib(Source, state.GetType(_dt),
                                VertexAttributeType.CopyNullable(state), VertexBuffer.CopyNullable(state),
                                VertexBufferStride.CopyNullable(state), VertexBufferOffset.CopyNullable(state),
                                OptionalIndexType.CopyNullable(state), OptionalIndexBuffer.CopyNullable(state)));
 }
示例#2
0
        public override Expression CopyExpression(CopyState state)
        {
            var result = new Lambda(Source, Parameters.Copy(state), state.GetType(DelegateType), null);

            state.AddLambda(this, result);
            var body = Body.CopyStatement(state);

            result.SetBody(body);
            return(result);
        }
示例#3
0
文件: Variable.cs 项目: mortend/uno
        public Variable Copy(CopyState state)
        {
            var result = new Variable(Source, Function, Name, state.GetType(ValueType), VariableType, OptionalValue.CopyNullable(state));

            state.AddVariable(this, result);
            if (Next != null)
            {
                result.Next = Next.Copy(state);
            }
            return(result);
        }
示例#4
0
 public override Expression CopyExpression(CopyState state)
 {
     return(new NewArray(Source, state.GetType(ArrayType), Size.CopyNullable(state), Initializers.Copy(state)));
 }
示例#5
0
 public override Expression CopyExpression(CopyState state)
 {
     return(new NewPixelSampler(Source, state.GetType(SamplerType),
                                Texture.CopyNullable(state),
                                OptionalState.CopyNullable(state)));
 }
示例#6
0
 public override Expression CopyExpression(CopyState state)
 {
     return(new IsOp(Source, Operand.CopyExpression(state), state.GetType(TestType), state.GetType(_boolType)));
 }
示例#7
0
 public override Expression CopyExpression(CopyState state)
 {
     return(new AllocObject(Source, state.GetType(ObjectType)));
 }
示例#8
0
文件: Constant.cs 项目: mortend/uno
 public override Expression CopyExpression(CopyState state)
 {
     return(new Constant(Source, state.GetType(ValueType), Value));
 }
示例#9
0
 public override Expression CopyExpression(CopyState state)
 {
     return(new NewDelegate(Source, state.GetType(DelegateType), Object?.CopyExpression(state), state.GetMember(Method)));
 }
示例#10
0
        public static Parameter[] Copy(this Parameter[] pl, CopyState state)
        {
            var result = new Parameter[pl.Length];

            for (int i = 0; i < result.Length; i++)
            {
                var p = pl[i];
                result[i] = new Parameter(p.Source, p.Attributes.Copy(state), p.Modifier, state.GetType(p.Type), p.Name, p.OptionalDefault.CopyNullable(state));
            }

            return(result);
        }
示例#11
0
 public override Expression CopyExpression(CopyState state)
 {
     return(new BranchOp(Source, state.GetType(_bool), BranchType, Left.CopyExpression(state), Right.CopyExpression(state)));
 }
示例#12
0
 public override Expression CopyExpression(CopyState state)
 {
     return(new PlaceholderArgument(Source, state.GetType(_dt), Index));
 }
示例#13
0
文件: Base.cs 项目: mortend/uno
 public override Expression CopyExpression(CopyState state)
 {
     return(new Base(Source, state.GetType(BaseType)));
 }
示例#14
0
        void ProcessStructs()
        {
            if (ShaderStructQueue.Count == 0)
            {
                return;
            }

            var provider = new StructProvider();
            var state    = new CopyState(null, provider);
            var owner    = Path.DrawBlock.Method.DeclaringType;

            foreach (var st in ShaderStructQueue)
            {
                var newst = new StructType(st.Source, IL, null, Modifiers.Public | Modifiers.Generated, st.UnoName + "_" + ShaderGlobalCounter++);
                provider.Map.Add(st, newst);
                DrawState.Structs.Add(newst);
            }

            foreach (var st in ShaderStructQueue)
            {
                var newst = state.GetType(st);

                foreach (var f in st.Fields)
                {
                    if (f.IsStatic)
                    {
                        continue;
                    }

                    var newf = new Field(f.Source, newst, f.UnoName, null, Modifiers.Public | Modifiers.Generated, 0, state.GetType(f.ReturnType));

                    newst.Fields.Add(newf);
                    provider.Map.Add(f, newf);
                }
            }


            state.SetFunction(DrawState.VertexShader.Entrypoint);
            DrawState.VertexShader.Entrypoint.SetBody(DrawState.VertexShader.Entrypoint.Body.CopyNullable(state));

            for (int i = 0; i < DrawState.Varyings.Count; i++)
            {
                var v = DrawState.Varyings[i];
                v.Value = v.Value.CopyExpression(state);
                DrawState.Varyings[i] = v;
            }

            foreach (var k in DrawState.VertexShader.Terminals.Keys.ToArray())
            {
                DrawState.VertexShader.Terminals[k] = DrawState.VertexShader.Terminals[k].CopyExpression(state);
            }

            foreach (var f in DrawState.VertexShader.Functions)
            {
                state.SetFunction(f);
                f.ReturnType = state.GetType(f.ReturnType);
                f.SetBody(f.Body.CopyNullable(state));

                foreach (var p in f.Parameters)
                {
                    p.Type = state.GetType(p.Type);
                }
            }


            state.SetFunction(DrawState.PixelShader.Entrypoint);
            DrawState.PixelShader.Entrypoint.SetBody(DrawState.PixelShader.Entrypoint.Body.CopyNullable(state));

            foreach (var k in DrawState.PixelShader.Terminals.Keys.ToArray())
            {
                DrawState.PixelShader.Terminals[k] = DrawState.PixelShader.Terminals[k].CopyExpression(state);
            }

            foreach (var f in DrawState.PixelShader.Functions)
            {
                state.SetFunction(f);
                f.ReturnType = state.GetType(f.ReturnType);
                f.SetBody(f.Body.CopyNullable(state));

                foreach (var p in f.Parameters)
                {
                    p.Type = state.GetType(p.Type);
                }
            }
        }
示例#15
0
 public override Expression CopyExpression(CopyState state)
 {
     return(new ExternOp(Source, Attributes.Copy(state), state.GetType(Type), String, Object.CopyNullable(state), Arguments.Copy(state), Usings));
 }
示例#16
0
 public override Expression CopyExpression(CopyState state)
 {
     return(new GetMetaObject(Source, state.GetType(_dt)));
 }
示例#17
0
文件: TypeOf.cs 项目: mortend/uno
 public override Expression CopyExpression(CopyState state)
 {
     return(new TypeOf(Source, state.GetType(TypeType), state.GetType(Type)));
 }
示例#18
0
 public override Expression CopyExpression(CopyState state)
 {
     return(new ReferenceOp(Source, state.GetType(_bool), EqualityType, Left.CopyExpression(state), Right.CopyExpression(state)));
 }
示例#19
0
文件: Default.cs 项目: mortend/uno
 public override Expression CopyExpression(CopyState state)
 {
     return(new Default(Source, state.GetType(ValueType)));
 }
示例#20
0
 public override Expression CopyExpression(CopyState state)
 {
     return(new GetMetaProperty(Source, state.GetType(_dt), Name, Offset));
 }
示例#21
0
文件: CastOp.cs 项目: mortend/uno
 public override Expression CopyExpression(CopyState state)
 {
     return(new CastOp(Source, state.GetType(TargetType), Operand.CopyExpression(state)));
 }
示例#22
0
 public override Expression CopyExpression(CopyState state)
 {
     return(new ExternString(Source, state.GetType(Type), String, Usings));
 }