simulationjsv2 0.5.0 → 0.5.1

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.
@@ -807,20 +807,19 @@ export class ShaderGroup extends SceneCollection {
807
807
  return null;
808
808
  const values = this.bindGroup.values();
809
809
  if (this.valueBuffers === null) {
810
- const buffers = [];
810
+ this.valueBuffers = [];
811
811
  for (let i = 0; i < values.length; i++) {
812
812
  const buffer = this.createBuffer(this.device, values[i]);
813
- buffers.push(buffer);
813
+ this.valueBuffers.push(buffer);
814
814
  }
815
- this.valueBuffers = buffers;
816
815
  }
817
816
  else {
818
817
  for (let i = 0; i < values.length; i++) {
819
818
  const arrayConstructor = values[i].array;
820
819
  const array = new arrayConstructor(values[i].value);
821
820
  if (array.byteLength > this.valueBuffers[i].size) {
822
- this.valueBuffers[i].destroy();
823
821
  const newBuffer = this.createBuffer(this.device, values[i]);
822
+ this.valueBuffers[i].destroy();
824
823
  this.valueBuffers[i] = newBuffer;
825
824
  }
826
825
  else {
package/dist/types.d.ts CHANGED
@@ -100,6 +100,7 @@ export type BindGroupEntry = {
100
100
  buffer: GPUBindGroupLayoutEntry['buffer'];
101
101
  };
102
102
  export type ArrayConstructors = Float32ArrayConstructor | Float64ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor;
103
+ export type ArrayTypes = Float32Array | Float64Array | Int8Array | Int16Array | Int32Array;
103
104
  export type BindGroupValue = {
104
105
  value: number[];
105
106
  usage: GPUBufferDescriptor['usage'];
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.5.0",
8
+ "version": "0.5.1",
9
9
  "exports": {
10
10
  ".": {
11
11
  "import": "./dist/index.js",