Added the rest of current builtins. Started properly implementing compile tests.
This commit is contained in:
@@ -1874,6 +1874,196 @@ add_builtins_new :: (checker : *Semantic_Checker) {
|
||||
new_builtin_function(checker, "float4", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "float4", .[farg()], targ("float4"));
|
||||
|
||||
new_builtin_function(checker, "cross", .[targ("float3"), targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "distance", .[targ("float2"), targ("float2")], farg());
|
||||
new_builtin_function(checker, "distance", .[targ("float3"), targ("float3")], farg());
|
||||
new_builtin_function(checker, "distance", .[targ("float4"), targ("float4")], farg());
|
||||
|
||||
new_builtin_function(checker, "length", .[targ("float2")], farg());
|
||||
new_builtin_function(checker, "length", .[targ("float3")], farg());
|
||||
new_builtin_function(checker, "length", .[targ("float3")], farg());
|
||||
|
||||
new_builtin_function(checker, "dot", .[targ("float2"), targ("float2")], farg());
|
||||
new_builtin_function(checker, "dot", .[targ("float3"), targ("float3")], farg());
|
||||
new_builtin_function(checker, "dot", .[targ("float4"), targ("float4")], farg());
|
||||
|
||||
new_builtin_function(checker, "normalize", .[targ("float2")], farg());
|
||||
new_builtin_function(checker, "normalize", .[targ("float3")], farg());
|
||||
new_builtin_function(checker, "normalize", .[targ("float3")], farg());
|
||||
|
||||
new_builtin_function(checker, "transpose", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "mul", .[targ("float2"), targ("float2")], farg());
|
||||
new_builtin_function(checker, "mul", .[targ("float3"), targ("float3")], farg());
|
||||
new_builtin_function(checker, "mul", .[targ("float4"), targ("float4")], farg());
|
||||
new_builtin_function(checker, "mul", .[targ("float4x4"), targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "mul", .[farg(), targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "mul", .[farg(), targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "mul", .[farg(), targ("float4")], targ("float4"));
|
||||
|
||||
new_builtin_function(checker, "mul", .[farg(), targ("float4x4")], targ("float4x4"));
|
||||
new_builtin_function(checker, "mul", .[targ("float4x4"), targ("float4x4")], targ("float4x4"));
|
||||
new_builtin_function(checker, "mul", .[targ("float4x4"), targ("float4")], targ("float4"));
|
||||
|
||||
new_builtin_function(checker, "mul", .[targ("float2"), farg()], targ("float2"));
|
||||
new_builtin_function(checker, "mul", .[targ("float3"), farg()], targ("float3"));
|
||||
new_builtin_function(checker, "mul", .[targ("float4"), farg()], targ("float4"));
|
||||
|
||||
new_builtin_function(checker, "mul", .[targ("float4"), targ("float4x4")], targ("float4"));
|
||||
|
||||
new_builtin_function(checker, "abs", .[farg()], farg());
|
||||
new_builtin_function(checker, "abs", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "abs", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "abs", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "abs", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "min", .[farg()], farg());
|
||||
new_builtin_function(checker, "min", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "min", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "min", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "min", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "max", .[farg()], farg());
|
||||
new_builtin_function(checker, "max", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "max", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "max", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "max", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "ceil", .[farg()], farg());
|
||||
new_builtin_function(checker, "ceil", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "ceil", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "ceil", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "ceil", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "floor", .[farg()], farg());
|
||||
new_builtin_function(checker, "floor", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "floor", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "floor", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "floor", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "round", .[farg()], farg());
|
||||
new_builtin_function(checker, "round", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "round", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "round", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "round", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "clamp", .[farg(), farg(), farg()], farg());
|
||||
new_builtin_function(checker, "clamp", .[targ("float2"), targ("float2"), targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "clamp", .[targ("float3"), targ("float3"), targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "clamp", .[targ("float4"), targ("float4"), targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "clamp", .[targ("float4x4"), targ("float4x4"), targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "log", .[farg()], farg());
|
||||
new_builtin_function(checker, "log", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "log", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "log", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "log", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "log2", .[farg()], farg());
|
||||
new_builtin_function(checker, "log2", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "log2", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "log2", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "log2", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "log10", .[farg()], farg());
|
||||
new_builtin_function(checker, "log10", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "log10", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "log10", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "log10", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "pow", .[farg(), farg(), farg()], farg());
|
||||
new_builtin_function(checker, "pow", .[targ("float2"), targ("float2"), targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "pow", .[targ("float3"), targ("float3"), targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "pow", .[targ("float4"), targ("float4"), targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "pow", .[targ("float4x4"), targ("float4x4"), targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "smoothstep", .[farg(), farg(), farg()], farg());
|
||||
new_builtin_function(checker, "smoothstep", .[targ("float2"), targ("float2"), targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "smoothstep", .[targ("float3"), targ("float3"), targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "smoothstep", .[targ("float4"), targ("float4"), targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "smoothstep", .[targ("float4x4"), targ("float4x4"), targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "step", .[farg()], farg());
|
||||
new_builtin_function(checker, "step", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "step", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "step", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "step", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "sqrt", .[farg()], farg());
|
||||
new_builtin_function(checker, "sqrt", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "sqrt", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "sqrt", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "sqrt", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "cos", .[farg()], farg());
|
||||
new_builtin_function(checker, "cos", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "cos", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "cos", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "cos", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "cosh", .[farg()], farg());
|
||||
new_builtin_function(checker, "cosh", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "cosh", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "cosh", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "cosh", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "acos", .[farg()], farg());
|
||||
new_builtin_function(checker, "acos", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "acos", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "acos", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "acos", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "sin", .[farg()], farg());
|
||||
new_builtin_function(checker, "sin", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "sin", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "sin", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "sin", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "sinh", .[farg()], farg());
|
||||
new_builtin_function(checker, "sinh", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "sinh", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "sinh", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "sinh", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "asin", .[farg()], farg());
|
||||
new_builtin_function(checker, "asin", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "asin", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "asin", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "asin", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "tan", .[farg()], farg());
|
||||
new_builtin_function(checker, "tan", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "tan", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "tan", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "tan", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "tanh", .[farg()], farg());
|
||||
new_builtin_function(checker, "tanh", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "tanh", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "tanh", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "tanh", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "atan", .[farg()], farg());
|
||||
new_builtin_function(checker, "atan", .[targ("float2")], targ("float2"));
|
||||
new_builtin_function(checker, "atan", .[targ("float3")], targ("float3"));
|
||||
new_builtin_function(checker, "atan", .[targ("float4")], targ("float4"));
|
||||
new_builtin_function(checker, "atan", .[targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "atan2", .[farg(), farg()], farg());
|
||||
new_builtin_function(checker, "atan2", .[targ("float2"), targ("float2")], farg());
|
||||
new_builtin_function(checker, "atan2", .[targ("float3"), targ("float3")], farg());
|
||||
new_builtin_function(checker, "atan2", .[targ("float4"), targ("float4")], farg());
|
||||
new_builtin_function(checker, "atan2", .[targ("float4x4"), targ("float4x4")], targ("float4x4"));
|
||||
|
||||
new_builtin_function(checker, "sample", .[targ(Typenames[Type_Kind.Texture2D]), targ(Typenames[Type_Kind.Sampler])], targ("float4"));
|
||||
|
||||
new_builtin_function(checker, "pow", .[farg(), farg(), farg()], farg());
|
||||
new_builtin_function(checker, "pow", .[targ("float2"), targ("float2"), farg()], targ("float2"));
|
||||
new_builtin_function(checker, "pow", .[targ("float3"), targ("float3"), farg()], targ("float3"));
|
||||
new_builtin_function(checker, "pow", .[targ("float4"), targ("float4"), farg()], targ("float4"));
|
||||
|
||||
|
||||
checker.state = .Type_Checking;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user