mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Revert "internal/shader: Bug fix: Treat a non-typed consntat argument as a float"
This reverts commit 960b3796b2
.
This commit is contained in:
parent
960b3796b2
commit
bff48c8254
@ -200,13 +200,6 @@ func (cs *compileState) parseExpr(block *block, expr ast.Expr, markLocalVariable
|
||||
cs.addError(e.Pos(), fmt.Sprintf("single-value context and multiple-value context cannot be mixed: %s", e.Fun))
|
||||
return nil, nil, nil, false
|
||||
}
|
||||
// If the argument is a non-typed constant value, treat is as a float value (#1874).
|
||||
for i, e := range es {
|
||||
if e.Type == shaderir.NumberExpr && e.ConstType == shaderir.ConstTypeNone {
|
||||
e.ConstType = shaderir.ConstTypeFloat
|
||||
ts[i] = shaderir.Type{Main: shaderir.Float}
|
||||
}
|
||||
}
|
||||
args = append(args, es...)
|
||||
argts = append(argts, ts...)
|
||||
stmts = append(stmts, ss...)
|
||||
|
@ -1,6 +0,0 @@
|
||||
void F0(out float l0);
|
||||
|
||||
void F0(out float l0) {
|
||||
l0 = (sin(1.0000000000e-01)) + (cos(2.0000000000e-01));
|
||||
return;
|
||||
}
|
9
internal/shader/testdata/issue1874.go
vendored
9
internal/shader/testdata/issue1874.go
vendored
@ -1,9 +0,0 @@
|
||||
package main
|
||||
|
||||
func Foo() float {
|
||||
const (
|
||||
s = 0.1
|
||||
c = 0.2
|
||||
)
|
||||
return sin(s) + cos(c)
|
||||
}
|
Loading…
Reference in New Issue
Block a user