VirtualBox

Changeset 81903 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 17, 2019 10:42:29 AM (5 years ago)
Author:
vboxsync
Message:

Devices/Graphics: D3D backend: use the vertex attribute index to access the SVGA3dVertexDivisor array; OpenGL backend: never update an attribute with the zero stride to the next element

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

Legend:

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

    r81899 r81903  
    58385838int vmsvga3dDrawPrimitivesProcessVertexDecls(PVGASTATE pThis, PVMSVGA3DCONTEXT pContext,
    58395839                                             uint32_t iVertexDeclBase, uint32_t numVertexDecls,
    5840                                              SVGA3dVertexDecl *pVertexDecl, SVGA3dVertexDivisor const *paVertexDivisors)
     5840                                             SVGA3dVertexDecl *pVertexDecl,
     5841                                             SVGA3dVertexDivisor const *paVertexDivisors, uint32_t cInstances)
    58415842{
    58425843    PVMSVGA3DSTATE      pState = pThis->svga.p3dState;
     
    59095910
    59105911            GLuint divisor = paVertexDivisors && paVertexDivisors[index].s.instanceData ? 1 : 0;
    5911             if (pVertexDecl[iVertex].array.stride == 0 && divisor == 0)
     5912            if (pVertexDecl[iVertex].array.stride == 0)
    59125913            {
    59135914                /* Zero stride means that the attribute pointer must not be increased.
    59145915                 * See comment about stride in vmsvga3dDrawPrimitives.
    59155916                 */
    5916                 LogRelMax(8, ("VMSVGA: Warning: zero stride array (instancing %s)\n", paVertexDivisors ? "on" : "off"));
    5917                 AssertFailed();
    5918                 divisor = 1;
     5917                if (!divisor)
     5918                {
     5919                    LogRelMax(8, ("VMSVGA: zero stride array (instancing %s %d)\n", paVertexDivisors ? "on" : "off", cInstances));
     5920                    AssertFailed();
     5921                }
     5922
     5923                divisor = cInstances; /* This attrib must never advance. */
    59195924            }
    59205925            pState->ext.glVertexAttribDivisor(index, divisor);
     
    62466251
    62476252        rc = vmsvga3dDrawPrimitivesProcessVertexDecls(pThis, pContext, iCurrentVertex, iVertex - iCurrentVertex,
    6248                                                       &pVertexDecl[iCurrentVertex], pVertexDivisor);
     6253                                                      &pVertexDecl[iCurrentVertex], pVertexDivisor, cInstances);
    62496254        AssertRCReturn(rc, rc);
    62506255
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp

    r81899 r81903  
    51635163        if (cVertexDivisor)
    51645164        {
    5165             LogFunc(("SetStreamSourceFreq[%d]=%x\n", iCurrentStreamId, pVertexDivisor[iCurrentStreamId].value));
     5165            LogFunc(("SetStreamSourceFreq[%d]=%x\n", iCurrentStreamId, pVertexDivisor[iCurrentVertex].value));
    51665166            HRESULT hr2 = pContext->pDevice->SetStreamSourceFreq(iCurrentStreamId,
    5167                                                                  pVertexDivisor[iCurrentStreamId].value);
     5167                                                                 pVertexDivisor[iCurrentVertex].value);
    51685168            Assert(SUCCEEDED(hr2)); RT_NOREF(hr2);
    51695169        }
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