xgpu
Version:
XGPU is an extendable library for WebGPU that provides a higher-level, easy-to-use interface for building rendering engines or processing numeric data. It handles automatic data binding, buffer alignment, variable declarations in shaders, and more. XGPU i
18 lines (17 loc) • 592 B
JavaScript
import { VertexAttribute } from "../VertexAttribute";
export class Vec2Buffer extends VertexAttribute {
constructor(datas, offset) {
if (datas != undefined && offset === undefined) {
if (typeof datas === "number") {
offset = datas;
datas = undefined;
}
}
//console.log("Vec2Buffer ", offset)
super("", "float32x2", offset);
//console.log("Vec2Buffer.dataOffset = ", this.dataOffset)
if (typeof (datas) != "number") {
this.datas = datas;
}
}
}