mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/graphicsdriver/directx: refactoring
This commit is contained in:
parent
e796646abd
commit
35e9f26681
@ -179,7 +179,6 @@ func (q *commandQueue) flush(graphicsDriver graphicsdriver.Graphics, endFrame bo
|
||||
if err := graphicsDriver.Begin(); err != nil {
|
||||
return err
|
||||
}
|
||||
var screenRendered bool
|
||||
cs := q.commands
|
||||
for len(cs) > 0 {
|
||||
nv := 0
|
||||
@ -195,9 +194,6 @@ func (q *commandQueue) flush(graphicsDriver graphicsdriver.Graphics, endFrame bo
|
||||
}
|
||||
nv += dtc.numVertices()
|
||||
ne += dtc.numIndices()
|
||||
if dtc.dst.screen {
|
||||
screenRendered = true
|
||||
}
|
||||
}
|
||||
nc++
|
||||
}
|
||||
@ -223,8 +219,7 @@ func (q *commandQueue) flush(graphicsDriver graphicsdriver.Graphics, endFrame bo
|
||||
}
|
||||
cs = cs[nc:]
|
||||
}
|
||||
// TODO: Without checking screenRendered, the tests fail on Windows. Investigate this issue.
|
||||
if err := graphicsDriver.End(endFrame && screenRendered); err != nil {
|
||||
if err := graphicsDriver.End(endFrame); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -774,7 +774,8 @@ func (g *Graphics) End(present bool) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if present {
|
||||
// screenImage can be nil in tests.
|
||||
if present && g.screenImage != nil {
|
||||
if rb, ok := g.screenImage.transiteState(_D3D12_RESOURCE_STATE_PRESENT); ok {
|
||||
g.drawCommandList.ResourceBarrier([]_D3D12_RESOURCE_BARRIER_Transition{rb})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user