I had a bugreport here: https://bugs.winehq.org/show_bug.cgi?id=56161
This pull req fixes the bug that programs that do VirtualAlloc(placeholder)/VirtualFree(keep placeholder)/MapViewOfFile3(replace placeholder), do not run. Like the dotnet pe loader in .net 7 for example.
It was not clear to me at first, because i didnt notice it on msdn, but the way that Dmitry Timoshkov "hacked" it in https://bugs.winehq.org/show_bug.cgi?id=56122 is actually (nearly) how it is supposed to happen according to msdn.
From here: https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-… 
So thanks to Dmitry Timoshkov. If you are interested you could also look into the thing i mentioned in the bug report, that MapViewOfFile3 doesn't round down to 64k, but, i don't think this is a serious problem yet.
Edit: I found out that under windows, the alignment constraint is not fully lifted but, it is only required to be pagesize aligned if MEM_REPLACE_PLACEHOLDER is present in the flags.
To clarify why i want this in wine. The PE Loader of .net (see here https://github.com/dotnet/runtime/blob/f21dc6c3dceb6ea76bef73e2a026c770aaed…) does align with page size. Not with 64k. This breaks a .net 7 app during load up, that will execute otherwise just execute fine.
--
v18: kernelbase: Added a test for MapViewOfFile3 with MEM_REPLACE_PLACEHOLDER
https://gitlab.winehq.org/wine/wine/-/merge_requests/4822
Affected games: Phasmophobia, Lethal Company.
The games do not use joystick input but Unity Input subsystem is initialized and that's enough to cause stack overflow when it tries to parse 8 bit hat switches. Most joysticks and some mice have hats.
I own 2 Thrustmaster devices and this fixes the problem with them plugged in. I've also seen [report descriptors shared by Proton users](https://github.com/ValveSoftware/Proton/issues/7284) that reported the crash. The real devices always use 4 bits only.
This MR was tested using a few dinput test programs (upstream Wine) and Elite Dangerous (change was applied on top of the Proton tree). Singular hat works. I don't have anything with more than that though.
--
v4: winebus.sys: Use 4 bits for hat switches.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4964
When cross-compiling on macOS, like building on ARM64 to target x86_64 [1], `make install` would fail with `winebuild: cannot find the 'ar' tool`. `winebuild` was looking for `x86_64-apple-darwin-ar`, but macOS does not install prefixed tools. As a last step before failing in `find_tool()`, search for the un-prefixed tool name.
[1]: with a `configure` invocation like: `../configure --enable-archs=i386,x86_64 --host=x86_64-apple-darwin CC="clang -arch x86_64"`
--
v2: winebuild: As a last resort, search for tools un-prefixed using clang.
winebuild: Refactor find_tool().
https://gitlab.winehq.org/wine/wine/-/merge_requests/4966
For temporary registers, SM1-SM3 integer types are internally
represented as floating point, so, in order to perform a cast
from ints to floats we need a mere MOV.
By the same token, casts from floats to ints can also be implemented with a FLOOR + MOV,
where the FLOOR is then lowered by the lower_floor() pass.
For constant integer registers "iN" there is no operation for casting
from a floating point register to them. For address registers "aN", and
the loop counting register "aL", vertex shaders have the "mova" operation
but we haven't used these registers in any way yet.
We probably would want to introduce these as synthetic variables
allocated in a special register set. In that case we have to remember to
use MOVA instead of MOV in the store operations, but they shouldn't be src
or dst of CAST operations.
Regarding constant integer registers, in some shaders, constants are
expected to be received formatted as an integer, such as:
int m;
float4 main() : sv_target
{
float4 res = {0, 0, 0, 0};
for (int k = 0; k < m; ++k)
res += k;
return res;
}
which compiles as:
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// m i0 1
//
ps_3_0
def c0, 0, 1, 0, 0
mov r0, c0.x
mov r1.x, c0.x
rep i0
add r0, r0, r1.x
add r1.x, r1.x, c0.y
endrep
mov oC0, r0
but this only happens if the integer constant is used directly in an
instruction that needs it, and as I said there is no instruction that
allows converting them to a float representation.
Notice how a more complex shader, that performs operations with this
integer variable "m":
int m;
float4 main() : sv_target
{
float4 res = {0, 0, 0, 0};
for (int k = 0; k < m * m; ++k)
res += k;
return res;
}
gives the following output:
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// m c0 1
//
ps_3_0
def c1, 0, 0, 1, 0
defi i0, 255, 0, 0, 0
mul r0.x, c0.x, c0.x
mov r1, c1.y
mov r0.y, c1.y
rep i0
mov r0.z, r0.x
break_ge r0.y, r0.z
add r1, r0.y, r1
add r0.y, r0.y, c1.z
endrep
mov oC0, r1
Meaning that the uniform "m" is just stored as a floating point in
"c0", the constant integer register "i0" is just set to 255 (hoping
it is a high enough value) using "defi", and the "break_ge"
involving c0 is used to break from the loop.
We could potentially use this approach to implement loops from SM3
without expecting the variables being received as constant integer
registers.
According to the D3D documentation, for SM1-SM3 constant integer
registers are only used by the 'loop' and 'rep' instructions.
--
v3: vkd3d-shader/hlsl: Lower casts to int for SM1.
tests: Add simple test for implicit cast to int.
vkd3d-shader/d3dbc: Implement casts from ints to floats as a MOV.
tests: Remove [require] directives for tests that use int and bool uniforms.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/608
Instead of creating the TTS voice engine directly in SetVoice, we save
the specified voice token, and only create them in speak_proc when
necessary.
--
v2: sapi: Create a new engine only when needed in ISpVoice.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4932
When cross-compiling on macOS, like building on ARM64 to target x86_64 [1], `make install` would fail with `winebuild: cannot find the 'ar' tool`. `winebuild` was looking for `x86_64-apple-darwin-ar`, but macOS does not install prefixed tools. As a last step before failing in `find_tool()`, search for the un-prefixed tool name.
[1]: with a `configure` invocation like: `../configure --enable-archs=i386,x86_64 --host=x86_64-apple-darwin CC="clang -arch x86_64"`
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4966
Affected games: Phasmophobia, Lethal Company.
The games do not use joystick input but Unity Input subsystem is initialized and that's enough to cause stack overflow when it tries to parse 8 bit hat switches. Most joysticks and some mice have hats.
I own 2 Thrustmaster devices and this fixes the problem with them plugged in. I've also seen [report descriptors shared by Proton users](https://github.com/ValveSoftware/Proton/issues/7284) that reported the crash. The real devices always use 4 bits only.
This MR was tested using a few dinput test programs (upstream Wine) and Elite Dangerous (change was applied on top of the Proton tree). Singular hat works. I don't have anything with more than that though.
--
v3: winebus.sys: Use 4 bits for hat switches.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4964
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56259
Note: the stub now returns for the last two parameters the values
that the testbots gave me (DEVICEFAMILYINFOENUM_DESKTOP and
DEVICEFAMILYDEVICEFORM_UNKNOWN). The first parameter returned some value
that I don't get (like 0xa00004a63066d), for now i set it to 0, as the
Webview installer didn't use this anyway (null pointer).
--
v4: ntdll: Add stub for RtlGetDeviceFamilyInfoEnum.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4973
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56259
Note: the stub now returns for the last two parameters the values
that the testbots gave me (DEVICEFAMILYINFOENUM_DESKTOP and
DEVICEFAMILYDEVICEFORM_UNKNOWN). The first parameter returned some value
that I don't get (like 0xa00004a63066d), for now i set it to 0, as the
Webview installer didn't use this anyway (null pointer).
--
v3: ntdll: Add stub for RtlGetDeviceFamilyInfoEnum.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4973
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56259
Note: the stub now returns for the last two parameters the values
that the testbots gave me (DEVICEFAMILYINFOENUM_DESKTOP and
DEVICEFAMILYDEVICEFORM_UNKNOWN). The first parameter returned some value
that I don't get (like 0xa00004a63066d), for now i set it to 0, as the
Webview installer didn't use this anyway (null pointer).
--
v2: ntdll: Add stub for RtlGetDeviceFamilyInfoEnum.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4973
Affected games: Phasmophobia, Lethal Company.
The games do not use joystick input but Unity Input subsystem is initialized and that's enough to cause stack overflow when it tries to parse 8 bit hat switches. Most joysticks and some mice have hats.
I own 2 Thrustmaster devices and this fixes the problem with them plugged in. I've also seen [report descriptors shared by Proton users](https://github.com/ValveSoftware/Proton/issues/7284) that reported the crash. The real devices always use 4 bits only.
This MR was tested using a few dinput test programs (upstream Wine) and Elite Dangerous (change was applied on top of the Proton tree). Singular hat works. I don't have anything with more than that though.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4964
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56259
Note: the stub now returns for the last two parameters the values
that the testbots gave me (DEVICEFAMILYINFOENUM_DESKTOP and
DEVICEFAMILYDEVICEFORM_UNKNOWN). The first parameter returned some value
that I don't get (like 0xa00004a63066d), for now i set it to 0, as the
Webview installer didn't use this anyway (null pointer).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4973
Huw Davies (@huw) commented about include/netioapi.h:
> LARGE_INTEGER CreationTimeStamp;
> } MIB_UNICASTIPADDRESS_ROW, *PMIB_UNICASTIPADDRESS_ROW;
>
> +typedef struct _MIB_ANYCASTIPADDRESS_ROW {
Please move the opening brace to the next line.
Additionally, let's move this below the unicast table definition below.
Further, please add the function prototype (with the others, near the end).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4940#note_59470
Huw Davies (@huw) commented about dlls/iphlpapi/iphlpapi_main.c:
> row->CreationTimeStamp.QuadPart = stat->creation_time;
> }
>
> +DWORD WINAPI GetAnycastIpAddressTable(ADDRESS_FAMILY family, MIB_ANYCASTIPADDRESS_TABLE **table)
Could you move this so that it doesn't split the Unicast implementation, perhaps below `GetUnicastIpAddressTable()`?
Also, please capitalize the first leteter of 'add' in the commit message.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4940#note_59469
--
v7: vkd3d-shader/spirv: Handle thread group UAV barriers.
vkd3d-shader/spirv: Include Uniform in the memory semantics for UAV barriers.
vkd3d-shader/spirv: Handle globally coherent UAVs.
vkd3d-shader: Introduce a UAV_GLOBALLY_COHERENT descriptor info flag.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/306
Normally I am a strong proponent of adjusting implementations one small step at
a time, but this is a bit of an extreme case.
The current state of UrlCanonicalize() is a prototypical example of "spaghetti
code": the implementation has been repeatedly adjusted to fix a new discovered
edge case, without properly testing the scope of the new logic, with the effect
that the current logic is a scattered mess of conditions that interact in
unpredictable ways.
To be fair, the actual function is much more complicated than one would
anticipate, and the number of new weird edge cases I found while trying to flesh
out existing logic was rather exhausting.
I initially tried to "fix" the existing implementation one step at a time. After
racking up dozens of commits without an end in sight, though, and having to
waste time carefully unravelling the broken code in the right order so as to
avoid temporary failures, I decided instead to just fix everything at once,
effectively rewriting the function from scratch, and this proved to be much more
productive.
Hopefully the huge swath of new tests is enough to prove that this new
implementation really is correct, and has no more spaghetti than what Microsoft
made necessary.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4954
--
v13: tests/d3d12: Test multiple clip distance inputs in test_clip_distance().
tests/d3d12: Use five clip distances for the multiple test in test_clip_distance().
vkd3d-shader/ir: Transform clip/cull outputs and patch constants into arrays.
vkd3d-shader/ir: Transform clip/cull inputs into an array.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/564
For temporary registers, SM1-SM3 integer types are internally
represented as floating point, so, in order to perform a cast
from ints to floats we need a mere MOV.
By the same token, casts from floats to ints can also be implemented with a FLOOR + MOV,
where the FLOOR is then lowered by the lower_floor() pass.
For constant integer registers "iN" there is no operation for casting
from a floating point register to them. For address registers "aN", and
the loop counting register "aL", vertex shaders have the "mova" operation
but we haven't used these registers in any way yet.
We probably would want to introduce these as synthetic variables
allocated in a special register set. In that case we have to remember to
use MOVA instead of MOV in the store operations, but they shouldn't be src
or dst of CAST operations.
Regarding constant integer registers, in some shaders, constants are
expected to be received formatted as an integer, such as:
int m;
float4 main() : sv_target
{
float4 res = {0, 0, 0, 0};
for (int k = 0; k < m; ++k)
res += k;
return res;
}
which compiles as:
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// m i0 1
//
ps_3_0
def c0, 0, 1, 0, 0
mov r0, c0.x
mov r1.x, c0.x
rep i0
add r0, r0, r1.x
add r1.x, r1.x, c0.y
endrep
mov oC0, r0
but this only happens if the integer constant is used directly in an
instruction that needs it, and as I said there is no instruction that
allows converting them to a float representation.
Notice how a more complex shader, that performs operations with this
integer variable "m":
int m;
float4 main() : sv_target
{
float4 res = {0, 0, 0, 0};
for (int k = 0; k < m * m; ++k)
res += k;
return res;
}
gives the following output:
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// m c0 1
//
ps_3_0
def c1, 0, 0, 1, 0
defi i0, 255, 0, 0, 0
mul r0.x, c0.x, c0.x
mov r1, c1.y
mov r0.y, c1.y
rep i0
mov r0.z, r0.x
break_ge r0.y, r0.z
add r1, r0.y, r1
add r0.y, r0.y, c1.z
endrep
mov oC0, r1
Meaning that the uniform "m" is just stored as a floating point in
"c0", the constant integer register "i0" is just set to 255 (hoping
it is a high enough value) using "defi", and the "break_ge"
involving c0 is used to break from the loop.
We could potentially use this approach to implement loops from SM3
without expecting the variables being received as constant integer
registers.
According to the D3D documentation, for SM1-SM3 constant integer
registers are only used by the 'loop' and 'rep' instructions.
--
v2: vkd3d-shader/hlsl: Lower casts to int for SM1.
tests: Add simple test for implicit cast to int.
vkd3d-shader/d3dbc: Implement casts from ints to floats as a MOV.
tests: Remove [require] directives for tests that use int and bool uniforms.
tests/shader-runner: Pass bool uniforms as IEEE 754 floats to SM1 profiles.
tests/shader-runner: Pass int uniforms as IEEE 754 floats to SM1 profiles.
tests/shader-runner: Introduce "only" qualifier.
tests: Don't ignore SM1 on a non-const-indexing.shader_test test.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/608
I had a bugreport here: https://bugs.winehq.org/show_bug.cgi?id=56161
This pull req fixes the bug that programs that do VirtualAlloc(placeholder)/VirtualFree(keep placeholder)/MapViewOfFile3(replace placeholder), do not run. Like the dotnet pe loader in .net 7 for example.
It was not clear to me at first, because i didnt notice it on msdn, but the way that Dmitry Timoshkov "hacked" it in https://bugs.winehq.org/show_bug.cgi?id=56122 is actually (nearly) how it is supposed to happen according to msdn.
From here: https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-… 
So thanks to Dmitry Timoshkov. If you are interested you could also look into the thing i mentioned in the bug report, that MapViewOfFile3 doesn't round down to 64k, but, i don't think this is a serious problem yet.
Edit: I found out that under windows, the alignment constraint is not fully lifted but, it is only required to be pagesize aligned if MEM_REPLACE_PLACEHOLDER is present in the flags.
To clarify why i want this in wine. The PE Loader of .net (see here https://github.com/dotnet/runtime/blob/f21dc6c3dceb6ea76bef73e2a026c770aaed…) does align with page size. Not with 64k. This breaks a .net 7 app during load up, that will execute otherwise just execute fine.
--
v17: kernelbase: Added a test for MapViewOfFile3 with MEM_REPLACE_PLACEHOLDER
https://gitlab.winehq.org/wine/wine/-/merge_requests/4822
I had a bugreport here: https://bugs.winehq.org/show_bug.cgi?id=56161
This pull req fixes the bug that programs that do VirtualAlloc(placeholder)/VirtualFree(keep placeholder)/MapViewOfFile3(replace placeholder), do not run. Like the dotnet pe loader in .net 7 for example.
It was not clear to me at first, because i didnt notice it on msdn, but the way that Dmitry Timoshkov "hacked" it in https://bugs.winehq.org/show_bug.cgi?id=56122 is actually (nearly) how it is supposed to happen according to msdn.
From here: https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-… 
So thanks to Dmitry Timoshkov. If you are interested you could also look into the thing i mentioned in the bug report, that MapViewOfFile3 doesn't round down to 64k, but, i don't think this is a serious problem yet.
Edit: I found out that under windows, the alignment constraint is not fully lifted but, it is only required to be pagesize aligned if MEM_REPLACE_PLACEHOLDER is present in the flags.
To clarify why i want this in wine. The PE Loader of .net (see here https://github.com/dotnet/runtime/blob/f21dc6c3dceb6ea76bef73e2a026c770aaed…) does align with page size. Not with 64k. This breaks a .net 7 app during load up, that will execute otherwise just execute fine.
--
v16: kernelbase: Added a test for MapViewOfFile3 with MEM_REPLACE_PLACEHOLDER
ntdll: Fix: Use pagesize alignment if MEM_REPLACE_PLACEHOLDER is set in flags of NtMapViewOfSection(Ex)
https://gitlab.winehq.org/wine/wine/-/merge_requests/4822
Implements asin, acos, atan, and atan2.
Also includes some tests in a new test file.
One possible problem here is that I'm not sure how to test what Microsoft's atan and atan2 outputs are in boundary cases like atan2(1, 0). I've made the test suites adhere with the calculator program I've been using (Qalculate, which I assume is using libc's atan2).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55154
--
v8: vkd3d-shader/hlsl: Implement atan and atan2.
vkd3d-shader/hlsl: Implement acos and asin trig intrinsics.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/364
--
v2: winegstreamer: Implement H264 decoder GetInputCurrentType.
mf/topology_loader: Try to connect transform nodes with their current types first.
mf/topology_loader: Initialize transform output type before adding converter.
mf/topology_loader: Ignore SetOutputType errors when doing indirect connect.
mf/topology_loader: Use a local variable for the indirect connection method.
mf/tests: Check inserted topology loader transforms explicitly.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4881
Signed-off-by: David Kahurani k.kahurani(a)gmail.com
--
v6: dlls/gdiplus: Use path_list to path helper in GdipWidenPath.
dlls/gdiplus: Use path_list to path helper in GdipFlattenPath.
dlls/gdiplus: Use GdipCreatePath2 when serializing paths
dlls/gdiplus: Use GdipCreatePath2 in GdipClonePath
https://gitlab.winehq.org/wine/wine/-/merge_requests/4803
It's often just casted by callers anyway. Fixes clang warning:
```
dlls/windowscodecs/info.c:1426:81: warning: passing 'WICPixelFormatNumericRepresentation *' (aka 'enum WICPixelFormatNumericRepresentation *') to parameter of type 'UINT *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign]
return ComponentInfo_GetUINTValue(This->classkey, L"NumericRepresentation", pNumericRepresentation);
^~~~~~~~~~~~~~~~~~~~~~
../dlls/windowscodecs/info.c:104:11: note: passing argument to parameter 'result' here
UINT *result)
^
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4963
First part of Proton shared memory series. The full branch can be seen at https://gitlab.winehq.org/rbernon/wine/-/commits/mr/shared-memories.
--
v12: user32: Use the desktop shared data for GetCursorPos().
server: Expose the desktop shared mapping to clients.
server: Add a sequence number to the shared data.
server: Move the cursor position and last change time to the shared data.
server: Use the helper to update the cursor last change time.
server: Create a desktop shared mapping.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3103
The goal here is to be able to convert between SSA and TEMP easily, which will be the second preliminary pass for the CFG structurizer.
Ideally I would have added the check in commit 4/4 for TEMPs as well, but typing information from TPF sources is insufficient. This leaves the current validation inconsistent: we check that a register is always used either as a scalar or a vec4, but that "scalar" might be 32 bit in some cases and 64 bit in others. Maybe the right thing to do here is just give up on trying to put some typing on TEMPs and just say they're always 4x32 bit words. I don't know, I'll leave this for when the dust is more settled.
--
v3: vkd3d-shader/ir: Check that SSA registers are used with compatible data types.
vkd3d-shader: Use 64 bit swizzles for 64 bit data types in VSIR.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/603
This is the current proton thread priority implementation by @rbernon rebased for upstream with a few `#ifdef`s added since AFAIK Linux is the only operating system where threads have a unique PID which can be used to set niceness on.
~~I also ran `./tools/make_requests` on https://gitlab.winehq.org/mzent/wine/-/commit/6705d3481be0409f7e971c1d2c7a3… as well and `autoconf` on https://gitlab.winehq.org/mzent/wine/-/commit/d7bafe40c411753662b2ad97148a6… (which does blow up the line count a bit).~~
A few tiny changes ~~(with the ready variable for example)~~ are in anticipation for Part 2, which also adds Mach thread priorities and recalculates thread priorities on process priority change.
Since this is a rather large MR, I hope the split here is appropriate ~~(with the second part being slightly smaller)~~, but I think logically it makes the most sense here.
--
v12: server: Check wineserver privileges on init with -20 niceness.
server: Use setpriority to update thread niceness when safe.
ntdll: Set RLIMIT_NICE to its hard limit.
server: Introduce new set_thread_priority helper.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4551
This is a preliminary pass for the control flow graph structurizer. The plan, at least for the first version of the structurizer, is to have this pass, then another pass that converts all SSA registers to TEMPs (and correspondingly PHI nodes to MOVs/MOVCs), then a simple structurizer based on the so-called Böhm–Jacopini theorem. Some changes to the SPIR-V backend will also be needed, for supporting BOOL TEMP registers and fixing some details of 64 bit types.
But this pass is already quite complicated, so large enough for its own MR.
--
v4: vkd3d-shader/ir: Fixup PHI nodes when lowering switches to selection ladders.
vkd3d-shader/ir: Lower monolithic switches to selection ladders.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/598
I'll revise the operand codes once !572 is upstream.
--
v4: vkd3d-shader/spirv: Support 64-bit source value for bitfield instructions.
vkd3d-shader/dxil: Implement DX intrinsic Tertiary.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/587
Currently we are not properly handling register(cX) reservations for SM1, this is one of the things required for the SNK shaders (CW Bug Bug 18092).
register(cX) reservations also change the offset in the $Globals buffer in SM4, so support for this is also included.
---
Patch 1/4 is required to specify:
```
[require]
shader model < 4.0
```
so that the tests that follow do not get run with the vulkan backend on SM4. I think nobody disagreed with that patch.
--
v9: vkd3d-shader/hlsl: Turn register(cX) reservations into buffer offset for SM4.
vkd3d-shader/hlsl: Make register(cX) reservations work for SM1.
tests: Test register(cX) reservations.
tests: Rename register-reservations.shader_test to register-reservations-resources.shader_test.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/458
--
v4: server: Fix rawinput buffer sizes and alignment on WoW64.
server: Move rawinput message conversion from win32u.
server: Stop using hardware_msg_data in rawinput_message.
server: Combine HID usage page and usage together.
server: Stop using union rawinput in hw_input_t.
dinput/tests: Add more tests for HID rawinput buffer.
dinput/tests: Add a helper to wait on HID input reads.
user32/tests: Rewrite the rawinput buffer test with keyboard input.
user32/tests: Run rawinput device tests in the separate desktop.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4946
This is the current proton thread priority implementation by @rbernon rebased for upstream with a few `#ifdef`s added since AFAIK Linux is the only operating system where threads have a unique PID which can be used to set niceness on.
~~I also ran `./tools/make_requests` on https://gitlab.winehq.org/mzent/wine/-/commit/6705d3481be0409f7e971c1d2c7a3… as well and `autoconf` on https://gitlab.winehq.org/mzent/wine/-/commit/d7bafe40c411753662b2ad97148a6… (which does blow up the line count a bit).~~
A few tiny changes ~~(with the ready variable for example)~~ are in anticipation for Part 2, which also adds Mach thread priorities and recalculates thread priorities on process priority change.
Since this is a rather large MR, I hope the split here is appropriate ~~(with the second part being slightly smaller)~~, but I think logically it makes the most sense here.
--
v11: server: Check wineserver privileges on init with -20 niceness.
server: Use setpriority to update thread niceness when safe.
ntdll: Set RLIMIT_NICE to its hard limit.
server: Introduce new set_thread_priority helper.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4551
--
v3: server: Fix rawinput buffer sizes and alignment on WoW64.
server: Move rawinput message conversion from win32u.
server: Stop using hardware_msg_data in rawinput_message.
server: Combine HID usage page and usage together.
server: Stop using union rawinput in hw_input_t.
dinput/tests: Add more tests for HID rawinput buffer.
dinput/tests: Add a helper to wait on HID input reads.
user32/tests: Rewrite the rawinput buffer test with keyboard input.
user32/tests: Run rawinput device tests in the separate desktop.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4946
In file included from dlls/bcrypt/gnutls.c:1916:
include/windef.h:112:24: error: unknown type name ‘va_list’
112 | # define __ms_va_list va_list
| ^~~~~~~
include/winbase.h:2076:84: note: in expansion of macro ‘__ms_va_list’
2076 | WINBASEAPI DWORD WINAPI FormatMessageA(DWORD,LPCVOID,DWORD,DWORD,LPSTR,DWORD,__ms_va_list*);
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4957
@afrantzis Can't seem to be possible to add you as a reviewer, probably you need to request "Access" to the wine/wine project (near the top of the project page).
What do you think of something like that? It is very different from the current winex11 code, but I believe it will match keyboard layouts in a much more accurate way, and it's also IMO much simpler. If that works well with Wayland, I think it could be a good hint that it might work as well in X11 and make a case for my other MR to use that approach there.
I was a bit annoyed that it doesn't seem possible to retrieve the Xkb "layout:variant" string here, but only the layout description, so I had to use xkbregistry to match it back to the known layouts.
It is mostly only there to provide a more accurate HKL value (which should match the layout langid), and scan to vk mapping table, and custom layouts should still work. The lang would be neutral then, and the scan to vk table is QWERTY by default, which is the most common case, and doesn't enforce any vkey -> unicode mapping anyway. So, if the xkbregistry dependency is an issue we could probably make it optional and dynamically loaded, and skip the langid and scan to vk specialized mappings.
--
v3: winewayland.drv: Implement Xkb composition using ImeProcessKey.
winewayland.drv: Translate Xkb keyboard layouts to KBDTABLES.
win32u: Allow KBDTABLES conversion from CTLR + ALT to WCHAR.
win32u: Force US layout in ToUnicode when CTRL is pressed.
win32u: Introduce KbdLayerDescriptor user driver entry.
win32u: Avoid accessing NULL key name string pointer.
winewayland.drv: Enumerate Xkb layouts and create matching HKL.
winewayland.drv: Handle and parse Xkb keymap events.
win32u: Implement opt-in auto-repeat for WM_(SYS)KEYDOWN messages.
winewayland.drv: Configure win32u keyboard repeat delay and speed.
winewayland.drv: Basic handling of Wayland keyboard events.
gitlab: Install libxkbcommon and libxkbregistry dependencies.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4102
The goal here is to be able to convert between SSA and TEMP easily, which will be the second preliminary pass for the CFG structurizer.
Ideally I would have added the check in commit 4/4 for TEMPs as well, but typing information from TPF sources is insufficient. This leaves the current validation inconsistent: we check that a register is always used either as a scalar or a vec4, but that "scalar" might be 32 bit in some cases and 64 bit in others. Maybe the right thing to do here is just give up on trying to put some typing on TEMPs and just say they're always 4x32 bit words. I don't know, I'll leave this for when the dust is more settled.
--
v2: vkd3d-shader/ir: Check that SSA registers are used with compatible data types.
vkd3d-shader: Use 64 bit swizzles for 64 bit data types in VSIR.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/603
Goes atop !583. The last two commits belong to this MR.
--
v3: vkd3d-shader/spirv: Emit a vector bitcast if necessary in spirv_compiler_emit_load_ssa_reg().
vkd3d-shader/dxil: Implement DX intrinsic TextureLoad.
vkd3d-shader/dxil: Implement DX intrinsic RawBufferLoad.
vkd3d-shader/dxil: Load raw/structured buffer SRV/UAV descriptors.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/601
This serie is the first result of investigation of loops not
being played on dmusic for wave tracks.
It basically:
- extends tests so that we can check if loop work at some extend
(they don't right now)
- add and fix a couple of existing tests.
And contain fixes for crufts in existing code:
- fix an errouneous prototype
- removed unused fields.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4950
Shifting the rest of the variables by one towards indices of lesser value
overwrites the variable being cleared and effectively leaks it.
Signed-off-by: David Kahurani <k.kahurani(a)gmail.com>
--
v2: dlls/msvcrt: Free previous environment variable when clearing
https://gitlab.winehq.org/wine/wine/-/merge_requests/4944
Keep track of the window cursor set for each surface and apply it when
the pointer enters the corresponding surface. This fixes a problem where
due to transient disagreements between win32 pointer focus and Wayland
pointer focus a cursor update may be lost. For example:
1. Assume existing cursor C1.
2. Window is created beneath cursor.
3. The SetCursor(hwnd, C2) driver callback is called, but because the
wl_pointer hasn't entered the Wayland surface yet we don't update
the wl_pointer cursor.
4. wl_pointer enters the surface, we apply the latest cursor we know
about, which is C1.
5. Since no change in cursor window occurs, we don't get any
further SetCursor(hwnd, C2) callbacks, so we get stuck with C1.
This commit fixes the problem by tracking the per-surface HCURSOR in
step 3, regardless of whether the cursor is actually applied. So, in
step 4 we can use that HCURSOR for the surface.
This change also fixes some cases of our mouselook heuristics not
kicking in properly due to missing a SetCursor(hwnd, NULL) in the
manner described above.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4948
An alternative approach to `EnumAdapters2` that does not directly call to GDI driver and therefore does not require GDI driver functions to be expanded. The implementation now lives in `sysparams.c` to make it closer to win32u caches it accesses. It still uses `OpenAdapterFromLuid` internally because that's where adapter handles are actually assigned and to make sure returned handles are usable with other functions that rely on GDI driver being aware of what the handle represents to be able to function correctly (like `QueryVideoMemoryInfo`).
See !4791 for some background and why this version might be preferable over the one submitted there.
--
v4: win32u: Implement NtGdiDdDDIEnumAdapters2.
win32u: Maintain a list of GPUs in cache.
gdi32,win32u: Add stubs for D3DKMTEnumAdapters2 and NtGdiDdDDIEnumAdapters2.
gdi32/tests: Add D3DKMTEnumAdapters2 tests.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4857
--
v11: user32: Pass real argument to NtUserGetClassName in RealGetWindowClass{A/W}.
win32u: Add support for retrieving real window class ID across processes.
user32: Set real window class ID for user32 static controls.
win32u/tests: Add a test for real window class name retrieval.
comctl32/tests: Add tests for RealGetWindowClass.
user32/tests: Add tests for RealGetWindowClass.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4092
Oh and I believe part of the historic mess is that ddraw sets color keys per-surface, so on paper you might set a different key on a mipmap sublevel or cube face. Not that I expect that to do anything useful in practise.
test_ck_complex shows mipmap sub levels return DDERR_NOTONMIPMAPSUBLEVEL in ddraw7, but not earlier. I guess ddraw_surface_set_color_key() could use a FIXME for the !surface->is_root case...
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4888#note_59256
I just noticed this on wine-gitlab, and I am pretty sure the check was necessary at the time for the (IWineD3DTextureImpl *) stateblock->textures[0] cast.
Color keys have since been moved from surfaces to textures, and as Henri mentioned, textures unified. I don't know of a particular design reason why D3DRS_COLORKEYENABLE wouldn't work with cube textures. I don't know of any application that combines them though (the only ddraw thing I know that uses cube textures is a dx7 sdk sample), so I wouldn't be surprised if you hit driver bugs if you try.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4888#note_59255
On Tue Jan 23 10:02:40 2024 +0000, Krzysztof Bogacki wrote:
> I'm trying to follow the suggestion to read SetupAPI registry data but
> I'm having some difficulties, with the major one being: I'm not actually
> sure where that data is. Your sample code doesn't seem to read the
> registry and just returns/enumerates an empty device set. What am I
> missing here?
> On the other hand, I had a look at where win32u writes stores
> information when `add_gpu` is called and figured that I can (probably)
> use whatever this function writes. This gives me two possible leads:
> 1.
> `HKML\System\CurrentControlSet\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\${gpu_id}`.
> Although easier to enumerate, this doesn't have the most important piece
> of data: GPU LUID, which I'd have to retrieve from the second key anyway
> and it doesn't have any links to second keys I could use to open it
> directly, so it's not very viable for my purposes here.
> 2. `HKML\System\CurrentControlSet\Enum\PCI\${pci_id}\${gpu_idx}`. This
> does have GPU LUID I can easily retrieve but some of the other data is
> kept only as wide strings which I'd need to parse if I wanted to use
> them (if only for bookkeeping purposes). E.g. the only way I see to
> retrieve PCI vendor and device IDs would be parsing `${pci_id}` but as
> far as I can tell, I can't just use `snwscanf` to process 2-byte wide
> strings in Unixlibs.
> Of course, I could pick the second version and read only the LUID while
> ignoring PCI IDs and GPU ID/index completely, but I'd like to ask first
> if it's correct thing to do before I commit to that.
HKML\\System\\CurrentControlSet\\Enum\\PCI is the correct key to enumerate GPUs.
> the only way I see to retrieve PCI vendor and device IDs would be parsing ${pci_id} but as far as I can tell, I can't just use snwscanf to process 2-byte wide strings in Unixlibs.
Do you really need PCI IDs for D3DKMTEnumAdapters2? If you do, I am sure there is a way to parse them.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4857#note_59247
For temporary registers, SM1-SM3 integer types are internally
represented as floating point, so, in order to perform a cast
from ints to floats we need a mere MOV.
By the same token, casts from floats to ints can also be implemented with a FLOOR + MOV,
where the FLOOR is then lowered by the lower_floor() pass.
For constant integer registers "iN" there is no operation for casting
from a floating point register to them. For address registers "aN", and
the loop counting register "aL", vertex shaders have the "mova" operation
but we haven't used these registers in any way yet.
We probably would want to introduce these as synthetic variables
allocated in a special register set. In that case we have to remember to
use MOVA instead of MOV in the store operations, but they shouldn't be src
or dst of CAST operations.
Regarding constant integer registers, in some shaders, constants are
expected to be received formatted as an integer, such as:
int m;
float4 main() : sv_target
{
float4 res = {0, 0, 0, 0};
for (int k = 0; k < m; ++k)
res += k;
return res;
}
which compiles as:
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// m i0 1
//
ps_3_0
def c0, 0, 1, 0, 0
mov r0, c0.x
mov r1.x, c0.x
rep i0
add r0, r0, r1.x
add r1.x, r1.x, c0.y
endrep
mov oC0, r0
but this only happens if the integer constant is used directly in an
instruction that needs it, and as I said there is no instruction that
allows converting them to a float representation.
Notice how a more complex shader, that performs operations with this
integer variable "m":
int m;
float4 main() : sv_target
{
float4 res = {0, 0, 0, 0};
for (int k = 0; k < m * m; ++k)
res += k;
return res;
}
gives the following output:
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// m c0 1
//
ps_3_0
def c1, 0, 0, 1, 0
defi i0, 255, 0, 0, 0
mul r0.x, c0.x, c0.x
mov r1, c1.y
mov r0.y, c1.y
rep i0
mov r0.z, r0.x
break_ge r0.y, r0.z
add r1, r0.y, r1
add r0.y, r0.y, c1.z
endrep
mov oC0, r1
Meaning that the uniform "m" is just stored as a floating point in
"c0", the constant integer register "i0" is just set to 255 (hoping
it is a high enough value) using "defi", and the "break_ge"
involving c0 is used to break from the loop.
We could potentially use this approach to implement loops from SM3
without expecting the variables being received as constant integer
registers.
According to the D3D documentation, for SM1-SM3 constant integer
registers are only used by the 'loop' and 'rep' instructions.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/608