onegpuCookbook
onegpu cookbook
Compute basics
Run a compute shader in C#Compile HLSL at build time, bind a typed buffer, dispatch a Vulkan compute shader and read its output in C# with OneGpu. Includes a runnable example.Read a GPU buffer back to the CPU in C#Copy a OneGpu buffer into a C# array with ReadAsync or Read. Run a complete Vulkan example, read a subrange and understand when the result is ready.Choose a Vulkan physical device in C#Enumerate Vulkan adapters and select a discrete or integrated GPU in C# with OneGpu. Includes name matching, environment overrides and a runnable example.
Compute
Get deterministic GPU compute results in C#Get repeatable floating-point GPU results in C# with OneGpu’s deterministic mode. Includes a runnable matrix product and bitwise comparison.Measure GPU compute shader time in C#Measure a GPU compute pass in nanoseconds with OneGpu timestamp queries. Includes capability checks, a runnable example and real Vulkan output.Run WebGPU compute in Blazor WebAssemblyRun a GPU matrix product in a .NET 10 Blazor WebAssembly app with OneGpu. Includes async device creation, readback and a downloadable app.