12#include "impeller/shader_archive/shader_archive_flatbuffers.h"
18 case fb::Stage::kVertex:
20 case fb::Stage::kFragment:
22 case fb::Stage::kCompute:
29 : payload_(
std::move(payload)) {
30 if (!payload_ || payload_->GetMapping() ==
nullptr) {
35 if (!fb::ShaderArchiveBufferHasIdentifier(payload_->GetMapping())) {
40 auto shader_archive = fb::GetShaderArchive(payload_->GetMapping());
41 if (!shader_archive) {
45 if (
auto items = shader_archive->items()) {
46 for (
auto i = items->begin(),
end = items->end();
i !=
end;
i++) {
48 key.name =
i->name()->str();
50 shaders_[
key] = std::make_shared<fml::NonOwnedMapping>(
51 i->mapping()->Data(),
i->mapping()->size(),
52 [payload = payload_](
auto,
auto) {
71 return shaders_.size();
76 std::string
name)
const {
80 auto found = shaders_.find(
key);
81 return found == shaders_.end() ? nullptr : found->second;
86 const std::string&
name,
87 const std::shared_ptr<fml::Mapping>& mapping)>&
93 for (
const auto& shader : shaders_) {
95 if (!
callback(shader.first.type, shader.first.name, shader.second)) {
size_t IterateAllShaders(const std::function< bool(ArchiveShaderType type, const std::string &name, const std::shared_ptr< fml::Mapping > &mapping)> &) const
ShaderArchive(std::shared_ptr< fml::Mapping > payload)
size_t GetShaderCount() const
std::shared_ptr< fml::Mapping > GetMapping(ArchiveShaderType type, std::string name) const
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
#define FML_UNREACHABLE()
Dart_NativeFunction function
void(ABI *)(Params *, SkRasterPipelineStage *program, F r, F g, F b, F a) Stage
DEF_SWITCHES_START aot vmservice shared library name
constexpr ArchiveShaderType ToShaderType(fb::Stage stage)