Sergio0694/ComputeSharp

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

What it solves

ComputeSharp provides a way for .NET developers to utilize GPU acceleration without needing to write complex low-level graphics APIs or manually authoring HLSL shaders. It simplifies the process of running parallel code on the GPU by allowing developers to write their compute and pixel shaders directly in C#.

How it works

The library leverages DX12, D2D1, and source generators to dynamically generate HLSL compute and pixel shaders from C# code. It provides APIs to manage GPU devices, allocate buffers and textures, and handle data movement between the system RAM and the GPU.

Who it’s for

.NET developers who want to create scientific simulations, animated backgrounds, audio visualizers, or high-performance graphics effects in Windows applications (such as WinUI 3 or UWP).

Highlights

  • C# Shader Authoring: Write compute and pixel shaders entirely in C# instead of HLSL.
  • Windows Integration: Deep integration with WinUI 3, UWP, and Win2D for rendering shaders.
  • Production Ready: Used in major applications like the Microsoft Store and Paint.NET.
  • Extensible Ecosystem: Includes specialized packages for memory allocation (D3D12MA), shader reflection (DXC), and debugging (PIX).

Related

  • Project
  • Project
  • Project
  • Project
  • Project