Skip to content

Commit f8ff5a8

Browse files
authored
Update deno (#3041)
1 parent ffd7337 commit f8ff5a8

File tree

4 files changed

+66
-56
lines changed

4 files changed

+66
-56
lines changed

cts_runner/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ publish = false
1111
resolver = "2"
1212

1313
[dependencies]
14-
deno_console = "0.62.0"
15-
deno_core = "0.144.0"
16-
deno_url = "0.62.0"
17-
deno_web = "0.93.0"
18-
deno_webidl = "0.62.0"
14+
deno_console = "0.69.0"
15+
deno_core = "0.151.0"
16+
deno_url = "0.69.0"
17+
deno_web = "0.100.0"
18+
deno_webidl = "0.69.0"
1919
deno_webgpu = { path = "../deno_webgpu" }
2020
tokio = { version = "1.19.0", features = ["full"] }
2121
termcolor = "1.1.2"

deno_webgpu/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = "https://github.com/gfx-rs/wgpu"
1111
description = "WebGPU implementation for Deno"
1212

1313
[dependencies]
14-
deno_core = "0.144.0"
14+
deno_core = "0.151.0"
1515
serde = { version = "1.0", features = ["derive"] }
1616
tokio = { version = "1.19", features = ["full"] }
1717
wgpu-core = { path = "../wgpu-core", features = ["trace", "replay", "serde", "strict_asserts"] }

deno_webgpu/src/01_webgpu.js

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,11 @@
201201
}
202202
const GPUErrorPrototype = GPUError.prototype;
203203

