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
- Mouse inputs cannot be inputted when searching the Shortcuts Menu by type "Shortcut"
- "Debug Assertion Failed!" error when launching Windows Dedicated Server Player with Script Debugging enabled
- [Cinematic Studio][3D HDRP] Shader warnings thrown in the Console window when creating a new project with Cinematic Studio template
- Autoplay is triggered on Audio Assets when changing Asset Bundle tags
- Inspector Asset Bundle section has no indication for Variants, AssetBundle is written without a space, and Variant dropdown menu is available without setting the Asset Bundle first
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a11