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 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
961008c
[Impeller] compute circles in vertex shader
May 7, 2023
56638b0
++
May 8, 2023
be1332a
capabilities and license
May 8, 2023
7a83b0d
add support for square caps
May 8, 2023
d36a452
++
May 8, 2023
69ea8a9
++
May 8, 2023
6a830a7
++
May 8, 2023
5cec1a4
switch to enum class and add docs
May 8, 2023
de05b5c
fix offsets
May 9, 2023
94b0808
Merge branch 'master' of github.com:flutter/engine into draw_circles
May 10, 2023
f0a8297
use different render pass
May 10, 2023
96fea2f
Merge branch 'master' of github.com:flutter/engine into draw_circles
May 10, 2023
faba06f
fix merge
May 10, 2023
a8e4106
add CPU fallback
May 10, 2023
8b8f4f8
++
May 10, 2023
b23b616
fix off by one
May 10, 2023
0591bf1
non working index buffer removal
May 11, 2023
0fc1ee2
fix no index
May 12, 2023
6d979a2
++
May 12, 2023
75ce9fb
Merge branch 'master' of github.com:flutter/engine into draw_circles
May 12, 2023
a2f218d
++
May 12, 2023
cbb0aa6
Rename field
May 12, 2023
542b465
Merge branch 'master' of github.com:flutter/engine into draw_circles
May 12, 2023
8799795
improve efficiency
May 12, 2023
b715d40
++
May 12, 2023
7693925
disable on desktop
May 12, 2023
8cc4e81
Merge branch 'master' of github.com:flutter/engine into draw_circles
May 12, 2023
6f46186
fix geometry computation bug
May 13, 2023
cca59fe
malioc update
May 13, 2023
f08fff2
++
May 13, 2023
36b9ee3
[Impeller] draw cirlces with compute
May 13, 2023
08296cd
remove disabled rasterization support
May 15, 2023
9603338
++
May 15, 2023
728a734
++
May 15, 2023
92534b8
++
May 15, 2023
e306942
++
May 15, 2023
408642f
++
May 15, 2023
4a44b46
add golden for drawPoints
May 15, 2023
78f5a57
Merge branch 'master' of github.com:flutter/engine into draw_with_com…
May 16, 2023
c907260
dnfield review
May 18, 2023
1f0a9b6
Merge branch 'main' into draw_with_compute
May 18, 2023
40ef2b4
++
May 18, 2023
e788b29
Merge branch 'master' of github.com:flutter/engine into draw_with_com…
May 18, 2023
ca70a31
Merge branch 'draw_with_compute' of github.com:jonahwilliams/engine i…
May 18, 2023
14e76fc
fix threadgroup size for 1d dispatch
May 19, 2023
6e82927
Remove commented out code
May 19, 2023
96921e2
dont use std numeric limits
May 19, 2023
0275a10
++
May 19, 2023
e4fae27
++
May 19, 2023
f9e57a2
Merge branch 'main' into draw_with_compute
May 19, 2023
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
Prev Previous commit
Next Next commit
remove disabled rasterization support
  • Loading branch information
jonahwilliams committed May 15, 2023
commit 08296cdf8e05c8e11f35ab6188c11fa19ee571c3
21 changes: 0 additions & 21 deletions impeller/entity/contents/content_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,22 +163,6 @@ static std::unique_ptr<PipelineT> CreateDefaultPipeline(
return std::make_unique<PipelineT>(context, desc);
}

template <typename PipelineT>
static std::unique_ptr<PipelineT> CreateDefaultNonRenderingPipeline(
const Context& context) {
auto desc = PipelineT::Builder::MakeDefaultPipelineDescriptor(context);
if (!desc.has_value()) {
return nullptr;
}
// Apply default ContentContextOptions to the descriptor.
const auto default_color_fmt =
context.GetCapabilities()->GetDefaultColorFormat();
ContentContextOptions{.color_attachment_pixel_format = default_color_fmt,
.enable_rasterization = false}
.ApplyToPipelineDescriptor(*desc);
return std::make_unique<PipelineT>(context, desc);
}

