@luma.gl/engine 9.3.0-alpha.2 → 9.3.0-alpha.4
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/dist.dev.js +752 -271
- package/dist/dist.min.js +182 -23
- package/dist/dynamic-texture/dynamic-texture.d.ts.map +1 -1
- package/dist/dynamic-texture/dynamic-texture.js +37 -4
- package/dist/dynamic-texture/dynamic-texture.js.map +1 -1
- package/dist/dynamic-texture/mipmaps.d.ts +6 -0
- package/dist/dynamic-texture/mipmaps.d.ts.map +1 -0
- package/dist/dynamic-texture/mipmaps.js +441 -0
- package/dist/dynamic-texture/mipmaps.js.map +1 -0
- package/dist/dynamic-texture/texture-data.js +1 -1
- package/dist/dynamic-texture/texture-data.js.map +1 -1
- package/dist/index.cjs +759 -295
- package/dist/index.cjs.map +4 -4
- package/dist/utils/buffer-layout-order.d.ts.map +1 -1
- package/dist/utils/buffer-layout-order.js +12 -2
- package/dist/utils/buffer-layout-order.js.map +1 -1
- package/package.json +4 -4
- package/src/dynamic-texture/dynamic-texture.ts +54 -6
- package/src/dynamic-texture/mipmaps.ts +517 -0
- package/src/dynamic-texture/texture-data.ts +1 -1
- package/src/utils/buffer-layout-order.ts +18 -2
|
@@ -4,6 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
import {type BufferLayout, type ShaderLayout} from '@luma.gl/core';
|
|
6
6
|
|
|
7
|
+
function getMinLocation(
|
|
8
|
+
attributeNames: string[],
|
|
9
|
+
shaderLayoutMap: Record<string, number | undefined>
|
|
10
|
+
): number {
|
|
11
|
+
let minLocation = Infinity;
|
|
12
|
+
|
|
13
|
+
for (const name of attributeNames) {
|
|
14
|
+
const location = shaderLayoutMap[name];
|
|
15
|
+
if (location !== undefined) {
|
|
16
|
+
minLocation = Math.min(minLocation, location);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return minLocation;
|
|
21
|
+
}
|
|
22
|
+
|
|
7
23
|
export function sortedBufferLayoutByShaderSourceLocations(
|
|
8
24
|
shaderLayout: ShaderLayout,
|
|
9
25
|
bufferLayout: BufferLayout[]
|
|
@@ -16,8 +32,8 @@ export function sortedBufferLayoutByShaderSourceLocations(
|
|
|
16
32
|
sortedLayout.sort((a, b) => {
|
|
17
33
|
const attributeNamesA = a.attributes ? a.attributes.map(attr => attr.attribute) : [a.name];
|
|
18
34
|
const attributeNamesB = b.attributes ? b.attributes.map(attr => attr.attribute) : [b.name];
|
|
19
|
-
const minLocationA =
|
|
20
|
-
const minLocationB =
|
|
35
|
+
const minLocationA = getMinLocation(attributeNamesA, shaderLayoutMap);
|
|
36
|
+
const minLocationB = getMinLocation(attributeNamesB, shaderLayoutMap);
|
|
21
37
|
|
|
22
38
|
return minLocationA - minLocationB;
|
|
23
39
|
});
|