Display capture works fine. Both Game and Window capture just display a black screen.
Relevant OBS log:
19:29:04.980: [game-capture: 'Game Capture'] d3d11_shtex_init: failed to create texture
19:29:04.980: [game-capture: 'Game Capture'] ----------------- d3d11 capture freed ----------------
19:29:04.996: [game-capture: 'Game Capture'] create_d3d11_tex: failed to create texture (0x80070057): The parameter is incorrect.
Because I'm developing the D3D11 application, I can capture the debug output. There seems to be one of these errors for each corresponding entry in the OBS log:
D3D11 ERROR: ID3D11Device::CreateTexture2D: CreateResource: DXGI_FORMAT_R8G8B8A8_UNORM and DXGI_FORMAT_R8G8B8A8_UNORM_SRGB cannot be created with D3D10_DDI_RESOURCE_MISC_SHARED. Consider DXGI_FORMAT_B8G8R8A8_UNORM[_SRGB] instead. These formats are available in Direct3D9 as D3DFMT_A8R8G8B8, and in Direct3D10.1 (when CheckFormatSupport so indicates) and for all Direct3D11 devices. [ STATE_CREATION ERROR #1048617: CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED]
D3D11 ERROR: ID3D11Device::CreateTexture2D: Returning E_INVALIDARG, meaning invalid parameters were passed. [ STATE_CREATION ERROR #104: CREATETEXTURE2D_INVALIDARG_RETURN]
create_d3d11_tex: failed to create texture (0x80070057): The parameter is incorrect.
The output seems to indicate that OBS attempts to use DXGI_FORMAT_R8G8B8A8_UNORM, when it should use DXGI_FORMAT_B8G8R8A8_UNORM.
I have tried changing the back buffer format of my swap chain, but that didn't seem to have any effect on OBS.
I successfully tried capturing Overwatch. OBS log file says:
20:02:16.350: [game-capture: 'Game Capture'] attempting to hook process: Overwatch.exe
20:02:16.392: [game-capture: 'Game Capture'] using direct hook
20:02:16.417: [game-capture: 'Game Capture'] Hooked to process: Overwatch.exe
20:02:16.417: [game-capture: 'Game Capture'] (half life scientist) everything.. seems to be in order
20:02:16.429: [game-capture: 'Game Capture'] Hooked DXGI
20:02:16.437: [game-capture: 'Game Capture'] d3d11 shared texture capture successful
20:02:16.448: [game-capture: 'Game Capture'] shared texture capture successful
So it seems to work in principle.
Either something is wrong generally with my setup, or my application initializes D3D11 in a way that is not expected by OBS. How could I debug this? Is there any information for developers on how to make an application compatible with OBS?
Full log (although I doubt this will add much): https://obsproject.com/logs/l5MLbaBI-tVPGtcz
Relevant OBS log:
19:29:04.980: [game-capture: 'Game Capture'] d3d11_shtex_init: failed to create texture
19:29:04.980: [game-capture: 'Game Capture'] ----------------- d3d11 capture freed ----------------
19:29:04.996: [game-capture: 'Game Capture'] create_d3d11_tex: failed to create texture (0x80070057): The parameter is incorrect.
Because I'm developing the D3D11 application, I can capture the debug output. There seems to be one of these errors for each corresponding entry in the OBS log:
D3D11 ERROR: ID3D11Device::CreateTexture2D: CreateResource: DXGI_FORMAT_R8G8B8A8_UNORM and DXGI_FORMAT_R8G8B8A8_UNORM_SRGB cannot be created with D3D10_DDI_RESOURCE_MISC_SHARED. Consider DXGI_FORMAT_B8G8R8A8_UNORM[_SRGB] instead. These formats are available in Direct3D9 as D3DFMT_A8R8G8B8, and in Direct3D10.1 (when CheckFormatSupport so indicates) and for all Direct3D11 devices. [ STATE_CREATION ERROR #1048617: CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED]
D3D11 ERROR: ID3D11Device::CreateTexture2D: Returning E_INVALIDARG, meaning invalid parameters were passed. [ STATE_CREATION ERROR #104: CREATETEXTURE2D_INVALIDARG_RETURN]
create_d3d11_tex: failed to create texture (0x80070057): The parameter is incorrect.
The output seems to indicate that OBS attempts to use DXGI_FORMAT_R8G8B8A8_UNORM, when it should use DXGI_FORMAT_B8G8R8A8_UNORM.
I have tried changing the back buffer format of my swap chain, but that didn't seem to have any effect on OBS.
I successfully tried capturing Overwatch. OBS log file says:
20:02:16.350: [game-capture: 'Game Capture'] attempting to hook process: Overwatch.exe
20:02:16.392: [game-capture: 'Game Capture'] using direct hook
20:02:16.417: [game-capture: 'Game Capture'] Hooked to process: Overwatch.exe
20:02:16.417: [game-capture: 'Game Capture'] (half life scientist) everything.. seems to be in order
20:02:16.429: [game-capture: 'Game Capture'] Hooked DXGI
20:02:16.437: [game-capture: 'Game Capture'] d3d11 shared texture capture successful
20:02:16.448: [game-capture: 'Game Capture'] shared texture capture successful
So it seems to work in principle.
Either something is wrong generally with my setup, or my application initializes D3D11 in a way that is not expected by OBS. How could I debug this? Is there any information for developers on how to make an application compatible with OBS?
Full log (although I doubt this will add much): https://obsproject.com/logs/l5MLbaBI-tVPGtcz