I know that
RWTexture2D Result;
void CSMain (uint3 id : SV_DispatchThreadID)
{
Result[id.xy] = float3(1,2,3);
}
will result in an texture containing the numbers 1,2,3 however I'm now looking for a way to control a compute shader in such a way as to generate either a 3D texture with control over which order my operation occur or a way to fit a data structure in the return value of the compute shader.
For a simplified example let's say that I want to generate either a 2D array of linked lists with each value in the linked list being equal to 1+the next value so
9-8-7-6 , 11-10-9-8
8-7-6-5 , 6-5-4-3-2
from the input texture
6,8
5,2
or store the same in a 3D texture (the real version will be more complex so we will not be able compute that 5+2=7 but instead have to relly on the fact that 5+1=6 6+1=7)
Any idea how to do this?
↧