Skip to content

Commit 71f3da3

Browse files
authored
fix: reverse zigar (#354)
1 parent c55ac5e commit 71f3da3

6 files changed

Lines changed: 20 additions & 16 deletions

File tree

package-lock.json

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
"webpack-bundle-analyzer": "^4.10.2",
5959
"webpack-cli": "^6.0.1",
6060
"webpack-dev-server": "^5.2.0",
61-
"zigar-loader": "^0.14.1"
61+
"zigar-compiler": "0.14.1",
62+
"zigar-loader": "0.14.1",
63+
"zigar-runtime": "0.14.1"
6264
},
6365
"exports": {
6466
"./package.json": "./package.json",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/node_modules/zigar-runtime/dist/features/module-loading.js b/node_modules/zigar-runtime/dist/features/module-loading.js
2-
index d82ce94..6e4e361 100644
2+
index 4c9d511..c1b8d93 100644
33
--- a/node_modules/zigar-runtime/dist/features/module-loading.js
44
+++ b/node_modules/zigar-runtime/dist/features/module-loading.js
5-
@@ -202,7 +202,7 @@ var moduleLoading = mixin({
5+
@@ -163,7 +163,7 @@ var moduleLoading = mixin({
66
displayPanic(address, len) {
77
const array = new Uint8Array(this.memory.buffer, address, len);
88
const msg = decodeText(array);

src/WebGPU/setupDevice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ export let storageFormat: GPUTextureFormat
44

55
export async function setupDevice(captureError: (error: unknown) => void) {
66
if (!navigator.gpu) {
7-
throw Error('this browser does not support WebGPU')
7+
throw Error('X-WEBGPU - this browser does not support WebGPU')
88
}
99

1010
const adapter = await navigator.gpu.requestAdapter()
1111

1212
if (!adapter) {
13-
throw Error('this browser supports webgpu but it appears disabled')
13+
throw Error('X-WEBGPU - this browser supports webgpu but it appears disabled')
1414
}
1515
const hasBGRA8unormStorage = adapter.features.has('bgra8unorm-storage')
1616

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export default async function initCreator({ canvas, ...props }: CreatorProps): P
7474
CustomPrograms.init(onProgramUpdate, onProgramError)
7575
Fonts.init(props.getFontUrl)
7676

77-
// rotation doesnt work
7877
const context = canvas.getContext('webgpu')
7978
if (!context) throw Error('WebGPU from canvas needs to be always provided')
8079

src/logic/index.zig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ pub const @"meta(zigar)" = struct {
8888
};
8989
}
9090

91-
pub fn isFieldString(comptime T: type, comptime field_name: std.meta.FieldEnum(T)) bool {
91+
pub fn isFieldString(comptime T: type, comptime field_name: []const u8) bool {
92+
_ = field_name;
9293
return switch (T) {
93-
texts.Serialized => field_name == .content,
94-
texts.ComputeTextResult => field_name == .content,
94+
texts.Serialized => true,
95+
texts.ComputeTextResult => true,
9596
else => false,
9697
};
9798
}

0 commit comments

Comments
 (0)