vkd3d-shader: Introduce an instruction flag to suppress masking of bitwise shift counts.

DXIL does not use implicit masking of shift counts.
This commit is contained in:
Conor McCarthy
2023-11-22 23:58:44 +10:00
committed by Alexandre Julliard
parent 9cb4372378
commit 1929432559
Notes: Alexandre Julliard 2023-12-12 23:15:46 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/489
4 changed files with 15 additions and 2 deletions

View File

@@ -6764,8 +6764,8 @@ static enum vkd3d_result spirv_compiler_emit_alu_instruction(struct spirv_compil
* Microsoft fxc will compile immediate constants larger than 5 bits.
* Fixing up the constants would be more elegant, but the simplest way is
* to let this handle constants too. */
if (instruction->handler_idx == VKD3DSIH_ISHL || instruction->handler_idx == VKD3DSIH_ISHR
|| instruction->handler_idx == VKD3DSIH_USHR)
if (!(instruction->flags & VKD3DSI_SHIFT_UNMASKED) && (instruction->handler_idx == VKD3DSIH_ISHL
|| instruction->handler_idx == VKD3DSIH_ISHR || instruction->handler_idx == VKD3DSIH_USHR))
{
uint32_t mask_id = spirv_compiler_get_constant_vector(compiler,
VKD3D_SHADER_COMPONENT_UINT, vkd3d_write_mask_component_count(dst->write_mask), 0x1f);