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
capabilities and license
  • Loading branch information
jonahwilliams committed May 8, 2023
commit be1332ad0db7f3eaf11594762124f24b6c9c19d0
2 changes: 2 additions & 0 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ ORIGIN: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur_alp
ORIGIN: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur_alpha_nodecal.frag + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur_noalpha_decal.frag + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur_noalpha_nodecal.frag + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/shaders/geometry/points.vert + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/shaders/glyph_atlas.frag + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/shaders/glyph_atlas.vert + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/shaders/glyph_atlas_sdf.frag + ../../../flutter/LICENSE
Expand Down Expand Up @@ -3889,6 +3890,7 @@ FILE: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur_alpha
FILE: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur_alpha_nodecal.frag
FILE: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur_noalpha_decal.frag
FILE: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur_noalpha_nodecal.frag
FILE: ../../../flutter/impeller/entity/shaders/geometry/points.vert
FILE: ../../../flutter/impeller/entity/shaders/glyph_atlas.frag
FILE: ../../../flutter/impeller/entity/shaders/glyph_atlas.vert
FILE: ../../../flutter/impeller/entity/shaders/glyph_atlas_sdf.frag
Expand Down
8 changes: 6 additions & 2 deletions impeller/entity/contents/content_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,12 @@ ContentContext::ContentContext(std::shared_ptr<Context> context)
CreateDefaultPipeline<YUVToRGBFilterPipeline>(*context_);
porter_duff_blend_pipelines_[{}] =
CreateDefaultPipeline<PorterDuffBlendPipeline>(*context_);
point_field_geometry_pipelines_[{}] =
CreateDefaultNonRenderingPipeline<PointFieldGeometryPipeline>(*context_);

if (context_->GetCapabilities()->SupportsDisabledRasterization()) {
point_field_geometry_pipelines_[{}] =
CreateDefaultNonRenderingPipeline<PointFieldGeometryPipeline>(
*context_);
}

