Can i have a root signature with 3 root parameters all being of the UAV type? Because what I am trying to do is, add two buffers and put the output of that in a output buffer.

In the following snippet I am trying to do the afroementioned. However, I get an error at the line calling D3DX12SerializeVersionedRootSignature()

Is it because I am not allowed to have 3 uav ranges?


CD3DX12_DESCRIPTOR_RANGE1 ranges_madhu[3];
			ranges_madhu[0].Init(D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, 0, 0, D3D12_DESCRIPTOR_RANGE_FLAG_DATA_VOLATILE);
			ranges_madhu[1].Init(D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, 0, 0, D3D12_DESCRIPTOR_RANGE_FLAG_DATA_VOLATILE);
			ranges_madhu[2].Init(D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, 0, 0, D3D12_DESCRIPTOR_RANGE_FLAG_DATA_VOLATILE);
			
			CD3DX12_ROOT_PARAMETER1 rootParameters_madhu[ComputeRootParametersCount_madhu]; // this is 3   (thus all 3 ranges have been initialized as UAVs)
			rootParameters_madhu[ComputeRootUAVTable_in1].InitAsDescriptorTable(1, &ranges_madhu[0], D3D12_SHADER_VISIBILITY_ALL);
			rootParameters_madhu[ComputeRootUAVTable_in2].InitAsDescriptorTable(1, &ranges_madhu[1], D3D12_SHADER_VISIBILITY_ALL);
			rootParameters_madhu[ComputeRootUAVTable_outp1].InitAsDescriptorTable(1, &ranges_madhu[2], D3D12_SHADER_VISIBILITY_ALL);
			
			CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC computeRootSignatureDesc_madhu;
			computeRootSignatureDesc_madhu.Init_1_1(_countof(rootParameters_madhu), rootParameters_madhu, 0, nullptr);
			
			ComPtr<ID3DBlob> signature1;
			ComPtr<ID3DBlob> error1;
			
			ThrowIfFailed(D3DX12SerializeVersionedRootSignature(&computeRootSignatureDesc_madhu, featureData_madhu.HighestVersion, &signature1, &error1));
ThrowIfFailed(m_device->CreateRootSignature(0, signature1->GetBufferPointer(), signature1->GetBufferSize(), IID_PPV_ARGS(&m_computeRootSignature1)));
NAME_D3D12_OBJECT(m_computeRootSignature1);