This series is basically a single patch but that requires @cmccarthy's !225 first. So, the 2 patches from !225 are included as 1/3 and 2/3.
As can be implied from !225, in SM4 bytecode, all the information regarding whether the register uses a writemask, a swizzle, a dimension index, or none of these, is encoded in the register itself, and doesn't depend on the instruction nor argument position on which the register is used.
The possible register encodings are given by the following diagram:
![diagram3.drawio](/uploads/db330c2f7cc47801e3c3672828ae23b9/diagram3.drawio.png)
Where the swizzle_type (MASK4, VEC4, or SCALAR) only matter when the dim is VEC4.
Thus, it makes sense to merge these two types of registers into a single data type as 3/3 does. This has the added benefit of removing additional writemask and swizzle_type arguments to be initialized by pointer in several helper functions.
Also, this would help me to simplify a new version of !229.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/269
On Wed Jul 19 19:09:02 2023 +0000, Huw Davies wrote:
> There are a lot of changes in this MR, in particular the second commit
> could do with splitting and then the MR itself would ideally be split
> into two.
Done.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3328#note_39522
With this pipeline vkd3d automatically gets built on Linux (in an image based on Debian unstable), both in 32 and 64 bit mode. Both builds are tested with radv and llvmpipe. A number of caveats apply, though:
* A number of tests currently fail in llvmpipe, so the llvmpipe jobs are marked as allowed to fail. Ideally we'll eventually fix our bugs and mark the llvmpipe ones in the tests, so that the CI tests completely pass and possible problems in the Vulkan driver are recorded at a better granularity (this is the reason why GitLab says that the pipeline is passed with warnings: the warnings are that there are jobs that failed, even if they were allowed to fail).
* ~~The runners provided by the GitLab instance don't have a GPU available, so I configured my own computer (equipped with an AMD Radeon RX 5700 RX) to provide a runner with access to the GPU. This setup is not currently satisfying: for me, because I use that computer for other things and I don't like having random code submitted to it (it is theoretically sandboxed, but sandboxes are not always bullet-proof, especially if they have access to a GPU); for the users, because my computer might be unavailable at any time. I'll work on a better solution. For the time being I intend the runner to only accept jobs from the master branch; once a better solution is implemented I'd like to run the pipeline for MRs too.~~ **Fixed**, now there is a shared worker with an AMD GPU available.
* While the `Dockerfile` and related assets do not necessarily need to be available in this repository, given that the CI accesses the binary image from the Docker hub anyway, I think it's still valuable to have them, so others can improve them (and for sure improvement opportunities are nowhere near missing). However, other ways to make them available can be found, if for some reason it is not liked to have them in this repository (they are not pretty!).
* ~~One of the reason they are not pretty is that I have a custom hack to compile `widl` from the Wine sources without compiling (or installing from the distribution) the whole of Wine, in the interest of keeping the Docker image small (well, small-ish: Vulkan drivers, compilers and X libraries are not small anyway).~~ **A better solution was implemented**
* ~~Again on the subject of the Docker image, I am currently putting the binary image in my own namespace on the Docker hub. Using the GitLab container registry in the namespace of the Wine project would probably be better, so that I am not a bottleneck in the future.~~ **Done**
* ~~Even if we discount all the points above, this MR cannot be merged yet, because my runner is currently configured for my namespace only. I guess I need the intervention of a GitLab admin to fix that. However, I think there's already material enough for valuable feedback.~~ **Fixed too**
--
v5: ci: Introduce a CI pipeline for GitLab.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/271
I expect this is going to be tricky to get in. I ran into the following issues:
* test_ShowWindow behaves very strangely on Windows. It seems this isn't typical behavior, and is caused by an interaction with test_SetFocus, but I'm not sure exactly what it does to the thread state that causes this.
* Many of the SetWindowPos flag combinations tested don't actually show the window on Windows, therefore they don't send EVENT_SYSTEM_FOREGROUND. I was able to reproduce this with a stand-alone test, so it seems to be normal behavior.
* Windows can show a window without activating it, and Wine on X11 can't do that reliably for managed windows.
* There are a couple of cases where Windows sends an event and Wine doesn't. I figure it's OK to not cover every case, but I can go back and investigate those if needed.
This interacts with https://gitlab.winehq.org/wine/wine/-/merge_requests/2314, in that the tests don't really test much without it. I applied that MR for my own testing.
--
v2: win32u: Implement EVENT_SYSTEM_FOREGROUND.
user32: Run tests that notice focus changes early.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2853
Supersedes !3329.
--
v3: server: Cancel pipe asyncs when the last handle in process is closed.
server: Cancel socket asyncs when the last handle in process is closed.
ws2_32/tests: Add test for async cancel on socket's last process handle close.
ntdll/tests: Add test for async cancel on pipe's last process handle close.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3339
Knowing the content of the edit field is more useful than knowing the
strcmp() result. The text field may contain carriage returns and
linefeeds so use wine_dbgstr_a() so they are clearly visible in the
failure message.
Also prefix the ok messages with a unique string to indicate which
test_WM_PASTE() test failed.
---
The old failure messages all look the same so one has to refer to the
line number to know which test actually failed which is pretty tiresome.
Thisis even more so when checking old reports on test.winehq.org or
TestBot job results. It also prevents the TestBot from correctly
identifying failure modes (i.e. all test_WM_PASTE() failures looked the
same to it).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3356
Windows only provides the 32-bit API and using todo_wine win_skip() in
the 64-bit case would imply Wine needs fixing. So it's simpler to use
a plain skip().
Other schemes like picking between skip() and win_skip() based on bitness feel like they would be way overkill.
--
v2: msvcrt/tests: Check that some functions are only available in 32-bit code.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2811
It's a clean-room reimplementation that mimics Windows 10 program's output format.
It prints all the information that is available via KerbQueryTicketCacheMessage.
Also tested to work on Windows if dynamically linked + built with winegcc.
For further extension of the functonality, implementing
KerbQueryTicketCacheEx{,2,3}Message is required.
--
v9: klist: Add a program that lists Kerberos tickets.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3347
Decoding a GIF with no color table currently crashes on Wine.
Windows supports such files, and the GIF spec explicitly allows it.
--
v3: windowscodecs: Allow GIF with no color table.
windowscodecs: Factor out common GIF palette copying logic.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3344
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54748
--
v5: gdiplus: Fix GdipGetAllPropertyItems return value when no properties exist.
gdiplus: Fix GdipGetPropertySize return value when no properties exist.
gdiplus/tests: Pare down image property tests that are not run for Wine.
gdiplus/tests: Use test context for test ran in a loop.
gdiplus/tests: Add GIF to image properties tests.
gdiplus/tests: Use consistent no-alternate value for image properties.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3302
Instead of querying the registry, just calls `GetDpiForWindow`.
Winecfg's DPI slider sets `Control Panel\\Desktop\\LogPixels`.
See `programs/winecfg/x11drvdlg.c`
Notepad queries `Software\\Fonts\\LogPixels`, and so doesn't pick up
on the change.
I don't believe this changes how Notepad looks to the user, but it is
necessary for a further MR I'm working on that adds more information
to the status bar.
--
v6: notepad: Use GetDpiForWindow()
https://gitlab.winehq.org/wine/wine/-/merge_requests/3353
Instead of querying the registry, just calls `GetDpiForWindow`.
Winecfg's DPI slider sets `Control Panel\\Desktop\\LogPixels`.
See `programs/winecfg/x11drvdlg.c`
Notepad queries `Software\\Fonts\\LogPixels`, and so doesn't pick up
on the change.
I don't believe this changes how Notepad looks to the user, but it is
necessary for a further MR I'm working on that adds more information
to the status bar.
--
v5: notepad: Use GetDpiForWindow()
https://gitlab.winehq.org/wine/wine/-/merge_requests/3353
On Tue Jul 18 18:38:06 2023 +0000, Brendan Shanks wrote:
> Also, the commit title should start with `notepad:`, something like
> `notepad: Use GetDpiForWindow()`.
While changing the commit title, it might be worth-while to pare down the rest of the commit message. Specifically, while the last paragraph is relevant to the MR, I don't think it will serve any lasting value in the commit history.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3353#note_39330
Instead of querying the registry, just calls `GetDpiForWindow`.
Winecfg's DPI slider sets `Control Panel\\Desktop\\LogPixels`.
See `programs/winecfg/x11drvdlg.c`
Notepad queries `Software\\Fonts\\LogPixels`, and so doesn't pick up
on the change.
I don't believe this changes how Notepad looks to the user, but it is
necessary for a further MR I'm working on that adds more information
to the status bar.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3353
It's a clean-room reimplementation that mimics Windows 10 program's output format.
It prints all the information that is available via KerbQueryTicketCacheMessage.
Also tested to work on Windows if dynamically linked + built with winegcc.
For further extension of the functonality, implementing
KerbQueryTicketCacheEx{,2,3}Message is required.
--
v6: klist: Add a program that lists Kerberos tickets.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3347
With this pipeline vkd3d automatically gets built on Linux (in an image based on Debian unstable), both in 32 and 64 bit mode. Both builds are tested with radv and llvmpipe. A number of caveats apply, though:
* A number of tests currently fail in llvmpipe, so the llvmpipe jobs are marked as allowed to fail. Ideally we'll eventually fix our bugs and mark the llvmpipe ones in the tests, so that the CI tests completely pass and possible problems in the Vulkan driver are recorded at a better granularity (this is the reason why GitLab says that the pipeline is passed with warnings: the warnings are that there are jobs that failed, even if they were allowed to fail).
* ~~The runners provided by the GitLab instance don't have a GPU available, so I configured my own computer (equipped with an AMD Radeon RX 5700 RX) to provide a runner with access to the GPU. This setup is not currently satisfying: for me, because I use that computer for other things and I don't like having random code submitted to it (it is theoretically sandboxed, but sandboxes are not always bullet-proof, especially if they have access to a GPU); for the users, because my computer might be unavailable at any time. I'll work on a better solution. For the time being I intend the runner to only accept jobs from the master branch; once a better solution is implemented I'd like to run the pipeline for MRs too.~~ **Fixed**, now there is a shared worker with an AMD GPU available.
* While the `Dockerfile` and related assets do not necessarily need to be available in this repository, given that the CI accesses the binary image from the Docker hub anyway, I think it's still valuable to have them, so others can improve them (and for sure improvement opportunities are nowhere near missing). However, other ways to make them available can be found, if for some reason it is not liked to have them in this repository (they are not pretty!).
* ~~One of the reason they are not pretty is that I have a custom hack to compile `widl` from the Wine sources without compiling (or installing from the distribution) the whole of Wine, in the interest of keeping the Docker image small (well, small-ish: Vulkan drivers, compilers and X libraries are not small anyway).~~ **A better solution was implemented**
* Again on the subject of the Docker image, I am currently putting the binary image in my own namespace on the Docker hub. Using the GitLab container registry in the namespace of the Wine project would probably be better, so that I am not a bottleneck in the future.
* ~~Even if we discount all the points above, this MR cannot be merged yet, because my runner is currently configured for my namespace only. I guess I need the intervention of a GitLab admin to fix that. However, I think there's already material enough for valuable feedback.~~ **Fixed too**
--
v4: ci: Introduce a CI pipeline for GitLab.
configure: Require widl >= 3.21.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/271
@stefan It is possible the purpose of this MR morphed a bit along the way. IIRC, there was a thought that maybe Render was doing its own clear. It is not, so code using the API would be expected to explicitly call a Clear before Render. At this point, I guess this is essentially a way to retain that knowledge as a test.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/477#note_39301
Sufficient for compiling a no-op pixel shader.
This should probably be rebased on top of !263 because it introduces vkd3d_spirv_get_type_id_for_data_type(), which 263 renders unnecessary.
!263 is not essential, but I think using two different type systems in the backend is not ideal.
--
v2: vkd3d-shader/dxil: Emit undefined constants.
vkd3d-shader/spirv: Introduce an undefined register type.
vkd3d-shader/dxbc: Allow DXBC containers to have a zero checksum.
vkd3d-shader/dxil: Emit the shader instructions.
vkd3d-shader/spirv: Do not normalise Shader Model 6 shaders.
vkd3d-shader/dxil: Return an error from sm6_parser_globals_init() on invalid operand count.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/278
This MR allows existing some existing Windows TTS Engines, such as Amazon Polly, to be used in Far Cry 6, and possibly in other games/applications.
--
v3: sapi: Implement ISpVoice::WaitUntilDone.
sapi: Implement ISpTTSEngineSite::GetActions/Rate/Volume.
sapi: Implement ISpTTSEngineSite::Write.
sapi: Finish implementing ISpVoice::Speak.
sapi: Partially implement ISpVoice::Speak.
include: Fix ISpTTSEngineSite::GetActions return type.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3328
Add a '__program_vars' section to the preloader, to make it a correct macOS 10.7 binary.
This fixes Wine crashing on macOS Sonoma, and GStreamer crashing when initialized by Wine (on macOS Monterey and later).
However this causes dyld to initialize libSystem before the preloader runs, resulting
in system allocations throughout the ranges that need to be reserved.
To prevent this, use a zerofill section to reserve the entire low 8GB of address space
for use by Wine.
This also has the benefit of reserving as much address space as possible for Wow64.
Additionally, this MR is a step towards not using the preloader entirely on 64-bit macOS (it relies on very unsupported APIs and methods).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3349
On Mon Jul 17 20:07:36 2023 +0000, Esme Povirk wrote:
> If the IWICPalette has only 4 colors in it, it can be assumed to only
> return 4 colors. If for some reason we need a test for palettes writing
> out of bounds (which I don't think we do), that should go in palette.c.
Since 256 was hard-coded in `GifDecoder_CopyPalette` for the no-GCT-present case (256 was correct for the test case), I had thought it might be worth-while to expand the testing. However, I suppose the `IWICPalette_GetColorCount` check should be sufficient.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3344#note_39204
Esme Povirk (@madewokherd) commented about dlls/windowscodecs/tests/gifformat.c:
> ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]);
> ok(color[2] == 0xff070809, "expected 0xff070809, got %#x\n", color[2]);
> ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]);
> + for (i = 4; i < 256; i++)
> + ok(color[i] == 0xdeadbeef, "expected 0xdeadbeef, got %#x\n", color[i]);
If the IWICPalette has only 4 colors in it, it can be assumed to only return 4 colors. If for some reason we need a test for palettes writing out of bounds (which I don't think we do), that should go in palette.c.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3344#note_39201
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54748
--
v4: gdiplus: Fix GdipGetAllPropertyItems return value when no properties exist.
gdiplus: Fix GdipGetPropertySize return value when no properties exist.
gdiplus/tests: Pare down image property tests that are not run for Wine.
gdiplus/tests: Use test context for test ran in a loop.
gdiplus/tests: Add GIF to image properties tests.
gdiplus/tests: Use consistent no-alternate value for image properties.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3302
Some tests in gdiplus output hex-formatted data chunks, but it is very hard to read
EXAMPLE BEFORE FIX:
```
image.c:4831: Test marked todo: 16: data should match
image.c:4837: 40image.c:4837: 40image.c:4837: 40image.c:4837: 40image.c:4837: 40image.c:4837: 40image.c:4837: 80i
mage.c:4837: 80image.c:4837: 80image.c:4837: 80image.c:4837: 80image.c:4837: 80image.c:4837: 40image.c:4837: 40im
age.c:4837: 40image.c:4837: 40image.c:4837: 40image.c:4837: 40image.c:4837: 40image.c:4837: 40image.c:4837: 40ima
ge.c:4837: 40image.c:4837: 40image.c:4837: 40image.c:4838:
```
EXAMPLE AFTER FIX:
```
image.c:4802: Test marked todo: 16: data should match
image.c:4804: 40 40 40 40 40 40 80 80 80 80 80 80 40 40 40 40 40 40 40 40 40 40 40 40
```
--
v3: gdiplus/tests: Fix mangled test output when dumping data in hex format.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3313
--
v2: jscript: Properly set JS_E_WRONG_THIS as a TypeError.
mshtml/tests: Add tests for WeakMap.
jscript: Implement WeakMap.has().
jscript: Implement WeakMap.clear().
jscript: Implement WeakMap.delete().
jscript: Implement WeakMap.get().
jscript: Implement WeakMap.set().
jscript: Implement WeakMap instance stub and constructor.
jscript: Move the GC traversal for unmarking alive objects into a helper
jscript: Convert unlink_props to a helper that unlinks the entire object.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3300
--
v3: Release 8.0.2.
localspl: Don't pass original document name to cupsStartDocument.
wininet/tests: Update expected WineHQ certificate.
winhttp/tests: Fix a test failure.
This merge request has too many patches to be relayed via email.
Please visit the URL below to see the contents of the merge request.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3168
Most of the interesting part is the API (first patch); the rest is
implementation. The basic idea is that we have predefined fixed numbers for the
float, integer, and boolean constant arrays, and treat each of the three like a
constant buffer.
Implementation-wise, we lower sm1-style constant registers to sm4-style constant
buffers and immediate constants, which are capable of expressing a strict
superset of the same functionality.
Note that use of immediate constants is *not* the way that wined3d currently
handles DEF instructions, but rather those are uploaded via uniforms. Is there a
reason for this?
Relative addressing is not yet implemented. In theory it should be simple enough
to either translate it directly, for external constants, or use sm4-style
immediate constant buffers, for internal constants. There may be a snag if an
application depends on relative addressing to cover a range of both internal and
external constants; this surely would require manual assembly or an application
bug, but we could implement it by copying to a temporary array using a private
TEMP-like register type.
--
Because API is easiest to review when there's a concrete user, I have functional
patches hooking this up to wined3d, in the following branches:
https://gitlab.winehq.org/zfigura/vkd3d/-/commits/himavant5https://gitlab.winehq.org/zfigura/wine/-/commits/himavant_cb
The vkd3d branch contains some extra commits necessary to compile basic shaders;
I intend to submit these as soon as possible after the important API parts have
been reviewed. I tested this patch series by building a mingw vkd3d tree with
that branch, and running the shader runner through Wine, with a test that uses
both internal and external constants:
make tests/shader_runner.exe && WINE_D3D_CONFIG=renderer=vulkan wine tests/shader_runner.exe ../vkd3d/tests/hlsl/writemask-assignop-0.shader_test
I actually originally wrote the API without a user in mind, and later hooked up
the implementation in Wine, and was surprised to find how straightforward it
ended up being, so I think that speaks quite strongly in favour of this API.
Granted, I had already written "wined3d: Store push constants in wined3d_buffers
in struct wined3d_state." by that point, but that was something I anticipated
needing for Wine anyway, without thinking of vkd3d.
--
I actually originally did the implementation all in spirv.c, mostly because this
was before we had infrastructure in place to do passes on the middle IR. I much
prefer this version, it's quite centralized in one place and I think ends up
being simpler than the spirv.c version anyway, but I can retrieve the spirv.c
version if anyone wants to see it.
That said, we may not want to lower to VKD3DSPR_CONSTBUFFER for GLSL without
UBOs (but then again, we could also just emit VKD3DSPR_CONSTBUFFER registers as
plain GLSL arrays).
The actual declaration of flat constants is kept in spirv. I suppose the
alternative here is to instead declare buffers from the reflection information
and simply ignore dcl_constantbuffer. I submitted the patch as-is since it
seemed simple enough and I didn't want to block this work further on rewriting
that part, but we may want to rewrite it in the future regardless.
```
After the torchlight red on sweaty faces
After the frosty silence in the gardens
After the agony in stony places
The shouting and the crying
Prison and palace and reverberation
Of thunder of spring over distant mountains
```
--
v4: vkd3d-shader/spirv: Emit variables for flat constant buffers.
vkd3d-shader/ir: Normalise sm1-style constants.
vkd3d-shader/ir: Move normalization code from spirv.c to ir.c.
vkd3d-shader/d3dbc: Scan descriptors for constant register sets.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/273
On Mon Jul 17 16:08:54 2023 +0000, Erich Hoover wrote:
> What I have in staging has a lot more tests than this, were you only
> interested in these ones for some reason or are you just sending in the
> first bit so that rebasing is easier?
In this commit, I only took the tests from [the first patch](https://gitlab.winehq.org/wine/wine-staging/-/blob/4482bd34937ec6ab0….
Essentially, I'm trying to make it easier to upstream the junction point patches by splitting off small pieces of them, cleaning them up, and upstreaming them one at a time.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3331#note_39170
On Fri Jul 14 06:21:02 2023 +0000, **** wrote:
> Marvin replied on the mailing list:
> ```
> Hi,
> It looks like your patch introduced the new failures shown below.
> Please investigate and fix them before resubmitting your patch.
> If they are not new, fixing them anyway would help a lot. Otherwise
> please ask for the known failures list to be updated.
> The tests also ran into some preexisting test failures. If you know how
> to fix them that would be helpful. See the TestBot job for the details:
> The full results can be found at:
> https://testbot.winehq.org/JobDetails.pl?Key=134856
> Your paranoid android.
> === w7pro64 (64 bit report) ===
> ntdll:
> file.c:5702: Test failed: Unexpected error (0x0)
> ```
I honestly don't know why this test failed. I have not been able to reproduce the failure a second time.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3331#note_39167
It's a clean-room reimplementation that mimics Windows 10 program's output format.
It prints all the information that is available via KerbQueryTicketCacheMessage.
Also tested to work on Windows if dynamically linked + built with winegcc.
For further extension of the functonality, implementing
KerbQueryTicketCacheEx{,2,3}Message is required.
--
v5: klist: Add a program that lists Kerberos tickets.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3347
It's a clean-room reimplementation that mimics Windows 10 program's output format.
It prints all the information that is available via KerbQueryTicketCacheMessage.
Also tested to work on Windows if dynamically linked + built with winegcc.
For further extension of the functonality, implementing
KerbQueryTicketCacheEx{,2,3}Message is required.
--
v4: klist: Add a program that lists Kerberos tickets.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3347