Search Issue Tracker
By Design
By Design in 2020.3.X
Votes
0
Found in
2020.3.46f1
Issue ID
UUM-32134
Regression
No
Texture2D.LoadRawTextureData error appears for PVR images
How to reproduce:
1. Download and open the attached project
2. Enter "Play" mode
3. Observe the console window
Expected outcome: No errors appear in the console window
Actual outcome: "UnityException: LoadRawTextureData: not enough data provided (will result in overread)." error appears
Reproduced with: 2020.3.46f1, 2021.3.21f1, 2022.2.11f1, 2023.1.0b8, 2023.2.0a6
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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
Resolution Note:
This is by design: in the second (failing) case, "failing.pvr" contains 11 mipmap levels while Unity creates a Texture2D with 12 mipmap levels for the indicated width/height, so it is indeed correct to say that not enough data was provided.
A way to resolve this is to indicate the number of desired mipmap levels in the Texture2D constructor.
For example, in this case, line 26 in PVR_ERROR.cs can be replaced with:
Texture2D image = new Texture2D(width, height, TextureFormat.ASTC_6x6, mipchain, false);
Using the above, the error disappears and the expected result can be seen.
Resolution Note (2020.3.X):
This is by design: in the second (failing) case, "failing.pvr" contains 11 mipmap levels while Unity creates a Texture2D with 12 mipmap levels for the indicated width/height, so it is indeed correct to say that not enough data was provided.
A way to resolve this is to indicate the number of desired mipmap levels in the Texture2D constructor.
For example, in this case, line 26 in PVR_ERROR.cs can be replaced with:
Texture2D image = new Texture2D(width, height, TextureFormat.ASTC_6x6, mipchain, false);
Using the above, the error disappears and the expected result can be seen.