#include <shader_archive.h>
Definition at line 18 of file shader_archive.h.
◆ ShaderArchive() [1/2]
impeller::ShaderArchive::ShaderArchive |
( |
std::shared_ptr< fml::Mapping > |
payload | ) |
|
|
explicit |
Definition at line 28 of file shader_archive.cc.
29 : payload_(std::move(payload)) {
30 if (!payload_ || payload_->GetMapping() == nullptr) {
32 return;
33 }
34
35 if (!fb::ShaderArchiveBufferHasIdentifier(payload_->GetMapping())) {
37 return;
38 }
39
40 auto shader_archive = fb::GetShaderArchive(payload_->GetMapping());
41 if (!shader_archive) {
42 return;
43 }
44
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) {
53
54
55 });
56 }
57 }
58
59 is_valid_ = true;
60}
constexpr ArchiveShaderType ToShaderType(fb::Stage stage)
◆ ShaderArchive() [2/2]
◆ ~ShaderArchive()
impeller::ShaderArchive::~ShaderArchive |
( |
| ) |
|
|
default |
◆ GetMapping()
Definition at line 74 of file shader_archive.cc.
76 {
80 auto found = shaders_.find(
key);
81 return found == shaders_.end() ? nullptr : found->second;
82}
DEF_SWITCHES_START aot vmservice shared library name
◆ GetShaderCount()
size_t impeller::ShaderArchive::GetShaderCount |
( |
| ) |
const |
◆ IsValid()
bool impeller::ShaderArchive::IsValid |
( |
| ) |
const |
◆ IterateAllShaders()
Definition at line 84 of file shader_archive.cc.
88 {
90 return 0u;
91 }
93 for (const auto& shader : shaders_) {
95 if (!
callback(shader.first.type, shader.first.name, shader.second)) {
96 break;
97 }
98 }
100}
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
The documentation for this class was generated from the following files: