Enable playgrounds in all tests and fix default sample counts.

The sample counts were invalid after the default assumed rendering to an MSAA target.
This commit is contained in:
Chinmay Garde
2022-02-02 16:13:12 -08:00
committed by Dan Field
parent 1a1a8c03f4
commit 4c46c6e8bb
4 changed files with 13 additions and 6 deletions

View File

@@ -47,7 +47,7 @@ TEST_F(AiksTest, CanRenderColoredRect) {
.AddRect(Rect::MakeXYWH(100.0, 100.0, 100.0, 100.0))
.TakePath(),
paint);
// ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}
TEST_F(AiksTest, CanRenderImage) {
@@ -83,7 +83,7 @@ TEST_F(AiksTest, CanRenderStrokes) {
paint.style = Paint::Style::kStroke;
canvas.DrawPath(PathBuilder{}.AddLine({200, 100}, {800, 100}).TakePath(),
paint);
// ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}
TEST_F(AiksTest, CanRenderCurvedStrokes) {

View File

@@ -22,7 +22,7 @@ TEST_F(EntityTest, CanDrawRect) {
Entity entity;
entity.SetPath(PathBuilder{}.AddRect({100, 100, 100, 100}).TakePath());
entity.SetContents(SolidColorContents::Make(Color::Red()));
// ASSERT_TRUE(OpenPlaygroundHere(entity));
ASSERT_TRUE(OpenPlaygroundHere(entity));
}
} // namespace testing

View File

@@ -409,7 +409,12 @@ bool RenderPassMTL::EncodeCommands(Allocator& allocator,
if (target_sample_count !=
command.pipeline->GetDescriptor().GetSampleCount()) {
VALIDATION_LOG << "Pipeline for command and the render target disagree "
"on sample counts.";
"on sample counts (target was "
<< static_cast<uint64_t>(target_sample_count)
<< " but pipeline wanted "
<< static_cast<uint64_t>(
command.pipeline->GetDescriptor().GetSampleCount())
<< ").";
return false;
}

View File

@@ -36,6 +36,8 @@ TEST_F(RendererTest, CanCreateBoxPrimitive) {
ASSERT_TRUE(context);
using BoxPipelineBuilder = PipelineBuilder<VS, FS>;
auto desc = BoxPipelineBuilder::MakeDefaultPipelineDescriptor(*context);
ASSERT_TRUE(desc.has_value());
desc->SetSampleCount(SampleCount::kCount4);
auto box_pipeline =
context->GetPipelineLibrary()->GetRenderPipeline(std::move(desc)).get();
ASSERT_TRUE(box_pipeline);
@@ -89,7 +91,7 @@ TEST_F(RendererTest, CanCreateBoxPrimitive) {
}
return true;
};
// OpenPlaygroundHere(callback);
OpenPlaygroundHere(callback);
}
TEST_F(RendererTest, CanRenderMultiplePrimitives) {
@@ -159,7 +161,7 @@ TEST_F(RendererTest, CanRenderMultiplePrimitives) {
return true;
};
// OpenPlaygroundHere(callback);
OpenPlaygroundHere(callback);
}
TEST_F(RendererTest, CanRenderToTexture) {