playcanvas
Version:
PlayCanvas WebGL game engine
15 lines (12 loc) • 409 B
JavaScript
import { DeviceCache } from '../../platform/graphics/device-cache.js';
const programLibraryDeviceCache = new DeviceCache();
function getProgramLibrary(device) {
const library = programLibraryDeviceCache.get(device);
return library;
}
function setProgramLibrary(device, library) {
programLibraryDeviceCache.get(device, ()=>{
return library;
});
}
export { getProgramLibrary, setProgramLibrary };