204-
class GPUOutOfMemoryError extends GPUError {
205-
name = "GPUOutOfMemoryError";
204+
class GPUValidationError extends GPUError {
205+
name = "GPUValidationError";
206+
/** @param {string} message */
206207
constructor(message) {
207-
const prefix = "Failed to construct 'GPUOutOfMemoryError'";
208+
const prefix = "Failed to construct 'GPUValidationError'";
208209
webidl.requiredArguments(arguments.length, 1, { prefix });
209210
message = webidl.converters.DOMString(message, {
210211
prefix,
@@ -213,13 +214,12 @@
213214
super(message);
214215
}
215216
}
216-
const GPUOutOfMemoryErrorPrototype = GPUOutOfMemoryError.prototype;
217+
const GPUValidationErrorPrototype = GPUValidationError.prototype;
217218

218-
class GPUValidationError extends GPUError {
219-
name = "GPUValidationError";
220-
/** @param {string} message */
219+
class GPUOutOfMemoryError extends GPUError {
220+
name = "GPUOutOfMemoryError";
221221
constructor(message) {
222-
const prefix = "Failed to construct 'GPUValidationError'";
222+
const prefix = "Failed to construct 'GPUOutOfMemoryError'";
223223
webidl.requiredArguments(arguments.length, 1, { prefix });
224224
message = webidl.converters.DOMString(message, {
225225
prefix,
@@ -228,7 +228,7 @@
228228
super(message);
229229
}
230230
}
231-
const GPUValidationErrorPrototype = GPUValidationError.prototype;
231+
const GPUOutOfMemoryErrorPrototype = GPUOutOfMemoryError.prototype;
232232

233233
class GPU {
234234
[webidl.brand] = webidl.brand;
@@ -510,6 +510,10 @@
510510
webidl.assertBranded(this, GPUSupportedLimitsPrototype);
511511
return this[_limits].maxBindGroups;
512512
}
513+
get maxBufferSize() {
514+
webidl.assertBranded(this, GPUSupportedLimitsPrototype);
515+
return this[_limits].maxBufferSize;
516+
}
513517
get maxDynamicUniformBuffersPerPipelineLayout() {
514518
webidl.assertBranded(this, GPUSupportedLimitsPrototype);
515519
return this[_limits].maxDynamicUniformBuffersPerPipelineLayout;
@@ -1776,7 +1780,7 @@
17761780
[_size];
17771781
/** @type {number} */
17781782
[_usage];
1779-
/** @type {"mapped" | "mapped at creation" | "mapped pending" | "unmapped" | "destroy"} */
1783+
/** @type {"mapped" | "mapped at creation" | "pending" | "unmapped" | "destroy"} */
17801784
[_state];
17811785
/** @type {[number, number] | null} */
17821786
[_mappingRange];
@@ -1808,6 +1812,26 @@
18081812
webidl.illegalConstructor();
18091813
}
18101814

1815+
get size() {
1816+
webidl.assertBranded(this, GPUBufferPrototype);
1817+
return this[_size];
1818+
}
1819+
1820+
get usage() {
1821+
webidl.assertBranded(this, GPUBufferPrototype);
1822+
return this[_usage];
1823+
}
1824+
1825+
get mapState() {
1826+
webidl.assertBranded(this, GPUBufferPrototype);
1827+
const state = this[_state];
1828+
if (state === "mapped at creation") {
1829+
return "mapped";
1830+
} else {
1831+
return state;
1832+
}
1833+
}
1834+
18111835
/**
18121836
* @param {number} mode
18131837
* @param {number} offset
@@ -1886,7 +1910,7 @@
18861910
}
18871911

18881912
this[_mapMode] = mode;
1889-
this[_state] = "mapping pending";
1913+
this[_state] = "pending";
18901914
const promise = PromisePrototypeThen(
18911915
core.opAsync(
18921916
"op_webgpu_buffer_get_map_async",
@@ -1979,7 +2003,7 @@
19792003
"OperationError",
19802004
);
19812005
}
1982-
if (this[_state] === "mapping pending") {
2006+
if (this[_state] === "pending") {
19832007
// TODO(lucacasonato): this is not spec compliant.
19842008
throw new DOMException(
19852009
`${prefix}: can not unmap while mapping. This is a Deno limitation.`,
@@ -2031,16 +2055,6 @@
20312055
this[_cleanup]();
20322056
}
20332057

2034-
get size() {
2035-
webidl.assertBranded(this, GPUBufferPrototype);
2036-
return this[_size];
2037-
}
2038-
2039-
get usage() {
2040-
webidl.assertBranded(this, GPUBufferPrototype);
2041-
return this[_usage];
2042-
}
2043-
20442058
[SymbolFor("Deno.privateCustomInspect")](inspect) {
20452059
return `${this.constructor.name} ${
20462060
inspect({
@@ -5358,7 +5372,7 @@
53585372
GPURenderBundle,
53595373
GPUQuerySet,
53605374
GPUError,
5361-
GPUOutOfMemoryError,
53625375
GPUValidationError,
5376+
GPUOutOfMemoryError,
53635377
};
53645378
})(this);

deno_webgpu/webgpu.idl

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ interface GPUSupportedLimits {
2525
readonly attribute unsigned long minUniformBufferOffsetAlignment;
2626
readonly attribute unsigned long minStorageBufferOffsetAlignment;
2727
readonly attribute unsigned long maxVertexBuffers;
28+
readonly attribute unsigned long long maxBufferSize;
2829
readonly attribute unsigned long maxVertexAttributes;
2930
readonly attribute unsigned long maxVertexBufferArrayStride;
3031
readonly attribute unsigned long maxInterStageShaderComponents;
@@ -128,17 +129,25 @@ GPUDevice includes GPUObjectBase;
128129

129130
[Exposed=(Window, DedicatedWorker), SecureContext]
130131
interface GPUBuffer {
132+
readonly attribute GPUSize64 size;
133+
readonly attribute GPUBufferUsageFlags usage;
134+
135+
readonly attribute GPUBufferMapState mapState;
136+
131137
Promise<undefined> mapAsync(GPUMapModeFlags mode, optional GPUSize64 offset = 0, optional GPUSize64 size);
132138
ArrayBuffer getMappedRange(optional GPUSize64 offset = 0, optional GPUSize64 size);
133139
undefined unmap();
134140

135141
undefined destroy();
136-
137-
readonly attribute GPUSize64 size;
138-
readonly attribute GPUBufferUsageFlags usage;
139142
};
140143
GPUBuffer includes GPUObjectBase;
141144

145+
enum GPUBufferMapState {
146+
"unmapped",
147+
"pending",
148+
"mapped"
149+
};
150+
142151
dictionary GPUBufferDescriptor : GPUObjectDescriptorBase {
143152
required GPUSize64 size;
144153
required GPUBufferUsageFlags usage;
@@ -976,11 +985,11 @@ interface mixin GPURenderCommandsMixin {
976985
undefined setVertexBuffer(GPUIndex32 slot, GPUBuffer buffer, optional GPUSize64 offset = 0, optional GPUSize64 size);
977986

978987
undefined draw(GPUSize32 vertexCount, optional GPUSize32 instanceCount = 1,
979-
optional GPUSize32 firstVertex = 0, optional GPUSize32 firstInstance = 0);
988+
optional GPUSize32 firstVertex = 0, optional GPUSize32 firstInstance = 0);
980989
undefined drawIndexed(GPUSize32 indexCount, optional GPUSize32 instanceCount = 1,
981-
optional GPUSize32 firstIndex = 0,
982-
optional GPUSignedOffset32 baseVertex = 0,
983-
optional GPUSize32 firstInstance = 0);
990+
optional GPUSize32 firstIndex = 0,
991+
optional GPUSignedOffset32 baseVertex = 0,
992+
optional GPUSize32 firstInstance = 0);
984993

985994
undefined drawIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
986995
undefined drawIndexedIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
@@ -1073,44 +1082,31 @@ partial interface GPUDevice {
10731082
readonly attribute Promise<GPUDeviceLostInfo> lost;
10741083
};
10751084

1076-
enum GPUErrorFilter {
1077-
"out-of-memory",
1078-
"validation"
1079-
};
1080-
10811085
[Exposed=(Window, DedicatedWorker), SecureContext]
10821086
interface GPUError {
10831087
readonly attribute DOMString message;
10841088
};
10851089

10861090
[Exposed=(Window, DedicatedWorker), SecureContext]
1087-
interface GPUOutOfMemoryError : GPUError {
1091+
interface GPUValidationError : GPUError {
10881092
constructor(DOMString message);
10891093
};
10901094

10911095
[Exposed=(Window, DedicatedWorker), SecureContext]
1092-
interface GPUValidationError : GPUError {
1096+
interface GPUOutOfMemoryError : GPUError {
10931097
constructor(DOMString message);
10941098
};
10951099

1100+
enum GPUErrorFilter {
1101+
"validation",
1102+
"out-of-memory"
1103+
};
1104+
10961105
partial interface GPUDevice {
10971106
undefined pushErrorScope(GPUErrorFilter filter);
10981107
Promise<GPUError?> popErrorScope();
10991108
};
11001109

1101-
[Exposed=(Window, DedicatedWorker), SecureContext]
1102-
interface GPUUncapturedErrorEvent : Event {
1103-
constructor(
1104-
DOMString type,
1105-
GPUUncapturedErrorEventInit gpuUncapturedErrorEventInitDict
1106-
);
1107-
readonly attribute GPUError error;
1108-
};
1109-
1110-
dictionary GPUUncapturedErrorEventInit : EventInit {
1111-
required GPUError error;
1112-
};
1113-
11141110
partial interface GPUDevice {
11151111
[Exposed=(Window, DedicatedWorker)]
11161112
attribute EventHandler onuncapturederror;

0 commit comments

Comments
 (0)