VirtualBox

Changeset 69242 in vbox


Ignore:
Timestamp:
Oct 24, 2017 4:22:20 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
118555
Message:

Devices/Graphics: VMSVGA: support vertex divisors in vmsvga3dDrawPrimitives.

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

Legend:

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

    r69146 r69242  
    40554055                        STAM_REL_COUNTER_INC(&pSVGAState->StatR3Cmd3dDrawPrimitives);
    40564056
    4057                         uint32_t cVertexDivisor = (pHdr->size - sizeof(*pCmd) - sizeof(SVGA3dVertexDecl) * pCmd->numVertexDecls - sizeof(SVGA3dPrimitiveRange) * pCmd->numRanges);
     4057                        uint32_t cVertexDivisor = (pHdr->size - sizeof(*pCmd) - sizeof(SVGA3dVertexDecl) * pCmd->numVertexDecls - sizeof(SVGA3dPrimitiveRange) * pCmd->numRanges) / sizeof(uint32_t);
    40584058                        Assert(pCmd->numRanges <= SVGA3D_MAX_DRAW_PRIMITIVE_RANGES);
    40594059                        Assert(pCmd->numVertexDecls <= SVGA3D_MAX_VERTEX_ARRAYS);
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp

    r69163 r69242  
    52375237    AssertReturn(numRanges && numRanges <= SVGA3D_MAX_DRAW_PRIMITIVE_RANGES, VERR_INVALID_PARAMETER);
    52385238    AssertReturn(!cVertexDivisor || cVertexDivisor == numVertexDecls, VERR_INVALID_PARAMETER);
    5239     /** @todo */
    5240     Assert(!cVertexDivisor);
    52415239
    52425240    rc = vmsvga3dContextFromCid(pState, cid, &pContext);
     
    52845282        if (RT_FAILURE(rc))
    52855283            goto internal_error;
     5284
     5285        if (cVertexDivisor)
     5286        {
     5287            LogFunc(("SetStreamSourceFreq[%d]=%x\n", iCurrentStreamId, pVertexDivisor[iCurrentStreamId].value));
     5288            HRESULT hr2 = pContext->pDevice->SetStreamSourceFreq(iCurrentStreamId, pVertexDivisor[iCurrentStreamId].value);
     5289            Assert(SUCCEEDED(hr2));
     5290        }
    52865291
    52875292        iCurrentVertex = iVertex;
     
    54635468            hr = pContext->pDevice->SetStreamSource(i, NULL, 0, 0);
    54645469            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dDrawPrimitives: SetStreamSource failed with %x\n", hr), VERR_INTERNAL_ERROR);
     5470        }
     5471    }
     5472
     5473    if (cVertexDivisor)
     5474    {
     5475        /* "When you are finished rendering the instance data, be sure to reset the vertex stream frequency back..." */
     5476        for (uint32_t i = 0; i < cVertexDivisor; ++i)
     5477        {
     5478            HRESULT hr2 = pContext->pDevice->SetStreamSourceFreq(i, 1);
     5479            Assert(SUCCEEDED(hr2));
    54655480        }
    54665481    }
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