internal/graphicsdriver/directx: dispose a screen image explicitly

A screen image in DirectX 12 should not include any buffers to release
so there is not a bug, but disposing it explicitly when resizing the
window should be polite.
This commit is contained in:
Hajime Hoshi 2023-03-29 00:42:01 +09:00
parent 3c72ff0a65
commit c22957f678

View File

@ -994,6 +994,11 @@ func (g *graphics12) NewImage(width, height int) (graphicsdriver.Image, error) {
} }
func (g *graphics12) NewScreenFramebufferImage(width, height int) (graphicsdriver.Image, error) { func (g *graphics12) NewScreenFramebufferImage(width, height int) (graphicsdriver.Image, error) {
if g.screenImage != nil {
g.screenImage.Dispose()
g.screenImage = nil
}
if err := g.updateSwapChain(width, height); err != nil { if err := g.updateSwapChain(width, height); err != nil {
return nil, err return nil, err
} }