Helped investigate a recent regression in Blender, which broke ‘pass-through’ (i.e. AR) support on Quest 3. Pass-through works reliably on Blender 4.3, 4.4, 4.5 and 5.0, but has been broken since Blender 5.1.
git bisect didn’t help, because “good” commits would suddenly turn “bad” (and vice versa). It was really strange. And most of the code for passthrough hasn’t changed in 2 years (when it was first committed).
The root-cause turned out to be a bad struct initialization. Without proper initialization, we’d OR against garbage values, instead of zero-initialized flags. That is:
- XrPassthroughLayerCreateInfoFB passthrough_layer_create_info;
+ XrPassthroughLayerCreateInfoFB passthrough_layer_create_info = {};
passthrough_layer_create_info.flags |= XR_PASSTHROUGH_IS_RUNNING_AT_CREATION_BIT_FB;
The interesting bit is - why did this work before (and fail now)? The code is nearly 2 years old, and passthrough works (and fails) reliably on the versions that I’ve tested.
I can only imagine that recent builds of Blender resulted in a particular memory alignment that led to the flags field reading non-zero values. It has always been reading garbage values, but I suspect that those garbage values have always been zero (due to how the build packed stuff in memory). I think that’s kinda cool.