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
36 changes: 20 additions & 16 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,16 @@ ORIGIN: ../../../flutter/impeller/core/platform.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/platform.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/range.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/range.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/resource_binder.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/resource_binder.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/runtime_types.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/runtime_types.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/sampler.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/sampler.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/sampler_descriptor.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/sampler_descriptor.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/shader_types.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/shader_types.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/texture.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/texture.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/texture_descriptor.cc + ../../../flutter/LICENSE
Expand Down Expand Up @@ -1548,10 +1558,6 @@ ORIGIN: ../../../flutter/impeller/renderer/render_target.cc + ../../../flutter/L
ORIGIN: ../../../flutter/impeller/renderer/render_target.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/renderer.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/renderer.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/sampler.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/sampler.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/sampler_descriptor.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/sampler_descriptor.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/sampler_library.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/sampler_library.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/shader_function.cc + ../../../flutter/LICENSE
Expand All @@ -1560,8 +1566,6 @@ ORIGIN: ../../../flutter/impeller/renderer/shader_key.cc + ../../../flutter/LICE
ORIGIN: ../../../flutter/impeller/renderer/shader_key.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/shader_library.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/shader_library.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/shader_types.cc + ../../../flutter/LICENSE
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
Expand All @@ -1576,8 +1580,6 @@ ORIGIN: ../../../flutter/impeller/runtime_stage/runtime_stage.fbs + ../../../flu
ORIGIN: ../../../flutter/impeller/runtime_stage/runtime_stage.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/runtime_stage/runtime_stage_playground.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/runtime_stage/runtime_stage_playground.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/runtime_stage/runtime_types.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/runtime_stage/runtime_types.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/scene/animation/animation.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/scene/animation/animation.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/scene/animation/animation_clip.cc + ../../../flutter/LICENSE
Expand Down Expand Up @@ -3699,6 +3701,16 @@ FILE: ../../../flutter/impeller/core/platform.cc
FILE: ../../../flutter/impeller/core/platform.h
FILE: ../../../flutter/impeller/core/range.cc
FILE: ../../../flutter/impeller/core/range.h
FILE: ../../../flutter/impeller/core/resource_binder.cc
FILE: ../../../flutter/impeller/core/resource_binder.h
FILE: ../../../flutter/impeller/core/runtime_types.cc
FILE: ../../../flutter/impeller/core/runtime_types.h
FILE: ../../../flutter/impeller/core/sampler.cc
FILE: ../../../flutter/impeller/core/sampler.h
FILE: ../../../flutter/impeller/core/sampler_descriptor.cc
FILE: ../../../flutter/impeller/core/sampler_descriptor.h
FILE: ../../../flutter/impeller/core/shader_types.cc
FILE: ../../../flutter/impeller/core/shader_types.h
FILE: ../../../flutter/impeller/core/texture.cc
FILE: ../../../flutter/impeller/core/texture.h
FILE: ../../../flutter/impeller/core/texture_descriptor.cc
Expand Down Expand Up @@ -4123,10 +4135,6 @@ FILE: ../../../flutter/impeller/renderer/render_target.cc
FILE: ../../../flutter/impeller/renderer/render_target.h
FILE: ../../../flutter/impeller/renderer/renderer.cc
FILE: ../../../flutter/impeller/renderer/renderer.h
FILE: ../../../flutter/impeller/renderer/sampler.cc
FILE: ../../../flutter/impeller/renderer/sampler.h
FILE: ../../../flutter/impeller/renderer/sampler_descriptor.cc
FILE: ../../../flutter/impeller/renderer/sampler_descriptor.h
FILE: ../../../flutter/impeller/renderer/sampler_library.cc
FILE: ../../../flutter/impeller/renderer/sampler_library.h
FILE: ../../../flutter/impeller/renderer/shader_function.cc
Expand All @@ -4135,8 +4143,6 @@ FILE: ../../../flutter/impeller/renderer/shader_key.cc
FILE: ../../../flutter/impeller/renderer/shader_key.h
FILE: ../../../flutter/impeller/renderer/shader_library.cc
FILE: ../../../flutter/impeller/renderer/shader_library.h
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
Expand All @@ -4151,8 +4157,6 @@ FILE: ../../../flutter/impeller/runtime_stage/runtime_stage.fbs
FILE: ../../../flutter/impeller/runtime_stage/runtime_stage.h
FILE: ../../../flutter/impeller/runtime_stage/runtime_stage_playground.cc
FILE: ../../../flutter/impeller/runtime_stage/runtime_stage_playground.h
FILE: ../../../flutter/impeller/runtime_stage/runtime_types.cc
FILE: ../../../flutter/impeller/runtime_stage/runtime_types.h
FILE: ../../../flutter/impeller/scene/animation/animation.cc
FILE: ../../../flutter/impeller/scene/animation/animation.h
FILE: ../../../flutter/impeller/scene/animation/animation_clip.cc
Expand Down
2 changes: 1 addition & 1 deletion impeller/aiks/canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
#include "impeller/aiks/image.h"
#include "impeller/aiks/paint.h"
#include "impeller/aiks/picture.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/entity/entity_pass.h"
#include "impeller/entity/geometry.h"
#include "impeller/geometry/matrix.h"
#include "impeller/geometry/path.h"
#include "impeller/geometry/point.h"
#include "impeller/geometry/vector.h"
#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/typographer/glyph_atlas.h"
#include "impeller/typographer/text_frame.h"

