microsoft / angle

ANGLE: OpenGL ES to DirectX translation
Other
615 stars 166 forks source link

Can't get this going on immersive HMD headsets #127

Closed mlfarrell closed 7 years ago

mlfarrell commented 7 years ago

Please help me. I'm dying here guys. I have no idea why this is completely broken now on the windows MR headsets. Flickering random colors. My engine is completely dead without help.

ms-holographic-experimental branch latest windows 10 insider build

austinkinross commented 7 years ago

@MikeRiches

MikeRiches commented 7 years ago

@mlfarrell: You should be able to get unblocked by removing this code from HolographicSwapChain11.cpp:

948 // Discard the contents of the render target. 949 // This is a valid operation only when the existing contents will be 950 // entirely overwritten. If dirty or scroll rects are used, this call 951 // should be removed. 952 if (mBackBufferRTView != nullptr) 953 { 954 spContext->DiscardView(mBackBufferRTView.Get()); 955 } 956

957 // Discard the contents of the depth stencil. 958 if (mDepthStencilDSView != nullptr) 959 { 960 spContext->DiscardView(mDepthStencilDSView); 961 }

mlfarrell commented 7 years ago

Removing discards fixed the random colors flashing, but now I just have a black screen. Again, if I do the IsEqual hack from the other thread, I at least see something render in between black flickers. But allowing the RTV recreation each frame seems to completely hose the swapchain. It definitely doesn't like that for some reason.

Also debug log is spamming this message which may or may not be related

Exception thrown at 0x73DA0212 (KernelBase.dll) in VertoStudioVR3D.exe: 0x000006F5: The enumeration value is out of range.
analog\input\spectrum\common\spatialdevice.cpp(775)\Windows.Mirage.dll!57930BFF: (caller: 57931228) ReturnHr(125) tid(1e14) 800706F5 The enumeration value is out of range.
    CallContext:[\ClientComponentManager_OnSensorData] 

Thanks Mike. I really appreciate the response. I'll pick this stuff back up tomorrow night.

mlfarrell commented 7 years ago

@MikeRiches omg. so you're gonna laugh. Days of looking at this and then its beyond obvious

See the original code whenever that if statement is true, we jump out of the function like so

              return resetOffscreenBuffers(
                static_cast<EGLint>(mRenderTargetSize.Width),
                static_cast<EGLint>(mRenderTargetSize.Height));

The part below that lovely return is the code that updates the entirety of the stereo view transforms. Hence the black screen. I'll commit fix to my fall creators update branch today.

mlfarrell commented 7 years ago

https://github.com/mlfarrell/angle/commit/ea215775a1f8a33b269c32a88ca5c724ff162eca