From 0159beff448d55e9e8825673db2ec5de2f9d57a4 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 7 Feb 2023 19:12:12 +1100 Subject: [PATCH] Added wined3d-atomic_minmax_merge patchset --- patches/patchinstall.sh | 16 ++++ ...ATOMIC_IMIN-and-ATOMIC_UMIN-together.patch | 88 +++++++++++++++++++ .../wined3d-atomic_minmax_merge/definition | 1 + 3 files changed, 105 insertions(+) create mode 100644 patches/wined3d-atomic_minmax_merge/0001-wined3d-Merged-ATOMIC_IMIN-and-ATOMIC_UMIN-together.patch create mode 100644 patches/wined3d-atomic_minmax_merge/definition diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index aef29fda..312313a7 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -217,6 +217,7 @@ patch_enable_all () enable_wined3d_SWVP_shaders="$1" enable_wined3d_Silence_FIXMEs="$1" enable_wined3d_WINED3DFMT_B8G8R8X8_UNORM="$1" + enable_wined3d_atomic_minmax_merge="$1" enable_wined3d_bindless_texture="$1" enable_wined3d_mesa_texture_download="$1" enable_wined3d_rotate_WINED3D_SWAP_EFFECT_DISCARD="$1" @@ -662,6 +663,9 @@ patch_enable () wined3d-WINED3DFMT_B8G8R8X8_UNORM) enable_wined3d_WINED3DFMT_B8G8R8X8_UNORM="$2" ;; + wined3d-atomic_minmax_merge) + enable_wined3d_atomic_minmax_merge="$2" + ;; wined3d-bindless-texture) enable_wined3d_bindless_texture="$2" ;; @@ -3195,6 +3199,18 @@ if test "$enable_wined3d_WINED3DFMT_B8G8R8X8_UNORM" -eq 1; then patch_apply wined3d-WINED3DFMT_B8G8R8X8_UNORM/0001-wined3d-Implement-WINED3DFMT_B8G8R8X8_UNORM-to-WINED.patch fi +# Patchset wined3d-atomic_minmax_merge +# | +# | This patchset fixes the following Wine bugs: +# | * [#52233] wined3d: Handle u/signed integers that same +# | +# | Modified files: +# | * dlls/wined3d/glsl_shader.c +# | +if test "$enable_wined3d_atomic_minmax_merge" -eq 1; then + patch_apply wined3d-atomic_minmax_merge/0001-wined3d-Merged-ATOMIC_IMIN-and-ATOMIC_UMIN-together.patch +fi + # Patchset wined3d-bindless-texture # | # | This patchset fixes the following Wine bugs: diff --git a/patches/wined3d-atomic_minmax_merge/0001-wined3d-Merged-ATOMIC_IMIN-and-ATOMIC_UMIN-together.patch b/patches/wined3d-atomic_minmax_merge/0001-wined3d-Merged-ATOMIC_IMIN-and-ATOMIC_UMIN-together.patch new file mode 100644 index 00000000..c0a5f95d --- /dev/null +++ b/patches/wined3d-atomic_minmax_merge/0001-wined3d-Merged-ATOMIC_IMIN-and-ATOMIC_UMIN-together.patch @@ -0,0 +1,88 @@ +From 0320ea65de3bfc694d6f24bc410433a544555292 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Thu, 29 Jul 2021 12:28:20 +1000 +Subject: [PATCH] wined3d: Merged ATOMIC_IMIN and ATOMIC_UMIN together + +Batman: Arkham Knight. + +0670:fixme:d3d_shader:shader_glsl_atomic Unhandled opcode 0x6 for unsigned integers. +0670:fixme:d3d_shader:shader_glsl_atomic Unhandled opcode 0x7 for unsigned integers. + +Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52233 +--- + dlls/wined3d/glsl_shader.c | 36 ++++++++---------------------------- + 1 file changed, 8 insertions(+), 28 deletions(-) + +diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c +index 5cccd31207b..9928134c799 100644 +--- a/dlls/wined3d/glsl_shader.c ++++ b/dlls/wined3d/glsl_shader.c +@@ -5628,26 +5628,30 @@ static void shader_glsl_atomic(const struct wined3d_shader_instruction *ins) + op = "imageAtomicAdd"; + break; + case WINED3DSIH_ATOMIC_IMAX: ++ case WINED3DSIH_ATOMIC_UMAX: + case WINED3DSIH_IMM_ATOMIC_IMAX: ++ case WINED3DSIH_IMM_ATOMIC_UMAX: + if (is_tgsm) + op = "atomicMax"; + else + op = "imageAtomicMax"; +- if (data_type != WINED3D_DATA_INT) ++ if (data_type != WINED3D_DATA_INT && data_type != WINED3D_DATA_UINT) + { +- FIXME("Unhandled opcode %#x for unsigned integers.\n", ins->handler_idx); ++ FIXME("Unhandled opcode %#x for integers.\n", ins->handler_idx); + return; + } + break; + case WINED3DSIH_ATOMIC_IMIN: ++ case WINED3DSIH_ATOMIC_UMIN: + case WINED3DSIH_IMM_ATOMIC_IMIN: ++ case WINED3DSIH_IMM_ATOMIC_UMIN: + if (is_tgsm) + op = "atomicMin"; + else + op = "imageAtomicMin"; +- if (data_type != WINED3D_DATA_INT) ++ if (data_type != WINED3D_DATA_INT && data_type != WINED3D_DATA_UINT) + { +- FIXME("Unhandled opcode %#x for unsigned integers.\n", ins->handler_idx); ++ FIXME("Unhandled opcode %#x for integers.\n", ins->handler_idx); + return; + } + break; +@@ -5658,30 +5662,6 @@ static void shader_glsl_atomic(const struct wined3d_shader_instruction *ins) + else + op = "imageAtomicOr"; + break; +- case WINED3DSIH_ATOMIC_UMAX: +- case WINED3DSIH_IMM_ATOMIC_UMAX: +- if (is_tgsm) +- op = "atomicMax"; +- else +- op = "imageAtomicMax"; +- if (data_type != WINED3D_DATA_UINT) +- { +- FIXME("Unhandled opcode %#x for signed integers.\n", ins->handler_idx); +- return; +- } +- break; +- case WINED3DSIH_ATOMIC_UMIN: +- case WINED3DSIH_IMM_ATOMIC_UMIN: +- if (is_tgsm) +- op = "atomicMin"; +- else +- op = "imageAtomicMin"; +- if (data_type != WINED3D_DATA_UINT) +- { +- FIXME("Unhandled opcode %#x for signed integers.\n", ins->handler_idx); +- return; +- } +- break; + case WINED3DSIH_ATOMIC_XOR: + case WINED3DSIH_IMM_ATOMIC_XOR: + if (is_tgsm) +-- +2.30.2 + diff --git a/patches/wined3d-atomic_minmax_merge/definition b/patches/wined3d-atomic_minmax_merge/definition new file mode 100644 index 00000000..e03c79cb --- /dev/null +++ b/patches/wined3d-atomic_minmax_merge/definition @@ -0,0 +1 @@ +Fixes: [52233] wined3d: Handle u/signed integers the same