Expand Down
8 changes: 3 additions & 5 deletions impeller/compiler/code_gen_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ constexpr std::string_view kReflectionHeaderTemplate =
{# file itself and the no-check declarations will be stripped in generated files.#}
#include "impeller/core/buffer_view.h" {# // nogncheck #}

#include "impeller/renderer/command.h" {# // nogncheck #}
#include "impeller/core/sampler.h" {# // nogncheck #}

#include "impeller/renderer/compute_command.h" {# // nogncheck #}
#include "impeller/core/shader_types.h" {# // nogncheck #}

#include "impeller/renderer/sampler.h" {# // nogncheck #}

#include "impeller/renderer/shader_types.h" {# // nogncheck #}
#include "impeller/core/resource_binder.h" {# // nogncheck #}

#include "impeller/core/texture.h" {# // nogncheck #}

Expand Down
21 changes: 3 additions & 18 deletions impeller/compiler/reflector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,6 @@ static std::string ExecutionModelToString(spv::ExecutionModel model) {
}
}

static std::string ExecutionModelToCommandTypeName(
spv::ExecutionModel execution_model) {
switch (execution_model) {
case spv::ExecutionModel::ExecutionModelVertex:
case spv::ExecutionModel::ExecutionModelFragment:
case spv::ExecutionModel::ExecutionModelTessellationControl:
case spv::ExecutionModel::ExecutionModelTessellationEvaluation:
return "Command&";
case spv::ExecutionModel::ExecutionModelGLCompute:
return "ComputeCommand&";
default:
return "unsupported";
}
}

