mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +01:00
parent
ed240b8393
commit
18732ca879
@ -198,6 +198,12 @@ func (cs *compileState) parseExpr(block *block, expr ast.Expr) ([]shaderir.Expr,
|
|||||||
if callee.Type == shaderir.BuiltinFuncExpr {
|
if callee.Type == shaderir.BuiltinFuncExpr {
|
||||||
var t shaderir.Type
|
var t shaderir.Type
|
||||||
switch callee.BuiltinFunc {
|
switch callee.BuiltinFunc {
|
||||||
|
case shaderir.BoolF:
|
||||||
|
t = shaderir.Type{Main: shaderir.Bool}
|
||||||
|
case shaderir.IntF:
|
||||||
|
t = shaderir.Type{Main: shaderir.Int}
|
||||||
|
case shaderir.FloatF:
|
||||||
|
t = shaderir.Type{Main: shaderir.Float}
|
||||||
case shaderir.Vec2F:
|
case shaderir.Vec2F:
|
||||||
t = shaderir.Type{Main: shaderir.Vec2}
|
t = shaderir.Type{Main: shaderir.Vec2}
|
||||||
case shaderir.Vec3F:
|
case shaderir.Vec3F:
|
||||||
|
8
internal/shader/testdata/issue1298.expected.vs
vendored
Normal file
8
internal/shader/testdata/issue1298.expected.vs
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
void F0(in float l0, out int l1);
|
||||||
|
|
||||||
|
void F0(in float l0, out int l1) {
|
||||||
|
int l2 = 0;
|
||||||
|
l2 = int(l0);
|
||||||
|
l1 = l2;
|
||||||
|
return;
|
||||||
|
}
|
6
internal/shader/testdata/issue1298.go
vendored
Normal file
6
internal/shader/testdata/issue1298.go
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
func Foo(f float) int {
|
||||||
|
x := int(f)
|
||||||
|
return x
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user