Very basic D2D compute shader support (non-source generator)

Open
#771 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp

Research direction

Start in ComputeSharp.D2D1 by reading D2D1ShaderProfile, D2D1ShaderCompiler, and the existing D2DPixelShaderSource support. Compare the requested D2DComputeShaderSource path with the current pixel-shader flow and determine how cs_5_0/lib_5_0 should be handled. Done means basic compute-shader profile, compilation, and attribute support work without extending d2d1computeshaderhelpers.hlsli.

Written by the indexing model from the issue text.

Description

proposal :bulb: untriaged :toolbox:

Related to #351 and #552, I think there's an opportunity for very basic D2D compute shader support. The first two I was able to do myself with forked code, but the 3rd I would need ComputeSharp to specifically support:

  1. Add ComputeShader50 to D2D1ShaderProfile, which would resolve to cs_5_0 / lib_5_0
  2. Enable D2D1ShaderCompiler to compile these (might be automatic with # 1)
  3. Add [D2DComputeShaderSource] similar to [D2DPixelShaderSource]. I believe this should be trivial?

3 would really help me right now, as I'm currently having to compile my compute shaders at runtime. This causes a noticeable delay the first time one of them is used, and I can't verify it'll even compile until runtime!

I don't think it's necessary to worry about the d2d1computeshaderhelpers.hlsli just yet, that's not what I intend this issue to cover. I just want the basic stuff.

It may also be worth extending this to vertex shaders -- as in, no source generator support but at least we could compile and experiment with them. I don't have any plans to pursue vertex shaders, other than experimenting for satisfying my own curiosity, so this would just be about fleshing out ComputeSharp.D2D1.

Dominant language
C#
Stars
3.2k
Forks
148
Avg merge
4h 32m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Sergio0694/ComputeSharp

All issues in Sergio0694/ComputeSharp

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.