Skip to content

Commit 844d400

Browse files
chinmaygardednfield
authored andcommitted
Enable playgrounds in all tests and fix default sample counts.
The sample counts were invalid after the default assumed rendering to an MSAA target.
1 parent a449707 commit 844d400

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

impeller/aiks/aiks_unittests.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ TEST_F(AiksTest, CanRenderColoredRect) {
4747
.AddRect(Rect::MakeXYWH(100.0, 100.0, 100.0, 100.0))
4848
.TakePath(),
4949
paint);
50-
// ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
50+
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
5151
}
5252

5353
TEST_F(AiksTest, CanRenderImage) {
@@ -83,7 +83,7 @@ TEST_F(AiksTest, CanRenderStrokes) {
8383
paint.style = Paint::Style::kStroke;
8484
canvas.DrawPath(PathBuilder{}.AddLine({200, 100}, {800, 100}).TakePath(),
8585
paint);
86-
// ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
86+
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
8787
}
8888

8989
TEST_F(AiksTest, CanRenderCurvedStrokes) {

impeller/entity/entity_unittests.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ TEST_F(EntityTest, CanDrawRect) {
2222
Entity entity;
2323
entity.SetPath(PathBuilder{}.AddRect({100, 100, 100, 100}).TakePath());
2424
entity.SetContents(SolidColorContents::Make(Color::Red()));
25-
// ASSERT_TRUE(OpenPlaygroundHere(entity));
25+
ASSERT_TRUE(OpenPlaygroundHere(entity));
2626
}
2727

2828
} // namespace testing

impeller/renderer/backend/metal/render_pass_mtl.mm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,12 @@ static bool Bind(PassBindingsCache& pass,
409409
if (target_sample_count !=
410410
command.pipeline->GetDescriptor().GetSampleCount()) {
411411
VALIDATION_LOG << "Pipeline for command and the render target disagree "
412-
"on sample counts.";
412+
"on sample counts (target was "
413+
<< static_cast<uint64_t>(target_sample_count)
414+
<< " but pipeline wanted "
415+
<< static_cast<uint64_t>(
416+
command.pipeline->GetDescriptor().GetSampleCount())
417+
<< ").";
413418
return false;
414419
}
415420

impeller/renderer/renderer_unittests.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ TEST_F(RendererTest, CanCreateBoxPrimitive) {
3636
ASSERT_TRUE(context);
3737
using BoxPipelineBuilder = PipelineBuilder<VS, FS>;
3838
auto desc = BoxPipelineBuilder::MakeDefaultPipelineDescriptor(*context);
39+
ASSERT_TRUE(desc.has_value());
40+
desc->SetSampleCount(SampleCount::kCount4);
3941
auto box_pipeline =
4042
context->GetPipelineLibrary()->GetRenderPipeline(std::move(desc)).get();
4143
ASSERT_TRUE(box_pipeline);
@@ -89,7 +91,7 @@ TEST_F(RendererTest, CanCreateBoxPrimitive) {
8991
}
9092
return true;
9193
};
92-
// OpenPlaygroundHere(callback);
94+
OpenPlaygroundHere(callback);
9395
}
9496

9597
TEST_F(RendererTest, CanRenderMultiplePrimitives) {
@@ -159,7 +161,7 @@ TEST_F(RendererTest, CanRenderMultiplePrimitives) {
159161

160162
return true;
161163
};
162-
// OpenPlaygroundHere(callback);
164+
OpenPlaygroundHere(callback);
163165
}
164166

165167
TEST_F(RendererTest, CanRenderToTexture) {

0 commit comments

Comments
 (0)