]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Do not use texture allocation for mode change checks. Update also RTG mode when D3D11...
authorToni Wilen <twilen@winuae.net>
Wed, 9 May 2018 16:13:22 +0000 (19:13 +0300)
committerToni Wilen <twilen@winuae.net>
Wed, 9 May 2018 16:13:22 +0000 (19:13 +0300)
gfxboard.cpp
od-win32/direct3d.cpp
od-win32/direct3d.h
od-win32/direct3d11.cpp
od-win32/win32.cpp
od-win32/win32_scaler.cpp

index a94c3a17fe1c44826d1c6dabca01c94c6bef7336..e73e5b6cca325832516c61ae7300672e81f877cf 100644 (file)
@@ -852,16 +852,24 @@ uint8_t *surface_data(DisplaySurface *s)
 
 void gfxboard_refresh(int monid)
 {
-       if (monid > 0) {
+       if (monid >= 0) {
                for (int i = 0; i < MAX_RTG_BOARDS; i++) {
-                       struct rtggfxboard *gb = &rtggfxboards[i];
-                       if (gb->monitor_id == monid) {
-                               gb->fullrefresh = 2;
+                       struct rtgboardconfig *rbc = &currprefs.rtgboards[i];
+                       if (rbc->monitor_id == monid && rbc->rtgmem_size) {
+                               if (rbc->rtgmem_type >= GFXBOARD_HARDWARE) {
+                                       struct rtggfxboard *gb = &rtggfxboards[i];
+                                       gb->fullrefresh = 2;
+                               } else {
+                                       picasso_refresh(monid);
+                               }
                        }
                }
        } else {
-               if (rtg_visible[monid] >= 0) {
-                       rtggfxboards[rtg_visible[monid]].fullrefresh = 2;
+               for (int i = 0; i < MAX_RTG_BOARDS; i++) {
+                       struct rtgboardconfig *rbc = &currprefs.rtgboards[i];
+                       if (rbc->rtgmem_size) {
+                               gfxboard_refresh(rbc->monitor_id);
+                       }
                }
        }
 }
index 632b05e6bfce3de55bd34ef0b754869c16a8152e..83b57ee87935630cc8fc7e7b2fc33acd4fc7f5b4 100644 (file)
@@ -3235,10 +3235,11 @@ static void D3D_showframe2 (struct d3dstruct *d3d, bool dowait)
        }
 }
 
-static void xD3D_restore(int monid)
+static void xD3D_restore(int monid, bool checkonly)
 {
        struct d3dstruct *d3d = &d3ddata[monid];
-
+       if (checkonly)
+               return;
        d3d->renderdisabled = false;
 }
 
index b71f54378e8458ef4b16e6b6bf38cf3595a6308e..eb6796d1794b34a384846074e36e4e4a8ec6e6a9 100644 (file)
@@ -18,7 +18,7 @@ extern int(*D3D_goodenough)(void);
 extern bool(*D3D_setcursor)(int, int x, int y, int width, int height, bool visible, bool noscale);
 extern uae_u8* (*D3D_setcursorsurface)(int, int *pitch);
 extern float(*D3D_getrefreshrate)(int);
-extern void(*D3D_restore)(int);
+extern void(*D3D_restore)(int, bool);
 extern void(*D3D_resize)(int, int);
 extern void(*D3D_change)(int, int);
 extern bool(*D3D_getscalerect)(int, float *mx, float *my, float *sx, float *sy);
index 6061cc0280a24f91cb1cf88110e3d70a1de376fa..7422edda0406acb184487a43ec9b5a56462e595e 100644 (file)
@@ -25,6 +25,7 @@ using Microsoft::WRL::ComPtr;
 #include "statusline.h"
 #include "hq2x_d3d.h"
 #include "gui.h"
+#include "gfxboard.h"
 
 #include "d3dx.h"
 
@@ -57,7 +58,7 @@ int (*D3D_goodenough)(void);
 bool (*D3D_setcursor)(int, int x, int y, int width, int height, bool visible, bool noscale);
 uae_u8* (*D3D_setcursorsurface)(int, int *pitch);
 float (*D3D_getrefreshrate)(int);
-void(*D3D_restore)(int);
+void(*D3D_restore)(int, bool);
 void(*D3D_resize)(int, int);
 void (*D3D_change)(int, int);
 bool(*D3D_getscalerect)(int, float *mx, float *my, float *sx, float *sy);
@@ -4503,6 +4504,7 @@ static void D3D11_resize_do(struct d3d11struct *d3d)
 
        resizemode(d3d);
        notice_screen_contents_lost(d3d - d3d11data);
+       gfxboard_refresh(d3d - d3d11data);
 
        write_log(_T("D3D11 resize exit\n"));
 }
@@ -4621,8 +4623,10 @@ static void xD3D11_flushtexture(int monid, int miny, int maxy)
        struct d3d11struct *d3d = &d3d11data[monid];
 }
 
-static void xD3D11_restore(int monid)
+static void xD3D11_restore(int monid, bool checkonly)
 {
+       struct d3d11struct *d3d = &d3d11data[monid];
+       recheck(d3d);
 }
 
 static void xD3D11_vblank_reset(double freq)
@@ -4718,6 +4722,7 @@ static void xD3D11_guimode(int monid, int guion)
        } else if (guion == 0) {
                d3d->delayedfs = 1;
                notice_screen_contents_lost(monid);
+               gfxboard_refresh(monid);
        }
        write_log(_T("fs guimode end\n"));
 }
index ce28632c9004c38a96706ddd6c84a7d308560026..eb0ba3c5e95d5215c47c93e3b612e3eb4e268e9a 100644 (file)
@@ -1835,7 +1835,7 @@ static LRESULT CALLBACK AmigaWindowProc(HWND hWnd, UINT message, WPARAM wParam,
                        ignorelbutton = true;
                break;
        case WM_ACTIVATEAPP:
-               D3D_restore(0);
+               D3D_restore(0, false);
                //write_log(_T("WM_ACTIVATEAPP %08x\n"), wParam);
                if (!wParam && isfullscreen() > 0 && D3D_resize && !gui_active) {
                        write_log(_T("WM_ACTIVATEAPP inactive %p\n"), hWnd);
index ab75a72cf6c02b64a7e4ba65046496bfc51b11b3..8862f3191fadb242d90dac0d7619d721d331a02a 100644 (file)
@@ -997,6 +997,8 @@ void S2X_render(int monid, int y_start, int y_end)
        bufmem_ptr = sptr;
 
        if (d3d) {
+               if (D3D_restore)
+                       D3D_restore(monid, true);
                surfstart = D3D_locktexture(monid, &pitch, &surf_height, true);
                if (surfstart == NULL)
                        return;