// TODO: this still crashes often due to race conditions between dispatch above and release here
// The main cause will be that the MFSR context is released before the already dispatched commands are executed on the GPU
// Just adding mutexes everywhere is not going to fix that
// A cheap but slightly dirty solution would be to run this code only at EndOfFrame from Unity
//
// Another issue is that we reuse the same static s_mfsrContext pointer when recreating the MFSR context, which can lead to situations where dispatch uses the wrong context object
// Multi-buffering those pointers will help with that
// TODO: this still crashes often due to race conditions between dispatch above and release here
// The main cause will be that the MFSR context is released before the already dispatched commands are executed on the GPU
// Just adding mutexes everywhere is not going to fix that
// A cheap but slightly dirty solution would be to run this code only at EndOfFrame from Unity
//
// Another issue is that we reuse the same static s_mfsrContext pointer when recreating the MFSR context, which can lead to situations where dispatch uses the wrong context object
// Multi-buffering those pointers will help with that