VirtualBox

Changeset 77114 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 1, 2019 1:13:31 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128571
Message:

DevVGA-SVGA3d-ogl: remember type of created resource; CopySurface/StretchBlt fixes; vmsvga3dBackSurfaceDMACopyBox support for 3D textures; occlusion query functions should set current context.

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

Legend:

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

    r76553 r77114  
    292292            for (uint32_t i = 0; i < pSurface->faces[iFace].numMipLevels; i++, pMipmapLevel++)
    293293            {
    294 #ifdef VMSVGA3D_DIRECT3D
    295                 if (pSurface->u.pSurface)
    296 #else
    297                 if (pSurface->oglId.texture != OPENGL_INVALID_ID)
    298 #endif
     294                if (VMSVGA3DSURFACE_HAS_HW_SURFACE(pSurface))
    299295                {
    300296                    Assert(pMipmapLevel->cbSurface);
     
    451447                     * OpenGL specifics.
    452448                     */
    453                     switch (fSwitchFlags)
     449                    switch (pSurface->enmOGLResType)
    454450                    {
    455                         case SVGA3D_SURFACE_HINT_TEXTURE:
    456                         case SVGA3D_SURFACE_HINT_RENDERTARGET:
    457                         case SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET:
     451                        case VMSVGA3D_OGLRESTYPE_TEXTURE:
    458452                        {
    459453                            GLint activeTexture;
     
    483477                        }
    484478
    485                         case SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_INDEXBUFFER:
    486                         case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
    487                         case SVGA3D_SURFACE_HINT_INDEXBUFFER:
     479                        case VMSVGA3D_OGLRESTYPE_BUFFER:
    488480                        {
    489481                            pState->ext.glBindBuffer(GL_ARRAY_BUFFER, pSurface->oglId.buffer);
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h

    r76565 r77114  
    254254#  define VMSVGA3D_GL_COMPLAIN(a_pState, a_pContext, a_LogRelDetails) \
    255255    do { \
    256         LogRelMax(32, ("VMSVGA3d: OpenGL error %#x (idActiveContext=%#x) on line %u ", (a_pContext)->lastError, (a_pContext)->id)); \
     256        LogRelMax(32, ("VMSVGA3d: OpenGL error %#x (idActiveContext=%#x) on line %u ", (a_pContext)->lastError, (a_pContext)->id, __LINE__)); \
    257257        GLenum iNextError; \
    258258        while ((iNextError = glGetError()) != GL_NO_ERROR) \
     
    524524#endif /* VMSVGA3D_DIRECT3D  */
    525525
     526#ifdef VMSVGA3D_OPENGL
     527/* What kind of OpenGL resource has been created for the VMSVGA3D surface. */
     528typedef enum VMSVGA3DOGLRESTYPE
     529{
     530    VMSVGA3D_OGLRESTYPE_NONE           = 0,
     531    VMSVGA3D_OGLRESTYPE_BUFFER         = 1,
     532    VMSVGA3D_OGLRESTYPE_TEXTURE        = 2,
     533    VMSVGA3D_OGLRESTYPE_RENDERBUFFER   = 3
     534} VMSVGA3DOGLRESTYPE;
     535#endif
     536
    526537/**
    527538 * VMSVGA3d surface.
     
    541552    GLint                   formatGL;
    542553    GLint                   typeGL;
     554    VMSVGA3DOGLRESTYPE      enmOGLResType; /* Which resource was created for the surface. */
    543555    union
    544556    {
     
    10201032        PFNGLGETQUERYOBJECTUIVPROC                      glGetQueryObjectuiv;
    10211033        PFNGLTEXIMAGE3DPROC                             glTexImage3D;
     1034        PFNGLTEXSUBIMAGE3DPROC                          glTexSubImage3D;
    10221035        PFNGLVERTEXATTRIBDIVISORPROC                    glVertexAttribDivisor;
    10231036        PFNGLDRAWARRAYSINSTANCEDPROC                    glDrawArraysInstanced;
     
    10261039        PFNGLCOMPRESSEDTEXIMAGE3DPROC                   glCompressedTexImage3D;
    10271040        PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC                glCompressedTexSubImage2D;
     1041        PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC                glCompressedTexSubImage3D;
    10281042    } ext;
    10291043
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp

    r76553 r77114  
    680680    GLGETPROC_(PFNGLGETQUERYOBJECTUIVPROC                , glGetQueryObjectuiv, "");
    681681    GLGETPROC_(PFNGLTEXIMAGE3DPROC                       , glTexImage3D, "");
     682    GLGETPROC_(PFNGLTEXSUBIMAGE3DPROC                    , glTexSubImage3D, "");
    682683    GLGETPROC_(PFNGLCOMPRESSEDTEXIMAGE2DPROC             , glCompressedTexImage2D, "");
    683684    GLGETPROC_(PFNGLCOMPRESSEDTEXIMAGE3DPROC             , glCompressedTexImage3D, "");
    684685    GLGETPROC_(PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC          , glCompressedTexSubImage2D, "");
     686    GLGETPROC_(PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC          , glCompressedTexSubImage3D, "");
    685687    GLGETPROC_(PFNGLPOINTPARAMETERFPROC                  , glPointParameterf, "");
    686688    GLGETPROC_(PFNGLBLENDEQUATIONSEPARATEPROC            , glBlendEquationSeparate, "");
     
    19521954    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
    19531955
    1954     switch (pSurface->surfaceFlags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK)
    1955     {
    1956     case SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER:
    1957     case SVGA3D_SURFACE_HINT_INDEXBUFFER:
    1958     case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
    1959         if (pSurface->oglId.buffer != OPENGL_INVALID_ID)
    1960         {
     1956    switch (pSurface->enmOGLResType)
     1957    {
     1958        case VMSVGA3D_OGLRESTYPE_BUFFER:
     1959            Assert(pSurface->oglId.buffer != OPENGL_INVALID_ID);
    19611960            pState->ext.glDeleteBuffers(1, &pSurface->oglId.buffer);
    19621961            VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
    1963         }
    1964         break;
    1965 
    1966     case SVGA3D_SURFACE_CUBEMAP:
    1967     case SVGA3D_SURFACE_CUBEMAP | SVGA3D_SURFACE_HINT_TEXTURE:
    1968     case SVGA3D_SURFACE_CUBEMAP | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET:
    1969         /* Cubemap is a texture. */
    1970     case SVGA3D_SURFACE_HINT_TEXTURE:
    1971     case SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET:
    1972         if (pSurface->oglId.texture != OPENGL_INVALID_ID)
    1973         {
     1962            break;
     1963
     1964        case VMSVGA3D_OGLRESTYPE_TEXTURE:
     1965            Assert(pSurface->oglId.texture != OPENGL_INVALID_ID);
    19741966            glDeleteTextures(1, &pSurface->oglId.texture);
    19751967            VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
    1976         }
    1977         break;
    1978 
    1979     case SVGA3D_SURFACE_HINT_RENDERTARGET:
    1980     case SVGA3D_SURFACE_HINT_DEPTHSTENCIL:
    1981     case SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_HINT_TEXTURE:    /** @todo actual texture surface not supported */
    1982         if (pSurface->oglId.renderbuffer != OPENGL_INVALID_ID)
    1983         {
     1968            break;
     1969
     1970        case VMSVGA3D_OGLRESTYPE_RENDERBUFFER:
     1971            Assert(pSurface->oglId.renderbuffer != OPENGL_INVALID_ID);
    19841972            pState->ext.glDeleteRenderbuffers(1, &pSurface->oglId.renderbuffer);
    19851973            VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
    1986         }
    1987         break;
    1988 
    1989     default:
    1990         AssertMsg(!VMSVGA3DSURFACE_HAS_HW_SURFACE(pSurface), ("type=%x\n", (pSurface->surfaceFlags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK)));
    1991         break;
     1974            break;
     1975
     1976        default:
     1977            AssertMsg(!VMSVGA3DSURFACE_HAS_HW_SURFACE(pSurface),
     1978                      ("hint=%#x, type=%d\n",
     1979                       (pSurface->surfaceFlags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK), pSurface->enmOGLResType));
     1980            break;
    19921981    }
    19931982}
     
    20142003        destBox.d = pBox[i].d;
    20152004
    2016         int rc = vmsvga3dSurfaceStretchBlt(pThis, &dest, &destBox, &src, &srcBox, SVGA3D_STRETCH_BLT_LINEAR);
     2005        /* No stretching is required, therefore use SVGA3D_STRETCH_BLT_POINT which translated to GL_NEAREST. */
     2006        int rc = vmsvga3dSurfaceStretchBlt(pThis, &dest, &destBox, &src, &srcBox, SVGA3D_STRETCH_BLT_POINT);
    20172007        AssertRCReturn(rc, rc);
    20182008    }
     
    21842174    glGenTextures(1, &pSurface->oglId.texture);
    21852175    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
     2176    pSurface->enmOGLResType = VMSVGA3D_OGLRESTYPE_TEXTURE;
    21862177
    21872178    GLint activeTexture = 0;
     
    23882379    RT_NOREF(pThis);
    23892380
     2381    AssertReturn(   RT_BOOL(pSrcSurface->surfaceFlags & SVGA3D_SURFACE_HINT_DEPTHSTENCIL)
     2382                 == RT_BOOL(pDstSurface->surfaceFlags & SVGA3D_SURFACE_HINT_DEPTHSTENCIL), VERR_NOT_IMPLEMENTED);
     2383
     2384    GLenum glAttachment = GL_COLOR_ATTACHMENT0;
     2385    GLbitfield glMask = GL_COLOR_BUFFER_BIT;
     2386    if (pDstSurface->surfaceFlags & SVGA3D_SURFACE_HINT_DEPTHSTENCIL)
     2387    {
     2388        /** @todo Need GL_DEPTH_STENCIL_ATTACHMENT for depth/stencil formats? */
     2389        glAttachment = GL_DEPTH_ATTACHMENT;
     2390        glMask = GL_DEPTH_BUFFER_BIT;
     2391    }
     2392
    23902393    /* Activate the read and draw framebuffer objects. */
    23912394    pState->ext.glBindFramebuffer(GL_READ_FRAMEBUFFER, pContext->idReadFramebuffer);
     
    23962399    /* Bind the source and destination objects to the right place. */
    23972400    GLenum textarget;
    2398     if (pSrcSurface->surfaceFlags & SVGA3D_SURFACE_CUBEMAP)
     2401    if (pSrcSurface->targetGL == GL_TEXTURE_CUBE_MAP)
    23992402        textarget = vmsvga3dCubemapFaceFromIndex(uSrcFace);
    24002403    else
     2404    {
     2405        /// @todo later AssertMsg(pSrcSurface->targetGL == GL_TEXTURE_2D, ("%#x\n", pSrcSurface->targetGL));
    24012406        textarget = GL_TEXTURE_2D;
    2402     pState->ext.glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textarget,
     2407    }
     2408    pState->ext.glFramebufferTexture2D(GL_READ_FRAMEBUFFER, glAttachment, textarget,
    24032409                                       pSrcSurface->oglId.texture, uSrcMipmap);
    24042410    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
    24052411
    2406     if (pDstSurface->surfaceFlags & SVGA3D_SURFACE_CUBEMAP)
     2412    if (pDstSurface->targetGL == GL_TEXTURE_CUBE_MAP)
    24072413        textarget = vmsvga3dCubemapFaceFromIndex(uDstFace);
    24082414    else
     2415    {
     2416        /// @todo later AssertMsg(pDstSurface->targetGL == GL_TEXTURE_2D, ("%#x\n", pDstSurface->targetGL));
    24092417        textarget = GL_TEXTURE_2D;
    2410     pState->ext.glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textarget,
     2418    }
     2419    pState->ext.glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, glAttachment, textarget,
    24112420                                       pDstSurface->oglId.texture, uDstMipmap);
    24122421    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
     
    24262435                                  pDstBox->x + pDstBox->w,                                  /* exclusive. */
    24272436                                  pDstBox->y + pDstBox->h,
    2428                                   GL_COLOR_BUFFER_BIT,
     2437                                  glMask,
    24292438                                  (enmMode == SVGA3D_STRETCH_BLT_POINT) ? GL_NEAREST : GL_LINEAR);
    24302439    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
     
    26012610
    26022611        GLenum texImageTarget;
    2603         if (pSurface->targetGL == GL_TEXTURE_CUBE_MAP)
     2612        if (pSurface->targetGL == GL_TEXTURE_3D)
     2613        {
     2614            texImageTarget = GL_TEXTURE_3D;
     2615        }
     2616        else if (pSurface->targetGL == GL_TEXTURE_CUBE_MAP)
    26042617        {
    26052618            texImageTarget = vmsvga3dCubemapFaceFromIndex(uHostFace);
     
    26072620        else
    26082621        {
    2609             Assert(pSurface->targetGL == GL_TEXTURE_2D);
     2622            AssertMsg(pSurface->targetGL == GL_TEXTURE_2D, ("%#x\n", pSurface->targetGL));
    26102623            texImageTarget = GL_TEXTURE_2D;
    26112624        }
     
    26842697            vmsvga3dOglSetUnpackParams(pState, pContext, pSurface, &SavedParams); /** @todo do we need to set ROW_LENGTH to w here? */
    26852698
    2686             if (   pSurface->internalFormatGL == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
    2687                 || pSurface->internalFormatGL == GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
    2688                 || pSurface->internalFormatGL == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)
     2699            if (texImageTarget == GL_TEXTURE_3D)
    26892700            {
    2690                 pState->ext.glCompressedTexSubImage2D(texImageTarget,
    2691                                                       uHostMipmap,
    2692                                                       pBox->x,
    2693                                                       pBox->y,
    2694                                                       pBox->w,
    2695                                                       pBox->h,
    2696                                                       pSurface->internalFormatGL,
    2697                                                       cbSurfacePitch * cBlocksY,
    2698                                                       pDoubleBuffer);
     2701                if (   pSurface->internalFormatGL == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
     2702                    || pSurface->internalFormatGL == GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
     2703                    || pSurface->internalFormatGL == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)
     2704                {
     2705                    pState->ext.glCompressedTexSubImage3D(texImageTarget,
     2706                                                          uHostMipmap,
     2707                                                          pBox->x,
     2708                                                          pBox->y,
     2709                                                          pBox->z,
     2710                                                          pBox->w,
     2711                                                          pBox->h,
     2712                                                          pBox->d,
     2713                                                          pSurface->formatGL,
     2714                                                          pSurface->typeGL,
     2715                                                          pDoubleBuffer);
     2716                }
     2717                else
     2718                {
     2719                    pState->ext.glTexSubImage3D(texImageTarget,
     2720                                                uHostMipmap,
     2721                                                u32HostBlockX,
     2722                                                u32HostBlockY,
     2723                                                pBox->z,
     2724                                                cBlocksX,
     2725                                                cBlocksY,
     2726                                                pBox->d,
     2727                                                pSurface->formatGL,
     2728                                                pSurface->typeGL,
     2729                                                pDoubleBuffer);
     2730                }
    26992731            }
    27002732            else
    27012733            {
    2702                 glTexSubImage2D(texImageTarget,
    2703                                 uHostMipmap,
    2704                                 u32HostBlockX,
    2705                                 u32HostBlockY,
    2706                                 cBlocksX,
    2707                                 cBlocksY,
    2708                                 pSurface->formatGL,
    2709                                 pSurface->typeGL,
    2710                                 pDoubleBuffer);
     2734                if (   pSurface->internalFormatGL == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
     2735                    || pSurface->internalFormatGL == GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
     2736                    || pSurface->internalFormatGL == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)
     2737                {
     2738                    pState->ext.glCompressedTexSubImage2D(texImageTarget,
     2739                                                          uHostMipmap,
     2740                                                          pBox->x,
     2741                                                          pBox->y,
     2742                                                          pBox->w,
     2743                                                          pBox->h,
     2744                                                          pSurface->internalFormatGL,
     2745                                                          cbSurfacePitch * cBlocksY,
     2746                                                          pDoubleBuffer);
     2747                }
     2748                else
     2749                {
     2750                    glTexSubImage2D(texImageTarget,
     2751                                    uHostMipmap,
     2752                                    u32HostBlockX,
     2753                                    u32HostBlockY,
     2754                                    cBlocksX,
     2755                                    cBlocksY,
     2756                                    pSurface->formatGL,
     2757                                    pSurface->typeGL,
     2758                                    pDoubleBuffer);
     2759                }
    27112760            }
    27122761            VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
     
    44574506    case SVGA3D_RT_DEPTH:
    44584507    case SVGA3D_RT_STENCIL:
    4459         AssertReturn(target.mipmap == 0, VERR_INVALID_PARAMETER);
    44604508#if 1
    44614509        /* A texture surface can be used as a render target to fill it and later on used as a texture. */
     
    44784526        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
    44794527#else
     4528        AssertReturn(target.mipmap == 0, VERR_INVALID_PARAMETER);
    44804529        if (pRenderTarget->oglId.texture == OPENGL_INVALID_ID)
    44814530        {
     
    44864535            pState->ext.glGenRenderbuffers(1, &pRenderTarget->oglId.renderbuffer);
    44874536            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
     4537            pSurface->enmOGLResType = VMSVGA3D_OGLRESTYPE_RENDERBUFFER;
    44884538
    44894539            pState->ext.glBindRenderbuffer(GL_RENDERBUFFER, pRenderTarget->oglId.renderbuffer);
     
    57135763        pState->ext.glGenBuffers(1, &pVertexSurface->oglId.buffer);
    57145764        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
     5765        pVertexSurface->enmOGLResType = VMSVGA3D_OGLRESTYPE_BUFFER;
    57155766
    57165767        pState->ext.glBindBuffer(GL_ARRAY_BUFFER, pVertexSurface->oglId.buffer);
     
    60736124                pState->ext.glGenBuffers(1, &pIndexSurface->oglId.buffer);
    60746125                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
     6126                pIndexSurface->enmOGLResType = VMSVGA3D_OGLRESTYPE_BUFFER;
    60756127
    60766128                pState->ext.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, pIndexSurface->oglId.buffer);
     
    61166168        else
    61176169        {
     6170            Assert(pRange[iPrimitive].indexWidth == pRange[iPrimitive].indexArray.stride);
     6171
    61186172            GLenum indexType;
    6119 
    6120             Assert(pRange[iPrimitive].indexBias >= 0);  /** @todo  indexBias */
    6121             Assert(pRange[iPrimitive].indexWidth == pRange[iPrimitive].indexArray.stride);
    6122 
    6123             if (pRange[iPrimitive].indexWidth == sizeof(uint8_t))
     6173            switch (pRange[iPrimitive].indexWidth)
    61246174            {
    6125                 indexType = GL_UNSIGNED_BYTE;
    6126             }
    6127             else
    6128             if (pRange[iPrimitive].indexWidth == sizeof(uint16_t))
    6129             {
    6130                 indexType = GL_UNSIGNED_SHORT;
    6131             }
    6132             else
    6133             {
    6134                 Assert(pRange[iPrimitive].indexWidth == sizeof(uint32_t));
    6135                 indexType = GL_UNSIGNED_INT;
     6175                 case 1: indexType = GL_UNSIGNED_BYTE;  break;
     6176                 case 2: indexType = GL_UNSIGNED_SHORT; break;
     6177                 default: AssertMsgFailed(("indexWidth %d\n", pRange[iPrimitive].indexWidth));
     6178                     RT_FALL_THROUGH();
     6179                 case 4: indexType = GL_UNSIGNED_INT;   break;
    61366180            }
    61376181
     
    65736617{
    65746618    AssertReturn(pState->ext.glGenQueries, VERR_NOT_SUPPORTED);
     6619    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
     6620
    65756621    GLuint idQuery = 0;
    65766622    pState->ext.glGenQueries(1, &idQuery);
     
    65846630{
    65856631    AssertReturn(pState->ext.glDeleteQueries, VERR_NOT_SUPPORTED);
     6632    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
     6633
    65866634    if (pContext->occlusion.idQuery)
    65876635    {
     
    65946642{
    65956643    AssertReturn(pState->ext.glBeginQuery, VERR_NOT_SUPPORTED);
     6644    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
     6645
    65966646    pState->ext.glBeginQuery(GL_ANY_SAMPLES_PASSED, pContext->occlusion.idQuery);
    65976647    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
     
    66016651int vmsvga3dOcclusionQueryEnd(PVMSVGA3DSTATE pState, PVMSVGA3DCONTEXT pContext)
    66026652{
    6603     RT_NOREF(pContext);
    66046653    AssertReturn(pState->ext.glEndQuery, VERR_NOT_SUPPORTED);
     6654    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
     6655
    66056656    pState->ext.glEndQuery(GL_ANY_SAMPLES_PASSED);
    66066657    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
     
    66116662{
    66126663    AssertReturn(pState->ext.glGetQueryObjectuiv, VERR_NOT_SUPPORTED);
     6664    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
     6665
    66136666    GLuint pixels = 0;
    66146667    pState->ext.glGetQueryObjectuiv(pContext->occlusion.idQuery, GL_QUERY_RESULT, &pixels);
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-savedstate.cpp

    r76553 r77114  
    701701                    Log(("Surface sid=%d: save mipmap level %d with %x bytes data.\n", sid, i, pMipmapLevel->cbSurface));
    702702
    703 #ifdef VMSVGA3D_DIRECT3D
    704                     if (!pSurface->u.pSurface)
    705 #else
    706                     if (pSurface->oglId.texture == OPENGL_INVALID_ID)
    707 #endif
     703                    if (!VMSVGA3DSURFACE_HAS_HW_SURFACE(pSurface))
    708704                    {
    709705                        if (pMipmapLevel->fDirty)
     
    888884                        Assert(pMipmapLevel->cbSurface);
    889885
    890                         switch (pSurface->surfaceFlags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK)
     886                        switch (pSurface->enmOGLResType)
    891887                        {
    892888                        default:
    893889                            AssertFailed();
    894890                            RT_FALL_THRU();
    895                         case SVGA3D_SURFACE_HINT_DEPTHSTENCIL:
    896                         case SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_HINT_TEXTURE:
    897                             /** @todo fetch data from the renderbuffer */
     891                        case VMSVGA3D_OGLRESTYPE_RENDERBUFFER:
     892                            /** @todo fetch data from the renderbuffer. Not used currently. */
    898893                            /* No data follows */
    899894                            rc = SSMR3PutBool(pSSM, false);
     
    901896                            break;
    902897
    903                         case SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET:
    904                         case SVGA3D_SURFACE_HINT_TEXTURE:
    905                         case SVGA3D_SURFACE_HINT_RENDERTARGET:
     898                        case VMSVGA3D_OGLRESTYPE_TEXTURE:
    906899                        {
    907900                            GLint activeTexture;
     
    943936                        }
    944937
    945                         case SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_INDEXBUFFER:
    946                         case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
    947                         case SVGA3D_SURFACE_HINT_INDEXBUFFER:
     938                        case VMSVGA3D_OGLRESTYPE_BUFFER:
    948939                        {
    949940                            uint8_t *pBufferData;
Note: See TracChangeset for help on using the changeset viewer.

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