ReadWrite buffer for one shader, ReadOnly buffer in another shader?

Open
#890 0 comments 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 with ComputeSharp's buffer allocation API and the shader dispatch path, focusing on how buffer usage is specified. Compare the requested workflow with Unity's API and determine whether one buffer can be written as ReadWrite in one shader and consumed as ReadOnly in another. Done means the supported behavior or limitation is clearly established and covered by an appropriate validation.

Written by the indexing model from the issue text.

Description

question :question: untriaged :toolbox:

First of all let me just say this is a really useful package, and thank you for putting it together.

I am coming from game development where I write a lot of shaders (including compute shaders) in HLSL and use Unity's API wrapper to dispatch them.

Is it possible to allocate one buffer to be used as a ReadOnly buffer in one shader, after it has been written to as a ReadWrite buffer in another shader? I am used to doing this in Unity, but so far from playing with ComputeSharp it doesn't seem to be possible, as I need to specify the buffer usage when allocating the buffer.

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.