From 7993325086eb6dfeda07365521149ad6d482bd96 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 11 Jul 2018 09:41:05 +1000 Subject: [PATCH] Added wined3d-WINED3DFMT_B8G8R8X8_UNORM patchset --- patches/patchinstall.sh | 19 +++++++ ...t-WINED3DFMT_B8G8R8X8_UNORM-to-WINED.patch | 52 +++++++++++++++++++ .../definition | 1 + 3 files changed, 72 insertions(+) create mode 100644 patches/wined3d-WINED3DFMT_B8G8R8X8_UNORM/0001-wined3d-Implement-WINED3DFMT_B8G8R8X8_UNORM-to-WINED.patch create mode 100644 patches/wined3d-WINED3DFMT_B8G8R8X8_UNORM/definition diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 25d0b0b8..e7b3a243 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -370,6 +370,7 @@ patch_enable_all () enable_wined3d_QUERY_Stubs="$1" enable_wined3d_Silence_FIXMEs="$1" enable_wined3d_UAV_Counters="$1" + enable_wined3d_WINED3DFMT_B8G8R8X8_UNORM="$1" enable_wined3d_WINED3D_RS_COLORWRITEENABLE="$1" enable_wined3d_texture_blt_device="$1" enable_wined3d_wined3d_guess_gl_vendor="$1" @@ -1284,6 +1285,9 @@ patch_enable () wined3d-UAV_Counters) enable_wined3d_UAV_Counters="$2" ;; + wined3d-WINED3DFMT_B8G8R8X8_UNORM) + enable_wined3d_WINED3DFMT_B8G8R8X8_UNORM="$2" + ;; wined3d-WINED3D_RS_COLORWRITEENABLE) enable_wined3d_WINED3D_RS_COLORWRITEENABLE="$2" ;; @@ -7618,6 +7622,21 @@ if test "$enable_wined3d_Indexed_Vertex_Blending" -eq 1; then ) >> "$patchlist" fi +# Patchset wined3d-WINED3DFMT_B8G8R8X8_UNORM +# | +# | This patchset fixes the following Wine bugs: +# | * [#44888] Implement WINED3DFMT_B8G8R8X8_UNORM to WINED3DFMT_L8_UNORM conversion +# | +# | Modified files: +# | * dlls/wined3d/surface.c +# | +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 + ( + printf '%s\n' '+ { "Stanislav Zhukov", "wined3d: Implement WINED3DFMT_B8G8R8X8_UNORM to WINED3DFMT_L8_UNORM conversion.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-texture-blt-device # | # | This patchset fixes the following Wine bugs: diff --git a/patches/wined3d-WINED3DFMT_B8G8R8X8_UNORM/0001-wined3d-Implement-WINED3DFMT_B8G8R8X8_UNORM-to-WINED.patch b/patches/wined3d-WINED3DFMT_B8G8R8X8_UNORM/0001-wined3d-Implement-WINED3DFMT_B8G8R8X8_UNORM-to-WINED.patch new file mode 100644 index 00000000..0a0e81a1 --- /dev/null +++ b/patches/wined3d-WINED3DFMT_B8G8R8X8_UNORM/0001-wined3d-Implement-WINED3DFMT_B8G8R8X8_UNORM-to-WINED.patch @@ -0,0 +1,52 @@ +From e2d79a523dba80544b4358a60b5f248f74eb4c00 Mon Sep 17 00:00:00 2001 +From: Stanislav Zhukov +Date: Wed, 11 Jul 2018 09:33:19 +1000 +Subject: [PATCH] wined3d: Implement WINED3DFMT_B8G8R8X8_UNORM to + WINED3DFMT_L8_UNORM conversion. + +Signed-off-by: Stanislav Zhukov +--- + dlls/wined3d/surface.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index f9e3af37ff4..6ad7bb94573 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -919,6 +919,25 @@ static void convert_x8r8g8b8_dxt5(const BYTE *src, BYTE *dst, + wined3d_dxt5_encode(src, dst, pitch_in, pitch_out, WINED3DFMT_B8G8R8X8_UNORM, w, h); + } + ++static void convert_x8r8g8b8_l8(const BYTE *src, BYTE *dst, ++ DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h) ++{ ++ unsigned int x, y; ++ ++ TRACE("Converting %ux%u pixels, pitches %u %u.\n", w, h, pitch_in, pitch_out); ++ ++ for (y = 0; y < h; ++y) ++ { ++ const DWORD *src_line = (const DWORD *)(src + y * pitch_in); ++ BYTE *dst_line = (BYTE *)(dst + y * pitch_out); ++ ++ for (x = 0; x < w; ++x) ++ { ++ dst_line[x] = src_line[x] & 0x000000ff; ++ } ++ } ++} ++ + struct d3dfmt_converter_desc + { + enum wined3d_format_id from, to; +@@ -933,6 +952,7 @@ static const struct d3dfmt_converter_desc converters[] = + {WINED3DFMT_B8G8R8X8_UNORM, WINED3DFMT_B8G8R8A8_UNORM, convert_a8r8g8b8_x8r8g8b8}, + {WINED3DFMT_YUY2, WINED3DFMT_B8G8R8X8_UNORM, convert_yuy2_x8r8g8b8}, + {WINED3DFMT_YUY2, WINED3DFMT_B5G6R5_UNORM, convert_yuy2_r5g6b5}, ++ {WINED3DFMT_B8G8R8X8_UNORM, WINED3DFMT_L8_UNORM, convert_x8r8g8b8_l8}, + }; + + static const struct d3dfmt_converter_desc dxtn_converters[] = +-- +2.18.0 + diff --git a/patches/wined3d-WINED3DFMT_B8G8R8X8_UNORM/definition b/patches/wined3d-WINED3DFMT_B8G8R8X8_UNORM/definition new file mode 100644 index 00000000..f089e475 --- /dev/null +++ b/patches/wined3d-WINED3DFMT_B8G8R8X8_UNORM/definition @@ -0,0 +1 @@ +Fixes: [44888] Implement WINED3DFMT_B8G8R8X8_UNORM to WINED3DFMT_L8_UNORM conversion