-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] move everything needed by the code gen template to core #40801
Changes from all commits
9eae89c
45ed04f
2dd1eb3
e65aa02
65ee62b
3d9491d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 { | ||
|
|
||
| // | ||
|
|
||
| } // namespace impeller |
| 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 CPU resources available | ||
| /// to the GPU. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be more accurate to say it makes GPU resources (via handles) available to a given command's pipeline, since you can bind device private resources that never had a host buffer too (like we do with subpass render targets).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is causing friction for the Flutter-at-Google team I'm going to merge this and follow up with a doc fix. |
||
| /// | ||
| struct ResourceBinder { | ||
| virtual ~ResourceBinder() = default; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not strongly opposed to adding this pure virtual interface, but it may cause some confusion/friction down the road for whoever ends up adding the next command type. We're sort of lucky that the bindings match up between raster and compute commands right now, but if we add support for ray trace commands, the bindings won't perfectly match up anymore because we'll need to bind acceleration structures, and so we'll probably wind up needing to refactor anything that comes to rely on this polymorphism.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think in that case we'd make a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatively, in that scenario we could make
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I understand. What is the purpose of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| 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 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file and
impeller/core/vertex_buffer_builder.ccare basically empty, should they be removed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vertex_buffer_builder.cc was meant to be deleted.
But this follows the style of other TUs in this repository (particularyl in impeller)