Search Issue Tracker
By Design
Votes
1
Found in
5.3.5f1
Issue ID
817739
Regression
No
Error regarding invalid TextureFormat when calling SupportsTextureFormat
Steps to reproduce:
1. Open attached project "817739.zip"
2. Open scene "repro"
3. Run it
4. Scroll to the bottom of console and notice four lines at the end that instead of True or False has "(Failed SupportsTextureFormat; format is not a valid TextureFormat)"
Reproduced with: 5.2.4f1, 5.3.6p1, 5.4.0f3, 5.5.0a4
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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
Kaan-Yy
Oct 30, 2016 15:20
I have exact problem. ReadPixes (see at bottom) throws " Unsupported texture format for ReadPixels - needs to be ARGB32, RGB24, RGBAFloat, ARGBFloat or RGBAHalf". So although Unity claims device supports texture format; it throws unsupported texture format exception when that texture format is used.
textureFormat = TextureFormat.ARGB32;
#if UNITY_ANDROID
if (SystemInfo.SupportsTextureFormat(TextureFormat.ETC2_RGBA1))
{
textureFormat = TextureFormat.ETC2_RGBA1;
}
#elif UNIT_IOS
if (SystemInfo.SupportsTextureFormat(TextureFormat.PVRTC_RGBA2))
{
textureFormat = TextureFormat.PVRTC_RGBA2;
}
#endif
virtualPhoto = new Texture2D(w, h, textureFormat, false);
r = new Rect(0, 0, w, h);
virtualPhoto.ReadPixels(r, 0, 0); // you get the center section