internal/graphicsdriver/directx: bug fix: a wrong fence value was passed to SetEventOnCompletion

This commit is contained in:
Hajime Hoshi 2022-07-10 22:24:39 +09:00
parent a22125a075
commit 4c121ae5eb

View File

@ -836,7 +836,7 @@ func (g *Graphics) moveToNextFrame() error {
} }
if g.fence.GetCompletedValue() < g.fenceValues[g.frameIndex] { if g.fence.GetCompletedValue() < g.fenceValues[g.frameIndex] {
if err := g.fence.SetEventOnCompletion(fv, g.fenceWaitEvent); err != nil { if err := g.fence.SetEventOnCompletion(g.fenceValues[g.frameIndex], g.fenceWaitEvent); err != nil {
return err return err
} }
if _, err := windows.WaitForSingleObject(g.fenceWaitEvent, windows.INFINITE); err != nil { if _, err := windows.WaitForSingleObject(g.fenceWaitEvent, windows.INFINITE); err != nil {