internal/graphicsdriver/directx: bug fix: do not reset command allocators at Begin

Closes #2249
This commit is contained in:
Hajime Hoshi 2022-08-17 22:37:24 +09:00
parent e9e48919df
commit 9d303e8dc5

View File

@ -694,14 +694,10 @@ func (g *Graphics) resizeSwapChainDesktop(width, height int) error {
// TODO: Reset 0 on Xbox // TODO: Reset 0 on Xbox
g.frameIndex = int(g.swapChain.GetCurrentBackBufferIndex()) g.frameIndex = int(g.swapChain.GetCurrentBackBufferIndex())
if err := g.drawCommandAllocators[g.frameIndex].Reset(); err != nil { // Do not reset the command allocators here (#2249).
return err // The command allocators are reset at flushCommnadList.
}
if err := g.drawCommandList.Reset(g.drawCommandAllocators[g.frameIndex], nil); err != nil {
return err
}
if err := g.copyCommandAllocators[g.frameIndex].Reset(); err != nil { if err := g.drawCommandList.Reset(g.drawCommandAllocators[g.frameIndex], nil); err != nil {
return err return err
} }
if err := g.copyCommandList.Reset(g.copyCommandAllocators[g.frameIndex], nil); err != nil { if err := g.copyCommandList.Reset(g.copyCommandAllocators[g.frameIndex], nil); err != nil {
@ -751,14 +747,10 @@ func (g *Graphics) Begin() error {
} }
g.frameStarted = true g.frameStarted = true
if err := g.drawCommandAllocators[g.frameIndex].Reset(); err != nil { // Do not reset the command allocators here (#2249).
return err // The command allocators are reset at flushCommnadList.
}
if err := g.drawCommandList.Reset(g.drawCommandAllocators[g.frameIndex], nil); err != nil {
return err
}
if err := g.copyCommandAllocators[g.frameIndex].Reset(); err != nil { if err := g.drawCommandList.Reset(g.drawCommandAllocators[g.frameIndex], nil); err != nil {
return err return err
} }
if err := g.copyCommandList.Reset(g.copyCommandAllocators[g.frameIndex], nil); err != nil { if err := g.copyCommandList.Reset(g.copyCommandAllocators[g.frameIndex], nil); err != nil {