google / google/filament

Panic in MetalTexture: 464 And a crash occurred in FEngine::loop

Open
#7,011 5 comments 0 reactions 1 assignee Claimed by @bejado View on GitHub
ios
Dominant language
C++
Stars
20.5k
Forks
2.3k
Avg merge
2d 14h
Merged PRs (30d)
83

Description

Switching between multiple models, such as A, B, and C, and loading new models while releasing old model data:
```
ResourceLoader->evictResourceData();
Scene->removeEntities(_asset->getEntities(), _asset->getEntityCount());
AssetLoader->destroyAsset(_asset);
_asset = nullptr;
```
When rapidly switching operations, does the CPU usage remain high, and after operating for a while, get a crash

![企业微信截图_499bad68-a9a1-4373-ac88-564ede6a3a62](https://github.com/google/filament/assets/7437146/43efd51a-7626-439d-b576-f5ac2cd1c087)

**crash log:**
```
Panic
in MetalTexture:464
reason: Could not create Metal texture. Out of memory?

#0 xxxxxx 0x10484f754 _ZN5utils6TPanicINS_18PostconditionPanicEEC2EPKcS4_iNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 100
#1 xxxxxx 0x10484f4b4 _ZN5utils18PostconditionPanicCI1NS_6TPanicIS0_EEEPKcS3_iNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE + 12
#2 xxxxxx 0x10484f494 _ZN5utils6TPanicINS_18PostconditionPanicEE5panicEPKcS4_iS4_z + 116
#3 xxxxxx 0x1045c9298 _ZN8filament7backend12MetalTextureC2ERNS0_12MetalContextENS0_11SamplerTypeEhNS0_13TextureFormatEhjjjNS0_12TextureUsageENS0_14TextureSwizzleES7_S7_S7_ + 492
#4 xxxxxx 0x1045c9754 _ZN8filament7backend12MetalTextureC1ERNS0_12MetalContextENS0_11SamplerTypeEhNS0_13TextureFormatEhjjjNS0_12TextureUsageENS0_14TextureSwizzleES7_S7_S7_ + 64
#5 xxxxxx 0x1045b9eac _ZN8filament7backend18ConcreteDispatcherINS0_11MetalDriverEE13createTextureERNS0_6DriverEPNS0_11CommandBaseEPl + 220
#6 xxxxxx 0x1045a21e4 _ZNSt3__110__function6__funcIZN8filament7backend13CommandStream7executeEPvE3$_0NS_9allocatorIS6_EEFvvEEclEv + 52
#7 xxxxxx 0x1045bf484 _ZN8filament7backend11MetalDriver7executeERKNSt3__18functionIFvvEEE + 44
#8 xxxxxx 0x1045a1f50 _ZN8filament7backend13CommandStream7executeEPv + 96
#9 xxxxxx 0x104752c2c _ZN8filament7FEngine4loopEv + 324
#10 xxxxxx 0x104755c5c _ZNSt3__1L14__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEMN8filament7FEngineEFivEPS8_EEEEEPvSD_ + 64
#11 libsystem_pthread.dylib 0x1dbef9348 _pthread_start + 116
```

Device: iPhone7Plus
OS: iOS 15.5

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.