Convert all consecutive calls to d7_DrawPrimitive(TRIANGLE_FAN) into
a single call to d7_DrawPrimitive(TRIANGLE_LIST) with all the vertices.
Note, it *increase* the number of vertices, but bandwith is much less costly
than multiple calls.
Note, only a very precise subset of the calls get buffered in order to
ensure that the disruption is minimal.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=33814
--
v13: ddraw: Convert buffer API to use d3d_device struct
ddraw: Also Buffer D3DPT_POINTLIST
ddraw: directly buffering in the streaming buffer
https://gitlab.winehq.org/wine/wine/-/merge_requests/2105
Second commit is to be removed.
Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com>
--
v8: windows.media.speech: Implement Vosk create and release functions in the unixlib.
windows.media.speech/tests: Allow the SpeechRecognizer creation to fail in Wine.
windows.media.speech/tests: Get rid of duplicated hresult.
windows.media.speech: Add unixlib stub.
windows.media.speech: Add Vosk checks to autoconf.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2091
On Windows it seems sending to port 0 does nothing and does not error.
Presently sendmsg errors with EINVAL.
This works around it, by checking if it's port 0 then skipping the data.
--
v22: ntdll: Do not send data to port 0.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2100
While working in vbscript, I noticed abs on a `BSTR` value with a positive number would come back with an invalid value.
Given the following script:
```
Dim x
x = "30000"
Debug.Print "x" & "=" & abs(x)
```
Outputs:
```
Script.Print 'x=3.08221696253945E-314'
```
After debugging, `pVarIn` gets the R8 value but is never shallow copied into `pVarOut`.
In addition to a test case in `oleaut32`, I've included a test case in `vbscript`.
This fixes bug: https://bugs.winehq.org/show_bug.cgi?id=54489
--
v9: oleaut32: fix VarAbs function for BSTR with positive values
https://gitlab.winehq.org/wine/wine/-/merge_requests/2175
Zebediah Figura (@zfigura) commented about dlls/ntdll/unix/socket.c:
> {
> ULONG_PTR information;
>
> - status = try_send( fd, async );
> + if (protocol == WS_IPPROTO_UDP && async->addr && sockaddr_is_port0(async->addr, async->addr_len))
> + {
> + /* Spellforce 3 is known to send to port 0.
> + * This causes 'sendmsg' to throw a EINVAL error, on Windows this does nothing but consume the data.
> + */
> + ssize_t i;
> + for(i = async->iov_cursor; i < async->count; i++)
> + {
> + async->sent_len += async->iov[i].iov_len;
> + }
```suggestion:-3+0
for (i = async->iov_cursor; i < async->count; i++)
async->sent_len += async->iov[i].iov_len;
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2100#note_24096
Not completely sure if it's worth having for 8.0, but opening this to share the target I'm trying to reach.
--
v11: ntdll: Add a heap thread affinity and per-affinity bin group cache.
ntdll: Use atomics and lock-free list for bin groups.
ntdll: Implement Low Fragmentation Heap frontend.
ntdll: Split heap_resize_block into heap_resize_(block|large) helpers.
ntdll: Count allocations and automatically enable LFH.
ntdll: Increase heap block tail_size capacity to 16 bits.
ntdll: Implement HeapCompatibilityInformation.
ntdll: Fix HeapWalk with empty uncommitted consecutive subheaps.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1628
On Tue Feb 14 16:20:32 2023 +0000, Jacek Caban wrote:
> This will work, but while reviewing this I noticed that current handling
> of VT_R4 and VT_R8 is not exactly right, overflow checks don't really
> make sense. Fixing that allows to simplify VT_BSTR case a bit. Please
> take a look at https://gitlab.winehq.org/jacek/wine/-/commits/varabs/
> and if it looks good to you, update MR with that branch (it also
> contains BSTR allocation fixup).
Thanks. Hopefully I rebased properly!
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2175#note_24086
While working in vbscript, I noticed abs on a `BSTR` value with a positive number would come back with an invalid value.
Given the following script:
```
Dim x
x = "30000"
Debug.Print "x" & "=" & abs(x)
```
Outputs:
```
Script.Print 'x=3.08221696253945E-314'
```
After debugging, `pVarIn` gets the R8 value but is never shallow copied into `pVarOut`.
I'm not sure how to write a test case in `oleaut32`, so I included a test case in `vbscript`.
--
v7: oleaut32: fix VarAbs function for BSTR with positive values
oleaut32: Fix VarAbs function for BSTR with positive values.
oleaut32: Remove overflow check for VT_R4 and VT_R8 in VarAbs.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2175
Today, test_RtlUniform() skips almost all of its tests on Windows Vista
or later. The skipped tests only succeed in Windows XP, and fail on
Windows Vista or later.
This is because RtlUniform()'s behavior has changed, presumably due to a
bug fix shipped in Windows Vista. It appears that RtlUniform, a linear
congruential generator, could overflow before computing the modulo in
WindoWs XP. This is no longer the case in Windows Vista or later.
Meanwhile, we no longer support Windows XP behavior and thus do not test
for it regularly; therefore, the tests are obsolete as of 2023.
Remove obsolete tests that no longer work with any of the Windows
versions actively tested by WineHQ (as of 2023), and replace them with
updated tests that works in the Windows versions from Vista up to 10.
Also, fix Wine's RtlUniform() to match the new behavior accordingly.
--
v10: ntdll: Fix integer overflow in RtlUniform.
https://gitlab.winehq.org/wine/wine/-/merge_requests/821
While working in vbscript, I noticed abs on a `BSTR` value with a positive number would come back with an invalid value.
Given the following script:
```
Dim x
x = "30000"
Debug.Print "x" & "=" & abs(x)
```
Outputs:
```
Script.Print 'x=3.08221696253945E-314'
```
After debugging, `pVarIn` gets the R8 value but is never shallow copied into `pVarOut`.
I'm not sure how to write a test case in `oleaut32`, so I included a test case in `vbscript`.
--
v6: oleaut32: fix VarAbs function for BSTR with positive values
https://gitlab.winehq.org/wine/wine/-/merge_requests/2175
On Tue Feb 14 14:55:14 2023 +0000, Huw Davies wrote:
> The optimization below doesn't seem to be worth it. On x86_64 I
> couldn't measure a difference between the algorithm above and the
> optimization below. On i386, while the optimization was about 10%
> faster, the algorithm above matched native's performance, so there seems
> little point in adding the complexity.
> If you really need the optimization, you could potentially introduce it
> in a later MR.
It was an attempt to implement it in an unusual way so that there was low likelihood that the algorithm matched any particular existing implementation.
I'll switch to the modulo one anyway.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/821#note_24060
Huw Davies (@huw) commented about dlls/ntdll/rtl.c:
> - result = *seed * 0xffffffed + 0x7fffffc3;
> - if (result == 0xffffffff || result == 0x7ffffffe) {
> - result = (result + 2) & MAXLONG;
> - } else if (result == 0x7fffffff) {
> - result = 0;
> - } else if ((result & 0x80000000) == 0) {
> - result = result + (~result & 1);
> - } else {
> - result = (result + (result & 1)) & MAXLONG;
> - } /* if */
> + /* The algorithm below is equivalent to the following expression:
> + *
> + * result = ((ULONGLONG)*seed * 0x7fffffed + 0x7fffffc3) % 0x7fffffff;
> + * return (*seed = result);
> + */
> +
The optimization below doesn't seem to be worth it. On x86_64 I couldn't measure a difference between the algorithm above and the optimization below. On i386, while the optimization was about 10% faster, the algorithm above matched native's performance, so there seems little point in adding the complexity.
If you really need the optimization, you could potentially introduce it in a later MR.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/821#note_24059
User32 uses the input codepage in Unicode edit control.
However, it uses ANSI codepage, i.e. CP_ACP, in ANSI version control.
Comctl32 is different from user32. It doesn't have A-W duality and uses the input codepage in it.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54424
--
v2: comctl32/tests: Add WM_CHAR tests for edit control.
user32/edit: Use CP_ACP for WM_CHAR convresion in ANSI version control.
user32/tests: Fix WM_CHAR tests to use the input codepage.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2173
This serie is to move Wine's implementation of EnumProcessModules
closer to Windows' behavior.
Wine's current implementation is broken for a wow64 process enumerated
from a 64bit bit process:
- it returns the list of 32bit modules, while Windows returns the main
module (32bit) and the 64bit modules (in wow64 process).
This series:
- adds tests to demonstrate that discrepancy
- fix all caller's to EnumProcessModules in Wine source tree which
require the 32bit bit modules (thanks to EnumProcessModulesEx)
- fortunately, a couple of callers only require the first (main)
module and don't need to be changed.
- re-implement EnumProcessModules on top of EnumProcessModulesEx
(to mimic Window's results)
- shows also that Wine's implementation returns loaded modules
from a different directory than Windows. Also tested on Win10,
the returned paths from EnumProcessModules+GetModuleFileNameEx
are the same as the ones stored in LDR_DATA.
So, there's still more work to do after this serie:
- with loader's path for wow64 processes
- fix dbghelp to handle the conversions: information from
EnumProcessModules, debug events reports from system32, while
dbghelp (SymEnumerateModules, SymRefreshModules and the like)
report from syswow64! (except ntdll)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2186
First part of v2 of !27, which aims to:
* Allow allocation of variables of complex types that contain both numerics and objects across multiple register sets (regsets).
* Support the tex2D and tex3D intrinsics, inferring generic samplers dimension from usage, writing sampler declarations, and writing sample instructions.
* Support for arrays of resources for both SM1 and SM4 (not to be confused with the resource-arrays of SM 5.1, which can have non-constant indexes).
* Support for resources declared within structs.
* Support for synthetic combined samplers for SM1 and synthetic separated samplers for SM4, considering that they can be arrays or members of structs.
* Imitate the way the native compiler assigns the register indexes of the resources on allocation, which proved to be the most difficult thing.
* Support for object components within complex input parameters.
* Small fixes to corner cases.
This part consists on parsing the `tex2D()` and `tex3D()` intrinsics and beginning to support the allocation of variables across multiple regsets.
The whole series, is on my [master6](https://gitlab.winehq.org/fcasas/vkd3d/-/commits/master6) branch.
--
v10: vkd3d-shader/hlsl: Allocate register reservations in a separate pass.
vkd3d-shader/hlsl: Respect object reservations even if the object is unused.
tests: Test allocation of unused objects.
vkd3d-shader/hlsl: Allocate objects according to register set.
vkd3d-shader/hlsl: Keep an hlsl_reg for each register set in hlsl_ir_var.
vkd3d-shader/hlsl: Store the type's register size for each register set.
vkd3d-shader/hlsl: Leave offset empty for array and struct derefs.
vkd3d-shader/hlsl: Parse the tex3D() intrinsic.
vkd3d-shader/hlsl: Parse the tex2D() intrinsic.
vkd3d-shader/hlsl: Avoid segfault on missing sampler.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/66
There are two common ways I observe how games get monitor name to display:
1. Registry key under Enum/Display (also present in EnumDisplayDevicesA result for monitors). On Windows this key is derived from edid as 'Manufacturer ID' (3 letters) combined with "Manufacturer product code" (4 hex digits). We currently have 'Default_Display' there for all the displays;
2. DisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME). Windows sets friendlyNameFromEdid flag and returns a name from 'EDID Display Descriptor' with code 0xfc ("Display name"). As far as I could see by searching through the Windows registry this name doesn't seem to be explicitly present anywhere in registry (besides binary raw edid of course).
The first patch removes name from the gdi driver's display structure. Now none of the drivers set anything genuine there. x11 and winemac always end up with "Generic Non-Pnp Monitor" string, wineandroid sets NULL there and "Generic Non-Pnp Monitor" is set in win32u in this case. That "Generic Non-Pnp Monitor" goes to "DeviceDesc" registry value. While our value doesn't match Windows string exactly, Windows also doesn't have any meaningful name under DeviceDesc (and contains "Generic Non-Pnp Monitor" as a part of it). So this patch is essentially a no-op currently. Going forward my idea is that we just want to have edid from drivers. If the raw one is not available we can generate fallback one ourselves based on the info about the monitor we might have from elsewhere in the drivers. My motivation is:
- EDID is sometimes queried by apps directly, and it is better to provide a true one or a synthetic one with as much of accurate info as possible / reasonable;
- There is more info in EDID, e. g., colorimetry for HDR support in d3d. As far as I can tell, there is no documented way to query HDR info on Windows besides dxgi interfaces (which in case on Wine are based on gdi drivers for such things and can hardly become a genine source of such info in Wine) and WinRT interface (for which I don't know where it takes the info on Windows but we probably don't want to make it a lower level source of such info in Wine).
The alternative would be, instead of basing higher level win32u on EDID, parse EDID in drivers instead and add all the necessary info into gdi_monitor structure (instead of removing display name from there), but so far it seems less straightforward to me.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2177
While working in vbscript, I noticed abs on a `BSTR` value with a positive number would come back with an invalid value.
Given the following script:
```
Dim x
x = "30000"
Debug.Print "x" & "=" & abs(x)
```
Outputs:
```
Script.Print 'x=3.08221696253945E-314'
```
After debugging, `pVarIn` gets the R8 value but is never shallow copied into `pVarOut`.
I'm not sure how to write a test case in `oleaut32`, so I included a test case in `vbscript`.
--
v5: oleaut32: fix VarAbs function for BSTR with positive values
https://gitlab.winehq.org/wine/wine/-/merge_requests/2175
While working in vbscript, I noticed abs on a `BSTR` value with a positive number would come back with an invalid value.
Given the following script:
```
Dim x
x = "30000"
Debug.Print "x" & "=" & abs(x)
```
Outputs:
```
Script.Print 'x=3.08221696253945E-314'
```
After debugging, `pVarIn` gets the R8 value but is never shallow copied into `pVarOut`.
I'm not sure how to write a test case in `oleaut32`, so I included a test case in `vbscript`.
--
v4: oleaut32: fix VarAbs function for BSTR with positive values
https://gitlab.winehq.org/wine/wine/-/merge_requests/2175
While working in vbscript, I noticed abs on a `BSTR` value with a positive number would come back with an invalid value.
Given the following script:
```
Dim x
x = "30000"
Debug.Print "x" & "=" & abs(x)
```
Outputs:
```
Script.Print 'x=3.08221696253945E-314'
```
After debugging, `pVarIn` gets the R8 value but is never shallow copied into `pVarOut`.
I'm not sure how to write a test case in `oleaut32`, so I included a test case in `vbscript`.
--
v3: oleaut32: fix VarAbs function for BSTR with positive values
https://gitlab.winehq.org/wine/wine/-/merge_requests/2175
While working in vbscript, I noticed abs on a `BSTR` value with a positive number would come back with an invalid value.
Given the following script:
```
Dim x
x = "30000"
Debug.Print "x" & "=" & abs(x)
```
Outputs:
```
Script.Print 'x=3.08221696253945E-314'
```
After debugging, `pVarIn` gets the R8 value but is never shallow copied into `pVarOut`.
I'm not sure how to write a test case in `oleaut32`, so I included a test case in `vbscript`.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2175
First part of v2 of !27, which aims to:
* Allow allocation of variables of complex types that contain both numerics and objects across multiple register sets (regsets).
* Support the tex2D and tex3D intrinsics, inferring generic samplers dimension from usage, writing sampler declarations, and writing sample instructions.
* Support for arrays of resources for both SM1 and SM4 (not to be confused with the resource-arrays of SM 5.1, which can have non-constant indexes).
* Support for resources declared within structs.
* Support for synthetic combined samplers for SM1 and synthetic separated samplers for SM4, considering that they can be arrays or members of structs.
* Imitate the way the native compiler assigns the register indexes of the resources on allocation, which proved to be the most difficult thing.
* Support for object components within complex input parameters.
* Small fixes to corner cases.
This part consists on parsing the `tex2D()` and `tex3D()` intrinsics and beginning to support the allocation of variables across multiple regsets.
The whole series, is on my [master6](https://gitlab.winehq.org/fcasas/vkd3d/-/commits/master6) branch.
--
v9: vkd3d-shader/hlsl: Allocate register reservations in a separate pass.
vkd3d-shader/hlsl: Respect object reservations even if the object is unused.
tests: Test allocation of unused objects.
vkd3d-shader/hlsl: Allocate objects according to register set.
vkd3d-shader/hlsl: Keep an hlsl_reg for each register set in hlsl_ir_var.
vkd3d-shader/hlsl: Store the type's register size for each register set.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/66
Normalise the incoming vkd3d_shader_instruction IR to the shader model 6 pattern where only one patch constant function is emitted. This allows generation of a single patch constant function in SPIR-V.
--
v9: vkd3d-shader/normalise: Insert hull shader control point input declarations if no control point phase is defined.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/84
Normalise the incoming vkd3d_shader_instruction IR to the shader model 6 pattern where only one patch constant function is emitted. This allows generation of a single patch constant function in SPIR-V.
--
v8: vkd3d-shader/normalise: Insert hull shader control point input declarations if no control point phase is defined.
vkd3d-shader/normalise: Normalise control point phase output registers to include the control point id.
vkd3d-shader: Introduce an internal sm6 signature structure.
vkd3d-shader/spirv: Move the function declaration from spirv_compiler_begin_shader_phase() to spirv_compiler_enter_shader_phase().
vkd3d-shader/spirv: Remove the hull shader phase array.
vkd3d-shader/normalise: Merge all shader IR fork and join phases into a single phase.
vkd3d-shader/normalise: Introduce a normaliser structure.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/84
Second commit is to be removed.
Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com>
--
v7: windows.media.speech: Implement Vosk create and release functions in the unixlib.
windows.media.speech/tests: Allow the SpeechRecognizer creation to fail in Wine.
windows.media.speech/tests: Get rid of duplicated hresult.
windows.media.speech: Add unixlib stub.
windows.media.speech: Add Vosk checks to autoconf.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2091
Normalise the incoming vkd3d_shader_instruction IR to the shader model 6 pattern where only one patch constant function is emitted. This allows generation of a single patch constant function in SPIR-V.
--
v7: vkd3d-shader/normalise: Insert hull shader control point input declarations if no control point phase is defined.
vkd3d-shader/normalise: Normalise control point phase output registers to include the control point id.
vkd3d-shader: Introduce an internal sm6 signature structure.
vkd3d-shader/spirv: Move the function declaration from spirv_compiler_begin_shader_phase() to spirv_compiler_enter_shader_phase().
vkd3d-shader/spirv: Remove the hull shader phase array.
vkd3d-shader/normalise: Merge all shader IR fork and join phases into a single phase.
vkd3d-shader/normalise: Introduce a normaliser structure.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/84
First part of v2 of !27, which aims to:
* Allow allocation of variables of complex types that contain both numerics and objects across multiple register sets (regsets).
* Support the tex2D and tex3D intrinsics, inferring generic samplers dimension from usage, writing sampler declarations, and writing sample instructions.
* Support for arrays of resources for both SM1 and SM4 (not to be confused with the resource-arrays of SM 5.1, which can have non-constant indexes).
* Support for resources declared within structs.
* Support for synthetic combined samplers for SM1 and synthetic separated samplers for SM4, considering that they can be arrays or members of structs.
* Imitate the way the native compiler assigns the register indexes of the resources on allocation, which proved to be the most difficult thing.
* Support for object components within complex input parameters.
* Small fixes to corner cases.
This part consists on parsing the `tex2D()` and `tex3D()` intrinsics and beginning to support the allocation of variables across multiple regsets.
The whole series, is on my [master6](https://gitlab.winehq.org/fcasas/vkd3d/-/commits/master6) branch.
--
v8: vkd3d-shader/hlsl: Allocate register reservations in a separate pass.
vkd3d-shader/hlsl: Respect object reservations even if the object is unused.
tests: Test allocation of unused objects.
vkd3d-shader/hlsl: Allocate objects according to register set.
vkd3d-shader/hlsl: Keep an hlsl_reg for each register set in hlsl_ir_var.
vkd3d-shader/hlsl: Store the type's register size for each register set.
vkd3d-shader/hlsl: Leave offset empty for array and struct derefs.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/66
Normalise the incoming vkd3d_shader_instruction IR to the shader model 6 pattern where only one patch constant function is emitted. This allows generation of a single patch constant function in SPIR-V.
--
v6: vkd3d-shader/normalise: Insert hull shader control point input declarations if no control point phase is defined.
vkd3d-shader/normalise: Normalise control point phase output registers to include the control point id.
vkd3d-shader: Introduce an internal sm6 signature structure.
vkd3d-shader/spirv: Move the function declaration from spirv_compiler_begin_shader_phase() to spirv_compiler_enter_shader_phase().
vkd3d-shader/spirv: Remove the hull shader phase array.
vkd3d-shader/normalise: Merge all shader IR fork and join phases into a single phase.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/84
This is the last piece that's needed for function calls to basically work.
--
v3: vkd3d-shader/hlsl: Allow the final expression in a for loop initializer to be omitted.
vkd3d-shader/hlsl: Handle early return after a CF block only if there was actually a return somewhere in the CF block.
vkd3d-shader/hlsl: Inline function calls.
vkd3d-shader/hlsl: Emit a hlsl_fixme() for unhandled instruction types when writing bytecode.
vkd3d-shader/hlsl: Lower return statements.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/85
--
v4: riched20/tests: Add retry loop around OpenClipboard() to avoid access denial.
riched20/tests: Ensure clipboard has been pasted before testing the result.
riched20: Support SFF_SELECTION when streaming in plain text.
riched20/tests: Add tests when pasting in plain text mode.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2138