全息模拟器在 Unity 初始屏幕之前挂起



我正在运行Visual Studio 2015更新3,Unity 5.6.3f1,全息模拟器10.0.14393.1358和Windows 10 SDK 10.0.14393.798。我刚刚完成了HoloLens开发基础知识的Pluralsight课程,当我将我的应用程序部署到HoloLens模拟器时,我不断遇到这个问题。

无论我在不调试的情况下运行还是在调试的情况下运行并且没有设置任何断点,我都会看到开始菜单正常开花,然后它清除,在应该显示 Unity 初始屏幕的位置,我只是在屏幕中间看到白色小光标,没有其他任何事情发生。

但是,如果我在 app.cs 构造函数中设置断点,然后单步执行代码,则可以看到初始屏幕出现,并且在单步执行 Main 方法和 CoreApplication.Run(App) 方法调用后应用运行。

查看输出日志时,当程序挂起时,它会在如下所示的点停止。

Direct3D:
Version:  Direct3D 11.0 [level 11.1]
Renderer: Microsoft RemoteFX Graphics Device - WDDM (ID=0x2c1)
Vendor:   Microsoft
VRAM:     639 MB
Initialize engine version: 5.6.3f1 (d3101c3b8468)
'Example1.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:DataUsersDefaultAccountAppDataLocalDevelopmentFilesExample1VS.Debug_x86.xxxxUnityEngineProxy.dll'. Cannot find or open the PDB file.
'Example1.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:DataUsersDefaultAccountAppDataLocalDevelopmentFilesExample1VS.Debug_x86.xxxxSystem.Linq.dll'. Cannot find or open the PDB file.
'Example1.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:DataUsersDefaultAccountAppDataLocalDevelopmentFilesExample1VS.Debug_x86.xxxxSystem.Reflection.Extensions.dll'. Module was built without symbols.
The following GlobalManagers were stripped from the build (Either because they're not used or not supported on this platform):
NetworkManager
MasterServerInterface
UnityAdsManager
ClusterInputManager
CrashReportManager
If your machine has multiple graphics adapters, Unity may have created a WindowContext on the wrong adapter. If you experience a black screen when playing, please restart the Editor.
(Filename: C:/buildslave/unity/build/Runtime/VR/VRDevice.cpp Line: 194)

但是,当程序由于我设置断点并单步执行代码而正常运行时,输出窗口中上面列出的输出之后会出现以下行

UnloadTime: 36.962299 ms
Setting up 1 worker threads for Enlighten.
Thread -> id: 8d0 -> priority: 1 
The program '[1480] Example1.exe' has exited with code -1 (0xffffffff).

我的开发笔记本电脑有两个适配器;

AMD Radeon HD 8790M
Intel HD Graphics 4600

我在redditt r/HoloLens上找到了一个帖子,上面谈到了"进入播放器设置->其他设置->色彩空间并将其交换为伽玛而不是线性",但我的设置已经在伽玛上,所以这似乎不适用。

有什么想法吗?

我猜正在发生的事情是模拟器(使用 hyper v directx 加速)渲染到错误的适配器。 听起来这与时间有关。 具有双视频卡设置的笔记本电脑大部分时间使用低功耗的英特尔适配器,但在渲染 3D 内容时切换到 nvidia 卡。 我猜 Unity 和/或 hyperv 在切换发生之前正在选择适配器。

要尝试的事情:

  • 您应该能够在某处的驱动程序中强制一个适配器一直使用。 看看这是否使它起作用,如果是,你知道这就是问题所在。
  • 尝试将两个适配器的驱动程序更新到最新版本。
  • 尝试更新到最新的工具链 (vs2017/unity2017)

最新更新