public sealed class VideoSurfaceUploaderGets every video in a world onto the GPU and into the renderer, once a frame.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The step VideoSystem names and does not do. That system advances the players in SystemPhase.Update and its own remarks say the picture it chose "is uploaded in SystemPhase.PreRender and drawn in SystemPhase.Render". This is the middle one — and it is a plain class rather than a SystemBase because it needs a command list, and an ECS system in this engine is handed a world and a time and nothing else. Inventing a graphics-shaped system context to hide two method calls would be a worse answer than two method calls.
⚠ Upload must be called outside a render pass and Extract before the renderer sorts. The first records a buffer-to-texture copy and two barriers, which is the one thing a Vulkan command list may not do inside a pass; the second only fills dictionaries. They are separate for that reason and not for tidiness.
It owns a texture per player, not per entity. Two entities showing the same player — a video on a wall and the same video in a mirror — decode once, upload once and draw twice, which is the whole reason VideoSurface lets a player be shared.
Fields and properties (2)
public int TextureCountHow many textures are currently held, which is one per distinct player.
public int UploadsHow many copies the last Upload recorded.
Methods (5)
public VideoSurfaceUploader(IGraphicsDevice device, RenderStage stage)Sets up an uploader.
public VideoTexture? TextureFor(VideoPlayer player)The texture a player's frames are going into, if one has been made.
public void Upload(World world, ICommandList commands)Copies every changed picture into its textures. Called outside a render pass.
public void Extract(World world, RenderSystem system, VideoRenderFeature feature, Int2 surface)Puts this frame's videos into the renderer. Called during extraction.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.