We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7780f13 commit 8308ba7Copy full SHA for 8308ba7
2 files changed
packages/typegpu/src/std/boolean.ts
@@ -237,7 +237,7 @@ export const not = dualImpl({
237
238
if (isVec(dataType)) {
239
const vecConstructorStr = `vec${dataType.componentCount}<bool>`;
240
- return stitch`!${vecConstructorStr}(${arg})`;
+ return stitch`!(${vecConstructorStr}(${arg}))`;
241
}
242
243
throw new Error(
packages/typegpu/tests/std/boolean/not.test.ts
@@ -86,10 +86,10 @@ describe('not', () => {
86
return not(v);
87
});
88
expect(tgpu.resolve([testFn])).toMatchInlineSnapshot(`
89
- "fn testFn(v: vec3f) -> vec3<bool> {
90
- return !vec3<bool>(v);
91
- }"
92
- `);
+ "fn testFn(v: vec3f) -> vec3<bool> {
+ return !(vec3<bool>(v));
+ }"
+ `);
93
94
95
it('evaluates at compile time for comptime-known arguments', () => {
0 commit comments