VirtualBox

Changeset 62933 in vbox for trunk/src/VBox/Devices/Graphics


Ignore:
Timestamp:
Aug 3, 2016 5:01:03 PM (8 years ago)
Author:
vboxsync
Message:

Devices: warnings

Location:
trunk/src/VBox/Devices/Graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h

    r62932 r62933  
    864864
    865865#ifdef VMSVGA3D_OPENGL
    866     float                   fGLVersion;
     866    float                   rsGLVersion;
    867867    /* Current active context. */
    868868    uint32_t                idActiveContext;
     
    951951    R3PTRTYPE(char *)       pszOtherExtensions;
    952952    /** The version of the other GL profile. */
    953     float                   fOtherGLVersion;
     953    float                   rsOtherGLVersion;
    954954
    955955    /** Shader talk back interface. */
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp

    r62514 r62933  
    174174 * @param   pState              The VMSVGA3d state.
    175175 * @param   fActualGLVersion    The actual OpenGL version we're working against.
    176  * @param   fMinGLVersion       The OpenGL version that introduced this feature
     176 * @param   rsMinGLVersion      The OpenGL version that introduced this feature
    177177 *                              into the core.
    178178 * @param   pszWantedExtension  The name of the OpenGL extension we want padded
     
    180180 * @remarks Init time only.
    181181 */
    182 static bool vmsvga3dCheckGLExtension(PVMSVGA3DSTATE pState, float fMinGLVersion, const char *pszWantedExtension)
    183 {
     182static bool vmsvga3dCheckGLExtension(PVMSVGA3DSTATE pState, float rsMinGLVersion, const char *pszWantedExtension)
     183{
     184    RT_NOREF(rsMinGLVersion);
    184185    /* check padding. */
    185186    Assert(pszWantedExtension[0] == ' ');
     
    192193        fRet = true;
    193194
    194     /* Temporarily.  Later start if (fMinGLVersion != 0.0 && fActualGLVersion >= fMinGLVersion) return true; */
     195    /* Temporarily.  Later start if (rsMinGLVersion != 0.0 && fActualGLVersion >= rsMinGLVersion) return true; */
    195196#ifdef RT_OS_DARWIN
    196     AssertMsg(   fMinGLVersion == 0.0
    197               || fRet == (pState->fGLVersion >= fMinGLVersion)
     197    AssertMsg(   rsMinGLVersion == 0.0
     198              || fRet == (pState->rsGLVersion >= rsMinGLVersion)
    198199              || VBOX_VMSVGA3D_DEFAULT_OGL_PROFILE == 2.1,
    199200              ("%s actual:%d min:%d fRet=%d\n",
    200                pszWantedExtension, (int)(pState->fGLVersion * 10), (int)(fMinGLVersion * 10), fRet));
     201               pszWantedExtension, (int)(pState->rsGLVersion * 10), (int)(rsMinGLVersion * 10), fRet));
    201202#else
    202     AssertMsg(fMinGLVersion == 0.0 || fRet == (pState->fGLVersion >= fMinGLVersion),
     203    AssertMsg(rsMinGLVersion == 0.0 || fRet == (pState->rsGLVersion >= rsMinGLVersion),
    203204              ("%s actual:%d min:%d fRet=%d\n",
    204                pszWantedExtension, (int)(pState->fGLVersion * 10), (int)(fMinGLVersion * 10), fRet));
     205               pszWantedExtension, (int)(pState->rsGLVersion * 10), (int)(rsMinGLVersion * 10), fRet));
    205206#endif
    206207    return fRet;
     
    484485        while (*pszExt)
    485486        {
     487# ifdef VBOX_STRICT
    486488            size_t cchExt = strlen(pszExt);
    487489            Assert(cchExt > 3);
     
    490492            Assert(pszExt[cchExt - 2] != ' ');
    491493            Assert(pszExt[cchExt - 1] == ' ');
     494# endif
    492495
    493496            if (strstr(*ppszExtensions, pszExt) == NULL)
     
    633636    int              rc;
    634637
    635     if (pState->fGLVersion != 0.0)
     638    if (pState->rsGLVersion != 0.0)
    636639        return VINF_SUCCESS;    /* already initialized (load state) */
    637640
     
    656659    vmsvga3dLogRelExtensions("", pState->pszExtensions);
    657660
    658     pState->fGLVersion = atof((const char *)glGetString(GL_VERSION));
     661    pState->rsGLVersion = atof((const char *)glGetString(GL_VERSION));
    659662
    660663
     
    682685    vmsvga3dLogRelExtensions("Alternative ", pState->pszOtherExtensions);
    683686
    684     pState->fOtherGLVersion = atof((const char *)glGetString(GL_VERSION));
     687    pState->rsOtherGLVersion = atof((const char *)glGetString(GL_VERSION));
    685688
    686689    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
    687690#else
    688691    pState->pszOtherExtensions = (char *)"";
    689     pState->fOtherGLVersion = pState->fGLVersion;
     692    pState->rsOtherGLVersion = pState->rsGLVersion;
    690693#endif
    691694
     
    978981#endif
    979982
    980     if (   pState->fGLVersion < 3.0
    981         && pState->fOtherGLVersion < 3.0 /* darwin: legacy profile hack */)
     983    if (   pState->rsGLVersion < 3.0
     984        && pState->rsOtherGLVersion < 3.0 /* darwin: legacy profile hack */)
    982985    {
    983986        LogRel(("VMSVGA3d: unsupported OpenGL version; minimum is 3.0\n"));
     
    10951098    }
    10961099#else
    1097     NOREF(pThis); NOREF(idScreen);
     1100    RT_NOREF(pThis, idScreen, pOldViewport);
    10981101#endif
    10991102}
     
    11051108 *
    11061109 * @returns Supported/indented operations (SVGA3DFORMAT_OP_XXX).
    1107  * @param   pState3D        The 3D state.
    11081110 * @param   idx3dCaps       The SVGA3D_CAPS_XXX value of the surface format.
    11091111 *
     
    11121114 *              http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/svga/svga_format.c
    11131115 */
    1114 static uint32_t vmsvga3dGetSurfaceFormatSupport(PVMSVGA3DSTATE pState3D, uint32_t idx3dCaps)
     1116static uint32_t vmsvga3dGetSurfaceFormatSupport(uint32_t idx3dCaps)
    11151117{
    11161118    uint32_t result = 0;
     
    12181220static uint32_t vmsvga3dGetDepthFormatSupport(PVMSVGA3DSTATE pState3D, uint32_t idx3dCaps)
    12191221{
    1220     uint32_t result = 0;
     1222    RT_NOREF(pState3D, idx3dCaps);
    12211223
    12221224    /** @todo test this somehow */
    1223     result = SVGA3DFORMAT_OP_ZSTENCIL | SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH;
     1225    uint32_t result = SVGA3DFORMAT_OP_ZSTENCIL | SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH;
    12241226
    12251227    Log(("CAPS: %s =\n%s\n", vmsvga3dGetCapString(idx3dCaps), vmsvga3dGet3dFormatString(result)));
     
    14471449    case SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT:
    14481450    case SVGA3D_DEVCAP_SURFACEFMT_DXT1:
    1449         *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps);
     1451        *pu32Val = vmsvga3dGetSurfaceFormatSupport(idx3dCaps);
    14501452        break;
    14511453
     
    14751477    case SVGA3D_DEVCAP_SURFACEFMT_NV12:
    14761478    case SVGA3D_DEVCAP_SURFACEFMT_AYUV:
    1477         *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps);
     1479        *pu32Val = vmsvga3dGetSurfaceFormatSupport(idx3dCaps);
    14781480        break;
    14791481
     
    19281930                                PVMSVGAPACKPARAMS pSave)
    19291931{
     1932    RT_NOREF(pState);
     1933
    19301934    /*
    19311935     * Save (ignore errors, setting the defaults we want and avoids restore).
     
    20032007                                    PCVMSVGAPACKPARAMS pSave)
    20042008{
    2005     NOREF(pSurface);
     2009    RT_NOREF(pState, pSurface);
     2010
    20062011    if (pSave->iAlignment != 1)
    20072012        VMSVGA3D_ASSERT_GL_CALL(glPixelStorei(GL_UNPACK_ALIGNMENT, pSave->iAlignment), pState, pContext);
     
    20382043                              PVMSVGA3DSURFACE pSurface)
    20392044{
     2045    RT_NOREF(idAssociatedContext);
    20402046    GLint activeTexture = 0;
    20412047    uint32_t idPrevCtx = pState->idActiveContext;
     
    21272133                                  SVGA3dStretchBltMode enmMode, PVMSVGA3DCONTEXT pContext)
    21282134{
     2135    RT_NOREF(pThis);
     2136
    21292137    /* Activate the read and draw framebuffer objects. */
    21302138    pState->ext.glBindFramebuffer(GL_READ_FRAMEBUFFER, pContext->idReadFramebuffer);
     
    21922200                              PVMSVGAPACKPARAMS pSave)
    21932201{
     2202    RT_NOREF(pState);
    21942203    /*
    21952204     * Save (ignore errors, setting the defaults we want and avoids restore).
     
    22672276                                  PCVMSVGAPACKPARAMS pSave)
    22682277{
    2269     NOREF(pSurface);
     2278    RT_NOREF(pState, pSurface);
    22702279    if (pSave->iAlignment != 1)
    22712280        VMSVGA3D_ASSERT_GL_CALL(glPixelStorei(GL_PACK_ALIGNMENT, pSave->iAlignment), pState, pContext);
     
    23092318                                  SVGA3dCopyBox const *pBox, PVMSVGA3DCONTEXT pContext, int rc, int iBox)
    23102319{
     2320    RT_NOREF(iBox);
    23112321    PVMSVGA3DMIPMAPLEVEL pMipLevel = &pSurface->pMipmapLevels[uHostMipmap];
    23122322
     
    26492659    PVMSVGA3DSTATE      pState = pThis->svga.p3dState;
    26502660    PVMSVGA3DSURFACE    pSurface;
    2651     int                 rc = VINF_SUCCESS;
    26522661    PVMSVGA3DCONTEXT    pContext;
    26532662    uint32_t            cid;
     
    31253134     */
    31263135#ifdef RT_OS_WINDOWS
    3127     BOOL ret = SwapBuffers(pContext->hdc);
    3128     AssertMsg(ret, ("SwapBuffers failed with %d\n", GetLastError()));
     3136    BOOL fRef = SwapBuffers(pContext->hdc);
     3137    AssertMsg(fRef, ("SwapBuffers failed with %d\n", GetLastError())); NOREF(fRef);
    31293138#elif defined(RT_OS_DARWIN)
    31303139    vmsvga3dCocoaSwapBuffers(pContext->cocoaView, pContext->cocoaContext);
     
    38713880int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates, SVGA3dRenderState *pRenderState)
    38723881{
    3873     uint32_t                    val;
     3882    uint32_t                    val = UINT32_MAX; /* Shut up MSC. */
    38743883    PVMSVGA3DCONTEXT            pContext;
    38753884    PVMSVGA3DSTATE              pState = pThis->svga.p3dState;
     
    38893898    for (unsigned i = 0; i < cRenderStates; i++)
    38903899    {
    3891         GLenum enableCap = ~0U;
     3900        GLenum enableCap = ~(GLenum)0;
    38923901        Log(("vmsvga3dSetRenderState: cid=%x state=%s (%d) val=%x\n", cid, vmsvga3dGetRenderStateName(pRenderState[i].state), pRenderState[i].state, pRenderState[i].uintValue));
    38933902        /* Save the render state for vm state saving. */
     
    46884697        }
    46894698
    4690         if (enableCap != ~0U)
     4699        if (enableCap != ~(GLenum)0)
    46914700        {
    46924701            if (val)
     
    50165025int vmsvga3dSetTextureState(PVGASTATE pThis, uint32_t cid, uint32_t cTextureStates, SVGA3dTextureState *pTextureState)
    50175026{
    5018     GLenum                      val;
    5019     GLenum                      currentStage = ~0L;
     5027    GLenum                      val = ~(GLenum)0; /* Shut up MSC. */
     5028    GLenum                      currentStage = ~(GLenum)0;
    50205029    PVMSVGA3DCONTEXT            pContext;
    50215030    PVMSVGA3DSTATE              pState = pThis->svga.p3dState;
     
    50355044    for (unsigned i = 0; i < cTextureStates; i++)
    50365045    {
    5037         GLenum textureType = ~0U;
    5038         GLenum samplerType = ~0U;
     5046        GLenum textureType = ~(GLenum)0;
     5047#if 0
     5048        GLenum samplerType = ~(GLenum)0;
     5049#endif
    50395050
    50405051        Log(("vmsvga3dSetTextureState: cid=%x stage=%d type=%s (%x) val=%x\n", cid, pTextureState[i].stage, vmsvga3dTextureStateToString(pTextureState[i].name), pTextureState[i].name, pTextureState[i].value));
     
    52575268        }
    52585269
    5259         if (textureType != ~0U)
     5270        if (textureType != ~(GLenum)0)
    52605271        {
    52615272            glTexParameteri(GL_TEXTURE_2D /** @todo flexible type */, textureType, val);
     
    61396150}
    61406151
    6141 int vmsvga3dDrawPrimitives(PVGASTATE pThis, uint32_t cid, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl, uint32_t numRanges, SVGA3dPrimitiveRange *pRange, uint32_t cVertexDivisor, SVGA3dVertexDivisor *pVertexDivisor)
    6142 {
     6152int vmsvga3dDrawPrimitives(PVGASTATE pThis, uint32_t cid, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl,
     6153                           uint32_t numRanges, SVGA3dPrimitiveRange *pRange, uint32_t cVertexDivisor,
     6154                           SVGA3dVertexDivisor *pVertexDivisor)
     6155{
     6156    RT_NOREF(pVertexDivisor);
    61436157    PVMSVGA3DSTATE               pState = pThis->svga.p3dState;
     6158    AssertReturn(pState, VERR_INTERNAL_ERROR);
    61446159    PVMSVGA3DCONTEXT             pContext;
    6145     AssertReturn(pState, VERR_INTERNAL_ERROR);
    61466160    int                          rc = VERR_NOT_IMPLEMENTED;
    61476161    uint32_t                     iCurrentVertex;
     
    61696183        switch (pVertexDecl[iVertex].identity.usage)
    61706184        {
    6171         case SVGA3D_DECLUSAGE_POSITIONT:
    6172             Log(("ShaderSetPositionTransformed: (%d,%d)\n", pContext->state.RectViewPort.w, pContext->state.RectViewPort.h));
    6173         case SVGA3D_DECLUSAGE_POSITION:
    6174             ShaderSetPositionTransformed(pContext->pShaderContext, pContext->state.RectViewPort.w, pContext->state.RectViewPort.h,
    6175                                          pVertexDecl[iVertex].identity.usage == SVGA3D_DECLUSAGE_POSITIONT);
    6176             break;
     6185            case SVGA3D_DECLUSAGE_POSITIONT:
     6186                Log(("ShaderSetPositionTransformed: (%d,%d)\n", pContext->state.RectViewPort.w, pContext->state.RectViewPort.h));
     6187            case SVGA3D_DECLUSAGE_POSITION:
     6188                ShaderSetPositionTransformed(pContext->pShaderContext, pContext->state.RectViewPort.w,
     6189                                             pContext->state.RectViewPort.h,
     6190                                             pVertexDecl[iVertex].identity.usage == SVGA3D_DECLUSAGE_POSITIONT);
     6191                break;
     6192            default:  /* Shut up MSC. */ break;
    61776193        }
    61786194    }
     
    67326748int vmsvga3dQueryBegin(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type)
    67336749{
     6750    RT_NOREF(pThis, cid, type);
    67346751    AssertFailed();
    67356752    return VERR_NOT_IMPLEMENTED;
     
    67386755int vmsvga3dQueryEnd(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type, SVGAGuestPtr guestResult)
    67396756{
     6757    RT_NOREF(pThis, cid, type, guestResult);
    67406758    AssertFailed();
    67416759    return VERR_NOT_IMPLEMENTED;
     
    67446762int vmsvga3dQueryWait(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type, SVGAGuestPtr guestResult)
    67456763{
     6764    RT_NOREF(pThis, cid, type, guestResult);
    67466765    AssertFailed();
    67476766    return VERR_NOT_IMPLEMENTED;
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