Search Issue Tracker
By Design
Votes
0
Found in
2019.4
2019.4.14f1
2020.2
2020.3
2021.1
2021.2
Issue ID
1319312
Regression
No
Incorrect buffer values when computing shaders on AMD
Reproduction steps:
1. Download and open the "computeBuffers.zip" project
2. Build the project
3. Open the built project with "RenderDoc"
4. In the RenderDoc toolbar, press "Window" > "Resource Inspector"
5. Capture a frame and double-click on it
6. In the Resource Inspector window, inspect the "indirectDataBuffer_TestAMD" buffer
Expected result: Buffer contents don't differ when using AMD or Nvidia
Actual result: When using AMD, buffer contents differ from when using Nvidia
Reproducible with: 2019.4.22f1, 2020.2.4f1, 2020.3.0f1, 2021.1. 0b11, 2021.2.0a8
Could not test with: 2018.4 (Build errors)
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
- ListView fails to display items when the source list is cleared and a single element is added
- UI Toolkit ':hover' state remains active when another panel is drawn over the hovered element and Touch input is used
- Unsupported Orient modes can be selected and throw errors when using Strip VFX
- "Tab" key exits the name text field in the VFX Graph tab when renaming the Property
- Shader warnings are thrown when deleting blocks in the Ribbon VFX Graph
Resolution Note:
Not a bug. Buffer created with indirect arg usage only, but used also as a structured buffer (compute shader write). DX11 doesn't support structured buffer and indirect argument usage for the same buffer. Indirect argument buffers must be either raw or typed buffers if you want to write to them on GPU side.
Would should get DX11 validation layer error for your use case. AMD hardware is AoSoA swizzling structured buffers, so their data layout is not compatible with indirect argument buffer layout. Nvidia has identical data layout for both cases. This explains why the incorrect usage of DX11 resource flags works fine on Nvidia but breaks AMD. Please enable DX11 validation layers to get more info about this issue.
The correct flag combination is ComputeBufferType.IndirectArguments | ComputeBufferType.Raw. Use HLSL RWByteAddressBuffer for writing to indirect argument buffer.