This clears up much of the todo list for mspatcha. GetFilePatchSignature* and NormalizeFileForPatchSignature have now been implemented in these changes.
These changes bring better support for things like the Adobe Acrobat installer without the need for things like the winetricks mspatcha.dll native dll override. Still needed is support for interleaved streams in the LZXD decompression logic, however this is a great start to better supporting software installers that use the Windows interface for creating and applying patches to files.
This is the beginning of the fixes required for bug 12501: https://bugs.winehq.org/show_bug.cgi?id=12501
--
v25: mspatcha: Use string comparison for section names
mspatcha: Use unaligned typedefs
mspatcha: Relocate PE/COFF image functions
mspatcha: Add support for 32-bit file image patch transforms
mspatcha: Add implementations for GetFilePatchSignature* routines
mspatcha: Add support for 32-bit file normalizing
https://gitlab.winehq.org/wine/wine/-/merge_requests/3870
This clears up much of the todo list for mspatcha. GetFilePatchSignature* and NormalizeFileForPatchSignature have now been implemented in these changes.
These changes bring better support for things like the Adobe Acrobat installer without the need for things like the winetricks mspatcha.dll native dll override. Still needed is support for interleaved streams in the LZXD decompression logic, however this is a great start to better supporting software installers that use the Windows interface for creating and applying patches to files.
This is the beginning of the fixes required for bug 12501: https://bugs.winehq.org/show_bug.cgi?id=12501
--
v24: mspatcha: Use string comparison for section names
mspatcha: Use unaligned typedefs
mspatcha: Relocate PE/COFF image functions
mspatcha: Add support for 32-bit file image patch transforms
mspatcha: Add implementations for GetFilePatchSignature* routines
mspatcha: Add support for 32-bit file normalizing
mspatcha/tests: Add additional unit tests for ApplyPatchToFileByBuffers
https://gitlab.winehq.org/wine/wine/-/merge_requests/3870
This clears up much of the todo list for mspatcha. GetFilePatchSignature* and NormalizeFileForPatchSignature have now been implemented in these changes.
These changes bring better support for things like the Adobe Acrobat installer without the need for things like the winetricks mspatcha.dll native dll override. Still needed is support for interleaved streams in the LZXD decompression logic, however this is a great start to better supporting software installers that use the Windows interface for creating and applying patches to files.
This is the beginning of the fixes required for bug 12501: https://bugs.winehq.org/show_bug.cgi?id=12501
--
v23: mspatcha: Use string comparison for section names
mspatcha: Use unaligned typedefs
mspatcha: Relocate PE/COFF image functions
mspatcha: Add support for 32-bit file image patch transforms
mspatcha: Add implementations for GetFilePatchSignature* routines
mspatcha: Add support for 32-bit file normalizing
mspatcha/tests: Add additional unit tests for ApplyPatchToFileByBuffers
mspatcha/tests: Add unit tests for NormalizeFileForPatchSignature and GetFilePatchSignature*
https://gitlab.winehq.org/wine/wine/-/merge_requests/3870
This clears up much of the todo list for mspatcha. GetFilePatchSignature* and NormalizeFileForPatchSignature have now been implemented in these changes.
These changes bring better support for things like the Adobe Acrobat installer without the need for things like the winetricks mspatcha.dll native dll override. Still needed is support for interleaved streams in the LZXD decompression logic, however this is a great start to better supporting software installers that use the Windows interface for creating and applying patches to files.
This is the beginning of the fixes required for bug 12501: https://bugs.winehq.org/show_bug.cgi?id=12501
--
v22: mspatcha: Use string comparison for section names
mspatcha: Use unaligned typedefs
mspatcha: Relocate PE/COFF image functions
mspatcha: Add support for 32-bit file image patch transforms
mspatcha: Add implementations for GetFilePatchSignature* routines
mspatcha: Add support for 32-bit file normalizing
https://gitlab.winehq.org/wine/wine/-/merge_requests/3870
This goes on top of MR 320 and 345.
--
v4: tests/shader-runner: Add a '--dump-dxil' command line switch.
tests/shader-runner: Test shaders with dxcompiler.
tests/shader-runner: Replace immediate shader type strings with an enum.
tests/shader-runner: Do not exit if a 'require' directive is not met.
tests/shader-runner: Handle individual keywords in shader directives.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/346
This clears up much of the todo list for mspatcha. GetFilePatchSignature* and NormalizeFileForPatchSignature have now been implemented in these changes.
These changes bring better support for things like the Adobe Acrobat installer without the need for things like the winetricks mspatcha.dll native dll override. Still needed is support for interleaved streams in the LZXD decompression logic, however this is a great start to better supporting software installers that use the Windows interface for creating and applying patches to files.
This is the beginning of the fixes required for bug 12501: https://bugs.winehq.org/show_bug.cgi?id=12501
--
v21: mspatcha: Remove useless unused parameter annotation
mspatcha: Fix check for if patch was necessary
mspatcha: Fix normalize_old_file_image result if no old file is supplied
mspatcha: Use string comparison for section names
mspatcha: Use unaligned typedefs
mspatcha: Remove useless result variable in NormalizeFileForPatchSignature
mspatcha: Relocate PE/COFF image functions
mspatcha: Cleanup normalize_old_file_image return logic
mspatcha: Fix new file buffer local variable assignment
mspatcha: Fix relocation block enumeration
mspatcha: Fix progress callback behaviour
mspatcha: Fix binary to hex string conversions for GetFilePatchSignatureByBuffer
mspatcha: Add support for 32-bit file image patch transforms
mspatcha: Add implementations for GetFilePatchSignature* routines
mspatcha: Add support for 32-bit file normalizing
mspatcha/tests: Add additional unit tests for ApplyPatchToFileByBuffers
mspatcha/tests: Add unit tests for NormalizeFileForPatchSignature and GetFilePatchSignature*
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/3870
This clears up much of the todo list for mspatcha. GetFilePatchSignature* and NormalizeFileForPatchSignature have now been implemented in these changes.
These changes bring better support for things like the Adobe Acrobat installer without the need for things like the winetricks mspatcha.dll native dll override. Still needed is support for interleaved streams in the LZXD decompression logic, however this is a great start to better supporting software installers that use the Windows interface for creating and applying patches to files.
This is the beginning of the fixes required for bug 12501: https://bugs.winehq.org/show_bug.cgi?id=12501
--
v20: mspatcha: Remove useless unused parameter annotation
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/3870
This goes on top of MR 320 and 345.
--
v3: tests/shader-runner: Add a '--dump-dxil' command line switch.
tests/shader-runner: Test shaders with dxcompiler.
tests/shader-runner: Replace immediate shader type strings with an enum.
tests/shader-runner: Do not exit if a 'require' directive is not met.
tests/shader-runner: Handle individual keywords in shader directives.
vkd3d-shader/dxil: Do not compile compute shaders.
vkd3d-shader/dxil: Do not access null code blocks on failure.
vkd3d-shader/dxil: Implement DX instruction LoadInput.
vkd3d-shader/dxil: Declare shader inputs.
vkd3d-shader/dxbc: Load input signatures also from ISG1 chunks.
vkd3d-shader/spirv: Build undefined values once.
vkd3d-shader/spirv: Introduce a Static Single Assignment register type.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/346
On Thu Sep 21 05:34:32 2023 +0000, Zebediah Figura wrote:
> I assume you mean -Wunused-parameter, since -Wunused-variable alone
> shouldn't warn on parameters.
> I don't think -Wunused-parameter is reasonable to enable for Wine. The
> Windows API has far, far too many unused parameters for annotating them
> all to be worthwhile.
Yes, sorry you are correct, I meant `-Wunused-parameter`. I'll just remove this line then
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3870#note_46134
On Thu Sep 21 05:19:42 2023 +0000, Jeffrey Smith wrote:
> At each commit along the patch set, all tests need to run clean.
> Anything that fails on Wine should be marked as such with `todo_wine` or
> `todo_wine_if` as appropriate.
> So you would start with commit(s) adding tests, generally including
> (marked) failing tests. Then any commit that changes/fixes a test
> result should adjust/remove the todo markers in the same commit.
Ah okay, that would have been great to know before I removed all the todo's lol. This is going to be a mess to cleanup, got any tips?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3870#note_46133
This goes on top of MR 320 and 345.
--
v2: tests/shader-runner: Add a '--dump-dxil' command line switch.
tests/shader-runner: Test shaders with dxcompiler.
tests/shader-runner: Replace immediate shader type strings with an enum.
tests/shader-runner: Do not exit if a 'require' directive is not met.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/346
At each commit along the patch set, all tests need to run clean.
Anything that fails on Wine should be marked as such with `todo_wine` or `todo_wine_if` as appropriate.
So you would start with commit(s) adding tests, generally including failing tests. Then any commit that changes/fixes a test result should adjust/remove the todo markers in the same commit.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3870#note_46130
> I.e. server side decorations can be used as a primary option and if it's not available, Wine can fall back to libdecor.
That is how it's intended to be used, yes, but it is a workaround for applications or libraries that can't provide suitable window decorations themselves.
The idea that it's a workaround for GNOME isn't wrong, but it isn't right either. There are plenty of reasons why window decorations might not be supported, be it because the compositor needs to be as fast as possible, or it's just not technically possible.
I'm purely proposing libdecor here so that the experience on GNOME, Weston, and whatever desktops result from this migration and don't have xdg-decoration are able to integrate more "nicely", being subjective.
Again, I'm fine with it not having libdecor. In fact, using a library like that might even pose some technical challenges with things like web browsers running in Wine, which like to embed window decorations *in* their window, like libadwaita likes to do.
The performance hit with libdecor is more theoretical than anything, and would need to be confirmed before using it as a fact. It might even be fixable with some consultation with GTK folks on how to work with subsurfaces in a GTK context.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3909#note_46127
This clears up much of the todo list for mspatcha. GetFilePatchSignature* and NormalizeFileForPatchSignature have now been implemented in these changes.
These changes bring better support for things like the Adobe Acrobat installer without the need for things like the winetricks mspatcha.dll native dll override. Still needed is support for interleaved streams in the LZXD decompression logic, however this is a great start to better supporting software installers that use the Windows interface for creating and applying patches to files.
This is the beginning of the fixes required for bug 12501: https://bugs.winehq.org/show_bug.cgi?id=12501
--
v7: mspatcha: Fix binary to hex string conversions for GetFilePatchSignatureByBuffer
https://gitlab.winehq.org/wine/wine/-/merge_requests/3870
The default exit code is only used when a process is killed by the system or through a signal.
These are exceptional cases where exit code 1 (killed by Task Manager) is more appropriate than the normal termination code of 0.
Chromium does not restart helper processes that exit with code 0 (see [kill.h](https://source.chromium.org/chromium/chromium/src/+/main:base/proce…), with this fix they are restarted when killed by the system or by a signal.
--
v3: server: Set the default thread exit code to 1.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3648
On Thu Sep 21 00:46:47 2023 +0000, Jinoh Kang wrote:
> I'm not sure if it is correct to flip the "violent delth" flag
> parameter. Anyways, this looks like a duplicate of
> https://gitlab.winehq.org/wine/wine/-/merge_requests/3648, so you might
> want to ask about its status?
@iamahuman thanks for pointing out that older thread, I'll follow up on that!
With regards to the `violent_death` parameter, are there any guidelines around when it is appropriate to set that to a value of 1? From what I can see, it's primarily used when a protocol error is encountered (e.g. [here](https://gitlab.winehq.org/wine/wine/-/blob/wine-8.16/server/request.c… and [here](https://gitlab.winehq.org/wine/wine/-/blob/wine-8.16/server/request.c…) and the server can no longer communicate with the client process. That seems fairly similar to the abnormal process termination scenario (with the main difference being that the server isn't trying to send or receive a message at the time it detects the pipe close), but there might be some nuance there that I'm overlooking?
If there's a more appropriate mechanism to set the non-zero exit code in the abnormal process termination scenario then I'd certainly be happy to update the patch to use that instead. The current implementation was designed to be as minimally intrusive as possible whilst still achieving the desired behaviour, but I'm not familiar enough with the internal workings of the Wine server to be completely confident in its correctness, so any guidance here is much appreciated! (I'm also happy to add comments if desired, since I recognise that the current code is not particularly explicit in communicating its intent to readers.)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3908#note_46121
libdecor makes sense as a workaround for Gnome which doesn't support server side decorations. I.e. server side decorations can be used as a primary option and if it's not available, Wine can fall back to libdecor.
It shouldn't matter much for games I think, since games normally run in fullscreen if you care about performance, so window decorations are really irrelevant in gaming use case.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3909#note_46120
Hi, I'm back again :P
Since it's probably about time for it, and I forgot to send that email a while back, I might as well ask now: are there plans to make Wine use libdecor at some point in the future, so that there are "native" window decorations for desktops that don't provide xdg-decoration? A lot of the work here for compositor-initiated window closing is a requirement for that.
There may be performance implications for this, IIRC, since you'd have to work with another library's event loop on top of another GUI toolkit not made for games, and GTK doesn't support wl_subsurfaces normally *iirc*. SDL does it, at least, so there's that. But something to maybe consider. I'm satisfied with the default window decorations right now, myself.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3909#note_46062
> ```diff
> +static uint32_t spirv_compiler_emit_load_ssa_reg(struct spirv_compiler *compiler,
> + const struct vkd3d_shader_register *reg, enum vkd3d_shader_component_type component_type,
> + unsigned int swizzle, unsigned int write_mask)
> +{
> + uint32_t val_id = spirv_compiler_get_ssa_register_id(compiler, reg);
> + assert(val_id);
> + return val_id;
> +}
> ```
This doesn't emit anything, and "component_type", "swizzle", and "write_mask" are unused. More generally, it seems the only caller could just call spirv_compiler_get_ssa_register_id() instead.
> ```diff
> @@ -3912,6 +3938,13 @@ static void spirv_compiler_emit_store_reg(struct spirv_compiler *compiler,
>
> assert(!register_is_constant_or_undef(reg));
>
> + if (reg->type == VKD3DSPR_SSA)
> + {
> + assert(reg->idx[0].offset < compiler->ssa_register_count);
> + compiler->ssa_register_ids[reg->idx[0].offset] = val_id;
> + return;
> + }
> +
> ```
Here we seem to go entirely the other way, and simply inline the counterpart to spirv_compiler_get_ssa_register_id(). I.e., why do we have spirv_compiler_get_ssa_register_id() but not spirv_compiler_set_ssa_register_id()?
> ```diff
> +static void spirv_compiler_emit_ssas(struct spirv_compiler *compiler, unsigned int count)
> +{
> + assert(!compiler->ssa_register_ids);
> + if (!(compiler->ssa_register_ids = vkd3d_calloc(count, sizeof(*compiler->ssa_register_ids))))
> + {
> + ERR("Failed to allocate SSA register value id array, count %u.\n", count);
> + spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_OUT_OF_MEMORY,
> + "Failed to allocate SSA register value id array of count %u.", count);
> + }
> + compiler->ssa_register_count = count;
> +}
> ```
This doesn't emit any SPIR-V.
> ```diff
> @@ -523,6 +524,7 @@ enum vkd3d_shader_register_type
> VKD3DSPR_RASTERIZER,
> VKD3DSPR_OUTSTENCILREF,
> VKD3DSPR_UNDEF,
> + VKD3DSPR_SSA,
>
> VKD3DSPR_COUNT,
> ```
This is perhaps subtle, but note that this will cause init_sm4_lookup_tables() to map VKD3DSPR_SSA (like VKD3DSPR_UNDEF) to VKD3D_SM4_RT_TEMP, while ideally that lookup would fail.
> ```diff
> @@ -2838,7 +2855,8 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t
> return ret;
> }
>
> - if (!(sm6->output_params = shader_parser_get_dst_params(&sm6->p, output_signature->element_count)))
> + if (!(sm6->output_params = shader_parser_get_dst_params(&sm6->p, output_signature->element_count))
> + || !(sm6->input_params = shader_parser_get_dst_params(&sm6->p, input_signature->element_count)))
> {
> ERR("Failed to allocate output parameters.\n");
> vkd3d_shader_error(message_context, &location, VKD3D_SHADER_ERROR_DXIL_OUT_OF_MEMORY,
> ```
That makes the error message inaccurate.
> ```diff
> +static inline unsigned int sm6_parser_alloc_ssa_id(struct sm6_parser *sm6)
> +{
> + return sm6->ssa_next_id++;
> +}
> ```
Why is that "static inline"? The main thing it'll do in .c files is to make it harder to spot unused code. We seem to have some more instances of that in both the existing dxil.c code and this MR.
> ```diff
> +static void register_init_with_id(struct vkd3d_shader_register *reg,
> + enum vkd3d_shader_register_type reg_type, enum vkd3d_data_type data_type, unsigned int index)
> +{
> + shader_register_init(reg, reg_type, data_type, 1);
> + reg->idx[0].offset = index;
> +}
> ```
This is pretty minor in the scheme of things, but where is the ID above? I'm guessing it's supposed to be the "index" parameter.
> ```diff
> +static void register_init_ssa_vector(struct vkd3d_shader_register *reg, enum vkd3d_data_type data_type,
> + unsigned int component_count, struct sm6_parser *sm6)
> ...
> +static inline void register_init_ssa_scalar(struct vkd3d_shader_register *reg, const struct sm6_type *type,
> + struct sm6_parser *sm6)
> ```
Why does initialising a SSA vector require a vkd3d_data_type, while initialising a SSA scalar requires a sm6_type? Also, register_init_ssa_vector() is only ever called with a "component_count" of 1.
> ```diff
> +static void instruction_dst_param_init_ssa_scalar_component(struct vkd3d_shader_instruction *ins,
> + unsigned int component_idx, struct sm6_parser *sm6)
> +{
> + struct vkd3d_shader_dst_param *param = instruction_dst_params_alloc(ins, 1, sm6);
> + struct sm6_value *dst = sm6_parser_get_current_value(sm6);
> +
> + dst_param_init_ssa_scalar(param, dst->type, sm6);
> + param->write_mask = VKD3DSP_WRITEMASK_0 << component_idx;
> + dst->u.reg = param->reg;
> +}
> ```
Somewhat like register_init_ssa_vector() above, we're only ever calling instruction_dst_param_init_ssa_scalar_component() with a "component_idx" of 0.
I'm guessing future patches will make some of these issues go away, but that's not ideal.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/320#note_46057