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 17 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
8 changes: 8 additions & 0 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,8 @@ ORIGIN: ../../../flutter/impeller/renderer/compute_pipeline_builder.cc + ../../.
ORIGIN: ../../../flutter/impeller/renderer/compute_pipeline_builder.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/compute_pipeline_descriptor.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/compute_pipeline_descriptor.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/compute_tessellator.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/compute_tessellator.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/context.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/context.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/device_buffer.cc + ../../../flutter/LICENSE
Expand All @@ -1514,6 +1516,7 @@ ORIGIN: ../../../flutter/impeller/renderer/gpu_tracer.cc + ../../../flutter/LICE
ORIGIN: ../../../flutter/impeller/renderer/gpu_tracer.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/host_buffer.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/host_buffer.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/path_polyline.comp + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/pipeline.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/pipeline.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/pipeline_builder.cc + ../../../flutter/LICENSE
Expand Down Expand Up @@ -1548,6 +1551,7 @@ ORIGIN: ../../../flutter/impeller/renderer/shader_types.cc + ../../../flutter/LI
ORIGIN: ../../../flutter/impeller/renderer/shader_types.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/snapshot.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/snapshot.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/stroke.comp + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/surface.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/surface.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/texture.cc + ../../../flutter/LICENSE
Expand Down Expand Up @@ -4065,6 +4069,8 @@ FILE: ../../../flutter/impeller/renderer/compute_pipeline_builder.cc
FILE: ../../../flutter/impeller/renderer/compute_pipeline_builder.h
FILE: ../../../flutter/impeller/renderer/compute_pipeline_descriptor.cc
FILE: ../../../flutter/impeller/renderer/compute_pipeline_descriptor.h
FILE: ../../../flutter/impeller/renderer/compute_tessellator.cc
FILE: ../../../flutter/impeller/renderer/compute_tessellator.h
FILE: ../../../flutter/impeller/renderer/context.cc
FILE: ../../../flutter/impeller/renderer/context.h
FILE: ../../../flutter/impeller/renderer/device_buffer.cc
Expand All @@ -4077,6 +4083,7 @@ FILE: ../../../flutter/impeller/renderer/gpu_tracer.cc
FILE: ../../../flutter/impeller/renderer/gpu_tracer.h
FILE: ../../../flutter/impeller/renderer/host_buffer.cc
FILE: ../../../flutter/impeller/renderer/host_buffer.h
FILE: ../../../flutter/impeller/renderer/path_polyline.comp
FILE: ../../../flutter/impeller/renderer/pipeline.cc
FILE: ../../../flutter/impeller/renderer/pipeline.h
FILE: ../../../flutter/impeller/renderer/pipeline_builder.cc
Expand Down Expand Up @@ -4111,6 +4118,7 @@ FILE: ../../../flutter/impeller/renderer/shader_types.cc
FILE: ../../../flutter/impeller/renderer/shader_types.h
FILE: ../../../flutter/impeller/renderer/snapshot.cc
FILE: ../../../flutter/impeller/renderer/snapshot.h
FILE: ../../../flutter/impeller/renderer/stroke.comp
FILE: ../../../flutter/impeller/renderer/surface.cc
FILE: ../../../flutter/impeller/renderer/surface.h
FILE: ../../../flutter/impeller/renderer/texture.cc
Expand Down
4 changes: 4 additions & 0 deletions impeller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ impeller_component("impeller_unittests") {
"typographer:typographer_unittests",
]
}

if (impeller_enable_compute) {
deps += [ "renderer:compute_tessellation_unittests" ]
}
}

