Search Issue Tracker
Feature Request
Feature Request in 2023.1.X
Votes
0
Found in
2020.3.39f1
2021.3.9f1
2022.1.16f1
2022.2.0b7
2023.1.0a9
Issue ID
UUM-13615
Regression
No
The resulting texture is empty when serializing a region copied by Graphics.CopyTexture
Reproduction steps:
1. Open the “IN-15493_CopyTexture“ project and open the “TextureCopyTest“ scene
2. Enter and exit the Play mode
3. Observe the “Assets/Textures/CopiedTextureNotWorking” texture
4. Reimport it and observe it again
Expected result: “CopiedTextureNotWorking” looks the same as “CopiedTexture“ before and after reimporting
Actual result: “CopiedTextureNotWorking” is white (empty) before and/or after reimporting
Reproduced in: 2020.3.0f1, 2020.3.39f1, 2021.3.9f1, 2022.1.16f1, 2022.2.0b7, 2023.1.0a9
Reproduced OS: Windows 11, macOS Monterey 12.0.1
Notes:
1. Copied with Graphics.CopyTexture(Texture, int, int, int, int, int, int, Texture, int, int, int, int)
2. Not reproduced with Graphics.CopyTexture(Texture, int, int, Texture, int, int)
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
- Frame Debugger is not disabled when switching Scenes if the Frame Debugger window is not open during the transition
- Standalone Profiler Targets another Project if a Standalone Profiler was launched in it before when switching between Edit or Play Mode Targets
- Crash on ForwardRenderLoopJob when opening a specific project
- [Android] Memory leak and eventual crash on Snapdragon 8 Gen 1+ devices when a Clear Pass is executed after Framebuffer Fetch
- Crash on EnumerateDisabledKeywordsInVariantsArray or UNITY_XXH32 when rapidly saving ShaderGraph or VFXGraph changes
Resolution Note:
Asset serialization can only serialize data that is available on the CPU so a CPU copy is necessary beforehand. Graphics.CopyTexture only additionally copies CPU data if both the src and dst textures are Read/Write enabled, with some additional restrictions:
In this case specifically, when the format is compressed, region-only CPU copies via Graphics.CopyTexture are not supported by Unity at this time due to complexity. This would be a feature request, not a bugfix. This can be worked around if the format is not compressed, if the entire mip is copied via the appropriate overload, or if the data is separately copied to the CPU via the alternate function GetPixels, which is meant for that purpose.
Resolution Note (2023.1.X):
Asset serialization can only serialize data that is available on the CPU so a CPU copy is necessary beforehand. Graphics.CopyTexture only additionally copies CPU data if both the src and dst textures are Read/Write enabled, with some additional restrictions:
In this case specifically, when the format is compressed, region-only CPU copies via Graphics.CopyTexture are not supported by Unity at this time due to complexity. This would be a feature request, not a bugfix. This can be worked around if the format is not compressed, if the entire mip is copied via the appropriate overload, or if the data is separately copied to the CPU via the alternate function GetPixels, which is meant for that purpose.