VirtualBox

Changeset 95015 in vbox for trunk/src/VBox/Devices/Graphics


Ignore:
Timestamp:
May 15, 2022 1:47:07 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151453
Message:

Devices/Graphics: constant buffers: bugref:9830

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

Legend:

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

    r95013 r95015  
    352352        u32TrackedState &= ~DX_STATE_CONSTANTBUFFERS;
    353353
    354         for (int i = SVGA3D_SHADERTYPE_MIN; i < SVGA3D_SHADERTYPE_DX10_MAX; ++i) /** @todo SVGA3D_SHADERTYPE_MAX */
     354        for (int i = SVGA3D_SHADERTYPE_MIN; i < SVGA3D_SHADERTYPE_MAX; ++i)
    355355        {
    356356            SVGA3dShaderType const shaderType = (SVGA3dShaderType)i;
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win-dx.cpp

    r95014 r95015  
    51605160    }
    51615161
    5162     dxConstantBufferSet(pDevice, slot, type, pSurface->pBackendSurface->u.pBuffer);
     5162    /* Create the actual constane buffer taking into account offsetInBytes and sizeInBytes. */
     5163    D3D11_BUFFER_DESC bd;
     5164    RT_ZERO(bd);
     5165    bd.ByteWidth           = sizeInBytes;
     5166    bd.Usage               = D3D11_USAGE_DEFAULT;
     5167    bd.BindFlags           = D3D11_BIND_CONSTANT_BUFFER;
     5168
     5169    ID3D11Buffer *pBuffer = 0;
     5170    HRESULT hr = pDevice->pDevice->CreateBuffer(&bd, NULL, &pBuffer);
     5171    if (SUCCEEDED(hr))
     5172    {
     5173       ID3D11Resource *pDstResource = pBuffer;
     5174       UINT DstSubresource = 0;
     5175       UINT DstX = 0;
     5176       UINT DstY = 0;
     5177       UINT DstZ = 0;
     5178       ID3D11Resource *pSrcResource = pSurface->pBackendSurface->u.pResource;
     5179       UINT SrcSubresource = 0;
     5180       D3D11_BOX SrcBox;
     5181       SrcBox.left   = offsetInBytes;
     5182       SrcBox.top    = 0;
     5183       SrcBox.front  = 0;
     5184       SrcBox.right  = offsetInBytes + sizeInBytes;
     5185       SrcBox.bottom = 1;
     5186       SrcBox.back   = 1;
     5187       pDevice->pImmediateContext->CopySubresourceRegion(pDstResource, DstSubresource, DstX, DstY, DstZ,
     5188                                                         pSrcResource, SrcSubresource, &SrcBox);
     5189
     5190       dxConstantBufferSet(pDevice, slot, type, pBuffer);
     5191       D3D_RELEASE(pBuffer); /* xSSetConstantBuffers "will hold a reference to the interfaces passed in." */
     5192    }
    51635193
    51645194    return VINF_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette