Jump to content
  • Advertisement
Hoomanator

DX12 DirectX12 root signature error when using AppendStructuredBuffer

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!