mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
app/internal/d3d11: don't track the Backend for a Device
A previous commit removed the assumption that the output framebuffer is constant across frames. Thus it is no longer necessary to track and update a backend's current framebuffer when the window is resized. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -185,6 +185,10 @@ func (d *Device) CreateSwapChain(hwnd windows.Handle) (*SwapChain, error) {
|
||||
return &SwapChain{swchain: d3dswchain, fbo: &Framebuffer{}}, nil
|
||||
}
|
||||
|
||||
func (d *Device) BindFramebuffer(fbo *Framebuffer) {
|
||||
d.ctx.OMSetRenderTargets(fbo.renderTarget, fbo.depthView)
|
||||
}
|
||||
|
||||
func (s *SwapChain) Framebuffer(d *Device) (*Framebuffer, error) {
|
||||
if s.fbo.renderTarget != nil {
|
||||
return s.fbo, nil
|
||||
@@ -816,7 +820,7 @@ func (f *Framebuffer) ReadPixels(src image.Rectangle, pixels []byte) error {
|
||||
|
||||
func (b *Backend) BindFramebuffer(fbo backend.Framebuffer) {
|
||||
b.fbo = fbo.(*Framebuffer)
|
||||
b.dev.ctx.OMSetRenderTargets(b.fbo.renderTarget, b.fbo.depthView)
|
||||
b.dev.BindFramebuffer(b.fbo)
|
||||
}
|
||||
|
||||
func (f *Framebuffer) Invalidate() {
|
||||
|
||||
Reference in New Issue
Block a user