Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions impeller/aiks/picture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,22 @@ std::shared_ptr<Texture> Picture::RenderToTexture(
size, // size
"Picture Snapshot MSAA", // label
RenderTarget::
kDefaultColorAttachmentConfigMSAA, // color_attachment_config
std::nullopt // stencil_attachment_config
kDefaultColorAttachmentConfigMSAA // color_attachment_config
#ifndef FML_OS_ANDROID // Reduce PSO variants for Vulkan.
,
std::nullopt // stencil_attachment_config
#endif // FML_OS_ANDROID
);
} else {
target = RenderTarget::CreateOffscreen(
*impeller_context, // context
size, // size
"Picture Snapshot", // label
RenderTarget::kDefaultColorAttachmentConfig, // color_attachment_config
*impeller_context, // context
size, // size
"Picture Snapshot", // label
RenderTarget::kDefaultColorAttachmentConfig // color_attachment_config
#ifndef FML_OS_ANDROID // Reduce PSO variants for Vulkan.
,
std::nullopt // stencil_attachment_config
#endif // FML_OS_ANDROID
);
}
if (!target.IsValid()) {
Expand Down
18 changes: 15 additions & 3 deletions impeller/entity/contents/content_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ static std::unique_ptr<PipelineT> CreateDefaultPipeline(
// Apply default ContentContextOptions to the descriptor.
const auto default_color_fmt =
context.GetCapabilities()->GetDefaultColorFormat();
ContentContextOptions{.color_attachment_pixel_format = default_color_fmt}
ContentContextOptions{.sample_count = SampleCount::kCount4,
.color_attachment_pixel_format = default_color_fmt}
.ApplyToPipelineDescriptor(*desc);
return std::make_unique<PipelineT>(context, desc);
}
Expand All @@ -166,6 +167,7 @@ ContentContext::ContentContext(std::shared_ptr<Context> context)
return;
}
default_options_ = ContentContextOptions{
.sample_count = SampleCount::kCount4,
.color_attachment_pixel_format =
context_->GetCapabilities()->GetDefaultColorFormat()};

Expand Down Expand Up @@ -352,11 +354,21 @@ std::shared_ptr<Texture> ContentContext::MakeSubpass(
if (context->GetCapabilities()->SupportsOffscreenMSAA() && msaa_enabled) {
subpass_target = RenderTarget::CreateOffscreenMSAA(
*context, texture_size, SPrintF("%s Offscreen", label.c_str()),
RenderTarget::kDefaultColorAttachmentConfigMSAA, std::nullopt);
RenderTarget::kDefaultColorAttachmentConfigMSAA //
#ifndef FML_OS_ANDROID // Reduce PSO variants for Vulkan.
,
std::nullopt // stencil_attachment_config
#endif // FML_OS_ANDROID
);
} else {
subpass_target = RenderTarget::CreateOffscreen(
*context, texture_size, SPrintF("%s Offscreen", label.c_str()),
RenderTarget::kDefaultColorAttachmentConfig, std::nullopt);
RenderTarget::kDefaultColorAttachmentConfig //
#ifndef FML_OS_ANDROID // Reduce PSO variants for Vulkan.
,
std::nullopt // stencil_attachment_config
#endif // FML_OS_ANDROID
);
}
auto subpass_texture = subpass_target.GetRenderTargetTexture();
if (!subpass_texture) {
Expand Down
2 changes: 1 addition & 1 deletion impeller/entity/contents/content_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ using UvComputeShaderPipeline = ComputePipelineBuilder<UvComputeShader>;
/// Flutter application may easily require building hundreds of PSOs in total,
/// but they shouldn't require e.g. 10s of thousands.
struct ContentContextOptions {
SampleCount sample_count = SampleCount::kCount4;
SampleCount sample_count = SampleCount::kCount1;
BlendMode blend_mode = BlendMode::kSourceOver;
CompareFunction stencil_compare = CompareFunction::kEqual;
StencilOperation stencil_operation = StencilOperation::kKeep;
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/pipeline_descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class PipelineDescriptor final : public Comparable<PipelineDescriptor> {

private:
std::string label_;
SampleCount sample_count_ = SampleCount::kCount4;
SampleCount sample_count_ = SampleCount::kCount1;
WindingOrder winding_order_ = WindingOrder::kClockwise;
CullMode cull_mode_ = CullMode::kNone;
std::map<ShaderStage, std::shared_ptr<const ShaderFunction>> entrypoints_;
Expand Down
10 changes: 10 additions & 0 deletions impeller/renderer/render_target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ RenderTarget RenderTarget::CreateOffscreen(
return {};
}

// Dont force additional PSO variants on Vulkan.
#ifdef FML_OS_ANDROID
FML_DCHECK(stencil_attachment_config.has_value());
#endif // FML_OS_ANDROID

RenderTarget target;
PixelFormat pixel_format = context.GetCapabilities()->GetDefaultColorFormat();
TextureDescriptor color_tex0;
Expand Down Expand Up @@ -258,6 +263,11 @@ RenderTarget RenderTarget::CreateOffscreenMSAA(
return {};
}

// Dont force additional PSO variants on Vulkan.
#ifdef FML_OS_ANDROID
FML_DCHECK(stencil_attachment_config.has_value());
#endif // FML_OS_ANDROID

RenderTarget target;
PixelFormat pixel_format = context.GetCapabilities()->GetDefaultColorFormat();

Expand Down