UNPKG

gpu-curtains

Version:

gpu-curtains is a 3D WebGPU rendering engine. It can be used as a standalone 3D engine, but also includes extra classes focused on mapping 3d objects to DOM elements; It allows users to synchronize values such as position, sizing, or scale between them.

53 lines (50 loc) 1.16 kB
import { BufferBinding } from './BufferBinding.mjs'; import { Buffer } from '../buffers/Buffer.mjs'; class WritableBufferBinding extends BufferBinding { /** * WritableBufferBinding constructor * @param parameters - {@link WritableBufferBindingParams | parameters} used to create our {@link WritableBufferBinding} */ constructor({ label = "Work", name = "work", bindingType, visibility, useStruct = true, access = "read_write", usage = [], struct = {}, childrenBindings = [], buffer = null, parent = null, minOffset = 256, offset = 0, shouldCopyResult = false }) { bindingType = "storage"; visibility = ["compute"]; super({ label, name, bindingType, visibility, useStruct, access, usage, struct, childrenBindings, buffer, parent, minOffset, offset }); this.options = { ...this.options, shouldCopyResult }; this.shouldCopyResult = shouldCopyResult; this.cacheKey += `${shouldCopyResult},`; this.resultBuffer = new Buffer(); } } export { WritableBufferBinding };