Buffers and Textures as method parameter

Open
#784 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp

Research direction

The issue names no files, tests, or entry points. Start by locating the shader method and parameter-generation code that handles buffers and textures, then determine how HLSL method parameters are currently represented. Done would require an agreed design, implementation, and tests covering methods with one or more buffer or texture parameters.

Written by the indexing model from the issue text.

Description

question :question: untriaged :toolbox:

As far as I know, hlsl supports pass buffers and textures in method call. Are there any plans to support this?

Currently, I must maintain copies of the same function for each shader and each parameter

for example, to achieve something like
public readonly void DoSomething(ReadWriteBuffer<uint> array);
I have to make method variants and copies for every buffer and every shader, and situation may even get worse if their are more than one parameters

public ReadWriteBuffer<uint> array1;
public ReadWriteBuffer<uint> array2;
public ReadWriteBuffer<uint> array3;

public readonly void DoSomethingOverArray1AndArray2();
public readonly void DoSomethingOverArray1AndArray3();
public readonly void DoSomethingOverArray2AndArray3();

This looks foolish and brings a lot of trouble

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.