diff --git a/internal/shaderir/glsl.go b/internal/shaderir/glsl.go index 4314b2404..e6d08fc34 100644 --- a/internal/shaderir/glsl.go +++ b/internal/shaderir/glsl.go @@ -254,7 +254,8 @@ func (p *Program) glslBlock(b *Block, level int, localVarIndex int) []string { for _, exp := range e.Exprs[1:] { args = append(args, glslExpr(&exp)) } - return fmt.Sprintf("(%s)(%s)", glslExpr(&e.Exprs[0]), strings.Join(args, ", ")) + // Using parentheses at the callee is illegal. + return fmt.Sprintf("%s(%s)", glslExpr(&e.Exprs[0]), strings.Join(args, ", ")) case FieldSelector: return fmt.Sprintf("(%s).%s", glslExpr(&e.Exprs[0]), glslExpr(&e.Exprs[1])) case Index: diff --git a/internal/shaderir/ir_test.go b/internal/shaderir/ir_test.go index 25ee40334..99f6efeed 100644 --- a/internal/shaderir/ir_test.go +++ b/internal/shaderir/ir_test.go @@ -456,12 +456,12 @@ varying vec3 V0;`, }, }, GlslVS: `void F0(in float l0, in float l1, out vec2 l2) { - (F1)(); - l2 = (F2)(l0, l1); + F1(); + l2 = F2(l0, l1); }`, GlslFS: `void F0(in float l0, in float l1, out vec2 l2) { - (F1)(); - l2 = (F2)(l0, l1); + F1(); + l2 = F2(l0, l1); }`, }, { @@ -492,10 +492,10 @@ varying vec3 V0;`, }, }, GlslVS: `void F0(in float l0, in float l1, out float l2) { - l2 = (min)(l0, l1); + l2 = min(l0, l1); }`, GlslFS: `void F0(in float l0, in float l1, out float l2) { - l2 = (min)(l0, l1); + l2 = min(l0, l1); }`, }, {