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.
- package/dist/simulation.js +3 -4
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/simulation.js
CHANGED
|
@@ -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
|
-
|
|
810
|
+
this.valueBuffers = [];
|
|
811
811
|
for (let i = 0; i < values.length; i++) {
|
|
812
812
|
const buffer = this.createBuffer(this.device, values[i]);
|
|
813
|
-
|
|
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'];
|