Facepunch / sbox-issues

175 stars 12 forks source link

CSwapChainBase::QueuePresentAndWait() and various other console spam when restarting a game #3957

Closed yuberee closed 9 months ago

yuberee commented 1 year ago

Describe the bug

During a long development session, about 3 hours, I restarted my game through the Launch Config and instead of restarting my game it started dropping to single-digit fps and my console started spamming about what I presume is rendering since I could hear the game restarting in the background but it was frozen. It would restart itself a couple of times from what I could hear/see being printer in the console until eventually the game crashed.

To Reproduce

Not reliable, sorry.

Expected behavior

N/A

Media/Files

https://github.com/sboxgame/issues/assets/59583743/16775362-f647-4af5-8654-0d56a00f9fe9

I click through the error stack trace a bunch, it's random but I can't really target a single one because of the low fps

Here is the log: Log.log (Skip towards the end, it was a long development session)

Additional context

Windows 10 Latest drivers on everything GTX 1060 3GB Version 16GB Ram Ryzen 7 3800X

The development session was 3 hours long, in the middle of a game I used the button on the game window to pause since I was in the middle of fixing a bug in the behaviour of my bot, then unpaused around an hour later after dinner. Don't think it has anything to do since I restarted without problem a bunch of times after but it's worth noting. During that hour long pause I did put my PC to sleep.

During the whole time, I was on the latest version of S&box.

If I encounter it again I'll update.

andy013 commented 1 year ago

I've had this several times as well. It tends to happen when I've had the game open for long time but that might just be because it's rare and so it's more likely to happen the longer you have the game running.

I get similar errors:


2023/09/01 23:07:35.0524    engine/RenderSystem ERROR! D3D call failed! hr = DXGI_ERROR_DEVICE_REMOVED ( pDevice->CreateBuffer( &desc, NULL, &pD3dBuf ) ) 
PolSpock commented 11 months ago

Hello,

I'm currently working on my laptop with an Intel Iris Xe graphics card. On the day of 15 December, my s&box [staging] cannot be used anymore since the scene system can't be able to load. Resulting in a s&box crash after trying to play a s&box scene.

This is not the first time i'm having graphics trouble with this laptop and S&box, but it's the first time i cannot use S&box anymore, and that is embarrassing since i use it for multiplayer debugging.

The weird thing is that all working well on 12 december. Also, it's working well on the no-beta branch. So i definitively think it's a recent s&box update between 13 - 15 december who causing this.

Also here are interesting full-stack errors at my s&box startup :

ERROR! D3D call failed! hr = DXGI_ERROR_DEVICE_REMOVED ( pDevice->CreateBuffer( &desc, NULL, &pD3dBuf ) )
   at Sandbox.EngineLoop.Print(Int32 severity, String logger, String message)
   at Managed.SandboxEngine.Exports.Sandbox_EngineLoop_Print(Int32 severitty, IntPtr logger, IntPtr message)
   at Sandbox.SceneCamera.Render()
   at Sandbox.SceneCamera.AddToRenderList()
   at Sandbox.ToolsDll.OnRender()
   at Sandbox.EngineLoop.OnClientOutput()
   at Managed.SandboxEngine.Exports.Sandbox_EngineLoop_OnClientOutput()
   at Sandbox.EngineLoop.RunFrame(CMaterialSystem2AppSystemDict appDict, Boolean& wantsQuit)
   at Sandbox.SourceEngineApp.RunFrame() in C:\build\_work\sbox\sbox\engine\Launcher\SourceEngineApp.cs:line 48
   at Sandbox.SourceEngineApp.RunLoop() in C:\build\_work\sbox\sbox\engine\Launcher\SourceEngineApp.cs:line 39
   at Sandbox.Program.LaunchGame() in C:\build\_work\sbox\sbox\engine\Launcher\Launcher.cs:line 93
   at Sandbox.Program.Main() in C:\build\_work\sbox\sbox\engine\Launcher\Launcher.cs:line 58

These errors conclude to spammy errors in my s&box console (so similar to the main topic of the issue):

[engine/Engine] CSwapChainBase::QueuePresentAndWait() looped for 24 iterations without a present event. 
[engine/Engine] Bailing out of OnBlockForQuery after 0.250 seconds  

I have already tried to update my drivers to the latest version & also reinstall from scratch s&box (through Steam + deleting all keeping files)