ContentContext::ContentContext(std::shared_ptr<Context> context)
: context_(std::move(context)),
tessellator_(std::make_shared<Tessellator>()),
Expand Down Expand Up @@ -314,11 +298,6 @@ ContentContext::ContentContext(std::shared_ptr<Context> context)
porter_duff_blend_pipelines_[{}] =
CreateDefaultPipeline<PorterDuffBlendPipeline>(*context_);

if (context_->GetCapabilities()->SupportsDisabledRasterization()) {
point_field_geometry_pipelines_[{}] =
CreateDefaultNonRenderingPipeline<PointFieldGeometryPipeline>(
*context_);
}
if (context_->GetCapabilities()->SupportsCompute()) {
auto pipeline_desc =
PointsComputeShaderPipeline::MakeDefaultPipelineDescriptor(*context_);
Expand Down
10 changes: 0 additions & 10 deletions impeller/entity/contents/content_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,6 @@ using FramebufferBlendSoftLightPipeline =
FramebufferBlendSoftlightFragmentShader>;

/// Geometry Pipelines
using PointFieldGeometryPipeline =
RenderPipelineT<PointsVertexShader, NonRenderingFragment>;
using PointsComputeShaderPipeline = ComputePipelineBuilder<PointsComputeShader>;

/// Pipeline state configuration.
Expand Down Expand Up @@ -669,12 +667,6 @@ class ContentContext {
return GetPipeline(framebuffer_blend_softlight_pipelines_, opts);
}

std::shared_ptr<Pipeline<PipelineDescriptor>> GetPointFieldGeometryPipeline(
ContentContextOptions opts) const {
FML_DCHECK(GetDeviceCapabilities().SupportsDisabledRasterization());
return GetPipeline(point_field_geometry_pipelines_, opts);
}

std::shared_ptr<Pipeline<ComputePipelineDescriptor>> GetPointComputePipeline()
const {
FML_DCHECK(GetDeviceCapabilities().SupportsCompute());
Expand Down Expand Up @@ -806,8 +798,6 @@ class ContentContext {
mutable std::shared_ptr<Pipeline<ComputePipelineDescriptor>>
point_field_compute_pipelines_;

mutable Variants<PointFieldGeometryPipeline> point_field_geometry_pipelines_;

template <class TypedPipeline>
std::shared_ptr<Pipeline<PipelineDescriptor>> GetPipeline(
Variants<TypedPipeline>& container,
Expand Down
34 changes: 0 additions & 34 deletions impeller/entity/geometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,6 @@ GeometryResult PointFieldGeometry::GetPositionBuffer(

using PS = PointsComputeShader;

// using VS = PointFieldGeometryPipeline::VertexShader;

auto points_data = host_buffer.Emplace(
points_.data(), points_.size() * sizeof(Point), alignof(Point));

Expand All @@ -859,14 +857,6 @@ GeometryResult PointFieldGeometry::GetPositionBuffer(
cmd.label = "Points Geometry";
cmd.pipeline = renderer.GetPointComputePipeline();

// auto options = OptionsFromPass(pass);
// options.blend_mode = BlendMode::kSource;
// options.stencil_compare = CompareFunction::kAlways;
// options.stencil_operation = StencilOperation::kKeep;
// options.enable_rasterization = false;
// options.sample_count = SampleCount::kCount1;
// cmd.pipeline = renderer.GetPointFieldGeometryPipeline(options);

PS::FrameInfo frame_info;
frame_info.count = points_.size();
frame_info.radius = radius;
Expand All @@ -892,30 +882,6 @@ GeometryResult PointFieldGeometry::GetPositionBuffer(
}
}

// cmd.BindVertices(vtx_buffer);

// // Ensure correct synchronization by submitting vertex computation into
// // a different render pass.
// {
// auto render_target = RenderTarget::CreateOffscreen(
// *renderer.GetContext(), // context
// {1, 1}, // size
// "Geometry Snapshot", // label
// RenderTarget::
// kDefaultColorAttachmentConfigNonRendering, //
// color_attachment_config
// std::nullopt // stencil_attachment_config
// );
// auto cmd_buffer = renderer.GetContext()->CreateCommandBuffer();
// auto vertex_render_pass = cmd_buffer->CreateRenderPass(render_target);

// if (!vertex_render_pass->AddCommand(std::move(cmd)) ||
// !vertex_render_pass->EncodeCommands() ||
// !cmd_buffer->SubmitCommands()) {
// return {};
// }
// }

return {
.type = PrimitiveType::kTriangle,
.vertex_buffer = {.vertex_buffer = {.buffer = buffer,
Expand Down
49 changes: 11 additions & 38 deletions impeller/renderer/pipeline_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@

namespace impeller {

class NonRenderingFragment {
public:
static constexpr std::string_view kLabel = "";
static constexpr std::string_view kEntrypointName = "";
static constexpr ShaderStage kShaderStage = ShaderStage::kFragment;
static constexpr std::string_view kGeneratorName = "";
static constexpr std::array<DescriptorSetLayout, 0> kDescriptorSetLayouts{};
};

//------------------------------------------------------------------------------
/// @brief An optional (but highly recommended) utility for creating
/// pipelines from reflected shader information.
Expand Down Expand Up @@ -69,40 +60,22 @@ struct PipelineBuilder {
const Context& context,
PipelineDescriptor& desc) {
// Setup debug instrumentation.
if (!std::is_same<FragmentShader, NonRenderingFragment>::value) {
desc.SetLabel(SPrintF("%s Pipeline", FragmentShader::kLabel.data()));
} else {
desc.SetLabel(SPrintF("%s Pipeline", VertexShader::kLabel.data()));
}
desc.SetLabel(SPrintF("%s Pipeline", FragmentShader::kLabel.data()));

// Resolve pipeline entrypoints.
{
auto vertex_function = context.GetShaderLibrary()->GetFunction(
VertexShader::kEntrypointName, ShaderStage::kVertex);

std::shared_ptr<const ShaderFunction> fragment_function;
if (!std::is_same<FragmentShader, NonRenderingFragment>::value) {
fragment_function = context.GetShaderLibrary()->GetFunction(
FragmentShader::kEntrypointName, ShaderStage::kFragment);
}

if (!std::is_same<FragmentShader, NonRenderingFragment>::value) {
if (!vertex_function || !fragment_function) {
VALIDATION_LOG << "Could not resolve pipeline entrypoint(s) '"
<< VertexShader::kEntrypointName << "' and '"
<< FragmentShader::kEntrypointName
<< "' for pipeline named '" << VertexShader::kLabel
<< "'.";
return false;
}
} else {
if (!vertex_function) {
VALIDATION_LOG << "Could not resolve pipeline entrypoint(s) '"
<< FragmentShader::kEntrypointName
<< "' for pipeline named '" << VertexShader::kLabel
<< "'.";
return false;
}
auto fragment_function = context.GetShaderLibrary()->GetFunction(
FragmentShader::kEntrypointName, ShaderStage::kFragment);

if (!vertex_function || !fragment_function) {
VALIDATION_LOG << "Could not resolve pipeline entrypoint(s) '"
<< VertexShader::kEntrypointName << "' and '"
<< FragmentShader::kEntrypointName
<< "' for pipeline named '" << VertexShader::kLabel
<< "'.";
return false;
}

desc.AddStageEntrypoint(std::move(vertex_function));
Expand Down
6 changes: 0 additions & 6 deletions impeller/renderer/render_target.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ class RenderTarget final {
.store_action = StoreAction::kDontCare,
.clear_color = Color::BlackTransparent()};

static constexpr AttachmentConfig kDefaultColorAttachmentConfigNonRendering =
{.storage_mode = StorageMode::kDevicePrivate,
.load_action = LoadAction::kDontCare,
.store_action = StoreAction::kDontCare,
.clear_color = Color::BlackTransparent()};

static RenderTarget CreateOffscreen(
const Context& context,
ISize size,
Expand Down