From 305aae75f59a9e0e43b9213d86dbafe9e750c525 Mon Sep 17 00:00:00 2001 From: Joachim Henze Date: Sun, 18 Sep 2022 20:53:30 +0200 Subject: [PATCH] [DDRAW] Handle DDLOCK_WRITEONLY in wined3dmapflags_from_ddrawmapflags() CORE-18378 (#4713) Mutes the logging: fixme:(dll/directx/wine/ddraw/utils.c:584) Unhandled flags 0x20. gets logged many times per second. It does affect several applications, e.g. the game 'Anno 1602' from 1998, and the 'Diablo 2 demo' from rapps, For both games it can be observed with both: our VBEMP driver and the VBox4.3.12 3D-accelerated-driver. Muting may improve performance a bit in such apps. It gets logged although no missing features can be perceived visually in the rendering. Fix it by importing Wine-commit b943c7910b3261c9603343369cd632f7a3b56bba ddraw: Handle DDLOCK_WRITEONLY in wined3dmapflags_from_ddrawmapflags(). Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dll/directx/wine/ddraw/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/directx/wine/ddraw/utils.c b/dll/directx/wine/ddraw/utils.c index 65f24dc13fd..b0a028d4a57 100644 --- a/dll/directx/wine/ddraw/utils.c +++ b/dll/directx/wine/ddraw/utils.c @@ -570,7 +570,7 @@ unsigned int wined3dmapflags_from_ddrawmapflags(unsigned int flags) unsigned int wined3d_flags; wined3d_flags = flags & handled; - if (!(flags & (DDLOCK_NOOVERWRITE | DDLOCK_DISCARDCONTENTS))) + if (!(flags & (DDLOCK_NOOVERWRITE | DDLOCK_DISCARDCONTENTS | DDLOCK_WRITEONLY))) wined3d_flags |= WINED3D_MAP_READ; if (!(flags & DDLOCK_READONLY)) wined3d_flags |= WINED3D_MAP_WRITE; @@ -578,7 +578,7 @@ unsigned int wined3dmapflags_from_ddrawmapflags(unsigned int flags) wined3d_flags |= WINED3D_MAP_READ | WINED3D_MAP_WRITE; if (flags & DDLOCK_NODIRTYUPDATE) wined3d_flags |= WINED3D_MAP_NO_DIRTY_UPDATE; - flags &= ~(handled | DDLOCK_WAIT | DDLOCK_READONLY | DDLOCK_NODIRTYUPDATE); + flags &= ~(handled | DDLOCK_WAIT | DDLOCK_READONLY | DDLOCK_WRITEONLY | DDLOCK_NODIRTYUPDATE); if (flags) FIXME("Unhandled flags %#x.\n", flags);