simulationjsv2 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/graphics.js CHANGED
@@ -896,8 +896,11 @@ export class Instance extends SimulationElement3d {
896
896
  setMatrixBuffer() {
897
897
  if (!this.device || this.instanceMatrix.length === 0)
898
898
  return;
899
+ const minSize = 640;
900
+ const size = Math.max(minSize, this.instanceMatrix[0].byteLength * this.instanceMatrix.length);
901
+ console.log(size, this.instanceMatrix);
899
902
  this.matrixBuffer = this.device.createBuffer({
900
- size: this.instanceMatrix[0].length * 4 * this.instanceMatrix.length,
903
+ size,
901
904
  usage: GPUBufferUsage.STORAGE,
902
905
  mappedAtCreation: true
903
906
  });
@@ -214,7 +214,7 @@ export class Simulation {
214
214
  usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST
215
215
  });
216
216
  const instanceBuffer = device.createBuffer({
217
- size: 16 * 10 * 4,
217
+ size: 10 * 4 * 16,
218
218
  usage: GPUBufferUsage.STORAGE
219
219
  });
220
220
  const bindGroupLayout = device.createBindGroupLayout({
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Jackson Otto",
7
7
  "description": "A simple graphics library using WebGPU",
8
- "version": "0.3.1",
8
+ "version": "0.3.2",
9
9
  "exports": {
10
10
  ".": {
11
11
  "import": "./dist/index.js",