internal/graphicsdriver/directx: bug fix: ResizeBuffers failed without the flag

Closes #2193
This commit is contained in:
Hajime Hoshi 2022-07-10 19:55:24 +09:00
parent 4afabe34ae
commit a22125a075

View File

@ -661,7 +661,11 @@ func (g *Graphics) resizeSwapChainDesktop(width, height int) error {
r.Release()
}
if err := g.swapChain.ResizeBuffers(frameCount, uint32(width), uint32(height), _DXGI_FORMAT_B8G8R8A8_UNORM, 0); err != nil {
var flag uint32
if g.allowTearing {
flag |= uint32(_DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING)
}
if err := g.swapChain.ResizeBuffers(frameCount, uint32(width), uint32(height), _DXGI_FORMAT_B8G8R8A8_UNORM, flag); err != nil {
return err
}