VirtualBox

Changeset 64483 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Oct 29, 2016 11:28:48 AM (8 years ago)
Author:
vboxsync
Message:

DevVGA_SVGA: fixed index/vertex buffer usage with recent Mesa

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

Legend:

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

    r62937 r64483  
    556556    AVLU32TREE              pSharedObjectTree;
    557557    bool                    fStencilAsTexture;
     558    uint32_t                fu32ActualUsageFlags;
    558559#endif
    559560} VMSVGA3DSURFACE;
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp

    r63562 r64483  
    18481848        break;
    18491849
     1850    case SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER:
    18501851    case SVGA3D_SURFACE_HINT_INDEXBUFFER:
    18511852    case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
     
    24562457        break;
    24572458
     2459    case SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_INDEXBUFFER:
    24582460    case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
    24592461    case SVGA3D_SURFACE_HINT_INDEXBUFFER:
     
    24812483                              <= pMipLevel->cbSurface))
    24822484                {
    2483                     Log(("Lock %s memory for rectangle (%d,%d)(%d,%d)\n", (pSurface->flags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK) == SVGA3D_SURFACE_HINT_VERTEXBUFFER ? "vertex" : "index",
     2485                    Log(("Lock %s memory for rectangle (%d,%d)(%d,%d)\n",
     2486                         (pSurface->flags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK) == SVGA3D_SURFACE_HINT_VERTEXBUFFER ? "vertex" :
     2487                           (pSurface->flags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK) == SVGA3D_SURFACE_HINT_INDEXBUFFER ? "index" : "buffer",
    24842488                         pBox->x, pBox->y, pBox->x + pBox->w, pBox->y + pBox->h));
    24852489
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp

    r63562 r64483  
    11031103        break;
    11041104
     1105    case SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER:
    11051106    case SVGA3D_SURFACE_HINT_INDEXBUFFER:
    1106         if (pSurface->u.pIndexBuffer)
    1107             pSurface->u.pIndexBuffer->Release();
    1108         break;
    1109 
    11101107    case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
    1111         if (pSurface->u.pVertexBuffer)
    1112             pSurface->u.pVertexBuffer->Release();
     1108        if (pSurface->fu32ActualUsageFlags == SVGA3D_SURFACE_HINT_VERTEXBUFFER)
     1109        {
     1110            if (pSurface->u.pVertexBuffer)
     1111                pSurface->u.pVertexBuffer->Release();
     1112        }
     1113        else if (pSurface->fu32ActualUsageFlags == SVGA3D_SURFACE_HINT_INDEXBUFFER)
     1114        {
     1115            if (pSurface->u.pIndexBuffer)
     1116                pSurface->u.pIndexBuffer->Release();
     1117        }
     1118        else
     1119            AssertMsg(pSurface->u.pVertexBuffer == NULL, ("fu32ActualUsageFlags %x\n", pSurface->fu32ActualUsageFlags));
    11131120        break;
    11141121
     
    19301937    }
    19311938
     1939    case SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_INDEXBUFFER:
    19321940    case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
    1933         fVertex = true;
     1941        fVertex = RT_BOOL(pSurface->fu32ActualUsageFlags & SVGA3D_SURFACE_HINT_VERTEXBUFFER);
    19341942        /* no break */
    19351943
     
    19731981
    19741982    default:
    1975         AssertFailed();
     1983        AssertMsgFailed(("Unsupported surface hint 0x%08X\n", pSurface->flags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK));
    19761984        break;
    19771985    }
     
    48334841            }
    48344842            pVertexSurface->flags |= SVGA3D_SURFACE_HINT_VERTEXBUFFER;
     4843            pVertexSurface->fu32ActualUsageFlags |= SVGA3D_SURFACE_HINT_VERTEXBUFFER;
    48354844        }
    48364845        else
     
    50385047                }
    50395048                pIndexSurface->flags |= SVGA3D_SURFACE_HINT_INDEXBUFFER;
     5049                pIndexSurface->fu32ActualUsageFlags |= SVGA3D_SURFACE_HINT_INDEXBUFFER;
    50405050            }
    50415051            else
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.cpp

    r62514 r64483  
    217217    if (surfaceFlags & SVGA3D_SURFACE_AUTOGENMIPMAPS)
    218218        pSurface->fUsageD3D |= D3DUSAGE_AUTOGENMIPMAP;
     219    pSurface->fu32ActualUsageFlags = 0;
    219220#else
    220221    vmsvga3dSurfaceFormat2OGL(pSurface, format);
     
    443444    AssertReturn(pSurface && pSurface->id == sid, VERR_INVALID_PARAMETER);
    444445
    445     AssertMsg(host.face == 0, ("host.face=%#x\n", host.face));
    446     AssertReturn(pSurface->faces[0].numMipLevels > host.mipmap, VERR_INVALID_PARAMETER);
    447     PVMSVGA3DMIPMAPLEVEL pMipLevel = &pSurface->pMipmapLevels[host.mipmap];
    448 
    449446    if (pSurface->flags & SVGA3D_SURFACE_HINT_TEXTURE)
    450447        Log(("vmsvga3dSurfaceDMA TEXTURE guestptr gmr=%x offset=%x pitch=%x host sid=%x face=%d mipmap=%d transfer=%s cCopyBoxes=%d\n", guest.ptr.gmrId, guest.ptr.offset, guest.pitch, host.sid, host.face, host.mipmap, (transfer == SVGA3D_WRITE_HOST_VRAM) ? "READ" : "WRITE", cCopyBoxes));
    451448    else
    452449        Log(("vmsvga3dSurfaceDMA guestptr gmr=%x offset=%x pitch=%x host sid=%x face=%d mipmap=%d transfer=%s cCopyBoxes=%d\n", guest.ptr.gmrId, guest.ptr.offset, guest.pitch, host.sid, host.face, host.mipmap, (transfer == SVGA3D_WRITE_HOST_VRAM) ? "READ" : "WRITE", cCopyBoxes));
     450
     451    AssertMsg(host.face == 0, ("host.face=%#x\n", host.face));
     452    AssertMsgReturn(pSurface->faces[0].numMipLevels > host.mipmap, ("numMipLevels %d, host.mipmap %d", pSurface->faces[0].numMipLevels, host.mipmap), VERR_INVALID_PARAMETER);
     453    PVMSVGA3DMIPMAPLEVEL pMipLevel = &pSurface->pMipmapLevels[host.mipmap];
    453454
    454455    if (!VMSVGA3DSURFACE_HAS_HW_SURFACE(pSurface))
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