VirtualBox

Changeset 47049 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Jul 9, 2013 3:17:08 AM (12 years ago)
Author:
vboxsync
Message:

wddm/3d: do not submit TexPresent when host reports it unsupported

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.cpp

    r46801 r47049  
    882882    }
    883883
    884 #ifndef DEBUG_misha
     884#if 1 //ndef DEBUG_misha
    885885    /* zero it up temporary to avoid new code activation */
    886886    g_VBoxMpCrHostCaps = 0;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp

    r46885 r47049  
    942942        const RTRECT*paRects)
    943943{
     944    Assert(pDevExt->fTexPresentEnabled);
     945
    944946    uint32_t cbCommandBuffer = VBOXMP_CRCMD_HEADER_SIZE + VBOXMP_CRCMD_SIZE_VBOXTEXPRESENT(cRects);
    945947    uint32_t cCommands = 1;
     
    983985NTSTATUS vboxVdmaTexPresentSetAlloc(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, PVBOXWDDM_ALLOCATION pAllocation)
    984986{
     987    Assert(pDevExt->fTexPresentEnabled);
     988
    985989    RTRECT Rect, *pRect = NULL;
    986990    uint32_t cRects = 0;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r46966 r47049  
    11681168
    11691169                    pDevExt->fTexPresentEnabled = !!(VBoxMpCrGetHostCaps() & CR_VBOX_CAP_TEX_PRESENT);
     1170                    Assert(!pDevExt->fTexPresentEnabled);
    11701171
    11711172                    for (UINT i = 0; i < (UINT)VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i)
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h

    r46885 r47049  
    168168    }
    169169
    170     if (pAllocation && pAllocation->hostID)
    171     {
    172         NTSTATUS Status = vboxVdmaTexPresentSetAlloc(pDevExt, srcId, pAllocation);
    173         if (!NT_SUCCESS(Status))
     170    if (pDevExt->fTexPresentEnabled)
     171    {
     172        /* only submit TexPresent if host supports it and it is enabled */
     173        if (pAllocation && pAllocation->hostID)
    174174        {
    175             WARN(("vboxVdmaTexPresentSetAlloc failed, Status 0x%x", Status));
    176         }
    177 
    178         VBoxVrListClear(&pSource->VrList);
    179         pSource->fHas3DVrs = TRUE;
    180     }
    181     else
    182     {
    183         if (pSource->fHas3DVrs)
    184         {
    185             NTSTATUS Status = vboxVdmaTexPresentSetAlloc(pDevExt, srcId, NULL);
     175            NTSTATUS Status = vboxVdmaTexPresentSetAlloc(pDevExt, srcId, pAllocation);
    186176            if (!NT_SUCCESS(Status))
    187177            {
    188178                WARN(("vboxVdmaTexPresentSetAlloc failed, Status 0x%x", Status));
    189179            }
    190             pSource->fHas3DVrs = FALSE;
     180
     181            VBoxVrListClear(&pSource->VrList);
     182            pSource->fHas3DVrs = TRUE;
    191183        }
    192 
    193         RTRECT Rect;
    194         Rect.xLeft = 0;
    195         Rect.yTop = 0;
    196         Rect.xRight = pAllocation ? pAllocation->AllocData.SurfDesc.width : pSource->AllocData.SurfDesc.width;
    197         Rect.yBottom = pAllocation ? pAllocation->AllocData.SurfDesc.height : pSource->AllocData.SurfDesc.height;
    198 
    199         VBoxVrListRectsSet(&pSource->VrList, 1, &Rect, NULL);
     184        else
     185        {
     186            if (pSource->fHas3DVrs)
     187            {
     188                NTSTATUS Status = vboxVdmaTexPresentSetAlloc(pDevExt, srcId, NULL);
     189                if (!NT_SUCCESS(Status))
     190                {
     191                    WARN(("vboxVdmaTexPresentSetAlloc failed, Status 0x%x", Status));
     192                }
     193                pSource->fHas3DVrs = FALSE;
     194            }
     195
     196            RTRECT Rect;
     197            Rect.xLeft = 0;
     198            Rect.yTop = 0;
     199            Rect.xRight = pAllocation ? pAllocation->AllocData.SurfDesc.width : pSource->AllocData.SurfDesc.width;
     200            Rect.yBottom = pAllocation ? pAllocation->AllocData.SurfDesc.height : pSource->AllocData.SurfDesc.height;
     201
     202            VBoxVrListRectsSet(&pSource->VrList, 1, &Rect, NULL);
     203        }
     204    }
     205    else
     206    {
     207        Assert(!pSource->fHas3DVrs);
    200208    }
    201209
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