]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Disable D3D11 16-bit support. It isn't reliable.
authorToni Wilen <twilen@winuae.net>
Sat, 15 Sep 2018 17:13:15 +0000 (20:13 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 15 Sep 2018 17:13:15 +0000 (20:13 +0300)
od-win32/direct3d11.cpp
od-win32/win32gfx.cpp

index 6e0e9f5aeb54624512d24a261233664396e5263a..f2fefeeadc8a75a7249a2c256cd68797ff266292 100644 (file)
@@ -246,7 +246,6 @@ struct d3d11struct
        DXGI_FORMAT texformat;
        DXGI_FORMAT intformat;
        bool m_tearingSupport;
-       int texdepth;
        int dmult, dmultx;
        int xoffset, yoffset;
        float xmult, ymult;
@@ -1915,7 +1914,7 @@ static bool CreateTexture(struct d3d11struct *d3d)
        desc.Height = d3d->m_bitmapHeight;
        desc.MipLevels = 1;
        desc.ArraySize = 1;
-       desc.Format = d3d->scrformat;
+       desc.Format = d3d->texformat;
        desc.SampleDesc.Count = 1;
        desc.SampleDesc.Quality = 0;
        desc.Usage = D3D11_USAGE_STAGING;
@@ -1931,7 +1930,7 @@ static bool CreateTexture(struct d3d11struct *d3d)
        srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
        srvDesc.Texture2D.MostDetailedMip = 0;
        srvDesc.Texture2D.MipLevels = desc.MipLevels;
-       srvDesc.Format = d3d->scrformat;
+       srvDesc.Format = d3d->texformat;
 
        hr = d3d->m_device->CreateShaderResourceView(d3d->texture2d, &srvDesc, &d3d->texture2drv);
        if (FAILED(hr)) {
@@ -3257,7 +3256,7 @@ static int xxD3D11_init2(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t
        d3d->delayedfs = 0;
        d3d->device_errors = 0;
 
-       if (depth != 32 && depth != 16)
+       if (depth != 32)
                return 0;
 
        if (!can_D3D11(false))
@@ -3268,10 +3267,9 @@ static int xxD3D11_init2(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t
        d3d->m_screenWidth = w_w;
        d3d->m_screenHeight = w_h;
        d3d->ahwnd = ahwnd;
-       d3d->texformat = depth == 32 ? DXGI_FORMAT_B8G8R8A8_UNORM : DXGI_FORMAT_B5G6R5_UNORM;
+       d3d->texformat = DXGI_FORMAT_B8G8R8A8_UNORM;
        d3d->intformat = DXGI_FORMAT_B8G8R8A8_UNORM; // _SRGB;
        d3d->scrformat = DXGI_FORMAT_B8G8R8A8_UNORM;
-       d3d->texdepth = depth;
        d3d->dmultx = mmult;
 
        struct MultiDisplay *md = getdisplay(&currprefs, monid);
index 6db2f627f9c76f8ae7efd7c91b5498cb7f10dfd6..8941b9b4032f34c2c1ca37a17f743bd01046b99b 100644 (file)
@@ -1920,6 +1920,14 @@ static void close_hwnds(struct AmigaMonitor *mon)
        }
 }
 
+static bool canmatchdepth(void)
+{
+       if (!currprefs.win32_rtgmatchdepth)
+               return false;
+       if (currprefs.gfx_api >= 2)
+               return false;
+       return true;
+}
 
 static void updatemodes(struct AmigaMonitor *mon)
 {
@@ -1999,7 +2007,7 @@ static void update_gfxparams(struct AmigaMonitor *mon)
 #else
        mon->currentmode.current_depth = currprefs.color_mode < 5 ? 16 : 32;
 #endif
-       if (mon->screen_is_picasso && currprefs.win32_rtgmatchdepth && isfullscreen () > 0) {
+       if (mon->screen_is_picasso && canmatchdepth() && isfullscreen () > 0) {
                int pbits = state->BytesPerPixel * 8;
                if (pbits <= 8) {
                        if (mon->currentmode.current_depth == 32)
@@ -2024,7 +2032,7 @@ static void update_gfxparams(struct AmigaMonitor *mon)
                        if (!mon->scalepicasso && currprefs.win32_rtgscaleaspectratio)
                                mon->scalepicasso = -1;
                } else if (isfullscreen () > 0) {
-                       if (!currprefs.win32_rtgmatchdepth) { // can't scale to different color depth
+                       if (!canmatchdepth()) { // can't scale to different color depth
                                if (mon->currentmode.native_width > state->Width && mon->currentmode.native_height > state->Height) {
                                        if (currprefs.gf[1].gfx_filter_autoscale)
                                                mon->scalepicasso = 1;
@@ -2999,10 +3007,10 @@ static int modeswitchneeded(struct AmigaMonitor *mon, struct winuae_currentmode
        if (isfullscreen () > 0) {
                /* fullscreen to fullscreen */
                if (mon->screen_is_picasso) {
-                       if (state->BytesPerPixel > 1 && state->BytesPerPixel * 8 != wc->current_depth && currprefs.win32_rtgmatchdepth)
+                       if (state->BytesPerPixel > 1 && state->BytesPerPixel * 8 != wc->current_depth && canmatchdepth())
                                return -1;
                        if (state->Width < wc->current_width && state->Height < wc->current_height) {
-                               if ((currprefs.gf[1].gfx_filter_autoscale == 1 || (currprefs.gf[1].gfx_filter_autoscale == 2 && currprefs.win32_rtgallowscaling)) && !currprefs.win32_rtgmatchdepth)
+                               if ((currprefs.gf[1].gfx_filter_autoscale == 1 || (currprefs.gf[1].gfx_filter_autoscale == 2 && currprefs.win32_rtgallowscaling)) && !canmatchdepth())
                                        return 0;
                        }
                        if (state->Width != wc->current_width ||
@@ -3012,7 +3020,7 @@ static int modeswitchneeded(struct AmigaMonitor *mon, struct winuae_currentmode
                                state->Height == wc->current_height) {
                                        if (state->BytesPerPixel * 8 == wc->current_depth || state->BytesPerPixel == 1)
                                                return 0;
-                                       if (!currprefs.win32_rtgmatchdepth)
+                                       if (!canmatchdepth())
                                                return 0;
                        }
                        return 1;