if (impeller_supports_rendering) {
Expand Down
20 changes: 19 additions & 1 deletion impeller/compiler/compiler.cc
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chinmaygarde please review this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Particularly for the Vulkan change)

Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ static CompilerBackend CreateMSLCompiler(const spirv_cross::ParsedIR& ir,
sl_options.platform =
TargetPlatformToMSLPlatform(source_options.target_platform);
sl_options.msl_version = ParseMSLVersion(source_options.metal_version);
sl_options.ios_use_simdgroup_functions =
sl_options.is_ios() &&
sl_options.msl_version >=
spirv_cross::CompilerMSL::Options::make_msl_version(2, 4, 0);
sl_options.use_framebuffer_fetch_subpasses = true;
sl_compiler->set_msl_options(sl_options);

Expand Down Expand Up @@ -108,6 +112,18 @@ static CompilerBackend CreateMSLCompiler(const spirv_cross::ParsedIR& ir,
return CompilerBackend(sl_compiler);
}

static CompilerBackend CreateVulkanCompiler(
const spirv_cross::ParsedIR& ir,
const SourceOptions& source_options) {
auto gl_compiler = std::make_shared<spirv_cross::CompilerGLSL>(ir);
spirv_cross::CompilerGLSL::Options sl_options;
sl_options.vulkan_semantics = true;
sl_options.vertex.fixup_clipspace = true;
sl_options.force_zero_initialized_variables = true;
gl_compiler->set_common_options(sl_options);
return CompilerBackend(gl_compiler);
}

static CompilerBackend CreateGLSLCompiler(const spirv_cross::ParsedIR& ir,
const SourceOptions& source_options) {
auto gl_compiler = std::make_shared<spirv_cross::CompilerGLSL>(ir);
Expand Down Expand Up @@ -162,9 +178,11 @@ static CompilerBackend CreateCompiler(const spirv_cross::ParsedIR& ir,
case TargetPlatform::kMetalDesktop:
case TargetPlatform::kMetalIOS:
case TargetPlatform::kRuntimeStageMetal:
compiler = CreateMSLCompiler(ir, source_options);
break;
case TargetPlatform::kVulkan:
case TargetPlatform::kRuntimeStageVulkan:
compiler = CreateMSLCompiler(ir, source_options);
compiler = CreateVulkanCompiler(ir, source_options);
break;
case TargetPlatform::kUnknown:
case TargetPlatform::kOpenGLES:
Expand Down
12 changes: 0 additions & 12 deletions impeller/entity/geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@ enum GeometryVertexType {
kUV,
};

enum class Cap {
kButt,
kRound,
kSquare,
};

enum class Join {
kMiter,
kRound,
kBevel,
};

class Geometry {
public:
Geometry();
Expand Down
6 changes: 2 additions & 4 deletions impeller/fixtures/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import("//flutter/impeller/tools/impeller.gni")
import("//flutter/testing/testing.gni")

if (impeller_enable_vulkan || impeller_enable_metal) {
if (impeller_enable_compute) {
impeller_shaders("shader_subgroup_fixtures") {
enable_opengles = false
name = "subgroup_fixtures"
Expand All @@ -16,7 +16,6 @@ if (impeller_enable_vulkan || impeller_enable_metal) {
shaders = [
"cubic_to_quads.comp",
"quad_polyline.comp",
"stroke.comp",
]
}
}
Expand Down Expand Up @@ -103,7 +102,6 @@ test_fixtures("file_fixtures") {
"sa%m#ple.vert",
"stage1.comp",
"stage2.comp",
"stroke.comp",
"struct_def_bug.vert",
"table_mountain_nx.png",
"table_mountain_ny.png",
Expand Down Expand Up @@ -137,7 +135,7 @@ group("fixtures") {
":shader_fixtures",
]

if (impeller_enable_vulkan || impeller_enable_metal) {
if (impeller_enable_compute) {
public_deps += [ ":shader_subgroup_fixtures" ]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,61 @@ std::vector<Point> golden_heart_vertices = {
{163.155, 22.7357}, {155.704, 20.5285}, {155.546, 21.5159},
{155.673, 20.5245}, {155.577, 21.5199}, {147.924, 19.7793},
{147.828, 20.7747}, {147.893, 19.7773}, {147.858, 20.7767},
{140.018, 19.5003}, {139.982, 20.4997}, {140, 20},
{140, 20}};
{140.018, 19.5003}, {139.982, 20.4997}, {140.018, 19.5003},
{139.982, 20.4997}};

std::vector<Point> golden_cubic_and_quad_points = {
{139.982, 19.5003}, {140.018, 20.4997}, {131.747, 19.8026},
{131.783, 20.802}, {131.715, 19.8048}, {131.815, 20.7998},
{123.622, 20.6102}, {123.721, 21.6053}, {123.59, 20.6145},
{123.753, 21.601}, {115.652, 21.9306}, {115.816, 22.9171},
{115.619, 21.9372}, {115.848, 22.9105}, {107.85, 23.7687},
{108.08, 24.742}, {107.817, 23.7777}, {108.113, 24.733},
{100.23, 26.1264}, {100.526, 27.0817}, {100.197, 26.1378},
{100.558, 27.0703}, {92.8037, 29.0025}, {93.165, 29.935},
{92.7736, 29.0154}, {93.1952, 29.9221}, {85.708, 32.3003},
{86.1296, 33.2071}, {85.68, 32.3144}, {86.1576, 33.193},
{78.8865, 36.008}, {79.3641, 36.8865}, {78.8588, 36.0242},
{79.3918, 36.8703}, {72.3485, 40.125}, {72.8815, 40.9711},
{72.3216, 40.1432}, {72.9084, 40.9529}, {66.1045, 44.6479},
{66.6913, 45.4577}, {66.0788, 44.6679}, {66.717, 45.4378},
{60.1632, 49.5711}, {60.8014, 50.341}, {60.139, 49.5924},
{60.8255, 50.3196}, {54.5317, 54.8864}, {55.2183, 55.6136},
{54.5094, 54.909}, {55.2406, 55.591}, {49.254, 60.5436},
{49.9853, 61.2257}, {49.2329, 60.5677}, {50.0063, 61.2016},
{44.3684, 66.5025}, {45.1418, 67.1364}, {44.3488, 66.5281},
{45.1614, 67.1108}, {39.8827, 72.7564}, {40.6954, 73.3391},
{39.8648, 72.7832}, {40.7133, 73.3123}, {35.8029, 79.297},
{36.6515, 79.8261}, {35.7869, 79.3246}, {36.6675, 79.7985},
{32.1328, 86.1144}, {33.0134, 86.5883}, {32.1188, 86.1424},
{33.0273, 86.5603}, {28.8739, 93.1973}, {29.7824, 93.6152},
{28.8613, 93.2272}, {29.795, 93.5853}, {26.0399, 100.583},
{26.9736, 100.941}, {26.0288, 100.615}, {26.9847, 100.908},
{23.7144, 108.15}, {24.6704, 108.444}, {23.7056, 108.183},
{24.6792, 108.411}, {21.9002, 115.886}, {22.8738, 116.115},
{21.8937, 115.919}, {22.8804, 116.082}, {20.5962, 123.779},
{21.5828, 123.942}, {20.592, 123.812}, {21.5871, 123.91},
{19.7985, 131.816}, {20.7936, 131.914}, {19.7964, 131.847},
{20.7957, 131.883}, {19.5003, 139.982}, {20.4997, 140.018},
{20.2883, 140.409}, {19.7117, 139.591}, {29.9421, 133.595},
{29.3655, 132.778}, {29.9544, 133.586}, {29.3532, 132.787},
{39.1905, 126.639}, {38.5894, 125.839}, {39.2039, 126.628},
{38.576, 125.85}, {47.9822, 119.545}, {47.3542, 118.767},
{47.9968, 119.533}, {47.3396, 118.779}, {56.2739, 112.316},
{55.6167, 111.562}, {56.2898, 112.302}, {55.6008, 111.577},
{64.0197, 104.952}, {63.3307, 104.228}, {64.0369, 104.935},
{63.3134, 104.245}, {71.1714, 97.4578}, {70.4479, 96.7675},
{71.1899, 97.4373}, {70.4294, 96.7879}, {77.6791, 89.8381},
{76.9187, 89.1887}, {77.6987, 89.8137}, {76.8991, 89.2131},
{83.4923, 82.1009}, {82.6928, 81.5003}, {83.5125, 82.0718},
{82.6725, 81.5293}, {88.5609, 74.2563}, {87.7209, 73.7138},
{88.5812, 74.2221}, {87.7007, 73.748}, {92.8369, 66.3173},
{91.9564, 65.8432}, {92.8562, 66.2772}, {91.9371, 65.8833},
{96.2756, 58.299}, {95.3564, 57.9051}, {96.2927, 58.253},
{95.3393, 57.951}, {98.8374, 50.2196}, {97.8841, 49.9176},
{98.8508, 50.1681}, {97.8708, 49.969}, {100.49, 42.0995},
{99.51, 41.9005}, {100.49, 42.0995}, {99.51, 41.9005},
};

} // namespace testing
} // namespace impeller
12 changes: 12 additions & 0 deletions impeller/geometry/path.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@

namespace impeller {

enum class Cap {
kButt,
kRound,
kSquare,
};

enum class Join {
kMiter,
kRound,
kBevel,
};

enum class FillType {
kNonZero, // The default winding order.
kOdd,
Expand Down
2 changes: 1 addition & 1 deletion impeller/playground/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impeller_component("playground") {
"//third_party/imgui:imgui_glfw",
]

if (impeller_enable_vulkan || impeller_enable_metal) {
if (impeller_enable_compute) {
public_deps += [ "../fixtures:shader_subgroup_fixtures" ]
}

Expand Down
37 changes: 20 additions & 17 deletions impeller/playground/backend/metal/playground_impl_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "impeller/renderer/backend/metal/formats_mtl.h"
#include "impeller/renderer/backend/metal/surface_mtl.h"
#include "impeller/renderer/backend/metal/texture_mtl.h"
#include "impeller/renderer/mtl/tessellation_shaders.h"
#include "impeller/scene/shaders/mtl/scene_shaders.h"

namespace impeller {
Expand All @@ -34,23 +35,25 @@

static std::vector<std::shared_ptr<fml::Mapping>>
ShaderLibraryMappingsForPlayground() {
return {
std::make_shared<fml::NonOwnedMapping>(impeller_entity_shaders_data,
impeller_entity_shaders_length),
std::make_shared<fml::NonOwnedMapping>(impeller_modern_shaders_data,
impeller_modern_shaders_length),
std::make_shared<fml::NonOwnedMapping>(
impeller_framebuffer_blend_shaders_data,
impeller_framebuffer_blend_shaders_length),
std::make_shared<fml::NonOwnedMapping>(impeller_fixtures_shaders_data,
impeller_fixtures_shaders_length),
std::make_shared<fml::NonOwnedMapping>(
impeller_subgroup_fixtures_shaders_data,
impeller_subgroup_fixtures_shaders_length),
std::make_shared<fml::NonOwnedMapping>(impeller_imgui_shaders_data,
impeller_imgui_shaders_length),
std::make_shared<fml::NonOwnedMapping>(impeller_scene_shaders_data,
impeller_scene_shaders_length),
return {std::make_shared<fml::NonOwnedMapping>(
impeller_entity_shaders_data, impeller_entity_shaders_length),
std::make_shared<fml::NonOwnedMapping>(
impeller_modern_shaders_data, impeller_modern_shaders_length),
std::make_shared<fml::NonOwnedMapping>(
impeller_framebuffer_blend_shaders_data,
impeller_framebuffer_blend_shaders_length),
std::make_shared<fml::NonOwnedMapping>(
impeller_fixtures_shaders_data, impeller_fixtures_shaders_length),
std::make_shared<fml::NonOwnedMapping>(
impeller_subgroup_fixtures_shaders_data,
impeller_subgroup_fixtures_shaders_length),
std::make_shared<fml::NonOwnedMapping>(impeller_imgui_shaders_data,
impeller_imgui_shaders_length),
std::make_shared<fml::NonOwnedMapping>(impeller_scene_shaders_data,
impeller_scene_shaders_length),
std::make_shared<fml::NonOwnedMapping>(
impeller_tessellation_shaders_data,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Consider naming these something other than tessellation shaders since these don't setup tessellation pipeline stages in the rasterizer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

impeller_tessellation_shaders_length)

};
}
Expand Down
Loading