fix(rhi): align empty pipeline layout contract

This commit is contained in:
2026-03-26 11:44:33 +08:00
parent 6f1cbbf305
commit d8e14df78a
3 changed files with 33 additions and 45 deletions

View File

@@ -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();

View File

@@ -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);