Skip to content

Commit 0eb1598

Browse files
committed
feat(glsl): round function
1 parent 9cdea3b commit 0eb1598

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/glsl/builtin.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ export class BuiltIn {
140140
return fastCalc(Math.ceil, x);
141141
}
142142

143+
round(x) {
144+
return fastCalc(Math.round, x);
145+
}
146+
143147
fract(x) {
144148
return fastCalc((x) => x - Math.floor(x), x);
145149
}
@@ -391,4 +395,8 @@ export class BuiltIn {
391395
notEqual(x, y) {
392396
return !this.equal(x, y);
393397
}
398+
399+
discard() {
400+
throw new Error('discard');
401+
}
394402
}

0 commit comments

Comments
 (0)