Reproduce steps:

Click me to see my full `Log.log` : ``` 2023/12/15 16:16:39.3020 [engine/Engine] SteamAPI_Init succeeded. SteamID is [U:1:15116645] (76561197975382373), AppID is 590830 2023/12/15 16:16:39.3441 [engine/Steam] CSteam3Client::Activate succeeded. SteamID is [U:1:15116645] (76561197975382373), AppID is 590830 2023/12/15 16:16:41.7450 [Generic] Waiting for Web Auth Ticket.. 2023/12/15 16:16:41.7563 [engine/Engine] Console command or convar "package_list" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7563 [engine/Engine] Console command or convar "package_install" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7563 [engine/Engine] Console command or convar "package_unmount_tag" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "hotload_log" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "hotload_fast" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "interopsystem.status" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "interopsystem.dump" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "host" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "joinlobby" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "connect" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "status" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "disconnect" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "reconnect" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "vr_depth_submit" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "vr_gpu_flush_timer" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "vr_force_interleaved_projection" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7698 [engine/Engine] Console command or convar "vr_predict" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7796 [engine/Engine] Console command or convar "vr_use_predicted_hmd_tracking" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:41.7796 [engine/Engine] Console command or convar "perf_time" is being ignored because it conflicts with a menu convar with the same name 2023/12/15 16:16:44.3864 [Generic] Create Compiler `base` 2023/12/15 16:16:44.3976 [Generic] Create Compiler `local.menu` 2023/12/15 16:16:44.3976 [Generic] Create Compiler `toolbase` 2023/12/15 16:16:44.3976 [Generic] Create Compiler `local.shadergraph` 2023/12/15 16:16:44.3976 [Generic] Create Compiler `local.actiongraph` 2023/12/15 16:16:44.3976 [Generic] Create Compiler `local.my_minimal` 2023/12/15 16:16:49.6466 [engine/ToolsStallMonitor] Stall detected. 2023/12/15 16:16:58.1018 [GameMenu] LoadGamePackageAsync: local.my_minimal#local 2023/12/15 16:16:58.6371 [engine/RenderSystem] ERROR! D3D call failed! hr = DXGI_ERROR_DEVICE_REMOVED ( pDevice->CreateBuffer( &desc, NULL, &pD3dBuf ) ) 2023/12/15 16:16:58.6371 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:58.6386 [engine/RenderSystem] ERROR! D3D call failed! hr = DXGI_ERROR_DEVICE_REMOVED ( pDevice->CreateBuffer( &desc, NULL, &pD3dBuf ) ) 2023/12/15 16:16:58.6386 [engine/Assert] C:\build\_work\sbox\sbox\src\renderingpipelines\renderingpipeline_vr.cpp (634) : Assertion Failed in function CreatePerViewConstantBuffer(): false LockDynamicConstantBuffer failed in CreatePerViewConstantBuffer!!! 2023/12/15 16:16:58.6386 [engine/RenderSystem] ERROR! D3D call failed! hr = DXGI_ERROR_DEVICE_REMOVED ( pDevice->CreateBuffer( &desc, NULL, &pD3dBuf ) ) 2023/12/15 16:16:58.6386 [engine/Assert] C:\build\_work\sbox\sbox\src\renderingpipelines\renderingpipeline_vr.cpp (634) : Assertion Failed in function CreatePerViewConstantBuffer(): false LockDynamicConstantBuffer failed in CreatePerViewConstantBuffer!!! 2023/12/15 16:16:58.6386 [engine/RenderSystem] ERROR! D3D call failed! hr = DXGI_ERROR_DEVICE_REMOVED ( pDevice->CreateBuffer( &desc, NULL, &pD3dBuf ) ) 2023/12/15 16:16:58.6386 [engine/Assert] C:\build\_work\sbox\sbox\src\renderingpipelines\renderingpipeline_vr.cpp (634) : Assertion Failed in function CreatePerViewConstantBuffer(): false LockDynamicConstantBuffer failed in CreatePerViewConstantBuffer!!! 2023/12/15 16:16:58.6386 [engine/RenderSystem] ERROR! D3D call failed! hr = DXGI_ERROR_DEVICE_REMOVED ( pDevice->CreateBuffer( &desc, NULL, &pD3dBuf ) ) 2023/12/15 16:16:58.6386 [engine/Assert] C:\build\_work\sbox\sbox\src\renderingpipelines\renderingpipeline_vr.cpp (634) : Assertion Failed in function CreatePerViewConstantBuffer(): false LockDynamicConstantBuffer failed in CreatePerViewConstantBuffer!!! 2023/12/15 16:16:58.6386 [engine/RenderSystem] ERROR! D3D call failed! hr = DXGI_ERROR_DEVICE_REMOVED ( pDevice->CreateBuffer( &desc, NULL, &pD3dBuf ) ) 2023/12/15 16:16:58.6386 [engine/Assert] C:\build\_work\sbox\sbox\src\renderingpipelines\renderingpipeline_vr.cpp (634) : Assertion Failed in function CreatePerViewConstantBuffer(): false LockDynamicConstantBuffer failed in CreatePerViewConstantBuffer!!! 2023/12/15 16:16:58.6386 [engine/RenderSystem] ERROR! D3D call failed! hr = DXGI_ERROR_DEVICE_REMOVED ( pDevice->CreateBuffer( &desc, NULL, &pD3dBuf ) ) 2023/12/15 16:16:58.6551 [engine/RenderSystem] ERROR! D3D call failed! hr = DXGI_ERROR_DEVICE_REMOVED ( pDevice->CreateBuffer( &desc, NULL, &pD3dBuf ) ) 2023/12/15 16:16:58.6551 [engine/RenderSystem] ERROR! D3D call failed! hr = DXGI_ERROR_DEVICE_REMOVED ( pDevice->CreateBuffer( &desc, NULL, &pD3dBuf ) ) 2023/12/15 16:16:58.6551 [engine/RenderSystem] ERROR! D3D call failed! hr = DXGI_ERROR_DEVICE_REMOVED ( pDevice->CreateBuffer( &desc, NULL, &pD3dBuf ) ) 2023/12/15 16:16:58.6551 [engine/Engine] *** VB "": Failed to allocate! 2023/12/15 16:16:58.6551 [engine/Engine] *** VB "": Failed to allocate! 2023/12/15 16:16:58.6551 [engine/Engine] *** VB "": Failed to allocate! 2023/12/15 16:16:58.6551 [engine/Engine] *** VB "": Failed to allocate! 2023/12/15 16:16:58.6551 [engine/Engine] *** VB "": Failed to allocate! 2023/12/15 16:16:58.8704 [engine/Engine] CSwapChainBase::QueuePresentAndWait() looped for 21 iterations without a present event. 2023/12/15 16:16:58.8977 [engine/Engine] Bailing out of OnBlockForQuery after 0.250 seconds 2023/12/15 16:16:59.1492 [engine/Engine] Bailing out of OnBlockForQuery after 0.250 seconds 2023/12/15 16:16:59.1718 [engine/RenderSystem] Texture missing shader resource view when setting parameter "?" - returning error texture in CTextureManagerDx11::GetResourceView Texture: "materials/gizmo/directionallight.vtex" 2023/12/15 16:16:59.1718 [engine/RenderSystem] Texture missing shader resource view when setting parameter "?" - returning error texture in CTextureManagerDx11::GetResourceView Texture: "materials/gizmo/camera.vtex" 2023/12/15 16:16:59.1896 [engine/ToneMapping] tonemap.cpp: g_pRenderDevice->CreateQueryObject( RENDER_QUERY_OCCLUSION ) failed! 2023/12/15 16:16:59.1896 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 54 2023/12/15 16:16:59.1896 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 15 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 40 CPUAccessFlags = 0 MiscFlags = 1 2023/12/15 16:16:59.1896 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.1896 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.1896 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\dx\dxfunctions.h (118) : Assertion Failed in function _DOD3D(): false D3D call for D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) failed with 0x80070057, logging minidump 2023/12/15 16:16:59.1896 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 54 2023/12/15 16:16:59.1896 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 15 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 40 CPUAccessFlags = 0 MiscFlags = 1 2023/12/15 16:16:59.1896 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.1896 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.1896 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 24 2023/12/15 16:16:59.1896 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 9 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 40 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.1896 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.1896 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.1896 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 24 2023/12/15 16:16:59.1896 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 9 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 168 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2016 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2016 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2016 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 24 2023/12/15 16:16:59.2016 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 9 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 168 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2016 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2016 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2016 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 59 2023/12/15 16:16:59.2016 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 53 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 168 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2016 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2016 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2016 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 59 2023/12/15 16:16:59.2016 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 53 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 168 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2016 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2016 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2016 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 59 2023/12/15 16:16:59.2016 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 53 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 168 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2016 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2016 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2016 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 59 2023/12/15 16:16:59.2016 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 53 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 168 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2016 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2016 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2167 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 24 2023/12/15 16:16:59.2167 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 9 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 168 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2167 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2167 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2167 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 24 2023/12/15 16:16:59.2167 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 9 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 168 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2167 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2167 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2167 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 24 2023/12/15 16:16:59.2167 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 9 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 168 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2167 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2167 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2167 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 0 2023/12/15 16:16:59.2167 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 27 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 40 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2167 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2167 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2167 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 0 2023/12/15 16:16:59.2167 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 27 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 40 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2167 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2167 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2167 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 63 2023/12/15 16:16:59.2167 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 44 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 72 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2167 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2326 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2326 [engine/SceneSystem] Error: View "Unnamed", Layer "Camera Overlay", render target "scratchcolor....": It is illegal for the first write to a scratch render target to not discard or clear it! (This can often happen if you forget to clear both depth and stencil) 2023/12/15 16:16:59.2326 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 63 2023/12/15 16:16:59.2326 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 44 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 72 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2326 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2326 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2326 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 24 2023/12/15 16:16:59.2326 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 9 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 40 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2326 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2326 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2326 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 63 2023/12/15 16:16:59.2326 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 44 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 72 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2326 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2326 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2326 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 0 2023/12/15 16:16:59.2326 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 27 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 136 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2326 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2326 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2326 [engine/Assert] C:\build\_work\sbox\sbox\src\rendersystem\texturebase.cpp (90) : Assertion Failed in function AssertIsValidTextureSpec(): bValid Invalid texture spec (ComputeTextureObject): 0x0 1 mips fmt 0 2023/12/15 16:16:59.2326 [engine/Engine] CreateTexture2D FAILED with E_INVALIDARG! bImmutable = false desc = Width = 0 Height = 0 MipLevels = 1 ArraySize = 1 Format = 27 SampleDesc.Count = 1 SampleDesc.Quality = 0 Usage = 0 BindFlags = 40 CPUAccessFlags = 0 MiscFlags = 0 2023/12/15 16:16:59.2326 [engine/RenderSystem] ERROR! D3D call failed! hr = E_INVALIDARG ( D3D11Device()->CreateTexture2D( &desc, bImmutable ? pSubResource : nullptr, ( ID3D11Texture2D ** ) &pDx11Texture ) ) 2023/12/15 16:16:59.2326 [engine/RenderSystem] *** Run with -dx11debug to see native D3D errors! 2023/12/15 16:16:59.2326 [engine/RenderSystem] Texture missing shader resource view when setting parameter "?" - returning error texture in CTextureManagerDx11::GetResourceView Texture: "fbrt_tex_941479615.vtex" 2023/12/15 16:16:59.2326 [engine/RenderSystem] Texture missing shader resource view when setting parameter "?" - returning error texture in CTextureManagerDx11::GetResourceView Texture: "scratchrendertarget_1568349858_0x0_1_0_0.vtex" 2023/12/15 16:16:59.2326 [engine/RenderSystem] Texture missing shader resource view when setting parameter "?" - returning error texture in CTextureManagerDx11::GetResourceView Texture: "scratchrendertarget_1568349858_0x0_2_0_0.vtex" 2023/12/15 16:16:59.2326 [engine/ToneMapping] CTonemapRenderer is trying to render with an invalid occlusion query handle. Are we rendering while the screen isn't visible? Look for a previous warning saying we ran out of buckets. 2023/12/15 16:16:59.2326 [engine/RenderSystem] Texture missing shader resource view when setting parameter "?" - returning error texture in CTextureManagerDx11::GetResourceView Texture: "scratchrendertarget_1568349858_0x0_1_0_0.vtex" 2023/12/15 16:16:59.7475 [engine/SceneSystem] CSceneSystem::CompletionWaitJob(6877): Waited 500 ms for jobs to complete. Attempt to drain windows message queue. 2023/12/15 16:17:00.7693 [engine/SceneSystem] CSceneSystem::CompletionWaitJob(6877): Waited 500 ms for jobs to complete. Attempt to drain windows message queue. 2023/12/15 16:17:01.8034 [engine/SceneSystem] CSceneSystem::CompletionWaitJob(6877): Waited 500 ms for jobs to complete. Attempt to drain windows message queue. ```
Click me to see PC details Processor: 12th Gen Intel(R) Core(TM) i5-1235U Processor Speed: 1300 MHz GFX Driver Name: Intel® Iris® Xe Graphics Shader Version: 5.1 OpenCL* Version: 3.0 Microsoft DirectX: Runtime Version: 12 Hardware-Supported Version: 12 Vendor ID: 8086 Device ID: 46A8 Device Revision: 0C GFX Driver Version: 31.0.101.5081 Dedicated RAM: 128 Mo Shared RAM: 8 Go Max Supported Displays: 4 GFX Vulcan: 1.3.267 GFX GOP: 21.0.1046

