Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51848
SPORE creates a swapchain on a window, then destroys it, then creates a
different swapchain on the same window and uses it for the rest of its lifetime.
The swapchains have different GLX visuals (the details are unimportant).
The effect is that the second swapchain sees the pixel format set by the first
swapchain, through GetPixelFormat(), and therefore needs to set and then
restore the new pixel format on every present. This results in recreating the
GLX drawable twice per frame, which is extremely expensive.
This patch series changes WGL_WINE_pixel_format_passthrough to only set an
"internal" pixel format. The real pixel format will still be set as it is now,
but GetPixelFormat() will always return 0, signalling to wined3d that the
application has not set the pixel format, and therefore there is no need to
restore it.
As the tests show, this change also matches Windows, which does not report that
a pixel format has been set after presenting a Direct3D swapchain.
This is a large series by patch count, but I fear that splitting it into two
parts would make it difficult to grasp the entire picture, and purpose of the
earlier patches. It also contains six patches which are simply repetitions
across the three user drivers, which should ease the burden of review somewhat.
--
v3: wineandroid: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough.
winemac: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough.
winex11: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough.
win32u: Allow separately storing the internal pixel format set by WGL_WINE_pixel_format_passthrough.
wined3d: Do not set the pixel format if wglGetPixelFormat() returns zero and we already set the internal pixel format.
winemac: Retrieve the pixel format from win32u for normal windows in wglGetPixelFormat().
wineandroid: Retrieve the pixel format from win32u for normal windows in wglGetPixelFormat().
winex11: Retrieve the pixel format from win32u for normal windows in wglGetPixelFormat().
win32u: Introduce a win32u_get_window_pixel_format() helper.
win32u: Make NtUserSetWindowPixelFormat() into a proper export.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2217
based on libpcsclite1 \
rework of [original code by Mounir IDRASSI](https://sourceforge.net/projects/scard4wine/) to use unixlib interface
First step to resolve \
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39113 \
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=37495 \
It will probably also require the implementation of scarddlg.
In order for the tests to work fully in a virtual environment without the appropriate hardware,
I suggest using the project https://github.com/Jakuje/virt_cacard
Example for setting up a build server (It is supposed to be Debian):
```
apt-get install -y pcscd vsmartcard-vpcd libpcsclite1 libpcsclite-dev libcacard-dev libsofthsm2 libnss3-tools gnutls-bin opensc
service pcscd restart
git clone https://github.com/Jakuje/virt_cacard
cd virt_cacard
./autogen.sh && ./configure && make
./setup-softhsm2.sh
```
"Insert" smartcard before runing tests: \
`cd /path/to/virt_cacard && SOFTHSM2_CONF=softhsm2.conf ./virt_cacard &`
Partial test can be done if installed vsmartcard-vpcd (only test create/release context and list aviable card readers): \
```
apt-get install -y pcscd vsmartcard-vpcd
service pcscd restart
```
--
v2: winscard/test: skip when libpcsclite1 is not installed
https://gitlab.winehq.org/wine/wine/-/merge_requests/2249
based on libpcsclite1 \
rework of [original code by Mounir IDRASSI](https://sourceforge.net/projects/scard4wine/) to use unixlib interface
First step to resolve \
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39113 \
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=37495 \
It will probably also require the implementation of scarddlg.
In order for the tests to work fully in a virtual environment without the appropriate hardware,
I suggest using the project https://github.com/Jakuje/virt_cacard
Example for setting up a build server (It is supposed to be Debian):
```
apt-get install -y pcscd vsmartcard-vpcd libpcsclite1 libpcsclite-dev libcacard-dev libsofthsm2 libnss3-tools gnutls-bin opensc
service pcscd restart
git clone https://github.com/Jakuje/virt_cacard
cd virt_cacard
./autogen.sh && ./configure && make
./setup-softhsm2.sh
```
"Insert" smartcard before runing tests: \
`cd /path/to/virt_cacard && SOFTHSM2_CONF=softhsm2.conf ./virt_cacard &`
Partial test can be done if installed vsmartcard-vpcd (only test create/release context and list aviable card readers): \
```
apt-get install -y pcscd vsmartcard-vpcd
service pcscd restart
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2249
Wine's dxgi implementation doesn't handle the different DXGI_ALPHA_MODE
values, save for DXGI_ALPHA_MODE_IGNORE on both vkd3d (d3d12) and
wined3d (d3d11), but prints a fixme for DXGI_ALPHA_MODE_UNSPECIFIED for
wined3d but not vkd3d.
To match the behaviour between the two, and because the "Unspecified"
mode seems like it should always be acceptable to ignore, don't print a
fixme in the wined3d path either.
This eliminates the following warning:
010c:fixme:dxgi:wined3d_swapchain_desc_from_dxgi Ignoring alpha mode 0.
See the msdn docs for DXGI_ALPHA_MODE here:
https://learn.microsoft.com/en-us/windows/win32/api/dxgi1_2/ne-dxgi1_2-dxgi…
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2235
Removing WINED3D_RS entries from state tables and moving stubs to wined3d_device_apply_stateblock.
--
v2: wined3d: Move the WINED3D_RS_SUBPIXEL stub to wined3d_device_apply_stateblock.
wined3d: Move the WINED3D_RS_ZVISIBLE stub to wined3d_device_apply_stateblock.
wined3d: Move the WINED3D_RS_LASTPIXEL stub to wined3d_device_apply_stateblock.
wined3d: Move the WINED3D_RS_PLANEMASK stub to wined3d_device_apply_stateblock.
wined3d: Move the WINED3D_RS_ROP2 stub to wined3d_device_apply_stateblock.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2192
I suspect you're already aware of this, but wined3d_texture_reduction_mode_from_d3d11() should probably use D3D11_DECODE_FILTER_REDUCTION. Somewhat relatedly, the definition of D3D11_DECODE_IS_COMPARISON_FILTER will need to adjusted, or wined3d_texture_compare_from_d3d11() will return incorrect results.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2246#note_24991