Search Issue Tracker
Won't Fix
Won't Fix in 6000.4.X
Votes
0
Found in
6000.0.60f1
6000.2.8f1
6000.3.0b6
6000.4.0a2
Issue ID
UUM-122634
Regression
No
Constant buffers are redundantly uploaded when consecutive compute dispatches are executed on DirectX11
Reproduction steps:
1. Open the attached project "ReproProj"
2. Open the “/Assets/Scenes/SampleScene.unity” Scene
3. Right-click on the Game view tab and select “Load RenderDoc“
4. Enter the Play mode
5. Select the “Camera“ icon at the top of the Game view to take a RenderDoc Capture
6. Load Capture in RenderDoc
7. In the Event Browser, filter by term “ExecuteSetPositionsBuffer“
8. Expand “UIR.DrawChain“
9. Expand “SceneCamera.Render“
10. Select “ExecuteSetPositionsBuffer“
11. Remove the search term and press the “Enter” key
12. Expand “ExecuteSetPositionsBuffer“
13. Observe the first and second dispatch
Expected result: The second Map/Unmap/CSSetConstantBuffers sequence is skipped
Actual result: CSConstantBuffer-0-16 is being Map/Unmap twice between two consecutive Dispatch calls
Reproducible with: 6000.0.60f1, 6000.2.8f1, 6000.3.0b6, 6000.4.0a2
Reproducible on:
Play Mode
Could not test on:
Windows Standalone Player (Assets\Scripts\MeshSaverEditor.cs(7,40): error CS0246: The type or namespace name 'MenuCommand' could not be found)
Testing environment: Windows 10 Enterprise 21H2
Not reproducible on: No other environment tested
Notes:
- Reproducible with DX11
- Not reproducible with DX12
- Reproduction code is present in “RedundantConstantBufferTest.cs”
- Forum threads: https://discussions.unity.com/t/redundant-constant-buffer-writes-between-compute-shader-dispatches/1681303 , https://discussions.unity.com/t/3-questions-about-compute-shader-performance/857993
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
- Error “Shader error in 'YSCloudCover': call to 'tex3D' is ambiguous at Assets/YSCloudCoverText.shader(606) (on d3d11)“ is present when compiling tex3D shader with DXC
- Placeholder asset is not loaded with Advertisement Legacy sample when using the latest version of the package
- Addressables content build fails but the Player build is successful when building a development build
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
Resolution Note:
Unity's existing implementation of compute dispatch does not know if constant buffer contents have changed and so this update is expected between each dispatch.
We constantly consider performance improvements to Unity and will consider this feedback in future work.
Resolution Note (6000.4.X):
Unity's existing implementation of compute dispatch does not know if constant buffer contents have changed and so this update is expected between each dispatch.
We constantly consider performance improvements to Unity and will consider this feedback in future work.