simple-nvk
Version:
Graphic libary, using Javascript and Node-Vulkan.<br> It has similarities to WebGPU in some places.<br> ## Features Abstractions of Vulkan features like staged buffers.<br> Much shorter to write than Vulkan.<br> ## Install ````console npm install s
28 lines (24 loc) • 717 B
JavaScript
import { assertVulkan } from "../utils.mjs";
import Handle from "./handle.mjs";
export default class FenceHandle extends Handle{
constructor(owner, createInfo) {
super(owner);
let fenceCreateInfo = new VkFenceCreateInfo();
let fence = new VkFence();
vkCreateFence(this.device, fenceCreateInfo, null, fence);
this.vkFence = fence;
}
destroy() {
this.super_destroy();
vkDestroyFence(this.device, this.vkFence, null);
}
wait(timeout) {
vkWaitForFences(this.device, 1, [this.vkFence], true, timeout * 1E6);
}
reset() {
vkResetFences(this.device, 1, [this.vkFence]);
}
}
export function waitForIdle() {
vkDeviceWaitIdle(this.device);
}