Add renderer backpack scene integration test

This commit is contained in:
2026-03-26 22:28:11 +08:00
parent 5735e769b0
commit 8bdb1f34c7
6 changed files with 435 additions and 7 deletions

View File

@@ -91,7 +91,7 @@ RHI::GraphicsPipelineDesc CreatePipelineDesc(RHI::RHIType backendType, RHI::RHIP
pipelineDesc.topologyType = static_cast<uint32_t>(RHI::PrimitiveTopologyType::Triangle);
pipelineDesc.renderTargetCount = 1;
pipelineDesc.renderTargetFormats[0] = static_cast<uint32_t>(RHI::Format::R8G8B8A8_UNorm);
pipelineDesc.depthStencilFormat = static_cast<uint32_t>(RHI::Format::Unknown);
pipelineDesc.depthStencilFormat = static_cast<uint32_t>(RHI::Format::D24_UNorm_S8_UInt);
pipelineDesc.sampleCount = 1;
pipelineDesc.rasterizerState.fillMode = static_cast<uint32_t>(RHI::FillMode::Solid);
@@ -99,8 +99,9 @@ RHI::GraphicsPipelineDesc CreatePipelineDesc(RHI::RHIType backendType, RHI::RHIP
pipelineDesc.rasterizerState.frontFace = static_cast<uint32_t>(RHI::FrontFace::CounterClockwise);
pipelineDesc.rasterizerState.depthClipEnable = true;
pipelineDesc.depthStencilState.depthTestEnable = false;
pipelineDesc.depthStencilState.depthWriteEnable = false;
pipelineDesc.depthStencilState.depthTestEnable = true;
pipelineDesc.depthStencilState.depthWriteEnable = true;
pipelineDesc.depthStencilState.depthFunc = static_cast<uint32_t>(RHI::ComparisonFunc::Less);
pipelineDesc.depthStencilState.stencilEnable = false;
RHI::InputElementDesc position = {};
@@ -152,8 +153,10 @@ RHI::GraphicsPipelineDesc CreatePipelineDesc(RHI::RHIType backendType, RHI::RHIP
const Resources::Texture* FindMaterialTexture(const Resources::Material& material) {
static const char* kTextureNames[] = {
"baseColorTexture",
"_BaseColorTexture",
"_MainTex",
"albedoTexture",
"mainTexture",
"texture"
};
@@ -592,7 +595,8 @@ bool BuiltinForwardPipeline::DrawVisibleObject(
commandList->SetGraphicsDescriptorSets(kDescriptorFirstSet, 3, descriptorSets, m_pipelineLayout);
if (cachedMesh->indexBufferView != nullptr && section.indexCount > 0) {
commandList->DrawIndexed(section.indexCount, 1, section.startIndex, static_cast<int32_t>(section.baseVertex), 0);
// MeshLoader flattens section indices into a single global index buffer.
commandList->DrawIndexed(section.indexCount, 1, section.startIndex, 0, 0);
} else if (section.vertexCount > 0) {
commandList->Draw(section.vertexCount, 1, section.baseVertex, 0);
}