protonscr

ID2D1Factory::CreateDCRenderTarget method always fails under Proton

protonclosed
ValveSoftware/Proton#1105 · opened 2018-08-31 by kisak-valve · updated 2018-09-08 · 9 comments · github
1 matching comments, n / p to jump
Kkisak-valve 2018-08-31 github

Issue transferred from https://github.com/ValveSoftware/steam-for-linux/issues/5716.
@ioncore posted on 2018-08-31T23:49:47:

Your system information

  • Steam client version (build number or date): Aug 30, 2018, at 21:12:26
  • Distribution (e.g. Ubuntu): Ubuntu 18.04 LTS
  • Opted into Steam client beta?: Yes
  • Have you checked for system updates?: Yes

Please describe your issue in as much detail as possible:

Consider this snippet from MSDN:

ID2D1DCRenderTarget* mRenderTarget= nullptr;
D2D1_RENDER_TARGET_PROPERTIES renderTargetProps = D2D1::RenderTargetProperties(
D2D1_RENDER_TARGET_TYPE_DEFAULT,
D2D1::PixelFormat(
DXGI_FORMAT_B8G8R8A8_UNORM,
D2D1_ALPHA_MODE_IGNORE),
0, 0,
D2D1_RENDER_TARGET_USAGE_NONE,
D2D1_FEATURE_LEVEL_DEFAULT
);
HRESULT hr = D2DFactory->CreateDCRenderTarget( &renderTargetProps , &mRenderTarget);

Under Windows it succeeds and returns a non-null render target. Under Proton it fails with error code 0x80004005 and returns null render target.

I've also written a small render target enumerator function which attempts to create render target for every single possible combination of params in the D2D1_RENDER_TARGET_PROPERTIES structure. When run under Windows, it returns 54 valid combinations (indeed, all are based on DXGI_FORMAT_B8G8R8A8_UNORM format). When run under Proton, there is no valid combinations at all (so a DC render target can not be created under Proton).

My lshw output is here.

Nnsivov 2018-09-01 github

I believe this is DXVK issue. DC render target is using D3D10_RESOURCE_MISC_GDI_COMPATIBLE and IDXGISurface1 to access GDI device context. I don't see anything about IDXGISurface support in d3d10/d3d11 2D textures in DXVK. However E_FAIL error code indicates it fails earlier, probably during texture creation.

Iioncore 2018-09-01 github

Thanks, I'll try to collect more info like apitrace and file new bugreport on dxvk.

Nnsivov 2018-09-01 github

WINEDEBUG=+d2d and enabled DXVK logging (I don't know how that works), will already give some info.

Aaeikum 2018-09-04 github

Is there a game that needs this?

Setting PROTON_USE_WINED3D11=1 will use Wine's DXGI which is compatible with Wine's D2D, instead of DXVK's DXGI which isn't. See the README.

Iioncore 2018-09-08 github

That was it. With PROTON_USE_WINED3D11 enabled, rendering is broken (black screen etc), but at least rendering target is available now and I can proceed with in-detail debugging.
Thanks a lot for all your help, guys. @nsivov could you please close the defect?

Kkisak-valve maintainer 2018-09-08 github

Closing per the last comment.

Nnsivov 2018-09-08 github

@ioncore I don't think it's that unreasonable to expect dxvk to provide necessary dxgi functionality, but up to you. What application was that by the way?

Iioncore 2018-09-08 github

@nsivov we've recently got a customer bug report that our Windows game runs just fine on Linux (Steam/Proton), except few particular tools/features are missing (all of them are D2D-based). We are not officially supporting Proton yet, nor do we have any experience with that platform so far, so we may lack some basic knowledge with that domain (like DXVK DXGI turned out to be D2D-incompatible).
Before venturing further into DXVK we should first become fully compliant with Wine DXGI, I think.

Nnsivov 2018-09-08 github

Ok, makes sense. In that case please report any issues you find to bugs.winehq.org as well.

Launch options

Upstream links

Error codes