diff options
| author | Kenta Moriuchi <moriken@kimamass.com> | 2024-01-11 07:37:25 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-10 15:37:25 -0700 |
| commit | 515a34b4de222e35c7ade1b92614d746e73d4c2e (patch) | |
| tree | 8284201fc826a33f12597959a8a8be14e0f524bd /ext/webgpu/02_surface.js | |
| parent | d4893eb51a01c5a692d8ca74a3b8ff95c5fd1d9f (diff) | |
refactor: use `core.ensureFastOps()` (#21888)
Diffstat (limited to 'ext/webgpu/02_surface.js')
| -rw-r--r-- | ext/webgpu/02_surface.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/ext/webgpu/02_surface.js b/ext/webgpu/02_surface.js index 9ae7fb54d..319179dc1 100644 --- a/ext/webgpu/02_surface.js +++ b/ext/webgpu/02_surface.js @@ -7,10 +7,19 @@ /// <reference path="./lib.deno_webgpu.d.ts" /> import { core, primordials } from "ext:core/mod.js"; -const ops = core.ops; +const { + op_webgpu_surface_configure, + op_webgpu_surface_get_current_texture, + op_webgpu_surface_present, +} = core.ensureFastOps(); +const { + ObjectPrototypeIsPrototypeOf, + Symbol, + SymbolFor, +} = primordials; + import * as webidl from "ext:deno_webidl/00_webidl.js"; import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; -const { Symbol, SymbolFor, ObjectPrototypeIsPrototypeOf } = primordials; import { loadWebGPU, webgpu } from "ext:deno_webgpu/00_init.js"; const _surfaceRid = Symbol("[[surfaceRid]]"); @@ -52,7 +61,7 @@ class GPUCanvasContext { context: "configuration.device", }); - const { err } = ops.op_webgpu_surface_configure({ + const { err } = op_webgpu_surface_configure({ surfaceRid: this[_surfaceRid], deviceRid: device.rid, format: configuration.format, @@ -91,7 +100,7 @@ class GPUCanvasContext { return this[_currentTexture]; } - const { rid } = ops.op_webgpu_surface_get_current_texture( + const { rid } = op_webgpu_surface_get_current_texture( device.rid, this[_surfaceRid], ); @@ -127,7 +136,7 @@ class GPUCanvasContext { prefix, context: "this", }); - ops.op_webgpu_surface_present(device.rid, this[_surfaceRid]); + op_webgpu_surface_present(device.rid, this[_surfaceRid]); this[_currentTexture].destroy(); this[_currentTexture] = undefined; } |
