Note if a command signature is graphics or compute

This commit is contained in:
baldurk
2016-10-21 21:44:24 +02:00
parent ac53611f07
commit 106308a3fa
2 changed files with 17 additions and 0 deletions
+1
View File
@@ -171,6 +171,7 @@ struct D3D12RootSignature
struct D3D12CommandSignature
{
bool graphics;
UINT ByteStride;
vector<D3D12_INDIRECT_ARGUMENT_DESC> arguments;
};
@@ -1345,6 +1345,22 @@ bool WrappedID3D12Device::Serialise_CreateCommandSignature(Serialiser *localSeri
wrapped->sig.arguments.insert(wrapped->sig.arguments.begin(), desc.pArgumentDescs,
desc.pArgumentDescs + desc.NumArgumentDescs);
wrapped->sig.graphics = true;
// From MSDN, command signatures are either graphics or compute so just search for dispatches:
// "A given command signature is either a draw or a compute command signature. If a command
// signature contains a drawing operation, then it is a graphics command signature. Otherwise,
// the command signature must contain a dispatch operation, and it is a compute command
// signature."
for(uint32_t i = 0; i < desc.NumArgumentDescs; i++)
{
if(desc.pArgumentDescs[i].Type == D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH)
{
wrapped->sig.graphics = false;
break;
}
}
ret = wrapped;
GetResourceManager()->AddLiveResource(CommandSig, ret);