Search Issue Tracker
Fixed in 2021.2.X
Votes
3
Found in
2020.2.0b11
2020.2.1f1
2021.1
2021.2
Issue ID
1308132
Regression
Yes
Using CopyTexture on textures with different MSAA sample counts throws an error
How to reproduce:
1. Open the attached "1308132.zip" project
2. Enter the Play Mode
3. Check the Game View
Expected results: the Game View window is green
Actual results: the Game View window is red and there is an error in the Console
Reproducible with: 2020.2.0b11, 2020.2.3f1, 2021.1.0b4, 2021.2.0a3
Not reproducible with: 2019.4.19f1, 2020.1.17f1, 2020.2.0b10
Could not test with: 2018.4.31f1 (project not downgradable)
Note:
-The error thrown is CopyTexture called with mismatching sample count per pixel (src 2 dst 1). UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Comments (2)
-
Shii
Apr 23, 2021 09:10
Backport to 2020.3 please?
-
Petur-Aldin
Feb 02, 2021 15:53
I've managed to work around this problem by making a native plugin that directly calls the glCopyImageSubData function that Unity should be calling on Android, circumventing Graphics.CopyTexture. That also allowed me to copy more than one layer in a texture array in one call by using srcDepth, which Graphics.CopyTexture doesn't expose for some reason.
I think what Graphics.CopyTexture isn't considering when it's throwing that error is the fact that MSAA gets resolved immediately on mobile tiled renderers, so even though the RenderTextures in Unity are labelled as multi sampled, it isn't stored that way in memory and they can be copied without issue.
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
- [Android][BiRP] Depth processing is handled incorrectly on certain Android devices when using 2 camera's
- [APV] Cancelling Display Dialog Error is thrown after Adaptive Probe Volumes tab is open in Lighting Window
- [APV] NullReferenceException is thrown when baking Adaptive Probe Volume for a Terrain with Non-GI Contributing Tree Prototypes and multiple APV objects with different LayerMasks are present on the scene
- Hands are not recognized when using Hololens 2
- "OnTriggerExit2D" is called before "OnTriggerEnter2D" when object is destroyed immediately
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a11