ExecuteIndirect example: Which indirect argument buffer structure for which indirect argument type?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- documentation
Research direction
Read the linked Direct3D12 indirect-drawing documentation and the ExecuteIndirect example referenced in the issue. Map each indirect argument type to its descriptor fields and indirect buffer structure, then document the mappings and explain the constant-buffer-view case in the relevant documentation.
Written by the indexing model from the issue text.
Description
Hey there,
maybe I get something fundamentally wrong but the documentation does not say anything about which indirect argument buffer structure needs to be used for which indirect argument type in the IndirectCommand structure: https://learn.microsoft.com/en-us/windows/win32/direct3d12/indirect-drawing
In the ExecuteIndirect example the SceneConstantBuffer argument is defined as INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW. Intuitivly I would think that in the IndirectCommand structure the CBV needs to be of type D3D12_CONSTANT_BUFFER_VIEW_DESC which consists of the BufferLocation and its SizeInBytes.
typedef struct D3D12_CONSTANT_BUFFER_VIEW_DESC {
D3D12_GPU_VIRTUAL_ADDRESS BufferLocation;
UINT SizeInBytes;
} D3D12_CONSTANT_BUFFER_VIEW_DESC;
But in the example only a D3D12_GPU_VIRTUAL_ADDRESS is used in the IndirectCommand structure to give the buffer location without the size.
struct IndirectCommand
{
D3D12_GPU_VIRTUAL_ADDRESS cbv;
D3D12_DRAW_ARGUMENTS drawArguments;
};
So why does it work? And is there any documentation to make clear which indirect argument buffer structure needs to be used for which indirect argument type? My search so far didn't give me any answers.
Also there is no documentation which union fields need to be set in D3D12_INDIRECT_ARGUMENT_DESC for which type.
I would find it helpful to have a table in the docs like this:
D3D12_INDIRECT_ARGUMENT_TYPE | D3D12_INDIRECT_ARGUMENT_DESC | Indirect Argument Buffer Structure
**********************************************************************************************************************************
INDIRECT_ARGUMENT_TYPE_DRAW | - | D3D12_DRAW_ARGUMENTS
----------------------------------------------------------------------------------------------------------------------------------
... | ... | ....
----------------------------------------------------------------------------------------------------------------------------------
INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW | ConstantBufferView | CONSTANT_BUFFER_VIEW_DESC ???
----------------------------------------------------------------------------------------------------------------------------------
...
Thanks for looking into it!
- Dominant language
- C++
- Stars
- 6.8k
- Forks
- 2.2k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 3
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/DirectX-Graphics-Samples
-
bug samples
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in microsoft/DirectX-Graphics-Samples
Similar issues
-
Feature
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Narezzurri/OpenVPN-Config-Manager#95 ·
Maintainers usually reply within 1 day
-
bot-found bug priority: P1
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
madenvel/KalinkaPlayer#251 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sqlitebrowser/sqlitebrowser#4208 ·
-
ROSES ROSES - Student Review
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
area/ysql kind/bug priority/medium
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yugabyte/yugabyte-db#34552 ·
Maintainers usually reply within 1 day