Execution Model
Graphics context
GraphicsContext connects the application to a GPU device through a particular backend and provides its graphics, compute, and transfer queues. Resources used together must belong to the same context; buffers, textures, shaders, pipelines, and their handles cannot be bound across contexts.
Capabilities reports the device name and supported features. Use RayTracingSupported and MeshShadingSupported to check support before creating the resources for those workloads. The
Queue selection
GraphicsQueue is the usual starting point for a frame that combines drawing, computation, and copies. Keeping dependent operations on one queue simplifies their ordering.
|
|
|
|---|---|
GraphicsQueue
|
|
ComputeQueue
|
|
TransferQueue
|
|
Recording and submission
queue.CommandBuffer() returns a CommandBuffer with recording already in progress. After recording the operations and their dependencies, call Submit() once. Submission ends recording and returns a TimelineValue that identifies the completion point on that queue.
commandBuffer, the triangle tutorial submits it and waits for completion:
commandBuffer.Submit().Wait();
Submit() schedules that sequence for execution. Calling Wait() then blocks the CPU thread until the submission completes. This makes the tutorial's frame loop easy to follow, because each frame finishes before the next begins.
queue.CommandBuffer() for each recording, record from one thread at a time, and submit it once. After submission, leave the buffer to the queue: do not modify, resubmit, or dispose it.
Pipeline state
Ownership and lifetime
|
|
|
|---|---|
|
|
|
|
|
|
SwapChain.Drawable
|
|
|
|
|
Dispose() releases native resources even if C# references to the object remain. Submitting commands does not transfer ownership of their resources to the queue.