Skip to content

Commit

Permalink
update deno (#3379)
Browse files Browse the repository at this point in the history
* update deno

* update spec

* remove unrelated changes
  • Loading branch information
crowlKats authored Jan 14, 2023
1 parent 8c9f3f1 commit b39c0b9
Show file tree
Hide file tree
Showing 24 changed files with 83 additions and 117 deletions.
53 changes: 26 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ wasm-bindgen-test = "0.3"
web-sys = "0.3.60"

# deno dependencies
deno_console = "0.80.0"
deno_core = "0.162.0"
deno_url = "0.80.0"
deno_web = "0.111.0"
deno_webidl = "0.80.0"
deno_console = "0.84.0"
deno_core = "0.166.0"
deno_url = "0.84.0"
deno_web = "0.115.0"
deno_webidl = "0.84.0"
deno_webgpu = { path = "./deno_webgpu" }
tokio = "1.19.0"
termcolor = "1.1.2"
Expand Down
2 changes: 1 addition & 1 deletion cts_runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async fn run() -> Result<(), AnyError> {
}

fn extension() -> deno_core::Extension {
deno_core::Extension::builder()
deno_core::Extension::builder("bootstrap")
.ops(vec![
op_exit::decl(),
op_read_file_sync::decl(),
Expand Down
4 changes: 2 additions & 2 deletions deno_webgpu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
# Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

[package]
name = "deno_webgpu"
version = "0.81.0"
version = "0.85.0"
authors = ["the Deno authors"]
edition.workspace = true
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion deno_webgpu/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright 2018-2022 the Deno authors
Copyright 2018-2023 the Deno authors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
86 changes: 24 additions & 62 deletions deno_webgpu/src/01_webgpu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// @ts-check
/// <reference path="../../core/lib.deno_core.d.ts" />
Expand Down Expand Up @@ -34,14 +34,9 @@
SafeArrayIterator,
SafePromiseAll,
Set,
SetPrototypeEntries,
SetPrototypeForEach,
SetPrototypeHas,
SetPrototypeKeys,
SetPrototypeValues,
Symbol,
SymbolFor,
SymbolIterator,
TypeError,
Uint32Array,
Uint32ArrayPrototype,
Expand All @@ -61,7 +56,6 @@
const _architecture = Symbol("[[architecture]]");
const _description = Symbol("[[description]]");
const _limits = Symbol("[[limits]]");
const _features = Symbol("[[features]]");
const _reason = Symbol("[[reason]]");
const _message = Symbol("[[message]]");
const _label = Symbol("[[label]]");
Expand Down Expand Up @@ -332,8 +326,9 @@
context: "Argument 1",
});
const requiredFeatures = descriptor.requiredFeatures ?? [];
for (const feature of requiredFeatures) {
if (!SetPrototypeHas(this[_adapter].features[_features], feature)) {
for (let i = 0; i < requiredFeatures.length; ++i) {
const feature = requiredFeatures[i];
if (!SetPrototypeHas(this[_adapter].features[webidl.setlikeInner], feature)) {
throw new TypeError(
`${prefix}: nonGuaranteedFeatures must be a subset of the adapter features.`,
);
Expand Down Expand Up @@ -518,6 +513,10 @@
webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxBindGroups;
}
get maxBindingsPerBindGroup() {
webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxBindingsPerBindGroup;
}
get maxBufferSize() {
webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxBufferSize;
Expand Down Expand Up @@ -615,60 +614,19 @@

function createGPUSupportedFeatures(features) {
/** @type {GPUSupportedFeatures} */
const adapterFeatures = webidl.createBranded(GPUSupportedFeatures);
adapterFeatures[_features] = new Set(features);
return adapterFeatures;
const supportedFeatures = webidl.createBranded(GPUSupportedFeatures);
supportedFeatures[webidl.setlikeInner] = new Set(features);
return webidl.setlike(
supportedFeatures,
GPUSupportedFeaturesPrototype,
true,
);
}

class GPUSupportedFeatures {
/** @type {Set<string>} */
[_features];

constructor() {
webidl.illegalConstructor();
}

/** @return {IterableIterator<[string, string]>} */
entries() {
webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
return SetPrototypeEntries(this[_features]);
}

/** @return {void} */
forEach(callbackfn, thisArg) {
webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
SetPrototypeForEach(this[_features], callbackfn, thisArg);
}

/** @return {boolean} */
has(value) {
webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
return SetPrototypeHas(this[_features], value);
}

/** @return {IterableIterator<string>} */
keys() {
webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
return SetPrototypeKeys(this[_features]);
}

/** @return {IterableIterator<string>} */
values() {
webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
return SetPrototypeValues(this[_features]);
}

/** @return {number} */
get size() {
webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
return this[_features].size;
}

[SymbolIterator]() {
webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
return this[_features][SymbolIterator]();
}

[SymbolFor("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect([...new SafeArrayIterator(this.values())])
Expand Down Expand Up @@ -1060,7 +1018,9 @@
context: "Argument 1",
});
const device = assertDevice(this, { prefix, context: "this" });
for (const entry of descriptor.entries) {
for (let i = 0; i < descriptor.entries.length; ++i) {
const entry = descriptor.entries[i];

let i = 0;
if (entry.buffer) i++;
if (entry.sampler) i++;
Expand Down Expand Up @@ -1599,8 +1559,8 @@
},
);
const { err } = ops.op_webgpu_queue_submit(device.rid, commandBufferRids);
for (const commandBuffer of commandBuffers) {
commandBuffer[_rid] = undefined;
for (let i = 0; i < commandBuffers.length; ++i) {
commandBuffers[i][_rid] = undefined;
}
device.pushError(err);
}
Expand Down Expand Up @@ -1956,7 +1916,8 @@
if (!mappedRanges) {
throw new DOMException(`${prefix}: invalid state.`, "OperationError");
}
for (const [buffer, _rid, start] of mappedRanges) {
for (let i = 0; i < mappedRanges.length; ++i) {
const [buffer, _rid, start] = mappedRanges[i];
// TODO(lucacasonato): is this logic correct?
const end = start + buffer.byteLength;
if (
Expand Down Expand Up @@ -2024,7 +1985,8 @@
if (!mappedRanges) {
throw new DOMException(`${prefix}: invalid state.`, "OperationError");
}
for (const [buffer, mappedRid] of mappedRanges) {
for (let i = 0; i < mappedRanges.length; ++i) {
const [buffer, mappedRid] = mappedRanges[i];
const { err } = ops.op_webgpu_buffer_unmap(
bufferRid,
mappedRid,
Expand Down
2 changes: 1 addition & 1 deletion deno_webgpu/src/02_idl_types.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// @ts-check
/// <reference path="../web/internal.d.ts" />
Expand Down
2 changes: 1 addition & 1 deletion deno_webgpu/src/03_surface.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// @ts-check
/// <reference path="../../core/lib.deno_core.d.ts" />
Expand Down
2 changes: 1 addition & 1 deletion deno_webgpu/src/04_surface_idl_types.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

// @ts-check
/// <reference path="../../core/lib.deno_core.d.ts" />
Expand Down
2 changes: 1 addition & 1 deletion deno_webgpu/src/binding.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use deno_core::error::AnyError;
use deno_core::op;
Expand Down
Loading

0 comments on commit b39c0b9

Please sign in to comment.