Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce limits on tile GPU memory usage #688

Merged
merged 51 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
15dcb4a
OrderedSet; DisclosedTileTreeSet.
pmconne Jan 26, 2021
7e9d149
Do not override Tile.collectStatistics - that's what _collectStatisti…
pmconne Jan 26, 2021
24d42af
WIP track tile memory by category.
pmconne Jan 26, 2021
6743093
TileMemoryBreakdown
pmconne Jan 26, 2021
4d58930
Memory breakdown UI.
pmconne Jan 26, 2021
146a428
Merge remote-tracking branch 'origin/master' into gpu-memory-limits
pmconne Jan 26, 2021
dd4d361
docs etc
pmconne Jan 26, 2021
725d7db
Test proving we currently reload parent tile content when children ar…
pmconne Jan 27, 2021
c8100fe
If parent tile's content is loaded and then later unloaded to convers…
pmconne Jan 27, 2021
538be50
MemoryTracker can display stats for selected tiles.
pmconne Jan 27, 2021
945af36
WIP track tile memory usage.
pmconne Jan 28, 2021
038bff0
ViewportIdSet
pmconne Jan 28, 2021
d92b462
Test ViewportIdSet.
pmconne Jan 28, 2021
e9cb90b
WIP test LRUTileList.
pmconne Jan 28, 2021
f0afc5e
Fix node insertion/removal.
pmconne Jan 28, 2021
ef0ff3d
More tests.
pmconne Jan 28, 2021
782683a
Fix clearSelectedForViewport; tests.
pmconne Jan 28, 2021
7bbcfd1
docs clarification
pmconne Jan 28, 2021
8573e50
docs
pmconne Jan 28, 2021
bb662d2
Remove redundant and now-unwieldy TileAdmin abstract base class.
pmconne Jan 29, 2021
272844f
TileAdmin has a LRUTileList.
pmconne Jan 29, 2021
6d91c80
Hook up memory limits in TileAdmin.
pmconne Feb 1, 2021
22cca6d
typo
pmconne Feb 1, 2021
db27c4d
wip more tests.
pmconne Feb 1, 2021
70c1e93
More tests.
pmconne Feb 1, 2021
c82fefb
Merge branch 'master' into gpu-memory-limits
pmconne Feb 1, 2021
245b8ab
fix merge.
pmconne Feb 1, 2021
891d3a0
`fdt tile max mem` key-in
pmconne Feb 1, 2021
43023c8
fix key-in docs.
pmconne Feb 1, 2021
237cdc1
Do not discard contents of tiles we want to draw but can't yet.
pmconne Feb 1, 2021
6109dcd
Iterators over LRUTileList partitions.
pmconne Feb 2, 2021
41b91c1
Additional info in TileMemoryBreakdown.
pmconne Feb 2, 2021
bf5c563
Map tiles opt-out of memory limits.
pmconne Feb 2, 2021
cfcb965
TileAdmin docs; GpuMemoryLimit(s)
pmconne Feb 2, 2021
b1f0a01
doc.
pmconne Feb 2, 2021
34d5ee2
GpuMemoryLimits replace mobileExpirationMemoryThreshold and TileTree.…
pmconne Feb 3, 2021
68eb48f
Add tests and fix bugs revealed thereby.
pmconne Feb 3, 2021
a9a51e2
More tests => more bug fixes.
pmconne Feb 3, 2021
170034e
Adjust key-in for GpuMemoryLimit.
pmconne Feb 3, 2021
69c853c
docs.
pmconne Feb 3, 2021
bd06811
lint
pmconne Feb 3, 2021
69d56bb
extract-api
pmconne Feb 3, 2021
f29acea
NextVersion.md
pmconne Feb 3, 2021
08579aa
Merge branch 'master' into gpu-memory-limits
pmconne Feb 3, 2021
98bca02
Merge branch 'master' into gpu-memory-limits
mergify[bot] Feb 4, 2021
1eb4f97
broken doc link
pmconne Feb 4, 2021
ca0b0cd
Merge branch 'gpu-memory-limits' of /~https://github.com/imodeljs/imode…
pmconne Feb 4, 2021
e98c06b
fix outdated tool Id
pmconne Feb 4, 2021
808d888
Merge branch 'master' into gpu-memory-limits
mergify[bot] Feb 4, 2021
46a3011
Merge branch 'master' into gpu-memory-limits
mergify[bot] Feb 4, 2021
305645c
Merge branch 'master' into gpu-memory-limits
mergify[bot] Feb 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions common/api/bentleyjs-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,14 @@ export namespace OrderedId64Iterable {
export function uniqueIterator(ids: OrderedId64Iterable): Generator<string, void, unknown>;
}

