diff options
Diffstat (limited to 'ext/webgpu')
-rw-r--r-- | ext/webgpu/01_webgpu.js | 14 | ||||
-rw-r--r-- | ext/webgpu/lib.rs | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/ext/webgpu/01_webgpu.js b/ext/webgpu/01_webgpu.js index 55ca9c382..31b0a75f6 100644 --- a/ext/webgpu/01_webgpu.js +++ b/ext/webgpu/01_webgpu.js @@ -324,6 +324,7 @@ class GPU { /** * @param {GPURequestAdapterOptions} options */ + // deno-lint-ignore require-await async requestAdapter(options = {}) { webidl.assertBranded(this, GPUPrototype); options = webidl.converters.GPURequestAdapterOptions( @@ -332,7 +333,7 @@ class GPU { "Argument 1", ); - const { err, ...data } = await op_webgpu_request_adapter( + const { err, ...data } = op_webgpu_request_adapter( options.powerPreference, options.forceFallbackAdapter, ); @@ -411,6 +412,7 @@ class GPUAdapter { * @param {GPUDeviceDescriptor} descriptor * @returns {Promise<GPUDevice>} */ + // deno-lint-ignore require-await async requestDevice(descriptor = {}) { webidl.assertBranded(this, GPUAdapterPrototype); const prefix = "Failed to execute 'requestDevice' on 'GPUAdapter'"; @@ -431,7 +433,7 @@ class GPUAdapter { } } - const { rid, features, limits } = await op_webgpu_request_device( + const { rid, features, limits } = op_webgpu_request_device( this[_adapter].rid, descriptor.label, requiredFeatures, @@ -455,7 +457,7 @@ class GPUAdapter { * @param {string[]} unmaskHints * @returns {Promise<GPUAdapterInfo>} */ - async requestAdapterInfo(unmaskHints = []) { + requestAdapterInfo(unmaskHints = []) { webidl.assertBranded(this, GPUAdapterPrototype); const prefix = "Failed to execute 'requestAdapterInfo' on 'GPUAdapter'"; unmaskHints = webidl.converters["sequence<DOMString>"]( @@ -469,9 +471,7 @@ class GPUAdapter { architecture, device, description, - } = await op_webgpu_request_adapter_info( - this[_adapter].rid, - ); + } = op_webgpu_request_adapter_info(this[_adapter].rid); const adapterInfo = webidl.createBranded(GPUAdapterInfo); adapterInfo[_vendor] = ArrayPrototypeIncludes(unmaskHints, "vendor") @@ -484,7 +484,7 @@ class GPUAdapter { : ""; adapterInfo[_description] = ArrayPrototypeIncludes(unmaskHints, "description") ? description : ""; - return adapterInfo; + return PromiseResolve(adapterInfo); } [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { diff --git a/ext/webgpu/lib.rs b/ext/webgpu/lib.rs index 99c8fcf6b..5c0dc79c2 100644 --- a/ext/webgpu/lib.rs +++ b/ext/webgpu/lib.rs @@ -381,9 +381,9 @@ pub struct GpuAdapterDevice { is_software: bool, } -#[op2(async)] +#[op2] #[serde] -pub async fn op_webgpu_request_adapter( +pub fn op_webgpu_request_adapter( state: Rc<RefCell<OpState>>, #[serde] power_preference: Option<wgpu_types::PowerPreference>, force_fallback_adapter: bool, @@ -645,9 +645,9 @@ impl From<GpuRequiredFeatures> for wgpu_types::Features { } } -#[op2(async)] +#[op2] #[serde] -pub async fn op_webgpu_request_device( +pub fn op_webgpu_request_device( state: Rc<RefCell<OpState>>, #[smi] adapter_rid: ResourceId, #[string] label: String, @@ -702,9 +702,9 @@ pub struct GPUAdapterInfo { description: String, } -#[op2(async)] +#[op2] #[serde] -pub async fn op_webgpu_request_adapter_info( +pub fn op_webgpu_request_adapter_info( state: Rc<RefCell<OpState>>, #[smi] adapter_rid: ResourceId, ) -> Result<GPUAdapterInfo, AnyError> { |