fix(rhi): align empty pipeline layout contract
This commit is contained in:
@@ -155,7 +155,7 @@ void D3D12Device::Shutdown() {
|
||||
bool D3D12Device::CreateDXGIFactory(bool enableDebugLayer) {
|
||||
UINT dxgiFactoryFlags = 0;
|
||||
|
||||
{
|
||||
if (enableDebugLayer) {
|
||||
ID3D12Debug* debugController = nullptr;
|
||||
if (SUCCEEDED(D3D12GetDebugInterface(IID_PPV_ARGS(&debugController)))) {
|
||||
debugController->EnableDebugLayer();
|
||||
|
||||
@@ -72,12 +72,8 @@ bool D3D12PipelineLayout::InitializeInternal(D3D12Device* device, const RHIPipel
|
||||
rootIndex++;
|
||||
}
|
||||
|
||||
if (m_rootParameters.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
D3D12_ROOT_SIGNATURE_DESC rootSigDesc = D3D12RootSignature::CreateDesc(
|
||||
m_rootParameters.data(),
|
||||
m_rootParameters.empty() ? nullptr : m_rootParameters.data(),
|
||||
static_cast<uint32_t>(m_rootParameters.size()),
|
||||
nullptr, 0,
|
||||
D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT);
|
||||
|
||||
@@ -13,12 +13,11 @@ TEST_P(RHITestFixture, PipelineLayout_Create_Basic) {
|
||||
desc.uavCount = 0;
|
||||
|
||||
RHIPipelineLayout* layout = GetDevice()->CreatePipelineLayout(desc);
|
||||
if (layout != nullptr) {
|
||||
ASSERT_NE(layout, nullptr);
|
||||
EXPECT_NE(layout->GetNativeHandle(), nullptr);
|
||||
layout->Shutdown();
|
||||
delete layout;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(RHITestFixture, PipelineLayout_Create_WithTextures) {
|
||||
RHIPipelineLayoutDesc desc = {};
|
||||
@@ -28,12 +27,11 @@ TEST_P(RHITestFixture, PipelineLayout_Create_WithTextures) {
|
||||
desc.uavCount = 0;
|
||||
|
||||
RHIPipelineLayout* layout = GetDevice()->CreatePipelineLayout(desc);
|
||||
if (layout != nullptr) {
|
||||
ASSERT_NE(layout, nullptr);
|
||||
EXPECT_NE(layout->GetNativeHandle(), nullptr);
|
||||
layout->Shutdown();
|
||||
delete layout;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(RHITestFixture, PipelineLayout_Create_WithSamplers) {
|
||||
RHIPipelineLayoutDesc desc = {};
|
||||
@@ -43,12 +41,11 @@ TEST_P(RHITestFixture, PipelineLayout_Create_WithSamplers) {
|
||||
desc.uavCount = 0;
|
||||
|
||||
RHIPipelineLayout* layout = GetDevice()->CreatePipelineLayout(desc);
|
||||
if (layout != nullptr) {
|
||||
ASSERT_NE(layout, nullptr);
|
||||
EXPECT_NE(layout->GetNativeHandle(), nullptr);
|
||||
layout->Shutdown();
|
||||
delete layout;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(RHITestFixture, PipelineLayout_Create_WithUAVs) {
|
||||
RHIPipelineLayoutDesc desc = {};
|
||||
@@ -58,12 +55,11 @@ TEST_P(RHITestFixture, PipelineLayout_Create_WithUAVs) {
|
||||
desc.uavCount = 3;
|
||||
|
||||
RHIPipelineLayout* layout = GetDevice()->CreatePipelineLayout(desc);
|
||||
if (layout != nullptr) {
|
||||
ASSERT_NE(layout, nullptr);
|
||||
EXPECT_NE(layout->GetNativeHandle(), nullptr);
|
||||
layout->Shutdown();
|
||||
delete layout;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(RHITestFixture, PipelineLayout_Create_Complex) {
|
||||
RHIPipelineLayoutDesc desc = {};
|
||||
@@ -73,12 +69,11 @@ TEST_P(RHITestFixture, PipelineLayout_Create_Complex) {
|
||||
desc.uavCount = 1;
|
||||
|
||||
RHIPipelineLayout* layout = GetDevice()->CreatePipelineLayout(desc);
|
||||
if (layout != nullptr) {
|
||||
ASSERT_NE(layout, nullptr);
|
||||
EXPECT_NE(layout->GetNativeHandle(), nullptr);
|
||||
layout->Shutdown();
|
||||
delete layout;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(RHITestFixture, PipelineLayout_Create_ZeroCounts) {
|
||||
RHIPipelineLayoutDesc desc = {};
|
||||
@@ -88,12 +83,11 @@ TEST_P(RHITestFixture, PipelineLayout_Create_ZeroCounts) {
|
||||
desc.uavCount = 0;
|
||||
|
||||
RHIPipelineLayout* layout = GetDevice()->CreatePipelineLayout(desc);
|
||||
if (layout != nullptr) {
|
||||
ASSERT_NE(layout, nullptr);
|
||||
EXPECT_NE(layout->GetNativeHandle(), nullptr);
|
||||
layout->Shutdown();
|
||||
delete layout;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(RHITestFixture, PipelineLayout_Shutdown) {
|
||||
RHIPipelineLayoutDesc desc = {};
|
||||
@@ -102,23 +96,21 @@ TEST_P(RHITestFixture, PipelineLayout_Shutdown) {
|
||||
desc.samplerCount = 1;
|
||||
|
||||
RHIPipelineLayout* layout = GetDevice()->CreatePipelineLayout(desc);
|
||||
if (layout != nullptr) {
|
||||
ASSERT_NE(layout, nullptr);
|
||||
layout->Shutdown();
|
||||
delete layout;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(RHITestFixture, PipelineLayout_DoubleShutdown) {
|
||||
RHIPipelineLayoutDesc desc = {};
|
||||
desc.constantBufferCount = 1;
|
||||
|
||||
RHIPipelineLayout* layout = GetDevice()->CreatePipelineLayout(desc);
|
||||
if (layout != nullptr) {
|
||||
ASSERT_NE(layout, nullptr);
|
||||
layout->Shutdown();
|
||||
layout->Shutdown();
|
||||
delete layout;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(RHITestFixture, PipelineLayout_DescriptorSetAllocation) {
|
||||
RHIPipelineLayoutDesc layoutDesc = {};
|
||||
|
||||
Reference in New Issue
Block a user