mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
8bc1c8bbd8
commit
f71346da6c
@ -82,6 +82,12 @@ func basicTypeString(t shaderir.BasicType, packed bool) string {
|
||||
|
||||
func builtinFuncString(f shaderir.BuiltinFunc) string {
|
||||
switch f {
|
||||
case shaderir.BoolF:
|
||||
return "static_cast<bool>"
|
||||
case shaderir.IntF:
|
||||
return "static_cast<int>"
|
||||
case shaderir.FloatF:
|
||||
return "static_cast<float>"
|
||||
case shaderir.Vec2F:
|
||||
return "float2"
|
||||
case shaderir.Vec3F:
|
||||
|
@ -198,6 +198,9 @@ func OpFromToken(t token.Token) (Op, bool) {
|
||||
type BuiltinFunc string
|
||||
|
||||
const (
|
||||
BoolF BuiltinFunc = "bool"
|
||||
IntF BuiltinFunc = "int"
|
||||
FloatF BuiltinFunc = "float"
|
||||
Vec2F BuiltinFunc = "vec2"
|
||||
Vec3F BuiltinFunc = "vec3"
|
||||
Vec4F BuiltinFunc = "vec4"
|
||||
@ -247,7 +250,10 @@ const (
|
||||
|
||||
func ParseBuiltinFunc(str string) (BuiltinFunc, bool) {
|
||||
switch BuiltinFunc(str) {
|
||||
case Vec2F,
|
||||
case BoolF,
|
||||
IntF,
|
||||
FloatF,
|
||||
Vec2F,
|
||||
Vec3F,
|
||||
Vec4F,
|
||||
Mat2F,
|
||||
|
Loading…
Reference in New Issue
Block a user