VirtualBox

Changeset 95034 in vbox


Ignore:
Timestamp:
May 17, 2022 5:21:47 PM (3 years ago)
Author:
vboxsync
Message:

Devices/Graphics: minor fixes: bugref:9830

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win-dx.cpp

    r95032 r95034  
    20932093}
    20942094
     2095
     2096static DXGI_FORMAT dxGetDxgiTypelessFormat(DXGI_FORMAT dxgiFormat)
     2097{
     2098    switch (dxgiFormat)
     2099    {
     2100        case DXGI_FORMAT_B8G8R8A8_UNORM:
     2101        case DXGI_FORMAT_B8G8R8X8_UNORM :
     2102        case DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM:
     2103        case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
     2104        case DXGI_FORMAT_B8G8R8X8_TYPELESS:
     2105        case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
     2106            return DXGI_FORMAT_B8G8R8A8_TYPELESS;
     2107        /** @todo Other _TYPELESS formats. */
     2108        default:
     2109            break;
     2110    }
     2111
     2112    return dxgiFormat;
     2113}
     2114
     2115
    20952116static int vmsvga3dBackSurfaceCreateTexture(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, PVMSVGA3DSURFACE pSurface)
    20962117{
     
    21152136    AssertRCReturn(rc, rc);
    21162137
    2117     uint32_t const cWidth = pSurface->paMipmapLevels[0].mipmapSize.width;
    2118     uint32_t const cHeight = pSurface->paMipmapLevels[0].mipmapSize.height;
     2138    uint32_t const cWidth = pSurface->paMipmapLevels[0].cBlocksX * pSurface->cxBlock;
     2139    uint32_t const cHeight = pSurface->paMipmapLevels[0].cBlocksY * pSurface->cyBlock;
    21192140    uint32_t const cDepth = pSurface->paMipmapLevels[0].mipmapSize.depth;
    21202141    uint32_t const numMipLevels = pSurface->cLevels;
     
    21222143    DXGI_FORMAT dxgiFormat = vmsvgaDXSurfaceFormat2Dxgi(pSurface->format);
    21232144    AssertReturn(dxgiFormat != DXGI_FORMAT_UNKNOWN, E_FAIL);
     2145
     2146    dxgiFormat = dxGetDxgiTypelessFormat(dxgiFormat);
    21242147
    21252148    /*
     
    26882711            bd.Usage = D3D11_USAGE_DYNAMIC;
    26892712        else if (pSurface->f.surfaceFlags & SVGA3D_SURFACE_HINT_STATIC)
    2690             bd.Usage = D3D11_USAGE_IMMUTABLE;
     2713            bd.Usage = pInitialData ? D3D11_USAGE_IMMUTABLE : D3D11_USAGE_DEFAULT; /* Guest will update later. */
    26912714        else if (pSurface->f.surfaceFlags & SVGA3D_SURFACE_HINT_INDIRECT_UPDATE)
    26922715            bd.Usage = D3D11_USAGE_DEFAULT;
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