Add backpack RHI integration test

This commit is contained in:
2026-03-26 16:57:54 +08:00
parent 6244b586bb
commit 122495e581
16 changed files with 21504 additions and 10 deletions

View File

@@ -215,6 +215,38 @@ TEST_P(RHITestFixture, CommandList_SetIndexBuffer_WithRealView) {
delete buffer;
}
TEST_P(RHITestFixture, CommandList_SetIndexBuffer_WithUint16View) {
BufferDesc bufferDesc = {};
bufferDesc.size = 256;
bufferDesc.stride = sizeof(uint16_t);
bufferDesc.bufferType = static_cast<uint32_t>(BufferType::Index);
RHIBuffer* buffer = GetDevice()->CreateBuffer(bufferDesc);
ASSERT_NE(buffer, nullptr);
ResourceViewDesc viewDesc = {};
viewDesc.dimension = ResourceViewDimension::Buffer;
viewDesc.format = static_cast<uint32_t>(Format::R16_UInt);
RHIResourceView* ibv = GetDevice()->CreateIndexBufferView(buffer, viewDesc);
ASSERT_NE(ibv, nullptr);
CommandListDesc cmdDesc = {};
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);
RHICommandList* cmdList = GetDevice()->CreateCommandList(cmdDesc);
ASSERT_NE(cmdList, nullptr);
cmdList->Reset();
cmdList->SetIndexBuffer(ibv, 0);
cmdList->Close();
cmdList->Shutdown();
delete cmdList;
ibv->Shutdown();
delete ibv;
buffer->Shutdown();
delete buffer;
}
TEST_P(RHITestFixture, CommandList_SetStencilRef) {
CommandListDesc cmdDesc = {};
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);