Below are two images.
The first: a simple test method within a compute shader void that makes all z components of the struct vector z equal the number index i. (which is the x component of unit of SV_DispatchThreadID).
The second:
An array filled with the processed vector from reading a buffer (GetData).
As you can see it appears only about a third of the vectors are being modified and certainly got me confused.
I’m new to HLSL and shader code, but with other language and hardwaree backgrounds; learning fast.
Any explanation of advise would be appreciated.
The only cause I can think of atm would be a bottleneck issue between CPU and GPU, or I haven’t given enough threads or kernal ints to the input buffers (Currently 512).


Seems like this link might help:
From your image especially seems to match your problem exactly–only every 3rd element is being updated because you’re using triangles instead of points (according to that link… haven’t done much with compute shaders so can’t say for certain
)
1 Like
Thanks for the reply.
That’s certainly interesting xD
I’ll have to look into it after sleep 
Hmm that certainly explains things.
However on changing to.points , nothing seems to render :S
Perhaps something else needs changing :s
Graphics.DrawProcedural(MeshTopology.Points, 6, StartStarsCount);
Rightyo results:
Changing to points broke everything unfortunately.
I suspect this is due my structs being help in a cginc reference and linked to an equivalent struct.
I choose this method as it allows consistency of vars across all shaders - and is helpful when upgrading to server parse stuff.
I finally fixed the issue by simply reorganising my output methods and adding #region
Honestly no idea why it work, shot in the dark: could well be a compiling fluke.
But hey: it works 
1 Like