wesl 0.7.16 → 0.7.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/LowerAndEmit.ts +1 -1
- package/src/test/VirtualModules.test.ts +9 -0
package/dist/index.js
CHANGED
|
@@ -832,7 +832,7 @@ function emitStandardAttribute(e, ctx) {
|
|
|
832
832
|
}
|
|
833
833
|
ctx.srcBuilder.add("@" + e.attribute.name + "(", e.start, params[0].start);
|
|
834
834
|
for (let i = 0; i < params.length; i++) {
|
|
835
|
-
|
|
835
|
+
emitContents(params[i], ctx);
|
|
836
836
|
if (i < params.length - 1) ctx.srcBuilder.add(",", params[i].end, params[i + 1].start);
|
|
837
837
|
}
|
|
838
838
|
ctx.srcBuilder.add(")", params[params.length - 1].end, e.end);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wesl",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"wrangler": "^4.22.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"random_wgsl": "^0.6.
|
|
30
|
+
"random_wgsl": "^0.6.67"
|
|
31
31
|
},
|
|
32
32
|
"peerDependenciesMeta": {
|
|
33
33
|
"random_wgsl": {
|
package/src/LowerAndEmit.ts
CHANGED
|
@@ -504,7 +504,7 @@ function emitStandardAttribute(e: AttributeElem, ctx: EmitContext): void {
|
|
|
504
504
|
|
|
505
505
|
ctx.srcBuilder.add("@" + e.attribute.name + "(", e.start, params[0].start);
|
|
506
506
|
for (let i = 0; i < params.length; i++) {
|
|
507
|
-
|
|
507
|
+
emitContents(params[i], ctx);
|
|
508
508
|
if (i < params.length - 1) {
|
|
509
509
|
ctx.srcBuilder.add(",", params[i].end, params[i + 1].start);
|
|
510
510
|
}
|
|
@@ -57,6 +57,15 @@ test("inline constant in array template param", async () => {
|
|
|
57
57
|
expect(result).toContain("const size = 4");
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
+
test("constant in @binding attribute", async () => {
|
|
61
|
+
const src = `
|
|
62
|
+
@group(0) @binding(constants::slot) var<uniform> u: f32;
|
|
63
|
+
`;
|
|
64
|
+
const result = await linkTestOpts({ constants: { slot: 0 } }, src);
|
|
65
|
+
expect(result).toContain("const slot = 0");
|
|
66
|
+
expect(result).toContain("@binding(slot)");
|
|
67
|
+
});
|
|
68
|
+
|
|
60
69
|
test("function call with inline ref in template param", async () => {
|
|
61
70
|
const src = `
|
|
62
71
|
fn main() {
|