testing: Bug fix: Compile error

This commit is contained in:
Hajime Hoshi 2020-06-21 02:26:59 +09:00
parent ea9fae1faa
commit eb136daa39

View File

@ -15,6 +15,8 @@
package testing package testing
import ( import (
"go/constant"
"github.com/hajimehoshi/ebiten/internal/shaderir" "github.com/hajimehoshi/ebiten/internal/shaderir"
) )
@ -31,8 +33,9 @@ var (
Op: shaderir.Div, Op: shaderir.Div,
Exprs: []shaderir.Expr{ Exprs: []shaderir.Expr{
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 2, Const: constant.MakeFloat64(2),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FieldSelector, Type: shaderir.FieldSelector,
@ -50,28 +53,33 @@ var (
}, },
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 0, Const: constant.MakeFloat64(0),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 0, Const: constant.MakeFloat64(0),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 0, Const: constant.MakeFloat64(0),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 0, Const: constant.MakeFloat64(0),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.Binary, Type: shaderir.Binary,
Op: shaderir.Div, Op: shaderir.Div,
Exprs: []shaderir.Expr{ Exprs: []shaderir.Expr{
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 2, Const: constant.MakeFloat64(2),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FieldSelector, Type: shaderir.FieldSelector,
@ -89,44 +97,54 @@ var (
}, },
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 0, Const: constant.MakeFloat64(0),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 0, Const: constant.MakeFloat64(0),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 0, Const: constant.MakeFloat64(0),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 0, Const: constant.MakeFloat64(0),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 1, Const: constant.MakeFloat64(1),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 0, Const: constant.MakeFloat64(0),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: -1, Const: constant.MakeFloat64(-1),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: -1, Const: constant.MakeFloat64(-1),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 0, Const: constant.MakeFloat64(0),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 1, Const: constant.MakeFloat64(1),
ConstType: shaderir.ConstTypeFloat,
}, },
}, },
} }
@ -142,12 +160,14 @@ var (
Index: 0, Index: 0,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 0, Const: constant.MakeFloat64(0),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: 1, Const: constant.MakeFloat64(1),
ConstType: shaderir.ConstTypeFloat,
}, },
}, },
} }
@ -221,20 +241,24 @@ func ShaderProgramFill(r, g, b, a byte) shaderir.Program {
BuiltinFunc: shaderir.Vec4F, BuiltinFunc: shaderir.Vec4F,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: float32(r) / 0xff, Const: constant.MakeFloat64(float64(r) / 0xff),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: float32(g) / 0xff, Const: constant.MakeFloat64(float64(g) / 0xff),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: float32(b) / 0xff, Const: constant.MakeFloat64(float64(b) / 0xff),
ConstType: shaderir.ConstTypeFloat,
}, },
{ {
Type: shaderir.FloatExpr, Type: shaderir.NumberExpr,
Float: float32(a) / 0xff, Const: constant.MakeFloat64(float64(a) / 0xff),
ConstType: shaderir.ConstTypeFloat,
}, },
}, },
} }