VirtualBox

Changeset 79782 in vbox for trunk/src/VBox/Additions/3D/win


Ignore:
Timestamp:
Jul 15, 2019 9:22:26 AM (5 years ago)
Author:
vboxsync
Message:

Additions/3D/win/VBoxGL: check if the surface format is supported.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/3D/win/VBoxGL/GaDrvEnvKMT.cpp

    r78601 r79782  
    386386    }
    387387
     388    VBoxDispMpLoggerLogF("WDDM: EnvKMT: unsupported surface format %d\n", format);
    388389    Assert(0);
    389     VBoxDispMpLoggerLogF("WDDM: EnvKMT: unsupported surface format %d\n", format);
    390390    return D3DDDIFMT_UNKNOWN;
    391391}
     
    405405    uint8_t                          *pu8Req;
    406406    uint32_t                          cbReq;
     407
     408    /* First check if the format is supported. */
     409    D3DDDIFORMAT const ddiFormat = svgaToD3DDDIFormat((SVGA3dSurfaceFormat)pCreateParms->format);
     410    if (ddiFormat == D3DDDIFMT_UNKNOWN)
     411        return -1;
    407412
    408413    /* Size of the SVGA request data */
     
    459464                wddmAllocInfo.SurfDesc.width      = paSizes[0].cWidth;
    460465                wddmAllocInfo.SurfDesc.height     = paSizes[0].cHeight;
    461                 wddmAllocInfo.SurfDesc.format     = svgaToD3DDDIFormat((SVGA3dSurfaceFormat)pCreateParms->format);
     466                wddmAllocInfo.SurfDesc.format     = ddiFormat;
    462467                wddmAllocInfo.SurfDesc.VidPnSourceId = 0;
    463468                wddmAllocInfo.SurfDesc.bpp        = vboxWddmCalcBitsPerPixel(wddmAllocInfo.SurfDesc.format);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette