[Impeller] move everything needed by the code gen template to core (flutter/engine#40801)

This commit is contained in:
Dan Field
2023-03-30 16:35:02 -07:00
committed by GitHub
parent 1a59a35e3c
commit e31cf0690f
63 changed files with 181 additions and 113 deletions

View File

@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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

View File

@@ -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"

View File

@@ -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 #}

View File

@@ -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";
@@ -1126,7 +1111,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{
@@ -1145,7 +1130,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{
@@ -1164,7 +1149,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{

View File

@@ -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",

View File

@@ -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 {
//
} // namespace impeller

View File

@@ -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 CPU resources available
/// to the GPU.
///
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

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -11,6 +11,7 @@
#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"
@@ -18,7 +19,6 @@
#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 {

View File

@@ -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 {

View File

@@ -11,6 +11,7 @@
#include "flutter/fml/make_copyable.h"
#include "impeller/base/validation.h"
#include "impeller/core/formats.h"
#include "impeller/core/shader_types.h"
#include "impeller/entity/contents/clip_contents.h"
#include "impeller/entity/contents/content_context.h"
#include "impeller/entity/runtime_effect.vert.h"
@@ -18,7 +19,6 @@
#include "impeller/renderer/render_pass.h"
#include "impeller/renderer/sampler_library.h"
#include "impeller/renderer/shader_function.h"
#include "impeller/renderer/shader_types.h"
namespace impeller {

View File

@@ -6,8 +6,8 @@
#include <memory>
#include <vector>
#include "impeller/core/sampler_descriptor.h"
#include "impeller/entity/contents/color_source_contents.h"
#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/runtime_stage/runtime_stage.h"
namespace impeller {

View File

@@ -9,11 +9,11 @@
#include <utility>
#include "impeller/core/formats.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/entity/contents/content_context.h"
#include "impeller/entity/entity.h"
#include "impeller/geometry/path_builder.h"
#include "impeller/renderer/render_pass.h"
#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/renderer/sampler_library.h"
#include "impeller/tessellator/tessellator.h"
#include "impeller/typographer/glyph_atlas.h"

View File

@@ -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/geometry/path.h"
#include "impeller/renderer/sampler_descriptor.h"
namespace impeller {

View File

@@ -9,11 +9,11 @@
#include <vector>
#include "flutter/fml/macros.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/entity/contents/color_source_contents.h"
#include "impeller/entity/contents/filters/color_filter_contents.h"
#include "impeller/entity/entity.h"
#include "impeller/geometry/path.h"
#include "impeller/renderer/sampler_descriptor.h"
namespace impeller {

View File

@@ -9,13 +9,13 @@
#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/entity/geometry.h"
#include "impeller/geometry/color.h"
#include "impeller/geometry/path.h"
#include "impeller/geometry/point.h"
#include "impeller/renderer/sampler_descriptor.h"
namespace impeller {

View File

@@ -12,6 +12,9 @@
#include "impeller/entity/solid_fill.vert.h"
#include "impeller/geometry/color.h"
#include "impeller/geometry/path.h"
#include "impeller/geometry/point.h"
#include "impeller/geometry/scalar.h"
#include "impeller/renderer/vertex_buffer_builder.h"
namespace impeller {

View File

@@ -18,6 +18,7 @@
#include "impeller/core/allocator.h"
#include "impeller/core/formats.h"
#include "impeller/core/range.h"
#include "impeller/core/sampler.h"
#include "impeller/core/texture.h"
#include "impeller/core/texture_descriptor.h"
#include "impeller/core/vertex_buffer.h"
@@ -31,7 +32,6 @@
#include "impeller/renderer/pipeline_descriptor.h"
#include "impeller/renderer/pipeline_library.h"
#include "impeller/renderer/render_pass.h"
#include "impeller/renderer/sampler.h"
#include "impeller/renderer/sampler_library.h"
struct ImGui_ImplImpeller_Data {

View File

@@ -78,10 +78,6 @@ impeller_component("renderer") {
"render_target.h",
"renderer.cc",
"renderer.h",
"sampler.cc",
"sampler.h",
"sampler_descriptor.cc",
"sampler_descriptor.h",
"sampler_library.cc",
"sampler_library.h",
"shader_function.cc",
@@ -90,8 +86,6 @@ impeller_component("renderer") {
"shader_key.h",
"shader_library.cc",
"shader_library.h",
"shader_types.cc",
"shader_types.h",
"snapshot.cc",
"snapshot.h",
"surface.cc",

View File

@@ -7,8 +7,8 @@
#include <cstddef>
#include "flutter/fml/macros.h"
#include "impeller/core/shader_types.h"
#include "impeller/geometry/size.h"
#include "impeller/renderer/shader_types.h"
namespace impeller {

View File

@@ -7,8 +7,8 @@
#include "flutter/fml/logging.h"
#include "flutter/fml/macros.h"
#include "impeller/core/formats.h"
#include "impeller/core/shader_types.h"
#include "impeller/renderer/backend/gles/gles.h"
#include "impeller/renderer/shader_types.h"
namespace impeller {

View File

@@ -6,7 +6,7 @@
#include "flutter/fml/macros.h"
#include "impeller/base/backend_cast.h"
#include "impeller/renderer/sampler.h"
#include "impeller/core/sampler.h"
namespace impeller {

View File

@@ -5,7 +5,7 @@
#pragma once
#include "flutter/fml/macros.h"
#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/renderer/sampler_library.h"
namespace impeller {

View File

@@ -13,6 +13,7 @@
#include "impeller/base/backend_cast.h"
#include "impeller/core/formats.h"
#include "impeller/core/host_buffer.h"
#include "impeller/core/shader_types.h"
#include "impeller/renderer/backend/metal/blit_command_mtl.h"
#include "impeller/renderer/backend/metal/device_buffer_mtl.h"
#include "impeller/renderer/backend/metal/formats_mtl.h"
@@ -20,7 +21,6 @@
#include "impeller/renderer/backend/metal/sampler_mtl.h"
#include "impeller/renderer/backend/metal/texture_mtl.h"
#include "impeller/renderer/blit_command.h"
#include "impeller/renderer/shader_types.h"
namespace impeller {

View File

@@ -15,13 +15,13 @@
#include "impeller/base/backend_cast.h"
#include "impeller/core/formats.h"
#include "impeller/core/host_buffer.h"
#include "impeller/core/shader_types.h"
#include "impeller/renderer/backend/metal/compute_pipeline_mtl.h"
#include "impeller/renderer/backend/metal/device_buffer_mtl.h"
#include "impeller/renderer/backend/metal/formats_mtl.h"
#include "impeller/renderer/backend/metal/sampler_mtl.h"
#include "impeller/renderer/backend/metal/texture_mtl.h"
#include "impeller/renderer/compute_command.h"
#include "impeller/renderer/shader_types.h"
namespace impeller {

View File

@@ -11,6 +11,7 @@
#include "flutter/fml/macros.h"
#include "impeller/base/backend_cast.h"
#include "impeller/core/sampler.h"
#include "impeller/renderer/backend/metal/allocator_mtl.h"
#include "impeller/renderer/backend/metal/command_buffer_mtl.h"
#include "impeller/renderer/backend/metal/gpu_tracer_mtl.h"
@@ -18,7 +19,6 @@
#include "impeller/renderer/backend/metal/shader_library_mtl.h"
#include "impeller/renderer/capabilities.h"
#include "impeller/renderer/context.h"
#include "impeller/renderer/sampler.h"
namespace impeller {

View File

@@ -9,9 +9,9 @@
#include "flutter/fml/file.h"
#include "flutter/fml/logging.h"
#include "flutter/fml/paths.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/renderer/backend/metal/sampler_library_mtl.h"
#include "impeller/renderer/capabilities.h"
#include "impeller/renderer/sampler_descriptor.h"
namespace impeller {

View File

@@ -10,12 +10,12 @@
#include "impeller/base/backend_cast.h"
#include "impeller/core/formats.h"
#include "impeller/core/host_buffer.h"
#include "impeller/core/shader_types.h"
#include "impeller/renderer/backend/metal/device_buffer_mtl.h"
#include "impeller/renderer/backend/metal/formats_mtl.h"
#include "impeller/renderer/backend/metal/pipeline_mtl.h"
#include "impeller/renderer/backend/metal/sampler_mtl.h"
#include "impeller/renderer/backend/metal/texture_mtl.h"
#include "impeller/renderer/shader_types.h"
namespace impeller {

View File

@@ -11,7 +11,7 @@
#include "flutter/fml/macros.h"
#include "impeller/base/backend_cast.h"
#include "impeller/base/comparable.h"
#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/renderer/sampler_library.h"
namespace impeller {

View File

@@ -8,7 +8,7 @@
#include "flutter/fml/macros.h"
#include "impeller/base/backend_cast.h"
#include "impeller/renderer/sampler.h"
#include "impeller/core/sampler.h"
namespace impeller {

View File

@@ -6,8 +6,8 @@
#include "flutter/fml/macros.h"
#include "impeller/core/formats.h"
#include "impeller/core/shader_types.h"
#include "impeller/renderer/backend/vulkan/vk.h"
#include "impeller/renderer/shader_types.h"
#include "vulkan/vulkan_enums.hpp"
namespace impeller {

View File

@@ -13,6 +13,8 @@
#include "flutter/fml/trace_event.h"
#include "impeller/base/validation.h"
#include "impeller/core/formats.h"
#include "impeller/core/sampler.h"
#include "impeller/core/shader_types.h"
#include "impeller/renderer/backend/vulkan/command_encoder_vk.h"
#include "impeller/renderer/backend/vulkan/context_vk.h"
#include "impeller/renderer/backend/vulkan/device_buffer_vk.h"
@@ -21,8 +23,6 @@
#include "impeller/renderer/backend/vulkan/sampler_vk.h"
#include "impeller/renderer/backend/vulkan/shared_object_vk.h"
#include "impeller/renderer/backend/vulkan/texture_vk.h"
#include "impeller/renderer/sampler.h"
#include "impeller/renderer/shader_types.h"
#include "vulkan/vulkan_enums.hpp"
#include "vulkan/vulkan_structs.hpp"

View File

@@ -7,8 +7,8 @@
#include "flutter/fml/macros.h"
#include "impeller/base/backend_cast.h"
#include "impeller/base/comparable.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/renderer/backend/vulkan/vk.h"
#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/renderer/sampler_library.h"
namespace impeller {

View File

@@ -6,9 +6,9 @@
#include "flutter/fml/macros.h"
#include "impeller/base/backend_cast.h"
#include "impeller/core/sampler.h"
#include "impeller/renderer/backend/vulkan/shared_object_vk.h"
#include "impeller/renderer/backend/vulkan/vk.h"
#include "impeller/renderer/sampler.h"
#include "vulkan/vulkan_handles.hpp"
namespace impeller {

View File

@@ -5,8 +5,8 @@
#pragma once
#include "flutter/fml/macros.h"
#include "impeller/core/shader_types.h"
#include "impeller/renderer/backend/vulkan/vk.h"
#include "impeller/renderer/shader_types.h"
namespace impeller {

View File

@@ -13,12 +13,13 @@
#include "flutter/fml/macros.h"
#include "impeller/core/buffer_view.h"
#include "impeller/core/formats.h"
#include "impeller/core/resource_binder.h"
#include "impeller/core/sampler.h"
#include "impeller/core/shader_types.h"
#include "impeller/core/texture.h"
#include "impeller/core/vertex_buffer.h"
#include "impeller/geometry/rect.h"
#include "impeller/renderer/pipeline.h"
#include "impeller/renderer/sampler.h"
#include "impeller/renderer/shader_types.h"
#include "impeller/renderer/vertex_buffer_builder.h"
#include "impeller/tessellator/tessellator.h"
@@ -63,7 +64,7 @@ struct Bindings {
/// views into buffers managed by other allocators and resource
/// managers.
///
struct Command {
struct Command : public ResourceBinder {
//----------------------------------------------------------------------------
/// The pipeline to use for this command.
///
@@ -145,26 +146,30 @@ struct Command {
///
bool BindVertices(const VertexBuffer& buffer);
// |ResourceBinder|
bool BindResource(ShaderStage stage,
const ShaderUniformSlot& slot,
const ShaderMetadata& metadata,
const BufferView& view);
const BufferView& view) override;
// |ResourceBinder|
bool BindResource(ShaderStage stage,
const SampledImageSlot& slot,
const ShaderMetadata& metadata,
const std::shared_ptr<const Texture>& texture);
const std::shared_ptr<const Texture>& texture) override;
// |ResourceBinder|
bool BindResource(ShaderStage stage,
const SampledImageSlot& slot,
const ShaderMetadata& metadata,
const std::shared_ptr<const Sampler>& sampler);
const std::shared_ptr<const Sampler>& sampler) override;
// |ResourceBinder|
bool BindResource(ShaderStage stage,
const SampledImageSlot& slot,
const ShaderMetadata& metadata,
const std::shared_ptr<const Texture>& texture,
const std::shared_ptr<const Sampler>& sampler);
const std::shared_ptr<const Sampler>& sampler) override;
BufferView GetVertexBuffer() const;

View File

@@ -13,14 +13,15 @@
#include "flutter/fml/macros.h"
#include "impeller/core/buffer_view.h"
#include "impeller/core/formats.h"
#include "impeller/core/resource_binder.h"
#include "impeller/core/sampler.h"
#include "impeller/core/shader_types.h"
#include "impeller/core/texture.h"
#include "impeller/core/vertex_buffer.h"
#include "impeller/geometry/rect.h"
#include "impeller/renderer/command.h"
#include "impeller/renderer/compute_pipeline_descriptor.h"
#include "impeller/renderer/pipeline.h"
#include "impeller/renderer/sampler.h"
#include "impeller/renderer/shader_types.h"
#include "impeller/renderer/vertex_buffer_builder.h"
#include "impeller/tessellator/tessellator.h"
@@ -39,7 +40,7 @@ namespace impeller {
/// views into buffers managed by other allocators and resource
/// managers.
///
struct ComputeCommand {
struct ComputeCommand : public ResourceBinder {
//----------------------------------------------------------------------------
/// The pipeline to use for this command.
///
@@ -54,26 +55,30 @@ struct ComputeCommand {
///
std::string label;
// |ResourceBinder|
bool BindResource(ShaderStage stage,
const ShaderUniformSlot& slot,
const ShaderMetadata& metadata,
const BufferView& view);
const BufferView& view) override;
// |ResourceBinder|
bool BindResource(ShaderStage stage,
const SampledImageSlot& slot,
const ShaderMetadata& metadata,
const std::shared_ptr<const Texture>& texture);
const std::shared_ptr<const Texture>& texture) override;
// |ResourceBinder|
bool BindResource(ShaderStage stage,
const SampledImageSlot& slot,
const ShaderMetadata& metadata,
const std::shared_ptr<const Sampler>& sampler);
const std::shared_ptr<const Sampler>& sampler) override;
// |ResourceBinder|
bool BindResource(ShaderStage stage,
const SampledImageSlot& slot,
const ShaderMetadata& metadata,
const std::shared_ptr<const Texture>& texture,
const std::shared_ptr<const Sampler>& sampler);
const std::shared_ptr<const Sampler>& sampler) override;
constexpr operator bool() const { return pipeline && pipeline->IsValid(); }
};

View File

@@ -17,7 +17,7 @@
#include "flutter/fml/macros.h"
#include "impeller/base/comparable.h"
#include "impeller/core/formats.h"
#include "impeller/renderer/shader_types.h"
#include "impeller/core/shader_types.h"
#include "impeller/tessellator/tessellator.h"
namespace impeller {

View File

@@ -17,7 +17,7 @@
#include "flutter/fml/macros.h"
#include "impeller/base/comparable.h"
#include "impeller/core/formats.h"
#include "impeller/renderer/shader_types.h"
#include "impeller/core/shader_types.h"
#include "impeller/tessellator/tessellator.h"
namespace impeller {

View File

@@ -6,6 +6,8 @@
#include "impeller/base/strings.h"
#include "impeller/core/device_buffer_descriptor.h"
#include "impeller/core/formats.h"
#include "impeller/core/sampler.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/fixtures/array.frag.h"
#include "impeller/fixtures/array.vert.h"
#include "impeller/fixtures/box_fade.frag.h"
@@ -31,8 +33,6 @@
#include "impeller/renderer/pipeline_builder.h"
#include "impeller/renderer/pipeline_library.h"
#include "impeller/renderer/renderer.h"
#include "impeller/renderer/sampler.h"
#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/renderer/sampler_library.h"
#include "impeller/renderer/surface.h"
#include "impeller/renderer/vertex_buffer_builder.h"

View File

@@ -7,7 +7,7 @@
#include <unordered_map>
#include "flutter/fml/macros.h"
#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/core/sampler_descriptor.h"
namespace impeller {

View File

@@ -7,7 +7,7 @@
#include "flutter/fml/hash_combine.h"
#include "flutter/fml/macros.h"
#include "impeller/base/comparable.h"
#include "impeller/renderer/shader_types.h"
#include "impeller/core/shader_types.h"
namespace impeller {

View File

@@ -10,7 +10,7 @@
#include "flutter/fml/hash_combine.h"
#include "flutter/fml/macros.h"
#include "impeller/renderer/shader_types.h"
#include "impeller/core/shader_types.h"
namespace impeller {

View File

@@ -10,7 +10,7 @@
#include "flutter/fml/macros.h"
#include "fml/mapping.h"
#include "impeller/renderer/shader_types.h"
#include "impeller/core/shader_types.h"
namespace impeller {

View File

@@ -10,10 +10,10 @@
#include "flutter/fml/macros.h"
#include "impeller/core/formats.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/core/texture.h"
#include "impeller/geometry/matrix.h"
#include "impeller/geometry/rect.h"
#include "impeller/renderer/sampler_descriptor.h"
namespace impeller {

View File

@@ -8,7 +8,7 @@
#include "flutter/fml/macros.h"
#include "impeller/base/comparable.h"
#include "impeller/renderer/shader_types.h"
#include "impeller/core/shader_types.h"
namespace impeller {

View File

@@ -20,12 +20,11 @@ impeller_component("runtime_stage") {
sources = [
"runtime_stage.cc",
"runtime_stage.h",
"runtime_types.cc",
"runtime_types.h",
]
public_deps = [
":runtime_stage_flatbuffers",
"../base",
"../core",
"//flutter/fml",
]
}

View File

@@ -10,7 +10,7 @@
#include "flutter/fml/macros.h"
#include "flutter/fml/mapping.h"
#include "flutter/impeller/runtime_stage/runtime_types.h"
#include "flutter/impeller/core/runtime_types.h"
namespace impeller {

View File

@@ -8,8 +8,8 @@
#include "flutter/fml/make_copyable.h"
#include "flutter/testing/testing.h"
#include "impeller/core/shader_types.h"
#include "impeller/renderer/shader_library.h"
#include "impeller/renderer/shader_types.h"
namespace impeller {

View File

@@ -9,11 +9,11 @@
#include "flutter/testing/testing.h"
#include "impeller/base/allocation.h"
#include "impeller/base/validation.h"
#include "impeller/core/shader_types.h"
#include "impeller/playground/playground.h"
#include "impeller/renderer/pipeline_descriptor.h"
#include "impeller/renderer/pipeline_library.h"
#include "impeller/renderer/shader_library.h"
#include "impeller/renderer/shader_types.h"
#include "impeller/runtime_stage/runtime_stage.h"
#include "impeller/runtime_stage/runtime_stage_playground.h"

View File

@@ -10,10 +10,10 @@
#include "impeller/core/device_buffer_descriptor.h"
#include "impeller/core/formats.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/core/vertex_buffer.h"
#include "impeller/geometry/point.h"
#include "impeller/geometry/vector.h"
#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/renderer/sampler_library.h"
#include "impeller/renderer/vertex_buffer_builder.h"
#include "impeller/scene/importer/scene_flatbuffers.h"

View File

@@ -5,7 +5,7 @@
#include "impeller/scene/material.h"
#include "impeller/base/validation.h"
#include "impeller/core/formats.h"
#include "impeller/renderer/sampler_descriptor.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/renderer/sampler_library.h"
#include "impeller/scene/importer/conversions.h"
#include "impeller/scene/importer/scene_flatbuffers.h"