static std::string StringToShaderStage(std::string str) {
if (str == "vertex") {
return "ShaderStage::kVertex";
Expand Down Expand Up @@ -1100,7 +1085,7 @@ std::vector<Reflector::BindPrototype> Reflector::ReflectBindPrototypes(
proto.docstring = stream.str();
}
proto.args.push_back(BindPrototypeArgument{
.type_name = ExecutionModelToCommandTypeName(execution_model),
.type_name = "ResourceBinder&",
.argument_name = "command",
});
proto.args.push_back(BindPrototypeArgument{
Expand All @@ -1119,7 +1104,7 @@ std::vector<Reflector::BindPrototype> Reflector::ReflectBindPrototypes(
proto.docstring = stream.str();
}
proto.args.push_back(BindPrototypeArgument{
.type_name = ExecutionModelToCommandTypeName(execution_model),
.type_name = "ResourceBinder&",
.argument_name = "command",
});
proto.args.push_back(BindPrototypeArgument{
Expand All @@ -1138,7 +1123,7 @@ std::vector<Reflector::BindPrototype> Reflector::ReflectBindPrototypes(
proto.docstring = stream.str();
}
proto.args.push_back(BindPrototypeArgument{
.type_name = ExecutionModelToCommandTypeName(execution_model),
.type_name = "ResourceBinder&",
.argument_name = "command",
});
proto.args.push_back(BindPrototypeArgument{
Expand Down
10 changes: 10 additions & 0 deletions impeller/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ impeller_component("core") {
"platform.h",
"range.cc",
"range.h",
"resource_binder.cc",
"resource_binder.h",
"runtime_types.cc",
"runtime_types.h",
"sampler.cc",
"sampler.h",
"sampler_descriptor.cc",
"sampler_descriptor.h",
"shader_types.cc",
"shader_types.h",
"texture.cc",
"texture.h",
"texture_descriptor.cc",
Expand Down
11 changes: 11 additions & 0 deletions impeller/core/resource_binder.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "impeller/core/resource_binder.h"

namespace impeller {

//
Copy link
Member

Choose a reason for hiding this comment

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

What's 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.

This is how all the other otherwise header-only TUs are handled in impeller


} // namespace impeller
52 changes: 52 additions & 0 deletions impeller/core/resource_binder.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#pragma once

#include <map>
#include <memory>
#include <optional>
#include <string>

#include "flutter/fml/logging.h"
#include "flutter/fml/macros.h"
#include "impeller/core/buffer_view.h"
#include "impeller/core/formats.h"
#include "impeller/core/sampler.h"
#include "impeller/core/shader_types.h"
#include "impeller/core/texture.h"

namespace impeller {

//------------------------------------------------------------------------------
/// @brief An interface for binding resources. This is implemented by
/// |Command| and |ComputeCommand| to make GPU resources available
/// to a given command's pipeline.
///
struct ResourceBinder {
virtual ~ResourceBinder() = default;

virtual bool BindResource(ShaderStage stage,
const ShaderUniformSlot& slot,
const ShaderMetadata& metadata,
const BufferView& view) = 0;

virtual bool BindResource(ShaderStage stage,
const SampledImageSlot& slot,
const ShaderMetadata& metadata,
const std::shared_ptr<const Texture>& texture) = 0;

virtual bool BindResource(ShaderStage stage,
const SampledImageSlot& slot,
const ShaderMetadata& metadata,
const std::shared_ptr<const Sampler>& sampler) = 0;

virtual bool BindResource(ShaderStage stage,
const SampledImageSlot& slot,
const ShaderMetadata& metadata,
const std::shared_ptr<const Texture>& texture,
const std::shared_ptr<const Sampler>& sampler) = 0;
};

} // namespace impeller
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "impeller/runtime_stage/runtime_types.h"
#include "impeller/core/runtime_types.h"

namespace impeller {

Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/sampler.cc → impeller/core/sampler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "impeller/renderer/sampler.h"
#include "impeller/core/sampler.h"

namespace impeller {

Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/sampler.h → impeller/core/sampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "flutter/fml/macros.h"
#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/core/sampler_descriptor.h"

namespace impeller {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/core/sampler_descriptor.h"

#include "fml/logging.h"

namespace impeller {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "impeller/renderer/shader_types.h"
#include "impeller/core/shader_types.h"

namespace impeller {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

#include "flutter/fml/hash_combine.h"
#include "flutter/fml/logging.h"
#include "impeller/core/runtime_types.h"
#include "impeller/geometry/half.h"
#include "impeller/geometry/matrix.h"
#include "impeller/runtime_stage/runtime_types.h"

namespace impeller {

Expand Down
2 changes: 1 addition & 1 deletion impeller/display_list/nine_patch_converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "impeller/aiks/canvas.h"
#include "impeller/aiks/image.h"
#include "impeller/aiks/paint.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/geometry/path.h"
#include "impeller/renderer/sampler_descriptor.h"

namespace impeller {

Expand Down
2 changes: 1 addition & 1 deletion impeller/entity/contents/atlas_contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#include <vector>

#include "flutter/fml/macros.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/entity/contents/contents.h"
#include "impeller/entity/entity.h"
#include "impeller/renderer/sampler_descriptor.h"

namespace impeller {

Expand Down
3 changes: 2 additions & 1 deletion impeller/entity/contents/color_source_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "color_source_contents.h"
#include "impeller/entity/contents/color_source_contents.h"

#include "impeller/entity/entity.h"
#include "impeller/geometry/matrix.h"
#include "impeller/geometry/point.h"

namespace impeller {

Expand Down
2 changes: 1 addition & 1 deletion impeller/entity/contents/contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include <vector>

#include "flutter/fml/macros.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/core/texture.h"
#include "impeller/geometry/color.h"
#include "impeller/geometry/rect.h"
#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/renderer/snapshot.h"

namespace impeller {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
#include "impeller/base/strings.h"
#include "impeller/base/validation.h"
#include "impeller/core/formats.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/entity/contents/content_context.h"
#include "impeller/entity/contents/filters/filter_contents.h"
#include "impeller/geometry/rect.h"
#include "impeller/geometry/scalar.h"
#include "impeller/renderer/command_buffer.h"
#include "impeller/renderer/render_pass.h"
#include "impeller/renderer/render_target.h"
#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/renderer/sampler_library.h"

namespace impeller {
Expand Down
2 changes: 1 addition & 1 deletion impeller/entity/contents/gradient_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

#include "flutter/fml/macros.h"
#include "flutter/impeller/core/texture.h"
#include "impeller/core/shader_types.h"
#include "impeller/geometry/color.h"
#include "impeller/geometry/gradient.h"
#include "impeller/geometry/path.h"
#include "impeller/geometry/point.h"
#include "impeller/renderer/shader_types.h"

namespace impeller {

Expand Down
Loading