public sealed class SurfaceCacheTextureA surface cache, mirrored into the atlas textures the kernels read — doc 19 § L4's device half.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Five sampled planes, one card buffer, and a double-buffered gather. Albedo with the stored depth in alpha, the normal with validity in alpha, emissive, direct, and two gathered planes ping-ponged the way SurfaceCacheStore ping-pongs its arrays: a bounce reads the front while writing the back, because a bounce that reads its own pass converges to whatever the texel order made of it. The packing is the store's own — a texel uploaded from the CPU capture and one the rasterising capture will someday write are the same texel, the property every pool here shares.
Apply is the SurfaceCacheSource contract. The composed sampler's bindings are named for the slot that composed it — SurfaceCacheGather.SurfaceCacheSource.surfaceCards — and this writes every one of them, so a pass that composes the cache asks by name and gets this mirror's textures. A rename on either side is a binding that silently resolves to nothing.
⚠ The textures are not graph resources — they are named into descriptor sets — so nothing else in a frame will transition them. Whoever dispatches into the direct or gather planes brackets with TransitionDirect / TransitionGatherBack, the way every fill over the irradiance pool already does.
Fields and properties (14)
public SurfaceCacheStore StoreThe cache this mirrors.
public bool IsCreatedWhether the device objects exist yet.
public int UploadsHow many times the cache has been uploaded.
public int CardCountHow many cards the last upload staged — the count Apply publishes.
public bool DirectIsWrittenWhether the lighting dispatch owns the direct plane, so the upload must not copy it.
public bool BounceIsWrittenWhether the bounce dispatch owns both gather planes, so the upload must not copy them.
public const ResourceState PlaneIsBeingWrittenWhat a written plane is in while a dispatch owns it.
public BufferHandle CardsBufferThe card buffer, for the kernels' own cards binding.
public TextureViewHandle AlbedoDepthViewThe albedo-and-depth plane's view.
public TextureViewHandle NormalValidViewThe normal-and-validity plane's view.
public TextureViewHandle EmissiveViewThe emissive plane's view.
public TextureViewHandle DirectViewThe direct plane's view — the lighting dispatch's target.
public TextureViewHandle GatherFrontViewThe front gather plane — what the sampler reads, as of the last swap.
public TextureViewHandle GatherBackViewThe back gather plane — what the bounce dispatch writes.
Methods (12)
public SurfaceCacheTexture(SurfaceCacheStore store)Builds a mirror of one store. Nothing exists on the device until the first upload.
public void SwapGather()Makes the staged gather the one the sampler reads, without touching the device.
public void EnsureCreated(IGraphicsDevice graphics)Creates the device objects without recording anything.
public void Upload(IGraphicsDevice graphics, ICommandList commands)Creates the textures if they do not exist, and uploads the CPU cache.
public void TransitionDirect(ICommandList commands, ResourceState before, ResourceState after)Moves the direct plane from one state to another.
public void TransitionGatherBack(ICommandList commands, ResourceState before, ResourceState after)Moves the back gather plane from one state to another.
public bool RecordDirectReadback(ICommandList commands)Records a copy of the direct plane back into host memory.
public bool RecordGatherReadback(ICommandList commands)Records a copy of the back gather plane — the bounce dispatch's output — into host memory.
public bool TryReadDirect(Span<Vector4> texels)Decodes the direct plane the last RecordDirectReadback copied.
public bool TryReadGather(Span<Vector4> texels)Decodes the gather plane the last RecordGatherReadback copied.
public void Apply(ParameterCollection parameters, string shaderName)Writes the composed sampler's bindings, by the names the reflection interned.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Used by (8)
- ArenaIlluminationThirdPersonShooter
- ReflectionRendererVixen.Rendering.PostFx
- ReflectionTraceDeviceTestsVixen.Graphics.Golden.Tests
- SurfaceCacheGatherFillVixen.Rendering
- SurfaceCacheLightFillVixen.Rendering
- SurfaceCacheRadiosityDeviceTestsVixen.Graphics.Golden.Tests
- SurfaceCacheRendererVixen.Rendering
- SurfaceCacheRendererDeviceTestsVixen.Graphics.Golden.Tests