mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/graphicsdriver/directx: bug fix: need to reset command allocators
Closes #2202
This commit is contained in:
parent
b3267a7126
commit
479483b76d
@ -676,9 +676,16 @@ func (g *Graphics) resizeSwapChainDesktop(width, height int) error {
|
||||
// TODO: Reset 0 on Xbox
|
||||
g.frameIndex = int(g.swapChain.GetCurrentBackBufferIndex())
|
||||
|
||||
if err := g.drawCommandAllocators[g.frameIndex].Reset(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := g.drawCommandList.Reset(g.drawCommandAllocators[g.frameIndex], nil); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := g.copyCommandAllocators[g.frameIndex].Reset(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := g.copyCommandList.Reset(g.copyCommandAllocators[g.frameIndex], nil); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -726,10 +733,16 @@ func (g *Graphics) Begin() error {
|
||||
}
|
||||
g.frameStarted = true
|
||||
|
||||
if err := g.drawCommandAllocators[g.frameIndex].Reset(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := g.drawCommandList.Reset(g.drawCommandAllocators[g.frameIndex], nil); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := g.copyCommandAllocators[g.frameIndex].Reset(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := g.copyCommandList.Reset(g.copyCommandAllocators[g.frameIndex], nil); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -915,10 +928,16 @@ func (g *Graphics) flushCommandList(commandList *_ID3D12GraphicsCommandList) err
|
||||
|
||||
switch commandList {
|
||||
case g.drawCommandList:
|
||||
if err := g.drawCommandAllocators[g.frameIndex].Reset(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := commandList.Reset(g.drawCommandAllocators[g.frameIndex], nil); err != nil {
|
||||
return err
|
||||
}
|
||||
case g.copyCommandList:
|
||||
if err := g.copyCommandAllocators[g.frameIndex].Reset(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := commandList.Reset(g.copyCommandAllocators[g.frameIndex], nil); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user