VirtualBox

Changeset 83596 in vbox for trunk/src


Ignore:
Timestamp:
Apr 6, 2020 10:53:11 PM (5 years ago)
Author:
vboxsync
Message:

Devices/Graphics: check the resource type

File:
1 edited

Legend:

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

    r83579 r83596  
    25282528        AssertRCReturn(rc, rc);
    25292529    }
    2530     else
    2531     {
    2532         hr = pSurface->u.pTexture->SetAutoGenFilterType((D3DTEXTUREFILTERTYPE)filter);
    2533         AssertMsg(hr == D3D_OK, ("SetAutoGenFilterType failed with %x\n", hr));
    2534     }
     2530
     2531    AssertReturn(   pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_TEXTURE
     2532                 || pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_CUBE_TEXTURE
     2533                 || pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_VOLUME_TEXTURE,
     2534                 VERR_INVALID_PARAMETER);
     2535
     2536    hr = pSurface->u.pTexture->SetAutoGenFilterType((D3DTEXTUREFILTERTYPE)filter);
     2537    AssertMsg(hr == D3D_OK, ("SetAutoGenFilterType failed with %x\n", hr));
    25352538
    25362539    /* Generate the mip maps. */
     
    49154918    {
    49164919        /* The buffer object is not an vertex one. Recreate the D3D resource. */
    4917         Assert(pVertexSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_INDEX_BUFFER);
     4920        AssertReturn(pVertexSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_INDEX_BUFFER, VERR_INVALID_PARAMETER);
    49184921        D3D_RELEASE(pVertexSurface->u.pIndexBuffer);
    49194922        pVertexSurface->enmD3DResType = VMSVGA3D_D3DRESTYPE_NONE;
     
    49704973    {
    49714974        /* The buffer object is not an index one. Must recreate the D3D resource. */
    4972         Assert(pIndexSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_VERTEX_BUFFER);
     4975        AssertReturn(pIndexSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_VERTEX_BUFFER, VERR_INVALID_PARAMETER);
    49734976        D3D_RELEASE(pIndexSurface->u.pVertexBuffer);
    49744977        pIndexSurface->enmD3DResType = VMSVGA3D_D3DRESTYPE_NONE;
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