Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D3D12ExecuteIndirect: "Each triangle gets its own constant buffer per frame" #869

Open
ohmaya opened this issue May 8, 2024 · 0 comments
Labels
bug samples Issues related to Samples

Comments

@ohmaya
Copy link

ohmaya commented May 8, 2024

https://github.com/microsoft/DirectX-Graphics-Samples/blob/51d0c1c5e225186a279bcdf15b7dbf68745301db/Samples/Desktop/D3D12ExecuteIndirect/src/D3D12ExecuteIndirect.h#L106C8-L106C60
"// Each triangle gets its own constant buffer per frame."

m_device->CreateShaderResourceView(m_constantBuffer.Get(), &srvDesc, cbvSrvHandle);

        for (UINT frame = 0; frame < FrameCount; frame++)
        {
            srvDesc.Buffer.FirstElement = frame * TriangleCount;
            m_device->CreateShaderResourceView(m_constantBuffer.Get(), &srvDesc, cbvSrvHandle);
            cbvSrvHandle.Offset(CbvSrvUavDescriptorCountPerFrame, m_cbvSrvUavDescriptorSize);
        }

Actually, it is a single m_constantBuffer, all triangles per frame get 1 SRV.

Thanks.

@walbourn walbourn added bug samples Issues related to Samples labels Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug samples Issues related to Samples
Projects
None yet
Development

No branches or pull requests

2 participants