UNPKG

@itwin/frontend-devtools

Version:

Debug menu and supporting UI widgets

34 lines 1.51 kB
"use strict"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ /** @packageDocumentation * @module Tools */ Object.defineProperty(exports, "__esModule", { value: true }); exports.SetGpuMemoryLimitTool = void 0; const core_frontend_1 = require("@itwin/core-frontend"); /** Adjust the value of [TileAdmin.gpuMemoryLimit]($frontend). This controls how much GPU memory is allowed to be consumed * by tile graphics before the system starts discarding the graphics for the least recently drawn tiles. * @beta */ class SetGpuMemoryLimitTool extends core_frontend_1.Tool { static toolId = "SetGpuMemoryLimit"; static get minArgs() { return 1; } static get maxArgs() { return 1; } async run(limit) { if (undefined !== limit) { core_frontend_1.IModelApp.tileAdmin.gpuMemoryLimit = limit; core_frontend_1.IModelApp.requestNextAnimation(); } return true; } async parseAndRun(...args) { const maxBytes = Number.parseInt(args[0], 10); const limit = Number.isNaN(maxBytes) ? args[0] : maxBytes; return this.run(limit); } } exports.SetGpuMemoryLimitTool = SetGpuMemoryLimitTool; //# sourceMappingURL=SetGpuMemoryLimitTool.js.map