Video of what i get when i launch s&box [staging] :

https://github.com/Facepunch/sbox-issues/assets/5229571/c9a66062-0fed-4251-8199-9816fa6ae038

PolSpock commented 9 months ago

Hello,

I'm currently working on my laptop with an Intel Iris Xe graphics card. On the day of 15 December, my s&box [staging] cannot be used anymore since the scene system can't be able to load. Resulting in a s&box crash after trying to play a s&box scene.

This is not the first time i'm having graphics trouble with this laptop and S&box, but it's the first time i cannot use S&box anymore, and that is embarrassing since i use it for multiplayer debugging.

The weird thing is that all working well on 12 december. Also, it's working well on the no-beta branch. So i definitively think it's a recent s&box update between 13 - 15 december who causing this.

Also here are interesting full-stack errors at my s&box startup :

ERROR! D3D call failed! hr = DXGI_ERROR_DEVICE_REMOVED ( pDevice->CreateBuffer( &desc, NULL, &pD3dBuf ) )
   at Sandbox.EngineLoop.Print(Int32 severity, String logger, String message)
   at Managed.SandboxEngine.Exports.Sandbox_EngineLoop_Print(Int32 severitty, IntPtr logger, IntPtr message)
   at Sandbox.SceneCamera.Render()
   at Sandbox.SceneCamera.AddToRenderList()
   at Sandbox.ToolsDll.OnRender()
   at Sandbox.EngineLoop.OnClientOutput()
   at Managed.SandboxEngine.Exports.Sandbox_EngineLoop_OnClientOutput()
   at Sandbox.EngineLoop.RunFrame(CMaterialSystem2AppSystemDict appDict, Boolean& wantsQuit)
   at Sandbox.SourceEngineApp.RunFrame() in C:\build\_work\sbox\sbox\engine\Launcher\SourceEngineApp.cs:line 48
   at Sandbox.SourceEngineApp.RunLoop() in C:\build\_work\sbox\sbox\engine\Launcher\SourceEngineApp.cs:line 39
   at Sandbox.Program.LaunchGame() in C:\build\_work\sbox\sbox\engine\Launcher\Launcher.cs:line 93
   at Sandbox.Program.Main() in C:\build\_work\sbox\sbox\engine\Launcher\Launcher.cs:line 58

These errors conclude to spammy errors in my s&box console (so similar to the main topic of the issue):

[engine/Engine] CSwapChainBase::QueuePresentAndWait() looped for 24 iterations without a present event.   
[engine/Engine] Bailing out of OnBlockForQuery after 0.250 seconds    

I have already tried to update my drivers to the latest version & also reinstall from scratch s&box (through Steam + deleting all keeping files)

Reproduce steps:

  • Get an idiot HP laptop 15-eg2 with Intel Iris Xe Graphics
  • Install s&box [staging]

Click me to see my full Log.log : Click me to see PC details Video of what i get when i launch s&box [staging] :

out.mp4

Hello, i decided to retry S&box on my laptop with an Intel Iris Xe graphics card since the S&box Vulkan update has been released. I was surprised that now everything works like before.

But i don't know if it's really from the Vulkan change or another fix 🤷

handsomematt commented 9 months ago

It looks like there was a DX11 CreateBuffer call that was crashing the GPU device for all of you - and I suppose Pol says it's resolved on Vulkan now.