Search Issue Tracker
By Design
Votes
0
Found in
5.4.0b17
Issue ID
807967
Regression
No
SetInts doesn't work properly with ComputeShader
To reproduce:
1. Open attached project
2. Play DefaultScene
3. Observe log in console
In the DefaultScene an object TestCopy contains a component "TestCopyInts".
This component create a compute buffer, then dispatch a computeShader that copy data from the uniform parameter setted by "SetInts" and copy it to the ComputeBuffer with the same index.
Then the script get back the data from the compute Buffer, the content should be equal to the content sended by "SetInts".
But it is not.
Please not that if you do the same code with a compute buffer as input it works properly ( set UseInputCB to true in the component and in the shader uncomment the line //#define USE_INPUT_CB ).
Reproducible: 5.5.0a2, 5.4.0b23, 5.3.5p5, 5.2.5f1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- UI Overlay Image gets darker on each Camera when multiple Cameras are used
- Assertion failed on expression: 'scriptedImporterClass == SCRIPTING_NULL error when opening the standalone profiler window
- Disabled assets in Import Unity Package window aren't tracked but count as being selected by user
- [Windows] Crash on GetManagerFromContext when video is playing and creating High Definition 3D Projects after FMOD failed to switch back to normal output Error appeared
- GC Alloc produced when adding items to MultiColumnListView with Auto Assign Binding
shubhamswaraj2021
Aug 18, 2020 05:06
good one <a href="https://www.lyricsauto.com">lyricsauto</a>
m5240666
Apr 30, 2018 09:14
int[] data= new int[6];
//data assignments
//data={1,2,3,4,5,6}
computeShader.SetInts(id, data);
GPU:
int data[6]
resulting in {1,5,0,0,0,0}
TSWessel
Mar 28, 2018 13:49
To my experience, it appears that if your compute shader variable is an int[], then SetInts passes only every fourth value in the array to the compute shader.
So, passing [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] results in [0, 4, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0] in the compute shader.
If this odd behavior is really by design, then please update the documentation to reflect this.
Hakazaba
May 06, 2017 13:45
How is SetInts supposed to be used?