Revert "internal/shader: Bug fix: Treat a non-typed consntat argument as a float"

This reverts commit 960b3796b2.
This commit is contained in:
Hajime Hoshi 2021-11-14 16:14:08 +09:00
parent 960b3796b2
commit bff48c8254
3 changed files with 0 additions and 22 deletions

View File

@ -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...)

View File

@ -1,6 +0,0 @@
void F0(out float l0);
void F0(out float l0) {
l0 = (sin(1.0000000000e-01)) + (cos(2.0000000000e-01));
return;
}

View File

@ -1,9 +0,0 @@
package main
func Foo() float {
const (
s = 0.1
c = 0.2
)
return sin(s) + cos(c)
}