VirtualBox

Changeset 84259 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 11, 2020 4:14:27 PM (5 years ago)
Author:
vboxsync
Message:

DevVGA-SVGA3d-win.cpp: VC++ 14.1 warnings. bugref:8489

File:
1 edited

Legend:

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

    r84136 r84259  
    26792679                LogFunc(("Remove all dependencies for surface sid=%u\n", sid));
    26802680
    2681                 uint32_t            surfaceFlags = pSurface->surfaceFlags;
    2682                 SVGA3dSurfaceFormat format = pSurface->format;
    2683                 SVGA3dSurfaceFace   face[SVGA3D_MAX_SURFACE_FACES];
    2684                 uint32_t            multisampleCount = pSurface->multiSampleCount;
    2685                 SVGA3dTextureFilter autogenFilter = pSurface->autogenFilter;
    2686                 SVGA3dSize         *pMipLevelSize;
    2687                 uint32_t            cFaces = pSurface->cFaces;
    2688 
    2689                 pMipLevelSize = (SVGA3dSize *)RTMemAllocZ(pSurface->faces[0].numMipLevels * pSurface->cFaces * sizeof(SVGA3dSize));
     2681                uint32_t const              surfaceFlags     = pSurface->surfaceFlags;
     2682                SVGA3dSurfaceFormat const   format           = pSurface->format;
     2683                uint32_t const              multisampleCount = pSurface->multiSampleCount;
     2684                SVGA3dTextureFilter const   autogenFilter    = pSurface->autogenFilter;
     2685                uint32_t const              cFaces           = pSurface->cFaces;
     2686                uint32_t const              cMipLevels       = pSurface->faces[0].numMipLevels;
     2687
     2688                SVGA3dSize *pMipLevelSize = (SVGA3dSize *)RTMemAllocZ(cMipLevels * cFaces * sizeof(SVGA3dSize));
    26902689                AssertReturn(pMipLevelSize, VERR_NO_MEMORY);
    26912690
    2692                 for (uint32_t face=0; face < pSurface->cFaces; face++)
     2691                for (uint32_t face = 0; face < pSurface->cFaces; face++)
    26932692                {
    2694                     for (uint32_t i = 0; i < pSurface->faces[0].numMipLevels; i++)
     2693                    for (uint32_t i = 0; i < cMipLevels; i++)
    26952694                    {
    2696                         uint32_t idx = i + face * pSurface->faces[0].numMipLevels;
     2695                        uint32_t idx = i + face * cMipLevels;
    26972696                        memcpy(&pMipLevelSize[idx], &pSurface->paMipmapLevels[idx].mipmapSize, sizeof(SVGA3dSize));
    26982697                    }
    26992698                }
    2700                 memcpy(face, pSurface->faces, sizeof(pSurface->faces));
     2699
     2700                SVGA3dSurfaceFace aFaces[SVGA3D_MAX_SURFACE_FACES];
     2701                AssertCompile(sizeof(aFaces) == sizeof(pSurface->faces));
     2702                memcpy(aFaces, pSurface->faces, sizeof(pSurface->faces));
    27012703
    27022704                /* Recreate the surface with the original settings; destroys the contents, but that seems fairly safe since the context is also destroyed. */
     
    27092711                AssertRC(rc);
    27102712
    2711                 rc = vmsvga3dSurfaceDefine(pThisCC, sid, surfaceFlags, format, face, multisampleCount, autogenFilter,
    2712                                            face[0].numMipLevels * cFaces, pMipLevelSize);
     2713                rc = vmsvga3dSurfaceDefine(pThisCC, sid, surfaceFlags, format, aFaces, multisampleCount, autogenFilter,
     2714                                           cMipLevels * cFaces, pMipLevelSize);
    27132715                AssertRC(rc);
    27142716
     
    39853987            {
    39863988                LogFunc(("Creating stencil surface as texture!\n"));
    3987                 int rc = vmsvga3dBackCreateTexture(pState, pContext, cid, pRenderTarget);
    3988                 AssertRC(rc);   /* non-fatal, will use CreateDepthStencilSurface */
     3989                int rc2 = vmsvga3dBackCreateTexture(pState, pContext, cid, pRenderTarget);
     3990                AssertRC(rc2);   /* non-fatal, will use CreateDepthStencilSurface */
    39893991            }
    39903992
     
    40994101            {
    41004102                LogFunc(("Create texture to be used as render target; sid=%u type=%d format=%d -> create texture\n", target.sid, pRenderTarget->surfaceFlags, pRenderTarget->format));
    4101                 int rc = vmsvga3dBackCreateTexture(pState, pContext, cid, pRenderTarget);
     4103                rc = vmsvga3dBackCreateTexture(pState, pContext, cid, pRenderTarget);
    41024104                AssertRCReturn(rc, rc);
    41034105            }
     
    51895191    {
    51905192        /* Create and set the vertex declaration. */
    5191         IDirect3DVertexDeclaration9 *pVertexDecl;
    5192         hr = pContext->pDevice->CreateVertexDeclaration(&aVertexElements[0], &pVertexDecl);
     5193        IDirect3DVertexDeclaration9 *pVertexDecl0;
     5194        hr = pContext->pDevice->CreateVertexDeclaration(&aVertexElements[0], &pVertexDecl0);
    51935195        AssertMsgReturn(hr == D3D_OK, ("CreateVertexDeclaration failed with %x\n", hr), VERR_INTERNAL_ERROR);
    51945196
    5195         hr = pContext->pDevice->SetVertexDeclaration(pVertexDecl);
     5197        hr = pContext->pDevice->SetVertexDeclaration(pVertexDecl0);
    51965198        AssertMsgReturnStmt(hr == D3D_OK, ("SetVertexDeclaration failed with %x\n", hr),
    5197                             D3D_RELEASE(pVertexDecl),
     5199                            D3D_RELEASE(pVertexDecl0),
    51985200                            VERR_INTERNAL_ERROR);
    51995201
     
    52025204
    52035205        /* Remember the new vertext declaration. */
    5204         pContext->d3dState.pVertexDecl = pVertexDecl;
     5206        pContext->d3dState.pVertexDecl = pVertexDecl0;
    52055207        pContext->d3dState.cVertexElements = numVertexDecls + 1;
    52065208        memcpy(pContext->d3dState.aVertexElements,
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