Files
XCEngine/tests/RHI/D3D12/unit/test_pipeline_state.cpp
ssdfasd 12b71a319f chore: snapshot editor work and restore tests
Key points:\n- restore the tests tree removed by bc47e6e\n- capture current editor workspace, scene, and docs reshuffle changes\n- keep local cloud.nvdb resources ignored from this commit
2026-04-25 22:11:47 +08:00

42 lines
1.3 KiB
C++

#include "fixtures/D3D12TestFixture.h"
#include <cstring>
using namespace XCEngine::RHI;
TEST_F(D3D12TestFixture, PipelineState_Get_GraphicsPipelineDescDefaults) {
D3D12_GRAPHICS_PIPELINE_STATE_DESC psoDesc = {};
psoDesc.InputLayout = {};
psoDesc.pRootSignature = nullptr;
psoDesc.VS = {};
psoDesc.PS = {};
psoDesc.DS = {};
psoDesc.HS = {};
psoDesc.GS = {};
psoDesc.StreamOutput = {};
psoDesc.BlendState = {};
psoDesc.SampleMask = UINT_MAX;
psoDesc.RasterizerState = {};
psoDesc.DepthStencilState = {};
psoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
psoDesc.NumRenderTargets = 1;
psoDesc.RTVFormats[0] = DXGI_FORMAT_R8G8B8A8_UNORM;
psoDesc.DSVFormat = DXGI_FORMAT_D32_FLOAT;
psoDesc.SampleDesc.Count = 1;
psoDesc.SampleDesc.Quality = 0;
EXPECT_EQ(psoDesc.PrimitiveTopologyType, D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE);
EXPECT_EQ(psoDesc.NumRenderTargets, 1);
}
TEST_F(D3D12TestFixture, PipelineState_Get_ComputePipelineDescDefaults) {
D3D12_COMPUTE_PIPELINE_STATE_DESC psoDesc = {};
psoDesc.pRootSignature = nullptr;
psoDesc.CS = {};
psoDesc.NodeMask = 0;
psoDesc.CachedPSO = {};
psoDesc.Flags = D3D12_PIPELINE_STATE_FLAG_NONE;
EXPECT_EQ(psoDesc.NodeMask, 0);
EXPECT_EQ(psoDesc.Flags, D3D12_PIPELINE_STATE_FLAG_NONE);
}