diff --git a/ci/builders/mac_unopt.json b/ci/builders/mac_unopt.json index f0591e9e3e355..357bc5e33cb0f 100644 --- a/ci/builders/mac_unopt.json +++ b/ci/builders/mac_unopt.json @@ -13,7 +13,8 @@ "debug", "--unoptimized", "--no-lto", - "--prebuilt-dart-sdk" + "--prebuilt-dart-sdk", + "--enable-impeller-3d" ], "name": "host_debug_unopt", "ninja": { diff --git a/impeller/BUILD.gn b/impeller/BUILD.gn index 9855acc959de5..b62ab1262c597 100644 --- a/impeller/BUILD.gn +++ b/impeller/BUILD.gn @@ -44,6 +44,10 @@ config("impeller_public_config") { "_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING", ] } + + if (impeller_enable_3d) { + defines += [ "IMPELLER_ENABLE_3D" ] + } } group("impeller") { diff --git a/impeller/aiks/BUILD.gn b/impeller/aiks/BUILD.gn index 91ba4d190bac2..6509f6b3dd2a0 100644 --- a/impeller/aiks/BUILD.gn +++ b/impeller/aiks/BUILD.gn @@ -67,6 +67,7 @@ impeller_component("aiks_unittests") { "//flutter/impeller/geometry:geometry_asserts", "//flutter/impeller/golden_tests:golden_playground_test", "//flutter/impeller/playground:playground_test", + "//flutter/impeller/scene", "//flutter/impeller/typographer/backends/stb:typographer_stb_backend", "//flutter/testing:testing_lib", ] @@ -92,6 +93,7 @@ impeller_component("aiks_unittests_golden") { "//flutter/impeller/geometry:geometry_asserts", "//flutter/impeller/golden_tests:golden_playground_test", "//flutter/impeller/playground:playground_test", + "//flutter/impeller/scene", "//flutter/impeller/typographer/backends/stb:typographer_stb_backend", "//flutter/testing:testing_lib", ] diff --git a/impeller/aiks/aiks_unittests.cc b/impeller/aiks/aiks_unittests.cc index ba4305c1b63d4..540024415027d 100644 --- a/impeller/aiks/aiks_unittests.cc +++ b/impeller/aiks/aiks_unittests.cc @@ -2056,6 +2056,7 @@ TEST_P(AiksTest, SaveLayerFiltersScaleWithTransform) { ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); } +#if IMPELLER_ENABLE_3D TEST_P(AiksTest, SceneColorSource) { // Load up the scene. auto mapping = @@ -2096,6 +2097,7 @@ TEST_P(AiksTest, SceneColorSource) { ASSERT_TRUE(OpenPlaygroundHere(callback)); } +#endif // IMPELLER_ENABLE_3D TEST_P(AiksTest, PaintWithFilters) { // validate that a paint with a color filter "HasFilters", no other filters diff --git a/impeller/aiks/color_source.cc b/impeller/aiks/color_source.cc index 082225dd505a9..3329bcb4b832e 100644 --- a/impeller/aiks/color_source.cc +++ b/impeller/aiks/color_source.cc @@ -13,7 +13,6 @@ #include "impeller/entity/contents/linear_gradient_contents.h" #include "impeller/entity/contents/radial_gradient_contents.h" #include "impeller/entity/contents/runtime_effect_contents.h" -#include "impeller/entity/contents/scene_contents.h" #include "impeller/entity/contents/solid_color_contents.h" #include "impeller/entity/contents/sweep_gradient_contents.h" #include "impeller/entity/contents/tiled_texture_contents.h" @@ -21,7 +20,11 @@ #include "impeller/geometry/matrix.h" #include "impeller/geometry/scalar.h" #include "impeller/runtime_stage/runtime_stage.h" -#include "impeller/scene/node.h" + +#if IMPELLER_ENABLE_3D +#include "impeller/entity/contents/scene_contents.h" // nogncheck +#include "impeller/scene/node.h" // nogncheck +#endif // IMPELLER_ENABLE_3D namespace impeller { @@ -210,6 +213,7 @@ ColorSource ColorSource::MakeRuntimeEffect( return result; } +#if IMPELLER_ENABLE_3D ColorSource ColorSource::MakeScene(std::shared_ptr scene_node, Matrix camera_transform) { ColorSource result; @@ -224,6 +228,7 @@ ColorSource ColorSource::MakeScene(std::shared_ptr scene_node, }; return result; } +#endif // IMPELLER_ENABLE_3D ColorSource::Type ColorSource::GetType() const { return type_; diff --git a/impeller/aiks/color_source.h b/impeller/aiks/color_source.h index 84c6a6e3d56b8..7849b841ec784 100644 --- a/impeller/aiks/color_source.h +++ b/impeller/aiks/color_source.h @@ -15,7 +15,10 @@ #include "impeller/geometry/matrix.h" #include "impeller/geometry/point.h" #include "impeller/runtime_stage/runtime_stage.h" -#include "impeller/scene/node.h" + +#if IMPELLER_ENABLE_3D +#include "impeller/scene/node.h" // nogncheck +#endif // IMPELLER_ENABLE_3D namespace impeller { @@ -85,8 +88,10 @@ class ColorSource { std::shared_ptr> uniform_data, std::vector texture_inputs); +#if IMPELLER_ENABLE_3D static ColorSource MakeScene(std::shared_ptr scene_node, Matrix camera_transform); +#endif // IMPELLER_ENABLE_3D Type GetType() const; diff --git a/impeller/display_list/BUILD.gn b/impeller/display_list/BUILD.gn index c84a693a5fb1a..24a1980f59aac 100644 --- a/impeller/display_list/BUILD.gn +++ b/impeller/display_list/BUILD.gn @@ -61,6 +61,7 @@ impeller_component("display_list_unittests") { deps = [ ":display_list", "../playground:playground_test", + "//flutter/impeller/scene", "//flutter/impeller/typographer/backends/stb:typographer_stb_backend", ] diff --git a/impeller/display_list/dl_dispatcher.cc b/impeller/display_list/dl_dispatcher.cc index 1aff59079bcd6..0a61b45b72f23 100644 --- a/impeller/display_list/dl_dispatcher.cc +++ b/impeller/display_list/dl_dispatcher.cc @@ -26,7 +26,6 @@ #include "impeller/entity/contents/linear_gradient_contents.h" #include "impeller/entity/contents/radial_gradient_contents.h" #include "impeller/entity/contents/runtime_effect_contents.h" -#include "impeller/entity/contents/scene_contents.h" #include "impeller/entity/contents/sweep_gradient_contents.h" #include "impeller/entity/contents/tiled_texture_contents.h" #include "impeller/entity/entity.h" @@ -37,6 +36,10 @@ #include "impeller/geometry/sigma.h" #include "impeller/typographer/backends/skia/text_frame_skia.h" +#if IMPELLER_ENABLE_3D +#include "impeller/entity/contents/scene_contents.h" +#endif // IMPELLER_ENABLE_3D + namespace impeller { #define UNIMPLEMENTED \ diff --git a/impeller/entity/BUILD.gn b/impeller/entity/BUILD.gn index 0b55979172c2e..57113a7b7bbc5 100644 --- a/impeller/entity/BUILD.gn +++ b/impeller/entity/BUILD.gn @@ -203,8 +203,6 @@ impeller_component("entity") { "contents/radial_gradient_contents.h", "contents/runtime_effect_contents.cc", "contents/runtime_effect_contents.h", - "contents/scene_contents.cc", - "contents/scene_contents.h", "contents/solid_color_contents.cc", "contents/solid_color_contents.h", "contents/solid_rrect_blur_contents.cc", @@ -261,10 +259,17 @@ impeller_component("entity") { "../archivist", "../image:image_skia_backend", "../renderer", - "../scene", "../typographer", ] + if (impeller_enable_3d) { + sources += [ + "contents/scene_contents.cc", + "contents/scene_contents.h", + ] + public_deps += [ "../scene" ] + } + deps = [ "//flutter/fml" ] } diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index 081895bd0182c..2501ef822f053 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -167,7 +167,9 @@ ContentContext::ContentContext( lazy_glyph_atlas_( std::make_shared(std::move(typographer_context))), tessellator_(std::make_shared()), +#if IMPELLER_ENABLE_3D scene_context_(std::make_shared(context_)), +#endif // IMPELLER_ENABLE_3D render_target_cache_(std::make_shared( context_->GetResourceAllocator())) { if (!context_ || !context_->IsValid()) { @@ -413,9 +415,11 @@ std::shared_ptr ContentContext::MakeSubpass( return subpass_texture; } +#if IMPELLER_ENABLE_3D std::shared_ptr ContentContext::GetSceneContext() const { return scene_context_; } +#endif // IMPELLER_ENABLE_3D std::shared_ptr ContentContext::GetTessellator() const { return tessellator_; diff --git a/impeller/entity/contents/content_context.h b/impeller/entity/contents/content_context.h index fd976542d0d41..549d2b29811de 100644 --- a/impeller/entity/contents/content_context.h +++ b/impeller/entity/contents/content_context.h @@ -18,7 +18,6 @@ #include "impeller/renderer/capabilities.h" #include "impeller/renderer/pipeline.h" #include "impeller/renderer/render_target.h" -#include "impeller/scene/scene_context.h" #include "impeller/typographer/typographer_context.h" #ifdef IMPELLER_DEBUG @@ -113,6 +112,10 @@ #include "impeller/entity/framebuffer_blend_screen.frag.h" #include "impeller/entity/framebuffer_blend_softlight.frag.h" +#if IMPELLER_ENABLE_3D +#include "impeller/scene/scene_context.h" // nogncheck +#endif + namespace impeller { #ifdef IMPELLER_DEBUG @@ -348,7 +351,9 @@ class ContentContext { bool IsValid() const; +#if IMPELLER_ENABLE_3D std::shared_ptr GetSceneContext() const; +#endif // IMPELLER_ENABLE_3D std::shared_ptr GetTessellator() const; @@ -873,7 +878,9 @@ class ContentContext { bool is_valid_ = false; std::shared_ptr tessellator_; +#if IMPELLER_ENABLE_3D std::shared_ptr scene_context_; +#endif // IMPELLER_ENABLE_3D std::shared_ptr render_target_cache_; bool wireframe_ = false; diff --git a/impeller/tools/malioc.json b/impeller/tools/malioc.json index a0aeed92e6937..3fa01c48f9fbb 100644 --- a/impeller/tools/malioc.json +++ b/impeller/tools/malioc.json @@ -14571,732 +14571,5 @@ } } } - }, - "flutter/impeller/scene/shaders/gles/skinned.vert.gles": { - "Mali-G78": { - "core": "Mali-G78", - "filename": "flutter/impeller/scene/shaders/gles/skinned.vert.gles", - "has_uniform_computation": true, - "type": "Vertex", - "variants": { - "Position": { - "fp16_arithmetic": 0, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "load_store", - "texture" - ], - "longest_path_cycles": [ - 3.075000047683716, - 3.075000047683716, - 0.09375, - 0.0, - 4.0, - 4.0 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "load_store" - ], - "shortest_path_cycles": [ - 1.2625000476837158, - 1.2625000476837158, - 0.296875, - 0.0, - 2.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store", - "texture" - ], - "total_cycles": [ - 3.075000047683716, - 3.075000047683716, - 0.359375, - 0.0, - 4.0, - 4.0 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 50, - "uniform_registers_used": 30, - "work_registers_used": 64 - }, - "Varying": { - "fp16_arithmetic": 0, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "load_store" - ], - "longest_path_cycles": [ - 3.59375, - 3.59375, - 0.09375, - 0.0, - 13.0, - 4.0 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "load_store" - ], - "shortest_path_cycles": [ - 1.78125, - 1.78125, - 0.296875, - 0.0, - 11.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store" - ], - "total_cycles": [ - 3.59375, - 3.59375, - 0.359375, - 0.0, - 13.0, - 4.0 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 50, - "uniform_registers_used": 26, - "work_registers_used": 64 - } - } - }, - "Mali-T880": { - "core": "Mali-T880", - "filename": "flutter/impeller/scene/shaders/gles/skinned.vert.gles", - "has_uniform_computation": false, - "type": "Vertex", - "variants": { - "Main": { - "has_stack_spilling": true, - "performance": { - "longest_path_bound_pipelines": [ - "arithmetic" - ], - "longest_path_cycles": [ - 23.43000030517578, - 17.0, - 16.0 - ], - "pipelines": [ - "arithmetic", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "load_store" - ], - "shortest_path_cycles": [ - 12.210000038146973, - 13.0, - 0.0 - ], - "total_bound_pipelines": [ - "arithmetic" - ], - "total_cycles": [ - 20.0, - 17.0, - 16.0 - ] - }, - "thread_occupancy": 50, - "uniform_registers_used": 7, - "work_registers_used": 8 - } - } - } - }, - "flutter/impeller/scene/shaders/gles/unlit.frag.gles": { - "Mali-G78": { - "core": "Mali-G78", - "filename": "flutter/impeller/scene/shaders/gles/unlit.frag.gles", - "has_side_effects": false, - "has_uniform_computation": false, - "modifies_coverage": false, - "reads_color_buffer": false, - "type": "Fragment", - "uses_late_zs_test": false, - "uses_late_zs_update": false, - "variants": { - "Main": { - "fp16_arithmetic": 0, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "varying" - ], - "longest_path_cycles": [ - 0.25, - 0.25, - 0.03125, - 0.0, - 0.0, - 0.75, - 0.25 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "varying", - "texture" - ], - "shortest_path_bound_pipelines": [ - "varying" - ], - "shortest_path_cycles": [ - 0.25, - 0.25, - 0.0, - 0.0, - 0.0, - 0.75, - 0.25 - ], - "total_bound_pipelines": [ - "varying" - ], - "total_cycles": [ - 0.25, - 0.25, - 0.03125, - 0.0, - 0.0, - 0.75, - 0.25 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 8, - "work_registers_used": 19 - } - } - }, - "Mali-T880": { - "core": "Mali-T880", - "filename": "flutter/impeller/scene/shaders/gles/unlit.frag.gles", - "has_uniform_computation": false, - "type": "Fragment", - "variants": { - "Main": { - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "load_store" - ], - "longest_path_cycles": [ - 1.0, - 2.0, - 1.0 - ], - "pipelines": [ - "arithmetic", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "load_store" - ], - "shortest_path_cycles": [ - 1.0, - 2.0, - 1.0 - ], - "total_bound_pipelines": [ - "load_store" - ], - "total_cycles": [ - 1.3333333730697632, - 2.0, - 1.0 - ] - }, - "thread_occupancy": 100, - "uniform_registers_used": 2, - "work_registers_used": 2 - } - } - } - }, - "flutter/impeller/scene/shaders/gles/unskinned.vert.gles": { - "Mali-G78": { - "core": "Mali-G78", - "filename": "flutter/impeller/scene/shaders/gles/unskinned.vert.gles", - "has_uniform_computation": false, - "type": "Vertex", - "variants": { - "Position": { - "fp16_arithmetic": 0, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "load_store" - ], - "longest_path_cycles": [ - 0.265625, - 0.265625, - 0.0, - 0.0, - 2.0, - 0.0 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "load_store" - ], - "shortest_path_cycles": [ - 0.265625, - 0.265625, - 0.0, - 0.0, - 2.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store" - ], - "total_cycles": [ - 0.265625, - 0.265625, - 0.0, - 0.0, - 2.0, - 0.0 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 24, - "work_registers_used": 32 - }, - "Varying": { - "fp16_arithmetic": 0, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "load_store" - ], - "longest_path_cycles": [ - 0.75, - 0.75, - 0.0, - 0.0, - 11.0, - 0.0 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "load_store" - ], - "shortest_path_cycles": [ - 0.75, - 0.75, - 0.0, - 0.0, - 11.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store" - ], - "total_cycles": [ - 0.75, - 0.75, - 0.0, - 0.0, - 11.0, - 0.0 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 20, - "work_registers_used": 32 - } - } - }, - "Mali-T880": { - "core": "Mali-T880", - "filename": "flutter/impeller/scene/shaders/gles/unskinned.vert.gles", - "has_uniform_computation": false, - "type": "Vertex", - "variants": { - "Main": { - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "load_store" - ], - "longest_path_cycles": [ - 5.28000020980835, - 13.0, - 0.0 - ], - "pipelines": [ - "arithmetic", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "load_store" - ], - "shortest_path_cycles": [ - 5.28000020980835, - 13.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store" - ], - "total_cycles": [ - 5.333333492279053, - 13.0, - 0.0 - ] - }, - "thread_occupancy": 50, - "uniform_registers_used": 7, - "work_registers_used": 6 - } - } - } - }, - "flutter/impeller/scene/shaders/skinned.vert.vkspv": { - "Mali-G78": { - "core": "Mali-G78", - "filename": "flutter/impeller/scene/shaders/skinned.vert.vkspv", - "has_uniform_computation": true, - "type": "Vertex", - "variants": { - "Position": { - "fp16_arithmetic": 0, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "load_store", - "texture" - ], - "longest_path_cycles": [ - 3.0625, - 3.0625, - 0.09375, - 0.0, - 4.0, - 4.0 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "load_store" - ], - "shortest_path_cycles": [ - 1.25, - 1.25, - 0.296875, - 0.0, - 2.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store", - "texture" - ], - "total_cycles": [ - 3.0625, - 3.0625, - 0.359375, - 0.0, - 4.0, - 4.0 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 50, - "uniform_registers_used": 30, - "work_registers_used": 64 - }, - "Varying": { - "fp16_arithmetic": 0, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "load_store" - ], - "longest_path_cycles": [ - 3.59375, - 3.59375, - 0.09375, - 0.0, - 13.0, - 4.0 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "load_store" - ], - "shortest_path_cycles": [ - 1.78125, - 1.78125, - 0.296875, - 0.0, - 11.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store" - ], - "total_cycles": [ - 3.59375, - 3.59375, - 0.359375, - 0.0, - 13.0, - 4.0 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 50, - "uniform_registers_used": 30, - "work_registers_used": 64 - } - } - } - }, - "flutter/impeller/scene/shaders/unlit.frag.vkspv": { - "Mali-G78": { - "core": "Mali-G78", - "filename": "flutter/impeller/scene/shaders/unlit.frag.vkspv", - "has_side_effects": false, - "has_uniform_computation": true, - "modifies_coverage": false, - "reads_color_buffer": false, - "type": "Fragment", - "uses_late_zs_test": false, - "uses_late_zs_update": false, - "variants": { - "Main": { - "fp16_arithmetic": 0, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "varying" - ], - "longest_path_cycles": [ - 0.25, - 0.25, - 0.0, - 0.0, - 0.0, - 0.75, - 0.25 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "varying", - "texture" - ], - "shortest_path_bound_pipelines": [ - "varying" - ], - "shortest_path_cycles": [ - 0.25, - 0.25, - 0.0, - 0.0, - 0.0, - 0.75, - 0.25 - ], - "total_bound_pipelines": [ - "varying" - ], - "total_cycles": [ - 0.25, - 0.25, - 0.0, - 0.0, - 0.0, - 0.75, - 0.25 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 8, - "work_registers_used": 10 - } - } - } - }, - "flutter/impeller/scene/shaders/unskinned.vert.vkspv": { - "Mali-G78": { - "core": "Mali-G78", - "filename": "flutter/impeller/scene/shaders/unskinned.vert.vkspv", - "has_uniform_computation": true, - "type": "Vertex", - "variants": { - "Position": { - "fp16_arithmetic": 0, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "load_store" - ], - "longest_path_cycles": [ - 0.25, - 0.25, - 0.0, - 0.0, - 2.0, - 0.0 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "load_store" - ], - "shortest_path_cycles": [ - 0.25, - 0.25, - 0.0, - 0.0, - 2.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store" - ], - "total_cycles": [ - 0.25, - 0.25, - 0.0, - 0.0, - 2.0, - 0.0 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 24, - "work_registers_used": 32 - }, - "Varying": { - "fp16_arithmetic": 0, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "load_store" - ], - "longest_path_cycles": [ - 0.75, - 0.75, - 0.0, - 0.0, - 11.0, - 0.0 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "load_store" - ], - "shortest_path_cycles": [ - 0.75, - 0.75, - 0.0, - 0.0, - 11.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store" - ], - "total_cycles": [ - 0.75, - 0.75, - 0.0, - 0.0, - 11.0, - 0.0 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 24, - "work_registers_used": 31 - } - } - } } } \ No newline at end of file diff --git a/shell/platform/android/android_context_gl_impeller.cc b/shell/platform/android/android_context_gl_impeller.cc index c630ab2fb8f6e..a2a555000ae09 100644 --- a/shell/platform/android/android_context_gl_impeller.cc +++ b/shell/platform/android/android_context_gl_impeller.cc @@ -10,8 +10,10 @@ #include "flutter/impeller/toolkit/egl/context.h" #include "flutter/impeller/toolkit/egl/surface.h" #include "impeller/entity/gles/entity_shaders_gles.h" -#include "impeller/scene/shaders/gles/scene_shaders_gles.h" +#if IMPELLER_ENABLE_3D +#include "impeller/scene/shaders/gles/scene_shaders_gles.h" // nogcncheck +#endif // IMPELLER_ENABLE_3D namespace flutter { class AndroidContextGLImpeller::ReactorWorker final @@ -56,11 +58,12 @@ static std::shared_ptr CreateImpellerContext( } std::vector> shader_mappings = { - std::make_shared( - impeller_entity_shaders_gles_data, - impeller_entity_shaders_gles_length), - std::make_shared( - impeller_scene_shaders_gles_data, impeller_scene_shaders_gles_length), + std::make_shared(impeller_entity_shaders_gles_data, + impeller_entity_shaders_gles_length), +#if IMPELLER_ENABLE_3D + std::make_shared(impeller_scene_shaders_gles_data, + impeller_scene_shaders_gles_length), +#endif // IMPELLER_ENABLE_3D }; auto context = diff --git a/shell/platform/android/android_context_vulkan_impeller.cc b/shell/platform/android/android_context_vulkan_impeller.cc index 50df30cecb5e1..4adc2d1beefb6 100644 --- a/shell/platform/android/android_context_vulkan_impeller.cc +++ b/shell/platform/android/android_context_vulkan_impeller.cc @@ -8,7 +8,10 @@ #include "flutter/impeller/entity/vk/entity_shaders_vk.h" #include "flutter/impeller/entity/vk/modern_shaders_vk.h" #include "flutter/impeller/renderer/backend/vulkan/context_vk.h" + +#if IMPELLER_ENABLE_3D #include "flutter/impeller/scene/shaders/vk/scene_shaders_vk.h" +#endif // IMPELLER_ENABLE_3D namespace flutter { @@ -16,12 +19,14 @@ static std::shared_ptr CreateImpellerContext( const fml::RefPtr& proc_table, bool enable_vulkan_validation) { std::vector> shader_mappings = { - std::make_shared(impeller_entity_shaders_vk_data, - impeller_entity_shaders_vk_length), - std::make_shared(impeller_scene_shaders_vk_data, - impeller_scene_shaders_vk_length), - std::make_shared(impeller_modern_shaders_vk_data, - impeller_modern_shaders_vk_length), + std::make_shared(impeller_entity_shaders_vk_data, + impeller_entity_shaders_vk_length), +#if IMPELLER_ENABLE_3D + std::make_shared(impeller_scene_shaders_vk_data, + impeller_scene_shaders_vk_length), +#endif + std::make_shared(impeller_modern_shaders_vk_data, + impeller_modern_shaders_vk_length), }; PFN_vkGetInstanceProcAddr instance_proc_addr = diff --git a/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.mm b/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.mm index 00c4115698c08..fab938f1a600b 100644 --- a/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.mm +++ b/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.mm @@ -12,21 +12,26 @@ #include "impeller/entity/mtl/entity_shaders.h" #include "impeller/entity/mtl/framebuffer_blend_shaders.h" #include "impeller/entity/mtl/modern_shaders.h" -#include "impeller/scene/shaders/mtl/scene_shaders.h" + +#if IMPELLER_ENABLE_3D +#include "impeller/scene/shaders/mtl/scene_shaders.h" // nogncheck +#endif // IMPELLER_ENABLE_3D FLUTTER_ASSERT_ARC static std::shared_ptr CreateImpellerContext( std::shared_ptr is_gpu_disabled_sync_switch) { std::vector> shader_mappings = { - std::make_shared(impeller_entity_shaders_data, - impeller_entity_shaders_length), - std::make_shared(impeller_scene_shaders_data, - impeller_scene_shaders_length), - std::make_shared(impeller_modern_shaders_data, - impeller_modern_shaders_length), - std::make_shared(impeller_framebuffer_blend_shaders_data, - impeller_framebuffer_blend_shaders_length), + std::make_shared(impeller_entity_shaders_data, + impeller_entity_shaders_length), +#if IMPELLER_ENABLE_3D + std::make_shared(impeller_scene_shaders_data, + impeller_scene_shaders_length), +#endif // IMPELLER_ENABLE_3D + std::make_shared(impeller_modern_shaders_data, + impeller_modern_shaders_length), + std::make_shared(impeller_framebuffer_blend_shaders_data, + impeller_framebuffer_blend_shaders_length), }; auto context = impeller::ContextMTL::Create( shader_mappings, std::move(is_gpu_disabled_sync_switch), "Impeller Library"); diff --git a/shell/platform/embedder/embedder_surface_gl_impeller.cc b/shell/platform/embedder/embedder_surface_gl_impeller.cc index 4d03bff292811..20a2a5184e133 100644 --- a/shell/platform/embedder/embedder_surface_gl_impeller.cc +++ b/shell/platform/embedder/embedder_surface_gl_impeller.cc @@ -9,7 +9,10 @@ #include "impeller/entity/gles/entity_shaders_gles.h" #include "impeller/renderer/backend/gles/context_gles.h" #include "impeller/renderer/backend/gles/proc_table_gles.h" -#include "impeller/scene/shaders/gles/scene_shaders_gles.h" + +#if IMPELLER_ENABLE_3D +#include "impeller/scene/shaders/gles/scene_shaders_gles.h" // nogncheck +#endif // IMPELLER_ENABLE_3D namespace flutter { @@ -62,11 +65,12 @@ EmbedderSurfaceGLImpeller::EmbedderSurfaceGLImpeller( gl_dispatch_table_.gl_make_current_callback(); std::vector> shader_mappings = { - std::make_shared( - impeller_entity_shaders_gles_data, - impeller_entity_shaders_gles_length), - std::make_shared( - impeller_scene_shaders_gles_data, impeller_scene_shaders_gles_length), + std::make_shared(impeller_entity_shaders_gles_data, + impeller_entity_shaders_gles_length), +#if IMPELLER_ENABLE_3D + std::make_shared(impeller_scene_shaders_gles_data, + impeller_scene_shaders_gles_length), +#endif // IMPELLER_ENABLE_3D }; auto gl = std::make_unique( gl_dispatch_table_.gl_proc_resolver); diff --git a/shell/platform/embedder/embedder_surface_metal_impeller.mm b/shell/platform/embedder/embedder_surface_metal_impeller.mm index 139f3e9094081..c9f463a059700 100644 --- a/shell/platform/embedder/embedder_surface_metal_impeller.mm +++ b/shell/platform/embedder/embedder_surface_metal_impeller.mm @@ -16,7 +16,10 @@ #include "impeller/entity/mtl/framebuffer_blend_shaders.h" #include "impeller/entity/mtl/modern_shaders.h" #include "impeller/renderer/backend/metal/context_mtl.h" -#include "impeller/scene/shaders/mtl/scene_shaders.h" + +#if IMPELLER_ENABLE_3D +#include "impeller/scene/shaders/mtl/scene_shaders.h" // nogncheck +#endif // IMPELLER_ENABLE_3D FLUTTER_ASSERT_NOT_ARC @@ -31,14 +34,16 @@ metal_dispatch_table_(std::move(metal_dispatch_table)), external_view_embedder_(std::move(external_view_embedder)) { std::vector> shader_mappings = { - std::make_shared(impeller_entity_shaders_data, - impeller_entity_shaders_length), - std::make_shared(impeller_scene_shaders_data, - impeller_scene_shaders_length), - std::make_shared(impeller_modern_shaders_data, - impeller_modern_shaders_length), - std::make_shared(impeller_framebuffer_blend_shaders_data, - impeller_framebuffer_blend_shaders_length), + std::make_shared(impeller_entity_shaders_data, + impeller_entity_shaders_length), +#if IMPELLER_ENABLE_3D + std::make_shared(impeller_scene_shaders_data, + impeller_scene_shaders_length), +#endif // IMPELLER_ENABLE_3D + std::make_shared(impeller_modern_shaders_data, + impeller_modern_shaders_length), + std::make_shared(impeller_framebuffer_blend_shaders_data, + impeller_framebuffer_blend_shaders_length), }; context_ = impeller::ContextMTL::Create( (id)device, // device