Closed xiamingwei-sudo closed 1 week ago
There should be a postcondition reason printed in the logs. Can you check again and see if there's additional information about the crash?
thans you for response When I use Xcode debug, I get the following crash message
my device is iPad mini 3 os: 12.5.5 Backend: Metal
this is my code, and crashed on rendererManager.setMaterialInstanceAt(renderer, index, newMaterialInstance);
- (void)updateMaterialInstance:(MaterialInstance *)materialInstance withName:(NSString *)name rgba:(math::float4)rgba prNamePrefix:(NSString *)prNamePrefix material:(filament::Material *)material renderer:(RenderableManager::Instance)renderer index:(int)index {
if (![name hasPrefix:prNamePrefix]) {
return;
}
NSLog(@"updateFilamatWithBuffer prNamePrefix:%@, name: %@", prNamePrefix, name);
auto& rendererManager = _engine->getRenderableManager();
auto newMaterialInstance = material->createInstance();
rendererManager.setMaterialInstanceAt(renderer, index, newMaterialInstance);
[self setMaterialParameters:newMaterialInstance withRGBA:rgba];
}
crash:
2024-07-10 13:11:27.489492+0800 SoundCore[402:15649] [BLEPeripheral:137-notifyCharacteristicChange(_:)]🐛 notifyCharacteristicChange: <CBCharacteristic: 0x128dbe8f0, UUID = 8888, properties = 0x92, value = <09ff0000 010e070a 0028>, notifying = YES>, value: Optional(10 bytes)
Warning: sample comparison not supported by this GPU
2024-07-10 13:11:30.547020+0800 SoundCore[402:15649] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C18.1:2][0x13bf3d0a0] get output frames failed, state 8196
2024-07-10 13:11:30.548916+0800 SoundCore[402:15649] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C18.1:2][0x13bf3d0a0] get output frames failed, state 8196
2024-07-10 13:11:30.551812+0800 SoundCore[402:15649] TIC Read Status [18:0x0]: 1:57
2024-07-10 13:11:30.552141+0800 SoundCore[402:15649] TIC Read Status [18:0x0]: 1:57
2024-07-10 13:11:31.045106+0800 SoundCore[402:15709] Compiler failed to build request
Could not statically determine the target of a texture
Panic
in operator():97
reason: Could not create Metal pipeline state.
#0 SoundCore 0x1039a7a7c _ZN5utils6TPanicINS_18PostconditionPanicEEC2EPKcS4_iNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 100
#1 SoundCore 0x1039a77dc _ZN5utils18PostconditionPanicCI1NS_6TPanicIS0_EEEPKcS3_iNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE + 12
#2 SoundCore 0x1039a77bc _ZN5utils6TPanicINS_18PostconditionPanicEE5panicEPKcS4_iS4_z + 116
#3 SoundCore 0x10387fddc _ZN8filament7backend17DepthStateCreatorclEPU19objcproto9MTLDevice11objc_objectRKNS0_17DepthStencilStateE + 0
#4 SoundCore 0x103869b2c _ZN8filament7backend10StateCacheINS0_18MetalPipelineStateEU8__strongPU33objcproto22MTLRenderPipelineState11objc_objectNS0_20PipelineStateCreatorEN5utils4hash12MurmurHashFnIS2_EEE16getOrCreateStateERKS2_ + 364
#5 SoundCore 0x1038736d4 _ZN8filament7backend18ConcreteDispatcherINS0_11MetalDriverEE4drawERNS0_6DriverEPNS0_11CommandBaseEPl + 1164
#6 SoundCore 0x10384fbac _ZNSt3__110__function6__funcIZN8filament7backend13CommandStream7executeEPvE3$_0NS_9allocatorIS6_EEFvvEEclEv + 52
#7 SoundCore 0x103874bc4 _ZN8filament7backend11MetalDriver7executeERKNSt3__18functionIFvvEEE + 44
#8 SoundCore 0x10384f914 _ZN8filament7backend13CommandStream7executeEPv + 96
#9 SoundCore 0x103925f40 _ZN8filament7FEngine4loopEv + 448
#10 SoundCore 0x103929790 _ZNSt3__114__thread_proxyB7v160006INS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEMN8filament7FEngineEFivEPS8_EEEEEPvSD_ + 64
#11 libsystem_pthread.dylib 0x1fe2302c0 <redacted> + 128
#12 libsystem_pthread.dylib 0x1fe230220 _pthread_start + 44
There should be a postcondition reason printed in the logs. Can you check again and see if there's additional information about the crash?
I repeated the question, please see the log I replied above, thanks !!
We previously worked around an error like this, I wonder why this is no longer working: https://github.com/google/filament/blob/3728f0660395d04d5735d85831a43480501f1c63/shaders/src/light_indirect.fs#L75-L78
@xiamingwei-sudo are you able to investigate what the GPU's device.name
is? Maybe this check isn't sufficient:
We previously worked around an error like this, I wonder why this is no longer working:
@xiamingwei-sudo are you able to investigate what the GPU's
device.name
is? Maybe this check isn't sufficient:
thanks for you respons, and my ipad GPU info :
FEngine (64 bits) created at 0x120a1d800 (threading is enabled)
FEngine resolved backend: Metal
Selected physical device 'Apple A7 GPU'
Backend feature level: 2
FEngine feature level: 1
so how can i fix this issue? can you give me some suggestion ?
Perhaps we also need to extend that fix to Apple A7 GPUs. @xiamingwei-sudo can you change that check inside MetalDriver.mm to this and then recompile Filament?
mContext->bugs.a8xStaticTextureTargetError =
[mContext->device.name containsString:@"Apple A8X GPU"] ||
[mContext->device.name containsString:@"Apple A7 GPU"];
Perhaps we also need to extend that fix to Apple A7 GPUs. @xiamingwei-sudo can you change that check inside MetalDriver.mm to this and then recompile Filament?
mContext->bugs.a8xStaticTextureTargetError = [mContext->device.name containsString:@"Apple A8X GPU"] || [mContext->device.name containsString:@"Apple A7 GPU"];
Thank you very much for your reply, no more crashes after adding Apple A7 GPUs and recompiling Filament, but we also got crash on Ipad Air2/ Ipad mini 4 & iphone 6 & 6 plus , i think that is the same problem, Thanks again for your response!! and look forward to seeing the issue fixed in the release Version
⚠️ Issues not using this template will be systematically closed.
Describe the bug crash on ipad air2, and happens always. Is there anyone have solutions? thanks
Logs
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.