On Thu, 29 Jan 2026 21:09:16 GMT, Christopher Schnick <[email protected]> wrote:
> The previous value of BackBufferFormat for the D3DPRESENT_PARAMETERS for the > d3d9 swap chain was set to D3DFMT_UNKNOWN by default. This causes the d3d > implementation to use a default value, which depends on the system > configuration. The RTT texture by JavaFX always uses D3DFMT_A8R8G8B8. > > If the d3d swap chain defaults to D3DFMT_X8R8G8B8, this creates a format > mismatch. In theory, that shouldn't be a big deal as it's only about the > alpha channel being used or not in this case. But for whatever reason, the > format conversion by d3d is completely whack here. This is not only an alpha > conversion issue, I tested for that. The whole conversion is wrong. > > This only occurs when using a translucent background, e.g. with the UNIFIED > stage style previously. This issue is a blocker for the new translucent > backdrops and translucent EXTENDED stage style PRs that are open. Because > without this, you can't guarantee that they will display properly on all > Windows systems. Most will work fine, but some will be unusable. > > Most d3d swap chain implementations I have seen don't set an explicit > BackBufferFormat. However, in the case of JavaFX, it is easier to set the > format here than do it for the RTT texture to maintain the same format on all > platforms. > > The most important part about this issue is reproduction and testing: I have > tested it on multiple Windows 11 systems, Windows 10 1709, and Windows 10 > 22H2. It fixes the issue on the affected systems and maintains the same > behavior on the other systems. > > The reproduction instructions of the original issue are quite old, so it's > difficult to get this properly set up on modern systems. The hardware that > was affected back then might have gotten driver updates. The easiest way I > found was to run Hyper-V on Windows, and create a new MSIX packaging > environment VM. > > You can do so at Hyper-V Manager -> Action -> Quick Create -> Windows 10 MSIX > packaging environment. This creates a Windows 10 VM which reproduces the > issue reliably. The Windows 11 VM does not for some reason. > > You can run the BackdropTest from > https://github.com/openjdk/jfx/pull/2048/changes#diff-c25c5ccf435e59b6bfd593251ab6dfc31a12a782a78191a38b4e9adab31587a3 > with and without the BackBufferFormat line added to compare. LGTM. This change is fairly straightforward and it removes a pretty important point of discrepancy between hardware. To my knowledge even modern APIs support ABGR format more commonly than XBGR, so I don't suspect this would break anything. My main Windows machine did not have the issue (so I guess it won the GPU driver lottery) but I verified it with the Windows 10 Hyper-V VM - Unified Stages do not render without the fix and render properly with transparency when adding the fix. Other sanity testing also looked good. ------------- Marked as reviewed by lkostyra (Reviewer). PR Review: https://git.openjdk.org/jfx/pull/2058#pullrequestreview-3757555374
