DirectX12 root signature error when using AppendStructuredBuffer

Started by
4 comments, last by Hoomanator 4 years, 5 months ago

I do not have a CBV, but it looks like I am forgetting to bind a CBV. I am getting this error:

D3D12 ERROR: ID3D12Device::CreateComputePipelineState: Root Signature doesn't match Compute Shader: Shader CBV descriptor range (BaseShaderRegister=0, NumDescriptors=1, RegisterSpace=0) is not fully bound in root signature [ STATE_CREATION ERROR #882: CREATECOMPUTEPIPELINESTATE_CS_ROOT_SIGNATURE_MISMATCH]

the hlsl is very small..it's just add to a particle system

ParticleAdd.hlsl

Week8-2-ParticleAddCSApp.cpp

Advertisement

http://shader-playground.timjones.io/60afd391fee1167f0e06527667fb43c9


// cbuffer $Globals
// {
//
//   float TimeStep;                    // Offset:    0 Size:     4
//      = 0x3c888889 
//
// }

Try declaring your TimeStep as "static const" if you don't plan to override it from the app via constant buffer. Also, you can't use append/consume buffers from root UAVs, they need to be descriptors in a descriptor table.

Thanks SoldierOfLight! "static const" did the trick and I am not getting that error any more. Regarding descriptors, I was able to use append/consume using root UAVs. The same code that I attached originally worked fine. Where does it say that we can't use append/consume buffers from root UAVs.

https://docs.microsoft.com/en-us/windows/win32/direct3d12/uav-counters

Quote

If pCounterResource is specified in the call to CreateUnorderedAccessView, then there is a counter associated with the UAV.

Quote

If a shader attempts to access the counter of a UAV that does not have an associated counter, then the debug layer will issue a warning, and a GPU page fault will occur causing the apps’s device to be removed.

Root UAVs don't have associated counters, and therefore cannot be used as append/consume buffers.

I see. It will increment the counter when append is called and decrement the counter when consume is called.So, in my case, I have 256 particles. Every particle is a structure of 36 bytes. I have two UAVs associated to the append and consume structures. I don't get any error, but it doesn't produce anything either. Meaning, either append is not appending or consume is not getting the data from the application. I have attached the files.

Week8-3-ParticleAddCSApp.cpp

ParticleAdd.hlsl

This topic is closed to new replies.

Advertisement