fix(step097): compile Metal retained attachment tests
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled

This commit is contained in:
tei
2026-09-26 10:47:09 +09:00
parent 0aab2bdc83
commit 8c006ac83d
2 changed files with 5 additions and 3 deletions

View File

@@ -55,7 +55,7 @@ RenderPass::RenderPass(CommandEncoder& commandEncoder_, const char* name, const
if (const auto& original = resource.getRenderPassDescriptor()) {
auto rpd = NS::TransferPtr(original->copy());
if (!rpd) throw std::runtime_error("Metal render pass descriptor copy failed");
detail::applyRenderPassClears(*rpd, descriptor.clearColor, descriptor.clearDepth, descriptor.clearStencil);
detail::applyRenderPassClears(*rpd.get(), descriptor.clearColor, descriptor.clearDepth, descriptor.clearStencil);
encoder = NS::RetainPtr(buffer->renderCommandEncoder(rpd.get()));
if (!encoder) throw std::runtime_error("Metal render command encoder unavailable");

View File

@@ -50,7 +50,7 @@ TEST(MetalRetainedAttachments, ClearActionsApplyToCombinedDepthStencil) {
descriptor->stencilAttachment()->setTexture(combinedTexture.get());
const auto applied = mtl::detail::applyRenderPassClears(
*descriptor, Color{0.2f, 0.3f, 0.4f, 0.5f}, 1.0f, 0);
*descriptor.get(), Color{0.2f, 0.3f, 0.4f, 0.5f}, 1.0f, 0);
EXPECT_TRUE(applied.color);
EXPECT_TRUE(applied.depth);
EXPECT_TRUE(applied.stencil);
@@ -67,6 +67,8 @@ TEST(MetalRetainedAttachments, ClearActionsApplyToCombinedDepthStencil) {
TEST(MetalRetainedAttachments, OffscreenBindsRequestedAttachmentsAndSkipsAbsentOnes) {
auto pool = NS::TransferPtr(NS::AutoreleasePool::alloc()->init());
auto device = NS::TransferPtr(MTL::CreateSystemDefaultDevice());
if (!device) GTEST_SKIP() << "Metal device unavailable";
TestMetalBackend backend;
mtl::Context context{backend};
@@ -93,7 +95,7 @@ TEST(MetalRetainedAttachments, OffscreenBindsRequestedAttachmentsAndSkipsAbsentO
ASSERT_TRUE(colorDescriptor);
EXPECT_EQ(colorDescriptor->depthAttachment()->texture(), nullptr);
EXPECT_EQ(colorDescriptor->stencilAttachment()->texture(), nullptr);
const auto applied = mtl::detail::applyRenderPassClears(*colorDescriptor, std::nullopt, 1.0f, 0);
const auto applied = mtl::detail::applyRenderPassClears(*colorDescriptor.get(), std::nullopt, 1.0f, 0);
EXPECT_FALSE(applied.depth);
EXPECT_FALSE(applied.stencil);
}