@woosh/meep-engine 2.117.8 → 2.117.10

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.
Files changed (35) hide show
  1. package/build/bundle-worker-image-decoder.js +1 -1
  2. package/build/bundle-worker-terrain.js +1 -1
  3. package/build/meep.cjs +54 -16
  4. package/build/meep.min.js +1 -1
  5. package/build/meep.module.js +54 -16
  6. package/package.json +1 -1
  7. package/src/core/collection/array/typed/array_buffer_copy.d.ts.map +1 -1
  8. package/src/core/collection/array/typed/array_buffer_copy.js +7 -7
  9. package/src/core/collection/array/typed/isTypedArray.d.ts +1 -1
  10. package/src/core/collection/array/typed/isTypedArray.d.ts.map +1 -1
  11. package/src/core/collection/array/typed/isTypedArray.js +27 -10
  12. package/src/core/collection/array/typed/is_array_buffer_equals.d.ts +11 -0
  13. package/src/core/collection/array/typed/is_array_buffer_equals.d.ts.map +1 -0
  14. package/src/core/collection/array/typed/is_array_buffer_equals.js +45 -0
  15. package/src/core/collection/array/typed/is_typed_array_equals.d.ts.map +1 -1
  16. package/src/core/collection/array/typed/is_typed_array_equals.js +5 -6
  17. package/src/core/collection/array/typed/largest_common_alignment_uint32.d.ts +9 -0
  18. package/src/core/collection/array/typed/largest_common_alignment_uint32.d.ts.map +1 -0
  19. package/src/core/collection/array/typed/largest_common_alignment_uint32.js +29 -0
  20. package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts +2 -2
  21. package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts.map +1 -1
  22. package/src/engine/graphics/render/frame_graph/RenderGraph.js +1 -1
  23. package/src/engine/graphics/render/frame_graph/RenderPass.d.ts +10 -44
  24. package/src/engine/graphics/render/frame_graph/RenderPass.d.ts.map +1 -1
  25. package/src/engine/graphics/render/frame_graph/RenderPass.js +5 -0
  26. package/src/engine/graphics/render/frame_graph/sample/deferred/CopyPass.d.ts +1 -1
  27. package/src/engine/graphics/render/frame_graph/sample/deferred/CopyPass.d.ts.map +1 -1
  28. package/src/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.d.ts +1 -1
  29. package/src/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.d.ts.map +1 -1
  30. package/src/engine/graphics/render/frame_graph/sample/deferred/LightingPass.d.ts +1 -1
  31. package/src/engine/graphics/render/frame_graph/sample/deferred/LightingPass.d.ts.map +1 -1
  32. package/src/engine/graphics/render/frame_graph/sample/meep-v1/OutlinePass.d.ts +1 -1
  33. package/src/engine/graphics/render/frame_graph/sample/meep-v1/OutlinePass.d.ts.map +1 -1
  34. package/src/engine/graphics/render/frame_graph/sample/meep-v1/SSAOPass.d.ts +1 -1
  35. package/src/engine/graphics/render/frame_graph/sample/meep-v1/SSAOPass.d.ts.map +1 -1
package/build/meep.cjs CHANGED
@@ -27,22 +27,39 @@ function isArrayEqualStrict(a, b) {
27
27
  }
28
28
 
29
29
  /**
30
- * Checks whether supplied argument is a TypedArray instance, such as Flaot32Array
30
+ * Checks whether supplied argument is a TypedArray instance, such as Float32Array
31
31
  * @template T
32
32
  * @param {T} o
33
33
  * @returns {boolean}
34
34
  */
35
35
  function isTypedArray(o) {
36
+ const t = typeof o;
37
+
38
+ if(t !== "object"){
39
+ return false;
40
+ }
41
+
42
+ if(o === null){
43
+ // special case, null is treated as an object
44
+ return false;
45
+ }
46
+
47
+ const constructor = o.constructor;
48
+
36
49
  return (
37
- o instanceof Int8Array ||
38
- o instanceof Uint8Array ||
39
- o instanceof Uint8ClampedArray ||
40
- o instanceof Int16Array ||
41
- o instanceof Uint16Array ||
42
- o instanceof Int32Array ||
43
- o instanceof Uint32Array ||
44
- o instanceof Float32Array ||
45
- o instanceof Float64Array
50
+ constructor === Uint8Array
51
+ || constructor === Uint16Array
52
+ || constructor === Uint32Array
53
+
54
+ || constructor === Int8Array
55
+ || constructor === Int16Array
56
+ || constructor === Int32Array
57
+
58
+ || constructor === Float32Array
59
+ || constructor === Float64Array
60
+
61
+ || constructor === BigUint64Array
62
+ || constructor === BigInt64Array
46
63
  );
47
64
  }
48
65
 
@@ -49065,6 +49082,29 @@ function compute_binary_data_type_from_typed_array(array) {
49065
49082
  }
49066
49083
  }
49067
49084
 
49085
+ /**
49086
+ *
49087
+ * @param {number} a_offset
49088
+ * @param {number} b_offset
49089
+ * @param {number} byte_length
49090
+ * @returns {number}
49091
+ */
49092
+ function largest_common_alignment_uint32(a_offset, b_offset, byte_length) {
49093
+
49094
+ const mask = a_offset | b_offset | byte_length;
49095
+
49096
+ if ((mask & 3) === 0) {
49097
+ // aligned on 4-byte boundary
49098
+ return 4
49099
+ } else if ((mask & 1) === 0) {
49100
+ // aligned on 2-byte boundary
49101
+ return 2;
49102
+ } else {
49103
+ // worst-case, assume 1-byte boundary
49104
+ return 1;
49105
+ }
49106
+ }
49107
+
49068
49108
  //
49069
49109
 
49070
49110
  /**
@@ -49129,11 +49169,11 @@ function is_typed_array_equals(a, b) {
49129
49169
 
49130
49170
  const bytes_per_element = a_constructor.BYTES_PER_ELEMENT;
49131
49171
 
49172
+ const alignment = largest_common_alignment_uint32(a_offset, b_offset,byte_length);
49173
+
49132
49174
  if (
49133
49175
  bytes_per_element < 4
49134
- && byte_length % 4 === 0
49135
- && a_offset % 4 === 0
49136
- && b_offset % 4 === 0
49176
+ && alignment === 4
49137
49177
  ) {
49138
49178
 
49139
49179
  // 4 byte alignment, can use uint32
@@ -49142,9 +49182,7 @@ function is_typed_array_equals(a, b) {
49142
49182
 
49143
49183
  } else if (
49144
49184
  bytes_per_element < 2
49145
- && byte_length % 2 === 0
49146
- && a_offset % 2 === 0
49147
- && b_offset % 2 === 0
49185
+ && alignment === 2
49148
49186
  ) {
49149
49187
 
49150
49188
  // 2 byte alignment, can use uint16