From b28b323920d173f0901052d3d2f6c9027fda0f9e Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 21 Aug 2022 04:19:56 +0900 Subject: [PATCH] internal/shaderir: use parentheses for vector equal operators --- internal/shaderir/hlsl/hlsl.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/shaderir/hlsl/hlsl.go b/internal/shaderir/hlsl/hlsl.go index 374d8bfe4..59a01bdff 100644 --- a/internal/shaderir/hlsl/hlsl.go +++ b/internal/shaderir/hlsl/hlsl.go @@ -385,9 +385,9 @@ func (c *compileContext) block(p *shaderir.Program, topBlock, block *shaderir.Bl case shaderir.Binary: switch e.Op { case shaderir.VectorEqualOp: - return fmt.Sprintf("all(%s == %s)", expr(&e.Exprs[0]), expr(&e.Exprs[1])) + return fmt.Sprintf("all((%s) == (%s))", expr(&e.Exprs[0]), expr(&e.Exprs[1])) case shaderir.VectorNotEqualOp: - return fmt.Sprintf("!all(%s == %s)", expr(&e.Exprs[0]), expr(&e.Exprs[1])) + return fmt.Sprintf("!all((%s) == (%s))", expr(&e.Exprs[0]), expr(&e.Exprs[1])) case shaderir.MatrixMul: // If either is a matrix, use the mul function. // Swap the order of the lhs and the rhs since matrices are row-major in HLSL.