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
- WebGL Player with WebGPU Graphics API fails to render Scene when custom Render Feature is used
- “EndLayoutGroup” error thrown when changing Shader Precision Model settings in Build Profiles window > Player Settings Overrides
- Button hover state uses default theme color when a custom .uss is applied
- Samples Showcase script warning does not clear after enabling required settings until GameObject is reselected
- VFX Particles receive shadow artifacts when using ShaderGraph with enabled shadows and Face Camera Plane Orient mode
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a11