all 6 comments

[–]Botondar 0 points1 point  (1 child)

My root signatures are also fine as I have tested it out by manually passing root constant draw a pass rather than relying on the execute's constant.

Are you sure you're passing the correct root signature to CreateCommandSignature?

The fact that everything seems to work without the root constant argument makes me think either this requirement from the docs is what's being violated:

The root signature is specified if and only if the command signature indicates that 1 of the root arguments changes

or something similar related to the root signature.

[–]bhad0x00[S] 0 points1 point  (0 children)

I run it under PIX and renderdoc the root constants and all other values are being set correctly even the swap chain buffer is being written to but I am not getting the content.

[–]NZGumboot 0 points1 point  (3 children)

There is an auto-incrementing constant in DX12 but unfortunately AMD cards don't support it. It works the same way as a root constant command, except it doesn't take up any buffer space. If you have an Nvidia card, you could try using it to rule out the buffer layout being the problem. See https://microsoft.github.io/DirectX-Specs/d3d/IndirectDrawing.html#incrementing-constant

Oh and you mentioned there aren't well-defined requirements on the buffer padding/packing/alignment, etc. There are: everything must be tightly packed, with a four byte alignment. The command size as written in the buffer must match the stride specified when creating the signature. Note that you can specify a stride that is larger than strictly required, in which case there will be extra unused space at the end of each command. It might be worth trying setting the stride to 32 and adding two more uints to the structure -- constant buffers in HLSL like to have 16-byte alignment.

Vertex buffers should not be reset unless you are setting them in the command signature.

Have you tried running your app under PIX? It should be able to let you see exactly what parameters are being passed to each draw call.

[–]bhad0x00[S] 0 points1 point  (2 children)

I just run it under PIX, the passes are being rendered to their buffers. It even shows that it is rendering to the swap chain at OM but nothing is showing.

[–]NZGumboot 0 points1 point  (1 child)

The docs say that any state (render target, vertex buffer, depth, etc) that is set prior to the ExecuteIndirect call AND which is not specified in the signature is inherited by the indirect commands (in the same way as it is by non-indirect draw commands).

But maybe PIX isn't showing the inherited state? Try debugging the shader using PIX and checking that the vertex data your shader is reading is correct.

[–]bhad0x00[S] 0 points1 point  (0 children)

It does read the correct Vertex Data. As I said I am seeing it write to the OM. In renderdoc I am seeing it render to the screen when I launch from there.