Add forward shadow receiving support

This commit is contained in:
2026-04-04 23:01:34 +08:00
parent 353d129613
commit 96a44da2cb
22 changed files with 889 additions and 89 deletions

View File

@@ -154,6 +154,38 @@ TEST_P(RHITestFixture, Device_CreateShaderResourceView_FromInitialDataTexture) {
delete texture;
}
TEST_P(RHITestFixture, Device_CreateShaderResourceView_FromDepthTexture) {
TextureDesc texDesc = {};
texDesc.width = 256;
texDesc.height = 256;
texDesc.depth = 1;
texDesc.mipLevels = 1;
texDesc.arraySize = 1;
texDesc.format = static_cast<uint32_t>(Format::D24_UNorm_S8_UInt);
texDesc.textureType = static_cast<uint32_t>(TextureType::Texture2D);
texDesc.sampleCount = 1;
texDesc.sampleQuality = 0;
texDesc.flags = 0;
RHITexture* texture = GetDevice()->CreateTexture(texDesc);
ASSERT_NE(texture, nullptr);
ResourceViewDesc viewDesc = {};
viewDesc.format = static_cast<uint32_t>(Format::D24_UNorm_S8_UInt);
viewDesc.dimension = ResourceViewDimension::Texture2D;
viewDesc.mipLevel = 0;
RHIResourceView* srv = GetDevice()->CreateShaderResourceView(texture, viewDesc);
ASSERT_NE(srv, nullptr);
EXPECT_TRUE(srv->IsValid());
EXPECT_EQ(srv->GetViewType(), ResourceViewType::ShaderResource);
srv->Shutdown();
delete srv;
texture->Shutdown();
delete texture;
}
TEST_P(RHITestFixture, Device_CreateVertexBufferView) {
BufferDesc bufferDesc = {};
bufferDesc.size = 256;