Search Issue Tracker
Fixed in 2020.1.X
Votes
0
Found in
2018.3.0a4
2018.4
2019.2
2019.3
2019.3.0f3
2020.1
Issue ID
1205146
Regression
Yes
IncrementCounter() does not increment RWStructuredBuffer's counter value when using Vulkan Graphics API
Steps to reproduce:
1. Open the attached project (case_1205146-CSBug.zip)
2. Load the "DemoScene" scene (Drag it from Project/Scenes to the Hierarchy)
3. Enter Play Mode
4. Observe the value displayed in the top-left corner of the Game window and/or outputted to the console
5. In project settings under "Player" (Edit > Project Settings > Player), uncheck "Auto Graphics API for Windows" and switch the Graphics API to Vulkan
6. Unity will prompt you to restart, click "Restart Editor"
7. After restarting, enter Play Mode again
Expected results: Correct value is displayed on the screen and outputted to the console (should be 5)
Actual results: The value is either 0 or some other arbitrary number
Reproduced in: 2018.3.0a4, 2018.4.15f1, 2019.2.17f1, 2019.3.0f3, 2020.1.0a17
Not reproducible in: 2017.4.35f1, 2018.3.0a3
Note: It's possible that in 2018.3.0a3 and earlier Unity fallbacks and uses the D3D11 compiled Shader since both Vulkan and D3D11 compiled ComputeShader code is present, even when Vulkan is the only Graphics API selected.
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
- Unable to switch to either Facebook Instant Games/Meta Quest in the Build Profile
- Error "IndexOutOfRangeException: Index was outside the bounds of the array" logged when selecting an Element in UI Builder with a specific setup
- "native code called abort()" is thrown in WebGL player when loading first scene
- Crash on core::base_hash_set when importing a specific package
- SettingsService.NotifySettingsProviderChanged() Doesn't Call OnDeactivate for Existing SettingsProviders when new ServiceProvider is created
Resolution Note (fix version 2020.1):
Fixed in 2020.1.0a24
Workaround:
Instead of IncrementCounter(), use InterlockedAdd().
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/interlockedadd