// @public
export class OrderedSet<T> extends ReadonlyOrderedSet<T> {
constructor(compare: OrderedComparator<T>, clone?: CloneFunction<T>);
add(value: T): this;
clear(): void;
delete(value: T): boolean;
}

// @beta
export function partitionArray<T>(array: T[], criterion: (element: T) => boolean): number;

Expand Down Expand Up @@ -1241,6 +1249,16 @@ export class PriorityQueue<T> implements Iterable<T> {
protected _swap(a: number, b: number): void;
}

// @public
export class ReadonlyOrderedSet<T> implements Iterable<T> {
[Symbol.iterator](): Iterator<T>;
constructor(compare: OrderedComparator<T>, clone?: CloneFunction<T>);
// (undocumented)
protected readonly _array: SortedArray<T>;
has(value: T): boolean;
get size(): number;
}

// @public
export class ReadonlySortedArray<T> implements Iterable<T> {
[Symbol.iterator](): Iterator<T>;
Expand Down
26 changes: 26 additions & 0 deletions common/api/frontend-devtools.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Decorator } from '@bentley/imodeljs-frontend';
import { EmphasizeElements } from '@bentley/imodeljs-frontend';
import { EventHandled } from '@bentley/imodeljs-frontend';
import { GeometrySummaryOptions } from '@bentley/imodeljs-common';
import { GpuMemoryLimit } from '@bentley/imodeljs-frontend';
import { Hilite } from '@bentley/imodeljs-common';
import { HitDetail } from '@bentley/imodeljs-frontend';
import { Id64Arg } from '@bentley/bentleyjs-core';
Expand Down Expand Up @@ -642,6 +643,7 @@ export interface DiagnosticsPanelProps {
fps?: boolean;
tileStats?: boolean;
memory?: boolean;
tileMemoryBreakdown?: boolean;
gpuProfiler?: boolean;
toolSettings?: boolean;
};
Expand Down Expand Up @@ -791,6 +793,9 @@ export class FlipImageEffect extends AddEffectTool {
static toolId: string;
}

// @internal (undocumented)
export function formatMemory(numBytes: number): string;

// @beta
export class FpsTracker {
constructor(parent: HTMLElement, viewport: Viewport);
Expand Down Expand Up @@ -1408,6 +1413,20 @@ export class SetAspectRatioSkewTool extends Tool {
static toolId: string;
}

// @beta
export class SetGpuMemoryLimitTool extends Tool {
// (undocumented)
static get maxArgs(): number;
// (undocumented)
static get minArgs(): number;
// (undocumented)
parseAndRun(...args: string[]): boolean;
// (undocumented)
run(limit?: GpuMemoryLimit): boolean;
// (undocumented)
static toolId: string;
}

// @alpha
export class SetMapBaseTool extends AttachMapLayerTool {
constructor();
Expand Down Expand Up @@ -1751,6 +1770,13 @@ export interface TextBoxProps {
tooltip?: string;
}

// @beta
export class TileMemoryBreakdown {
constructor(parent: HTMLElement);
// (undocumented)
dispose(): void;
}

// @beta
export class TileStatisticsTracker {
constructor(parent: HTMLElement, vp: Viewport);
Expand Down
Loading