public sealed class TexturePoolScheduleWhich physical texture each of a plan's images lives in, worked out from the op order alone.
Remarks
Liveness is the op order, and the plan already fixes it. An image is written by exactly one op — Validate refuses a plan where that is not true — so it is live from that op until the last op that reads it, and dead afterwards unless the plan names it an output. Nothing here analyses a graph, because by the time a plan exists there is no graph left to analyse.
⚠ The number this exists to bound is Allocations, and a chain that allocates one texture per op is the failure it is looking for. Forty ops threaded through two live images must allocate two textures and not forty; at 2K that is the difference between 32 MB and 640 MB, and the version that allocates forty works perfectly on a small plan and takes the machine down on a real one.
A slot is reused only by an image of the same format and the same size. Aliasing across shapes is what a transient resource allocator does with a memory heap; this is a list of textures, and a texture is not reinterpretable. So Allocations is at least the peak number of live images and may be more when a plan works at several resolutions — which is the honest number, since those are textures that exist.
Computed with no device, which is what lets the bound be asserted on any machine. The assertion this whole type exists for is in a test that opens nothing.
Fields and properties (5)
public ImmutableArray<TexturePoolSlot> SlotsThe textures to create, in the order they are first needed.
public ImmutableArray<int> SlotOfWhich slot each image lives in, by image index; -1 for an image the caller supplies.
public int AllocationsHow many textures the evaluation creates.
public int PeakThe most images that are live at any one moment.
public long BytesHow many bytes the created textures take, at one mip and one layer each.
Methods (1)
public static TexturePoolSchedule For(TexturePlan plan)Works out the pooling for a plan.
Used by (10)
- TextureBakeVixen.Editor.TextureGraph
- TextureCpuOpDeviceTestsVixen.Editor.TextureGraph.Tests
- TextureEvaluationCostTestsVixen.Editor.TextureGraph.Tests
- TextureGraphCompilerTestsVixen.Editor.TextureGraph.Tests
- TextureGraphPreviewDeviceTestsVixen.Editor.TextureGraph.Tests
- TextureNodeResolutionTestsVixen.Editor.TextureGraph.Tests
- TexturePlanCheckTestsVixen.Editor.TextureGraph.Tests
- TexturePlanDeviceTestsVixen.Editor.TextureGraph.Tests
- TexturePlanEvaluatorVixen.Editor.TextureGraph
- TexturePoolTestsVixen.Editor.TextureGraph.Tests