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&)
-
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
- Packman: The same asset data is displayed differently in "Import" and "Remove" popups
- Reference to a deleted GameObject becomes "None" instead of "Missing" when the GameObject is restored with undo after entering and exiting Play Mode
- Size value in Particle System Curve's tab is highlighted with selection across all tab header
- Particle System Curve's Presets window has no visual indication of what preset is selected
- Blur shader doesn't work when the "Scene Color" Node is attached to the UI "Output" Node
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a11