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

Open
#869 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
55/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
cpp

Research direction

Review the comment in Samples/Desktop/D3D12ExecuteIndirect/src/D3D12ExecuteIndirect.h around line 106 and the SRV setup in D3D12ExecuteIndirect.cpp around line 415. Compare the comment with the shown m_constantBuffer and per-frame descriptor loop. Done means the comment accurately describes the constant-buffer and SRV arrangement.

Written by the indexing model from the issue text.

Description

bug samples

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."

https://github.com/microsoft/DirectX-Graphics-Samples/blob/51d0c1c5e225186a279bcdf15b7dbf68745301db/Samples/Desktop/D3D12ExecuteIndirect/src/D3D12ExecuteIndirect.cpp#L415

        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.

Dominant language
C++
Stars
6.8k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/DirectX-Graphics-Samples

All issues in microsoft/DirectX-Graphics-Samples

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.