VirtualBox

Changeset 102639 in vbox


Ignore:
Timestamp:
Dec 18, 2023 9:29:19 PM (13 months ago)
Author:
vboxsync
Message:

WDDM: fix for vertex and constant buffers tracking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDX.cpp

    r102631 r102639  
    323323                vgpu10SetSingleConstantBuffer(pDevice, i, enmShaderType, 0, 0, 0);
    324324        }
     325
     326        /* Trim empty slots. */
     327        while (pCBS->NumBuffers)
     328        {
     329            if (pCBS->apResource[pCBS->StartSlot + pCBS->NumBuffers - 1])
     330                break;
     331            --pCBS->NumBuffers;
     332        }
     333
     334        while (pCBS->NumBuffers)
     335        {
     336            if (pCBS->apResource[pCBS->StartSlot])
     337                break;
     338            --pCBS->NumBuffers;
     339            ++pCBS->StartSlot;
     340        }
    325341    }
    326342}
     
    341357    vgpu10SetVertexBuffers(pDevice, pVBS->StartSlot, pVBS->NumBuffers, aAllocations,
    342358                           &pVBS->aStrides[pVBS->StartSlot], &pVBS->aOffsets[pVBS->StartSlot]);
     359
     360    /* Trim empty slots. */
     361    while (pVBS->NumBuffers)
     362    {
     363        if (pVBS->apResource[pVBS->StartSlot + pVBS->NumBuffers - 1])
     364            break;
     365        --pVBS->NumBuffers;
     366    }
     367
     368    while (pVBS->NumBuffers)
     369    {
     370        if (pVBS->apResource[pVBS->StartSlot])
     371            break;
     372        --pVBS->NumBuffers;
     373        ++pVBS->StartSlot;
     374    }
    343375}
    344376
     
    22892321    }
    22902322
    2291     UINT FirstSlot = pVBS->StartSlot;
    2292     UINT EndSlot = pVBS->StartSlot + pVBS->NumBuffers;
    2293 
    2294     UINT const NewFirstSlot = StartSlot;
    2295     UINT const NewEndSlot = StartSlot + NumBuffers;
    2296 
    2297     FirstSlot = RT_MIN(FirstSlot, NewFirstSlot);
    2298     EndSlot = RT_MAX(EndSlot, NewEndSlot);
    2299 
    2300     pVBS->StartSlot = FirstSlot;
    2301     pVBS->NumBuffers = EndSlot - StartSlot;
     2323    /* Join the current range and the new range. */
     2324    if (pVBS->NumBuffers == 0)
     2325    {
     2326        pVBS->StartSlot = StartSlot;
     2327        pVBS->NumBuffers = NumBuffers;
     2328    }
     2329    else
     2330    {
     2331        UINT FirstSlot = RT_MIN(StartSlot, pVBS->StartSlot);
     2332        UINT EndSlot = RT_MAX(pVBS->StartSlot + pVBS->NumBuffers, StartSlot + NumBuffers);
     2333        pVBS->StartSlot = FirstSlot;
     2334        pVBS->NumBuffers = EndSlot - FirstSlot;
     2335    }
    23022336}
    23032337
     
    30303064    }
    30313065
    3032     UINT FirstSlot = pCBS->StartSlot;
    3033     UINT EndSlot = pCBS->StartSlot + pCBS->NumBuffers;
    3034 
    3035     UINT const NewFirstSlot = StartSlot;
    3036     UINT const NewEndSlot = StartSlot + NumBuffers;
    3037 
    3038     FirstSlot = RT_MIN(FirstSlot, NewFirstSlot);
    3039     EndSlot = RT_MAX(EndSlot, NewEndSlot);
    3040 
    3041     pCBS->StartSlot = FirstSlot;
    3042     pCBS->NumBuffers = EndSlot - StartSlot;
     3066    /* Join the current range and the new range. */
     3067    if (pCBS->NumBuffers == 0)
     3068    {
     3069        pCBS->StartSlot = StartSlot;
     3070        pCBS->NumBuffers = NumBuffers;
     3071    }
     3072    else
     3073    {
     3074        UINT FirstSlot = RT_MIN(StartSlot, pCBS->StartSlot);
     3075        UINT EndSlot = RT_MAX(pCBS->StartSlot + pCBS->NumBuffers, StartSlot + NumBuffers);
     3076        pCBS->StartSlot = FirstSlot;
     3077        pCBS->NumBuffers = EndSlot - FirstSlot;
     3078    }
    30433079}
    30443080
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