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.
32 lines (29 loc) • 812 B
JavaScript
import { toCamelCase } from '../../utils/utils.mjs';
import { getBindingVisibility } from './utils.mjs';
class Binding {
/**
* Binding constructor
* @param parameters - {@link BindingParams | parameters} used to create our {@link Binding}.
*/
constructor({
label = "Uniform",
name = "uniform",
bindingType = "uniform",
visibility = ["vertex", "fragment", "compute"]
}) {
this.label = label;
this.name = toCamelCase(name);
this.bindingType = bindingType;
this.visibility = getBindingVisibility(visibility);
this.options = {
label,
name,
bindingType,
visibility
};
this.shouldResetBindGroup = false;
this.shouldResetBindGroupLayout = false;
this.cacheKey = `${bindingType},${this.visibility},`;
}
}
export { Binding };