diff options
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; } |