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 +4 -1
- package/dist/simulation.js +1 -1
- package/package.json +1 -1
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
|
|
903
|
+
size,
|
|
901
904
|
usage: GPUBufferUsage.STORAGE,
|
|
902
905
|
mappedAtCreation: true
|
|
903
906
|
});
|
package/dist/simulation.js
CHANGED
|
@@ -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:
|
|
217
|
+
size: 10 * 4 * 16,
|
|
218
218
|
usage: GPUBufferUsage.STORAGE
|
|
219
219
|
});
|
|
220
220
|
const bindGroupLayout = device.createBindGroupLayout({
|