Skip to content

A .NET library to run C# code in parallel on the GPU through DX12, D2D1, and dynamically generated HLSL compute shaders, with the goal of making GPU computing easy to use for all .NET developers! πŸš€

License

LancerComet/ComputeSharp

Β 
Β 

Repository files navigation

.NET NuGet

What is it? πŸš€

ComputeSharp is a .NET library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders. The available APIs let you access GPU devices, allocate GPU buffers and textures, move data between them and the RAM, write compute shaders entirely in C# and have them run on the GPU. The goal of this project is to make GPU computing easy to use for all .NET developers!

What can it actually do? ✨

Since a video is worth a thousand words, here's a showcase of some pixel shaders (originally from shadertoy.com), ported from GLSL to C# and running with ComputeSharp in a WinUI 3 sample app. You can use this library to create all sorts of things from scientific simulations, to animated backgrounds, audio visualizers and more!

ComputeSharpWinUI3.mp4

Try out the sample app! πŸ’»

The sample app is available in the Microsoft Store, showcasing several pixel shaders all powered by ComputeSharp!

Get it from Microsoft

Available packages πŸ“¦

Name Description Latest version
ComputeSharp The main library, with compiled shaders support NuGet
ComputeSharp.Dynamic An extension for ComputeSharp, enabling dynamic shader compilation at runtime and shader metaprogramming NuGet
ComputeSharp.Pix An extension library for ComputeSharp, enabling PIX support to produce debugging information NuGet
ComputeSharp.Uwp A UWP library (targeting .NET Standard 2.0) with controls to render DX12 shaders powered by ComputeSharp NuGet
ComputeSharp.WinUI A WinUI 3 library (targeting .NET 6) with controls to render DX12 shaders powered by ComputeSharp NuGet
ComputeSharp.D2D1 A library to write D2D1 pixel shaders entirely with C# code, and to easily register and create ID2D1Effect-s from them NuGet

Preview builds are available at https://pkgs.computesharp.dev/index.json (as well as GitHub Packages).

Documentation πŸ“–

All the documentation for ComputeSharp is available in the wiki pages. That includes a recap of everything in this readme, as well as info and detailed samples on all features and APIs from the available packages. Make sure to go through it to get familiar with this library!

Sponsors 🎁

Huge thanks to these sponsors for directly supporting my work on ComputeSharp, it means a lot! πŸ™Œ

Special thanks

ComputeSharp was originally based on some of the code from the DX12GameEngine project by Amin Delavar.

Additionally, ComputeSharp uses NuGet packages from the following repositories:

About

A .NET library to run C# code in parallel on the GPU through DX12, D2D1, and dynamically generated HLSL compute shaders, with the goal of making GPU computing easy to use for all .NET developers! πŸš€

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%