if (solid_fill_pipelines_[{}]->GetDescriptor().has_value()) {
auto clip_pipeline_descriptor =
Expand Down
2 changes: 2 additions & 0 deletions impeller/entity/contents/content_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ using FramebufferBlendScreenPipeline =
using FramebufferBlendSoftLightPipeline =
RenderPipelineT<FramebufferBlendVertexShader,
FramebufferBlendSoftlightFragmentShader>;

/// Geometry Pipelines
using PointFieldGeometryPipeline =
RenderPipelineT<PointsVertexShader, NonRenderingFragment>;
Expand Down Expand Up @@ -669,6 +670,7 @@ class ContentContext {

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

Expand Down
6 changes: 3 additions & 3 deletions impeller/entity/geometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,8 @@ GeometryResult PointFieldGeometry::GetPositionBuffer(
const ContentContext& renderer,
const Entity& entity,
RenderPass& pass) {
FML_DCHECK(renderer.GetDeviceCapabilities().SupportsDisabledRasterization());

auto divisions_per_circle = ComputeResultSize(
entity.GetTransformation().GetMaxBasisLength() * radius_, points_.size());
auto total = divisions_per_circle * points_.size() * 3;
Expand Down Expand Up @@ -951,7 +953,6 @@ GeometryResult PointFieldGeometry::GetPositionBuffer(
frame_info.radian_step = k2Pi / divisions_per_circle;
frame_info.points_per_circle = divisions_per_circle * 3;
frame_info.divisions_per_circle = divisions_per_circle;
frame_info.total_length = total;

VS::BindFrameInfo(cmd, host_buffer.EmplaceUniform(frame_info));
VS::BindGeometryData(
Expand All @@ -968,7 +969,6 @@ GeometryResult PointFieldGeometry::GetPositionBuffer(
.vertex_buffer = {.vertex_buffer = {.buffer = buffer,
.range =
Range{0, total * sizeof(Point)}},

.index_buffer = index_buffer,
.index_count = index_count,
.index_type = IndexType::k32bit},
Expand All @@ -984,7 +984,7 @@ GeometryResult PointFieldGeometry::GetPositionUVBuffer(
const ContentContext& renderer,
const Entity& entity,
RenderPass& pass) {
return {};
FML_UNREACHABLE();
}

/// @brief Compute the exact storage size needed to store the resulting buffer.
Expand Down
1 change: 0 additions & 1 deletion impeller/entity/shaders/geometry/points.vert
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ uniform FrameInfo {
float16_t radian_step;
int points_per_circle;
int divisions_per_circle;
int total_length;
}
frame_info;

Expand Down
1 change: 1 addition & 0 deletions impeller/renderer/backend/metal/context_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ static bool DeviceSupportsComputeSubgroups(id<MTLDevice> device) {
.SetSupportsComputeSubgroups(DeviceSupportsComputeSubgroups(device))
.SetSupportsReadFromResolve(true)
.SetSupportsReadFromOnscreenTexture(true)
.SetSupportsDisabledRasterization(true)
.Build();
}

Expand Down
15 changes: 15 additions & 0 deletions impeller/renderer/capabilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ class StandardCapabilities final : public Capabilities {
return supports_decal_tile_mode_;
}

// |Capabilities|
bool SupportsDisabledRasterization() const override {
return supports_disabled_rasterization_;
}

// |Capabilities|
PixelFormat GetDefaultColorFormat() const override {
return default_color_format_;
Expand All @@ -88,6 +93,7 @@ class StandardCapabilities final : public Capabilities {
bool supports_read_from_onscreen_texture,
bool supports_read_from_resolve,
bool supports_decal_tile_mode,
bool supports_disabled_rasterization,
PixelFormat default_color_format,
PixelFormat default_stencil_format)
: has_threading_restrictions_(has_threading_restrictions),
Expand All @@ -102,6 +108,7 @@ class StandardCapabilities final : public Capabilities {
supports_read_from_onscreen_texture),
supports_read_from_resolve_(supports_read_from_resolve),
supports_decal_tile_mode_(supports_decal_tile_mode),
supports_disabled_rasterization_(supports_disabled_rasterization),
default_color_format_(default_color_format),
default_stencil_format_(default_stencil_format) {}

Expand All @@ -118,6 +125,7 @@ class StandardCapabilities final : public Capabilities {
bool supports_read_from_onscreen_texture_ = false;
bool supports_read_from_resolve_ = false;
bool supports_decal_tile_mode_ = false;
bool supports_disabled_rasterization_ = false;
PixelFormat default_color_format_ = PixelFormat::kUnknown;
PixelFormat default_stencil_format_ = PixelFormat::kUnknown;

Expand Down Expand Up @@ -202,6 +210,12 @@ CapabilitiesBuilder& CapabilitiesBuilder::SetSupportsDecalTileMode(bool value) {
return *this;
}

CapabilitiesBuilder& CapabilitiesBuilder::SetSupportsDisabledRasterization(
bool value) {
supports_disabled_rasterization_ = value;
return *this;
}

std::unique_ptr<Capabilities> CapabilitiesBuilder::Build() {
return std::unique_ptr<StandardCapabilities>(new StandardCapabilities( //
has_threading_restrictions_, //
Expand All @@ -215,6 +229,7 @@ std::unique_ptr<Capabilities> CapabilitiesBuilder::Build() {
supports_read_from_onscreen_texture_, //
supports_read_from_resolve_, //
supports_decal_tile_mode_, //
supports_disabled_rasterization_, //
*default_color_format_, //
*default_stencil_format_ //
));
Expand Down
5 changes: 5 additions & 0 deletions impeller/renderer/capabilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class Capabilities {

virtual bool SupportsDecalTileMode() const = 0;

virtual bool SupportsDisabledRasterization() const = 0;

virtual PixelFormat GetDefaultColorFormat() const = 0;

virtual PixelFormat GetDefaultStencilFormat() const = 0;
Expand Down Expand Up @@ -79,6 +81,8 @@ class CapabilitiesBuilder {

CapabilitiesBuilder& SetSupportsDecalTileMode(bool value);

CapabilitiesBuilder& SetSupportsDisabledRasterization(bool value);

std::unique_ptr<Capabilities> Build();

private:
Expand All @@ -93,6 +97,7 @@ class CapabilitiesBuilder {
bool supports_read_from_onscreen_texture_ = false;
bool supports_read_from_resolve_ = false;
bool supports_decal_tile_mode_ = false;
bool supports_disabled_rasterization_ = false;
std::optional<PixelFormat> default_color_format_ = std::nullopt;
std::optional<PixelFormat> default_stencil_format_ = std::nullopt;

Expand Down
1 change: 1 addition & 0 deletions impeller/renderer/capabilities_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ CAPABILITY_TEST(SupportsComputeSubgroups, false);
CAPABILITY_TEST(SupportsReadFromOnscreenTexture, false);
CAPABILITY_TEST(SupportsReadFromResolve, false);
CAPABILITY_TEST(SupportsDecalTileMode, false);
CAPABILITY_TEST(SupportsDisabledRasterization, false);

} // namespace testing
} // namespace impeller
2 changes: 1 addition & 1 deletion impeller/renderer/pipeline_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class NonRenderingFragment {
static constexpr std::string_view kLabel = "NonRendering";
static constexpr std::string_view kEntrypointName = "non_rendering_main";
static constexpr ShaderStage kShaderStage = ShaderStage::kFragment;
static constexpr std::string_view kGeneratorName = "";
static constexpr std::string_view kGeneratorName = "NonRendering";
static constexpr std::array<DescriptorSetLayout, 0> kDescriptorSetLayouts{};
};

Expand Down