I’ve tried to create a repro, but can’t seem to figure out what’s causing this. Running in Release will work, but if we run our title in Debug, we get the following in Output and a full debugger stop:
Module information:
Built with Compiler Ver ‘190023918’
Built from ‘5.5/patch-release’ branch
Version is ‘5.5.0p4 (2f9c3a0f4141)’
Debug build
Application type ‘XAML’
Used ‘UWP’
OS ‘Windows 10 (10.0.14393) 64bit’
PlayerConnection initialized from C:/Projects/Builds/W10_SDB_W1_dev/MEH/bin/x86/Debug/AppX/Data (debug = 0)
PlayerConnection initialized network socket : 0.0.0.0 55506
Multi-casting “[IP] 10.1.10.52 [Port] 55506 [Flags] 2 [Guid] 657393597 [EditorId] 3653897733 [Version] 1048832 [Id] MetroPlayerX86(DESKTOP-FL7B3VB) [Debug] 0” to [225.0.0.222:54997]…
Started listening to [0.0.0.0:55506]
GfxDevice: creating device client; threaded=1
Direct3D:
Version: Direct3D 11.0 [level 11.0]
Renderer: AMD Radeon ™ R7 370 Series (ID=0x6811)
Vendor: ATI
VRAM: 3072 MB
Assertion failed on expression: ‘SUCCEEDED(hr)’
(Filename: C:\buildslave\unity\build\Runtime/GfxDevice/d3d11/D3D11Context_Metro.cpp Line: 749)
The program ‘[20728] MEH.exe’ has exited with code 1073741855 (0x4000001f).
Can I get some insight into what the assertion for that line is so I can maybe narrow this down a little bit?
Can you switch to mixed mode debugging in project settings and paste the callstack of the assertion? Looks like this happens when trying to create a shader resource view on the backbuffer for some reason. Does it output any additional messages when using mixed mode debugging?
By the way, with mixed mode debugging enabled, you should be able to continue past this assertion.
RIGHT. I forgot that step. We’re getting warmed back up on our W10 build. I can get past that yes. Here’s the requested info:
Call Stack:
UnityPlayer.dll!InitializeOrResetD3D11SwapChain(GfxDevice * device, IDXGISwapChain2 * chain, bool xaml, int & width, int & height, bool fullScreen, bool stereo, int nativeWidth, int nativeHeight, float scaleX, float scaleY, int vsynccount, int & outBackbufferBPP, int & outFrontbufferBPP, int & outDepthBPP, int & outFSAA) Line 749 C++
UnityPlayer.dll!ScreenManagerMetro::SetResolutionImmediate(int width, int height, bool fullscreen, int preferredRefreshRate) Line 187 C++
UnityPlayer.dll!metro::InitializeGfxWindow(IDXGISwapChain2 * swapChain, bool xaml, int width, int height, bool fullScreen) Line 142 C++
UnityPlayer.dll!UnityPlayer::AppCallbacks::InitializeD3DXAML::__l2::() Line 1078 C++
UnityPlayer.dll!Platform:
etails::__abi_FunctorCapture<void (void),void>::Invoke() Line 881 C++
UnityPlayer.dll!UnityPlayer::AppCallbackItem::NonVInvoke() C++
UnityPlayer.dll!UnityPlayer::AppCallbacks::ExecuteQueuedCallbacks() Line 401 C++
UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThreadImplementation(void * param) Line 173 C++
UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThread(void * param) Line 212 C++
UnityPlayer.dll!win32::CreateThread::__l2::(Windows::Foundation::IAsyncAction ^ __formal) Line 276 C++
UnityPlayer.dll!Platform:
etails::__abi_FunctorCapture<void (Windows::Foundation::IAsyncAction ^),void,Windows::Foundation::IAsyncAction ^>::Invoke(Windows::Foundation::IAsyncAction ^ <__args_0>) Line 881 C++
UnityPlayer.dll!Windows::System::Threading::WorkItemHandler::Invoke(Windows::Foundation::IAsyncAction ^ __param0) C++
UnityPlayer.dll!Windows::System::Threading::WorkItemHandler::[Windows::System::Threading::WorkItemHandler::__abi_IDelegate]::__abi_Windows_System_Threading_WorkItemHandler___abi_IDelegate____abi_Invoke(Windows::Foundation::IAsyncAction ^ __param0) C++
threadpoolwinrt.dll!6d434c6f() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for threadpoolwinrt.dll]
threadpoolwinrt.dll!6d43aff6() Unknown
kernel32.dll!774362c4() Unknown
ntdll.dll!77560fd9() Unknown
ntdll.dll!77560fa4() Unknown
Output:
[1.022468 / 4.851005] - Initialize
D3D11 ERROR: ID3D11Device::CreateShaderResourceView: The Format (0x5b, B8G8R8A8_UNORM_SRGB) is invalid, when creating a View; the Resource was already created with a fully qualified Format, which is not castable (0x57, B8G8R8A8_UNORM). [ STATE_CREATION ERROR #127: CREATESHADERRESOURCEVIEW_INVALIDFORMAT]
Exception thrown at 0x7620A832 in Super Dungeon Bros.exe: Microsoft C++ exception: _com_error at memory location 0x0DFFEE34.
D3D11 ERROR: ID3D11Device::CreateShaderResourceView: Returning E_INVALIDARG, meaning invalid parameters were passed. [ STATE_CREATION ERROR #131: CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN]
Assertion failed on expression: ‘SUCCEEDED(hr)’
(Filename: C:\buildslave\unity\build\Runtime/GfxDevice/d3d11/D3D11Context_Metro.cpp Line: 749)
Looks like this assert is fixed in 5.6. Since this is only happening in debug builds, and it isn’t a fatal error, we’ll not be backporting it since the fix was part of a bigger refactor.
There’s also another workaround you can do locally to avoid the issue: switch to gamma color space when you want to run it in debug. This assert only fires when you’re using linear color space. Don’t forget to switch back before shipping, though 