@CruCo, rhetorically asking, how am I supposed to interpret this in any way other than you told your AI tool to create a testcase as an excuse to re-post your issue report? Your original feedback isn't less valid because it was put on the game's compatibility report. Please do not intentionally open duplicate issue reports.
Closing as a duplicate of #10275 / https://github.com/ValveSoftware/Proton/issues/291#issuecomment-6235815259.
Summary
wineopenxrcorrupts composition layers inxrEndFramewhen the first layer and later layers have different struct sizes. A frame[XrCompositionLayerProjection, XrCompositionLayerQuad, XrCompositionLayerQuad]reaches the runtime with corrupted quad poses, and SteamVR rejects every such frame withXR_ERROR_POSE_INVALID(-39). This affects any Windows OpenXR app, not one specific game. A standalone repro is below.Cause
convert_XrCompositionLayerBaseHeader_pointer_array_win64_to_hostinwineopenxr/openxr_thunks.c(generated bymake_openxrviapolymorphic_elem_size, checked at experimental_11.07a94df49e4695fc101fd47d614166e69c43d9669) picks one element size for all layers fromin[0]->type:conversion_context_allocis a bump allocator. With a projection first, each quad (112 bytes on x64) is written into a 48-byte slot, so converting quad n+1 overwrites thepose/sizeof quad n. With a single trailing quad the overflow lands in unused space, which is why most apps work. Thewin32variant has the same pattern.Expected
Each layer is allocated with the size of its own type, for example by computing the size from
in[i]->typeinside the loop, or by using the largest layer struct size.Standalone repro
A minimal D3D11 OpenXR app (about 270 lines, source below). It submits three layer layouts in turn for 45 seconds and counts the
xrEndFrameresults:[projection, quad][projection, quad, quad]-39,XR_ERROR_POSE_INVALID)[quad (tiny), projection, quad, quad]Mode C contains the same layers as B plus one tiny quad in front. It succeeds only because
layers[0]is now a quad, so every converted slot is large enough. All layer data is valid: unit quaternions, sane sizes, full-swapchain rects, LOCAL and VIEW spaces.Environment:
Build:
cl /EHsc /O2 /MT /std:c++17 xrquadtest.cpp /I <OpenXR-SDK>\include /link /LIBPATH:<OpenXR-SDK>\x64\lib(OpenXR SDK 1.1.58). Run it with SteamVR active and the headset on. It writesxrquadtest.logto the working directory.I first reported this as #10275, which was moved into #291 because I found it with a mod. The repro above shows that it is independent of any game. Mod-side report: https://github.com/dubrovskiy-yevhen-stakelogic/vice-city-vr/issues/22
xrquadtest.cpp