[Bug 59837] New: DrawImage with a registered custom effect renders nothing (silently)
http://bugs.winehq.org/show_bug.cgi?id=59837 Bug ID: 59837 Summary: DrawImage with a registered custom effect renders nothing (silently) Product: Wine Version: 11.10 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: d2d Assignee: wine-bugs@list.winehq.org Reporter: peter.soetens@gmail.com Distribution: --- Created attachment 81122 --> http://bugs.winehq.org/attachment.cgi?id=81122 stand-alone reproducability test code. ## Summary An application registers a custom Direct2D effect (`ID2D1Factory1::RegisterEffectFromString` + `CreateEffect`), sets a bitmap as input, and draws it via `ID2D1DeviceContext::DrawImage` into a DXGI-surface render target. On wine 11.10 every call in the sequence returns `S_OK` — `RegisterEffectFromString`, `CreateEffect`, `CreateBitmap`, `SetValue`, `SetInput`, `DrawImage`, `EndDraw` — but **no pixels are written**: a D3D11 staging readback of the target is all-zero. On Windows the same binary renders the expected pixels. ## Reproducing Attached `d2dprobe.cpp` (32-bit, builds with MSVC or clang-cl; prebuilt `d2dprobe.exe` attached): creates a D3D11 device + texture, wraps it via `CreateDxgiSurfaceRenderTarget`, registers the custom effect, draws a 16x16 bitmap through it, and reads the target back through a staging texture. Prints each hr and the OR of the sampled pixels. - wine 11.10 (vanilla, new-WOW64 build): `readback OR of sampled pixels = 00000000 (ALL ZERO - draw did not land)` — all hrs S_OK. - Windows 10: pixels rendered. ## Real-world impact X-Wing Alliance Upgrade (XWAU 2025, the community mod for the 1999 LucasArts game on Steam/GOG) renders its entire HD concourse UI through exactly this pattern (hook_concourse). We currently ship an application-side workaround, but the native path returning S_OK while drawing nothing on 11.10 means apps cannot even detect the failure. ## Proposed patches (attached) Two patches against wine-11.10 (also apply to current git), validated with the attached repro on 11.10: 1. `0001-d2d1-Store-the-pixel-shader-constant-buffer-set-thro.patch` — implements the `ID2D1DrawInfo::SetPixelShaderConstantBuffer` stub (stores a copy on the draw info; custom effects upload their shader constants through it from `PrepareForRender`). 2. `0002-d2d1-Render-single-draw-transform-custom-effects-in-.patch` — minimal execution path in `d2d_device_context_DrawImage` for the common case (single draw-transform graph with a pixel shader): calls `PrepareForRender`, renders input 0 through the registered (already compiled) shader 1:1 into an intermediate texture with the draw-info constant buffer bound, then composites the intermediate through the existing bitmap path so context transform/clips apply. Passthrough graphs draw their input directly; unsupported graph shapes now set `E_NOTIMPL` on the context instead of failing silently. With both applied, the attached repro goes from `readback OR = 00000000 (ALL ZERO)` to `FFFF0000` — the correct premultiplied opaque-red output for its input — and the game's HD UI renders. Limitations are commented in the code (SCENE_POSITION is approximated; multi-node graphs, vertex shaders, resource textures and intermediates-between-nodes remain unimplemented and now fail loudly). A DWrite/text rendering probe shows no regression on the normal d2d paths; the build used here is `--disable-tests`, so the d2d1 test suite run is left to CI. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59837 --- Comment #1 from Peter <peter.soetens@gmail.com> --- Created attachment 81123 --> http://bugs.winehq.org/attachment.cgi?id=81123 [PATCH 1/2] d2d1: Store the pixel shader constant buffer set through ID2D1DrawInfo. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59837 --- Comment #2 from Peter <peter.soetens@gmail.com> --- Created attachment 81124 --> http://bugs.winehq.org/attachment.cgi?id=81124 [PATCH 2/2] d2d1: Render single draw-transform custom effects in DrawImage. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59837 --- Comment #3 from Peter <peter.soetens@gmail.com> --- I can also create a MR on gitlab once I get the permission to clone there. my wine GL user name is psoetens. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59837 --- Comment #4 from Nikolay Sivov <bunglehead@gmail.com> --- Hi, As mentioned in https://gitlab.winehq.org/wine/wine/-/wikis/Developer-FAQ, LLM-assisted contributions are not going to be accepted. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59837 Stian Low <wineryyyyy@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wineryyyyy@gmail.com --- Comment #5 from Stian Low <wineryyyyy@gmail.com> --- (In reply to Nikolay Sivov from comment #4)
Hi,
As mentioned in https://gitlab.winehq.org/wine/wine/-/wikis/Developer-FAQ, LLM-assisted contributions are not going to be accepted.
Most refreshingly actual intelligent decision -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59837 --- Comment #6 from Peter <peter.soetens@gmail.com> --- Sorry for not checking that. The bug report is still valid afaikt. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59837 --- Comment #7 from Stian Low <wineryyyyy@gmail.com> --- (In reply to Peter from comment #6)
Sorry for not checking that. The bug report is still valid afaikt.
Indeed the bug may still be valid and should be left open for now. GOG X-Wing Alliance seems works up until it warns about not detecting a joystick and clicking ok closes the game. Do you run the games with a joystick? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla