playcanvas
Version:
Open-source WebGL/WebGPU 3D engine for the web
19 lines (18 loc) • 508 B
JavaScript
import { Debug } from "../../core/debug.js";
import { DeviceCache } from "../../platform/graphics/device-cache.js";
const programLibraryDeviceCache = new DeviceCache();
function getProgramLibrary(device) {
const library = programLibraryDeviceCache.get(device);
Debug.assert(library);
return library;
}
function setProgramLibrary(device, library) {
Debug.assert(library);
programLibraryDeviceCache.get(device, () => {
return library;
});
}
export {
getProgramLibrary,
setProgramLibrary
};