Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rickbrew opened this issue Mar 2, 2024 · 1 comment
Open

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

rickbrew opened this issue Mar 2, 2024 · 1 comment
Labels
proposal 💡 A proposal for a new feature untriaged 🧰 A new issue that needs initial triage

Comments

@rickbrew
Copy link
Collaborator

rickbrew commented Mar 2, 2024

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.

@rickbrew rickbrew added proposal 💡 A proposal for a new feature untriaged 🧰 A new issue that needs initial triage labels Mar 2, 2024
@rickbrew
Copy link
Collaborator Author

rickbrew commented Mar 2, 2024

Also, I have some compute shaders you can copy-paste if you want something for unit testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal 💡 A proposal for a new feature untriaged 🧰 A new issue that needs initial triage
Projects
None yet
Development

No branches or pull requests

1 participant