internal/graphicsdriver/directx: initialize the refresh rate explicitly for Windows 7

This is an experimental fix inspired by Chromium/ANGLE
https://source.chromium.org/chromium/chromium/src/+/main:third_party/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp;l=491-492;drc=79aa846e38739138918891e8b334fac464dd9b83

Updates #2613
This commit is contained in:
Hajime Hoshi 2023-03-30 22:22:24 +09:00
parent 09250ff4f3
commit a4bfe8a869

View File

@ -278,6 +278,8 @@ func (g *graphicsInfra) initSwapChain(width, height int, device unsafe.Pointer,
if !isWindows10OrGreaterWin32() {
desc.SwapEffect = _DXGI_SWAP_EFFECT_SEQUENTIAL
desc.BufferCount = 1
desc.BufferDesc.RefreshRate.Numerator = 0
desc.BufferDesc.RefreshRate.Denominator = 1
}
g.bufferCount = int(desc.BufferCount)