Sergio0694/ComputeSharp

D2D compute shader support tracking issue

Sergio0694 opened this issue · 0 comments

Note

Tracking issue, closes #351

Description

This meta issue is for tracking all work related to adding support for D2D compute shaders.
See MS docs on D2D compute shaders for further reference.

Planned work

There's extensive work that will be needed to add full support, so it's being split into different milestones.

Milestone 1 (prototype):

  • Create a new ComputeShaderEffect native object that implements ID2D1EffectImpl and ID2D1ComputeTransform
    • Mostly the same stuff as the pixel shader effect minus the differences there
    • Can probably share/reuse a lot of code from that other type
  • Add a new ID2D1ComputeShader interface with appropriate hooks
  • Expose some D2D1ComputeShaderEffect interop API with methods to register shaders and whatnot
  • Manually implement a hello world D2D compute shader with this and get it to run

Milestone 2 (projection/generator support):

  • Expose similar ThreadIds APIs as for DX12 shaders
  • Expose some new D2D APIs for the compute shader exclusive stuff
  • Write a header for D2D compute shaders
  • D2D injects a custom constant buffer with additional info
  • Add a new source generator to transpile compute shaders too and generate supporting code

Milestone 3 (Win2D interop):

  • Add a new ComputeShaderEffect<T> effect for Win2D interop