- DescriptorHeap: CBV_SRV_UAV, Sampler, RTV, DSV, HandleIncrementSize - Shader: Vertex/Pixel/Compute profiles - RootSignature: Empty, with CBV parameter - PipelineState: Graphics/Compute pipeline desc defaults - Views: RTV, DSV, CBV descriptor heaps, handle increment - All 54 tests pass
43 lines
1.6 KiB
C++
43 lines
1.6 KiB
C++
#include "fixtures/D3D12TestFixture.h"
|
|
|
|
TEST_F(D3D12TestFixture, RootSignature_Placeholder) {
|
|
ASSERT_NE(GetDevice(), nullptr);
|
|
}
|
|
|
|
TEST_F(D3D12TestFixture, RootSignature_CreateEmptyRootSignature) {
|
|
D3D12_ROOT_SIGNATURE_DESC rootSigDesc = {};
|
|
rootSigDesc.NumParameters = 0;
|
|
rootSigDesc.NumStaticSamplers = 0;
|
|
rootSigDesc.Flags = D3D12_ROOT_SIGNATURE_FLAG_NONE;
|
|
|
|
ComPtr<ID3DBlob> blob;
|
|
ComPtr<ID3DBlob> errorBlob;
|
|
HRESULT hr = D3D12SerializeRootSignature(&rootSigDesc, D3D_ROOT_SIGNATURE_VERSION_1, &blob, &errorBlob);
|
|
ASSERT_HRESULT_SUCCEEDED(hr);
|
|
ASSERT_NE(blob.Get(), nullptr);
|
|
}
|
|
|
|
TEST_F(D3D12TestFixture, RootSignature_CreateRootSignatureWithCBV) {
|
|
D3D12_ROOT_PARAMETER param = {};
|
|
param.ParameterType = D3D12_ROOT_PARAMETER_TYPE_CBV;
|
|
param.Descriptor.ShaderRegister = 0;
|
|
param.Descriptor.RegisterSpace = 0;
|
|
param.ShaderVisibility = D3D12_SHADER_VISIBILITY_ALL;
|
|
|
|
D3D12_ROOT_SIGNATURE_DESC rootSigDesc = {};
|
|
rootSigDesc.NumParameters = 1;
|
|
rootSigDesc.pParameters = ¶m;
|
|
rootSigDesc.NumStaticSamplers = 0;
|
|
rootSigDesc.Flags = D3D12_ROOT_SIGNATURE_FLAG_NONE;
|
|
|
|
ComPtr<ID3DBlob> blob;
|
|
ComPtr<ID3DBlob> errorBlob;
|
|
HRESULT hr = D3D12SerializeRootSignature(&rootSigDesc, D3D_ROOT_SIGNATURE_VERSION_1, &blob, &errorBlob);
|
|
ASSERT_HRESULT_SUCCEEDED(hr);
|
|
|
|
ComPtr<ID3D12RootSignature> rootSig;
|
|
hr = GetDevice()->CreateRootSignature(0, blob->GetBufferPointer(), blob->GetBufferSize(), IID_PPV_ARGS(&rootSig));
|
|
ASSERT_HRESULT_SUCCEEDED(hr);
|
|
ASSERT_NE(rootSig.Get(), nullptr);
|
|
}
|