]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
If old and new mode has identical size, check also if render backend surface has...
authorToni Wilen <twilen@winuae.net>
Wed, 11 Oct 2023 17:13:51 +0000 (20:13 +0300)
committerToni Wilen <twilen@winuae.net>
Wed, 11 Oct 2023 17:13:51 +0000 (20:13 +0300)
od-win32/direct3d.cpp
od-win32/direct3d11.cpp
od-win32/gdirender.cpp
od-win32/win32gfx.cpp

index 969f34bb2a90c0f38b2b69b71f86cf322a7e6301..263bcce53e653f82cbecc202488006c14ee8dbbf 100644 (file)
@@ -2438,6 +2438,8 @@ static void invalidatedeviceobjects (struct d3dstruct *d3d)
                d3d->d3dswapchain = NULL;
        }
        d3d->locked = 0;
+       d3d->fulllocked = 0;
+       d3d->fakelock = 0;
        d3d->maskshift.x = d3d->maskshift.y = d3d->maskshift.z = d3d->maskshift.w = 0;
        d3d->maskmult.x = d3d->maskmult.y = d3d->maskmult.z = d3d->maskmult.w = 0;
 }
@@ -3094,6 +3096,10 @@ static bool xD3D_alloctexture (int monid, int w, int h)
 {
        struct d3dstruct *d3d = &d3ddata[monid];
 
+       if (w < 0 || h < 0) {
+               return d3d->texture1 != NULL;
+       }
+
        d3d->tin_w = w * d3d->dmult;
        d3d->tin_h = h * d3d->dmult;
 
@@ -3809,14 +3815,18 @@ static void xD3D_unlocktexture(int monid, int y_start, int y_end)
        struct d3dstruct *d3d = &d3ddata[monid];
        HRESULT hr;
 
-       if (!isd3d(d3d) || !d3d->texture1)
+       if (!isd3d(d3d)) {
                return;
-
+       }
+               
        if (d3d->fakelock) {
                d3d->fakelock--;
                return;
        }
 
+       if (!d3d->texture1)
+               return;
+
        if (d3d->locked) {
                LPDIRECT3DTEXTURE9 tex = d3d->texture1;
                if (d3d->locked == 2) {
index 68aa2be9f80964c4ceb2fdc624961973e36224d2..69692e55f10e0f51929d6b7f091a220026ac9f72 100644 (file)
@@ -5019,6 +5019,10 @@ static bool xD3D11_alloctexture(int monid, int w, int h)
        struct d3d11struct *d3d = &d3d11data[monid];
        bool v;
 
+       if (w < 0 || h < 0) {
+               return d3d->texture2d != NULL;
+       }
+
        recheck(d3d, monid);
 
        if (d3d->invalidmode)
index 0a548e0417bd538cea3676d8f4fa580051e13ec4..c19dea0e59badbe32ab86f665e84ac03b93a7186 100644 (file)
@@ -233,6 +233,10 @@ static bool gdi_alloctexture(int monid, int w, int h)
 {
        struct gdistruct *gdi = &gdidata[monid];
 
+       if (w < 0 || h < 0) { 
+               return gdi->hdc != NULL;
+       }
+
        freetexture(monid);
 
        gdi->hdc = GetDC(gdi->hwnd);
index 9e69592a197b6f052481cc70bded509ff0318a4e..dd9177e4b5d98444e69c71afbad03966af7c090e 100644 (file)
@@ -4139,7 +4139,7 @@ bool target_graphics_buffer_update(int monid)
                h = vb->outheight;
        }
        
-       if (oldtex_w[monid] == w && oldtex_h[monid] == h && oldtex_rtg[monid] == mon->screen_is_picasso)
+       if (oldtex_w[monid] == w && oldtex_h[monid] == h && oldtex_rtg[monid] == mon->screen_is_picasso && D3D_alloctexture(mon->monitor_id, -1, -1))
                return false;
 
        if (!w || !h) {