From: chenjiangyi <chenjiangyi(a)uniontech.com> On Windows, if wglChoosePixelFormat specifies cAccumBits, the best matching PIXELFORMATDESCRIPTOR obtained should contain AccumBits information. Some industrial software, such as CAD applications, require matching the AccumBits information. Signed-off-by: chenjiangyi <chenjiangyi(a)uniontech.com> --- dlls/opengl32/wgl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index b24225684e0..76b452841b1 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -145,6 +145,7 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd) best.cDepthBits = -1; best.cStencilBits = -1; best.cAuxBuffers = -1; + best.cAccumBits = -1; for (i = 1; i <= count; i++) { @@ -294,6 +295,18 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd) continue; } } + if (ppfd->cAccumBits) + { + if (((ppfd->cAccumBits > best.cAccumBits) && (format.cAccumBits > best.cAccumBits)) || + ((format.cAccumBits >= ppfd->cAccumBits) && (format.cAccumBits < best.cAccumBits))) + goto found; + + if (best.cAccumBits != format.cAccumBits) + { + TRACE( "cAccumBits mismatch for iPixelFormat=%d\n", i ); + continue; + } + } if (ppfd->dwFlags & PFD_DEPTH_DONTCARE) { if (format.cDepthBits < best.cDepthBits) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8710