Read a material's held texture through internals.js, pinned to Cesium's Material

dropPendingTexture reads the private material._textures; it now does so
through internals.js like every other private field. The internals test
fails when the installed Cesium no longer declares _textures or no
longer takes a uniform's texture as Material updates.
This commit is contained in:
Sameh Khamis committed 2026-11-10 09:50:22 -08:00
1 parent f1817756ed
commit 4972aac345
3 files changed
+31 -1

No files matched your search

+13
View File
@@ -205,3 +205,16 @@ export function creditDisplayContents(display) {
logo: display?._currentCesiumCredit,
};
}
/**
* The texture a material holds for an image uniform. A material takes a
* texture handed to a uniform (and destroys it when it takes the next one,
* or is destroyed) only when it next updates; `draw.js` destroys one handed
* over but never taken, so it does not leak.
* @param {object} material Cesium Material.
* @param {string} uniform The uniform's name.
* @returns {object|undefined} Cesium Texture.
*/
export function materialTexture(material, uniform) {
return material?._textures?.[uniform];
}