mirror of
https://github.com/LIV2/WinUAE.git
synced 2025-12-06 00:12:52 +00:00
Do not reset d3d11 if display size has not changed
This commit is contained in:
parent
5ec143e3c3
commit
12ca839df5
@ -3414,16 +3414,29 @@ static float xD3D_getrefreshrate(int monid)
|
||||
return d3d->vblank;
|
||||
}
|
||||
|
||||
static void xD3D11_initvals(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t_h, int depth, int *freq, int mmulth, int mmultv)
|
||||
static bool xD3D11_initvals(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t_h, int depth, int *freq, int mmulth, int mmultv, bool doalloc)
|
||||
{
|
||||
struct d3d11struct *d3d = &d3d11data[monid];
|
||||
bool changed = false;
|
||||
|
||||
if (d3d->m_screenWidth != w_w || d3d->m_screenHeight != w_h) {
|
||||
changed = true;
|
||||
}
|
||||
if (doalloc && !changed && (d3d->m_bitmapWidth != t_w || d3d->m_bitmapHeight != t_h || d3d->dmultxh != mmulth || d3d->dmultxv != mmultv)) {
|
||||
d3d->m_bitmapWidth = t_w;
|
||||
d3d->m_bitmapHeight = t_h;
|
||||
d3d->dmultxh = mmulth;
|
||||
d3d->dmultxv = mmultv;
|
||||
D3D_alloctexture(monid, t_w, t_h);
|
||||
}
|
||||
d3d->m_bitmapWidth = t_w;
|
||||
d3d->m_bitmapHeight = t_h;
|
||||
d3d->m_screenWidth = w_w;
|
||||
d3d->m_screenHeight = w_h;
|
||||
d3d->dmultxh = mmulth;
|
||||
d3d->dmultxv = mmultv;
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
static int xxD3D11_init2(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t_h, int depth, int *freq, int mmulth, int mmultv)
|
||||
@ -3461,7 +3474,7 @@ static int xxD3D11_init2(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t
|
||||
return 0;
|
||||
}
|
||||
|
||||
xD3D11_initvals(ahwnd, monid, w_w, w_h, t_w, t_h, depth, freq, mmulth, mmultv);
|
||||
xD3D11_initvals(ahwnd, monid, w_w, w_h, t_w, t_h, depth, freq, mmulth, mmultv, false);
|
||||
|
||||
d3d->ahwnd = ahwnd;
|
||||
|
||||
@ -4204,8 +4217,9 @@ static const TCHAR *xD3D11_init(HWND ahwnd, int monid, int w_w, int w_h, int dep
|
||||
return _T("D3D11 INITIALIZATION ERROR");
|
||||
} else {
|
||||
struct d3d11struct *d3d = &d3d11data[monid];
|
||||
xD3D11_initvals(ahwnd, monid, w_w, w_h, w_w, w_h, depth, freq, mmulth, mmultv);
|
||||
d3d->fsresizedo = true;
|
||||
if (xD3D11_initvals(ahwnd, monid, w_w, w_h, w_w, w_h, depth, freq, mmulth, mmultv, true)) {
|
||||
d3d->fsresizedo = true;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user