public sealed class TransientResourcePoolPhysical resources the graph hands out and takes back.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
This is where "transient aliasing" actually happens, and it is worth being exact about what it is and is not. Two virtual resources whose lifetimes do not overlap are given the same physical resource — a 4 K GBuffer target and a 4 K post-FX target that never coexist cost one allocation between them, which is the saving [05](../../docs/plan/05-graphics-rhi.md) describes.
It is not memory aliasing in the Vulkan sense: two resources of different descriptions overlapping in one allocation. That needs placed resources, which IGraphicsDevice does not expose and which two of the six planned backends cannot express at all. Reuse gets most of the benefit with none of the API surface, and the distinction is written down here rather than left for someone to discover from a memory graph that did not shrink as much as they expected.
Resources persist across frames. Creating and destroying a GBuffer sixty times a second is a driver allocation per frame per target; the pool holds them and hands the same ones back, which is what makes the graph free to run every frame.
Fields and properties (3)
public int CountHow many physical resources are held.
public int InUseHow many are currently lent out.
public int ReusesHow many times a lend found an existing resource rather than creating one.
Methods (9)
public TransientResourcePool(IGraphicsDevice device)Creates a pool for a device.
public int AcquireTexture(in TextureDescription description)Takes a texture matching a description.
public int AcquireBuffer(in BufferDescription description)Takes a buffer matching a description.
public void Release(int slot)Gives one back.
public TextureHandle TextureAt(int slot)The texture in a slot.
public TextureViewHandle ViewAt(int slot)The default view of the texture in a slot.
public BufferHandle BufferAt(int slot)The buffer in a slot.
public void ReleaseAll()Marks everything free, without destroying anything.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Used by (9)
- PbrShowcaseGamePbrShowcase
- TriangleGameHelloTriangle
- UiHostHelloUi
- VideoGameVideoPlayback
- FixtureVixen.Graphics.Golden.Tests
- RenderGraphVixen.Graphics.RenderGraph
- RenderGraphPropertyTestsVixen.Graphics.RenderGraph.Tests
- RenderGraphTestsVixen.Graphics.RenderGraph.Tests
- EditorHostVixen.Editor.Host