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))); }
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); }
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); }
public override Expression CopyExpression(CopyState state) { return(new NewArray(Source, state.GetType(ArrayType), Size.CopyNullable(state), Initializers.Copy(state))); }
public override Expression CopyExpression(CopyState state) { return(new NewPixelSampler(Source, state.GetType(SamplerType), Texture.CopyNullable(state), OptionalState.CopyNullable(state))); }
public override Expression CopyExpression(CopyState state) { return(new IsOp(Source, Operand.CopyExpression(state), state.GetType(TestType), state.GetType(_boolType))); }
public override Expression CopyExpression(CopyState state) { return(new AllocObject(Source, state.GetType(ObjectType))); }
public override Expression CopyExpression(CopyState state) { return(new Constant(Source, state.GetType(ValueType), Value)); }
public override Expression CopyExpression(CopyState state) { return(new NewDelegate(Source, state.GetType(DelegateType), Object?.CopyExpression(state), state.GetMember(Method))); }
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); }
public override Expression CopyExpression(CopyState state) { return(new BranchOp(Source, state.GetType(_bool), BranchType, Left.CopyExpression(state), Right.CopyExpression(state))); }
public override Expression CopyExpression(CopyState state) { return(new PlaceholderArgument(Source, state.GetType(_dt), Index)); }
public override Expression CopyExpression(CopyState state) { return(new Base(Source, state.GetType(BaseType))); }
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); } } }
public override Expression CopyExpression(CopyState state) { return(new ExternOp(Source, Attributes.Copy(state), state.GetType(Type), String, Object.CopyNullable(state), Arguments.Copy(state), Usings)); }
public override Expression CopyExpression(CopyState state) { return(new GetMetaObject(Source, state.GetType(_dt))); }
public override Expression CopyExpression(CopyState state) { return(new TypeOf(Source, state.GetType(TypeType), state.GetType(Type))); }
public override Expression CopyExpression(CopyState state) { return(new ReferenceOp(Source, state.GetType(_bool), EqualityType, Left.CopyExpression(state), Right.CopyExpression(state))); }
public override Expression CopyExpression(CopyState state) { return(new Default(Source, state.GetType(ValueType))); }
public override Expression CopyExpression(CopyState state) { return(new GetMetaProperty(Source, state.GetType(_dt), Name, Offset)); }
public override Expression CopyExpression(CopyState state) { return(new CastOp(Source, state.GetType(TargetType), Operand.CopyExpression(state))); }
public override Expression CopyExpression(CopyState state) { return(new ExternString(Source, state.GetType(Type), String, Usings)); }