Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] Rename blobcat to shader_archive(r). #47247

Merged
merged 2 commits into from
Oct 24, 2023
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
2 changes: 1 addition & 1 deletion ci/licenses_golden/excluded_files
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
../../../flutter/impeller/archivist/archivist_unittests.cc
../../../flutter/impeller/base/README.md
../../../flutter/impeller/base/base_unittests.cc
../../../flutter/impeller/blobcat/blobcat_unittests.cc
../../../flutter/impeller/compiler/README.md
../../../flutter/impeller/compiler/compiler_unittests.cc
../../../flutter/impeller/compiler/switches_unittests.cc
Expand Down Expand Up @@ -175,6 +174,7 @@
../../../flutter/impeller/scene/README.md
../../../flutter/impeller/scene/importer/importer_unittests.cc
../../../flutter/impeller/scene/scene_unittests.cc
../../../flutter/impeller/shader_archive/shader_archive_unittests.cc
../../../flutter/impeller/tessellator/dart/.dart_tool
../../../flutter/impeller/tessellator/dart/pubspec.lock
../../../flutter/impeller/tessellator/dart/pubspec.yaml
Expand Down
28 changes: 14 additions & 14 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1719,13 +1719,6 @@ ORIGIN: ../../../flutter/impeller/base/validation.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/base/validation.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/base/version.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/base/version.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/blobcat/blob.fbs + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/blobcat/blob_library.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/blobcat/blob_library.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/blobcat/blob_types.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/blobcat/blob_writer.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/blobcat/blob_writer.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/blobcat/blobcat_main.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/compiler/code_gen_template.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/compiler/compiler.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/compiler/compiler.h + ../../../flutter/LICENSE
Expand Down Expand Up @@ -2338,6 +2331,13 @@ ORIGIN: ../../../flutter/impeller/scene/shaders/unlit.frag + ../../../flutter/LI
ORIGIN: ../../../flutter/impeller/scene/shaders/unskinned.vert + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/scene/skin.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/scene/skin.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/shader_archive/shader_archive.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/shader_archive/shader_archive.fbs + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/shader_archive/shader_archive.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/shader_archive/shader_archive_main.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/shader_archive/shader_archive_types.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/shader_archive/shader_archive_writer.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/shader_archive/shader_archive_writer.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/tessellator/c/tessellator.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/tessellator/c/tessellator.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/tessellator/dart/lib/tessellator.dart + ../../../flutter/LICENSE
Expand Down Expand Up @@ -4491,13 +4491,6 @@ FILE: ../../../flutter/impeller/base/validation.cc
FILE: ../../../flutter/impeller/base/validation.h
FILE: ../../../flutter/impeller/base/version.cc
FILE: ../../../flutter/impeller/base/version.h
FILE: ../../../flutter/impeller/blobcat/blob.fbs
FILE: ../../../flutter/impeller/blobcat/blob_library.cc
FILE: ../../../flutter/impeller/blobcat/blob_library.h
FILE: ../../../flutter/impeller/blobcat/blob_types.h
FILE: ../../../flutter/impeller/blobcat/blob_writer.cc
FILE: ../../../flutter/impeller/blobcat/blob_writer.h
FILE: ../../../flutter/impeller/blobcat/blobcat_main.cc
FILE: ../../../flutter/impeller/compiler/code_gen_template.h
FILE: ../../../flutter/impeller/compiler/compiler.cc
FILE: ../../../flutter/impeller/compiler/compiler.h
Expand Down Expand Up @@ -5111,6 +5104,13 @@ FILE: ../../../flutter/impeller/scene/shaders/unlit.frag
FILE: ../../../flutter/impeller/scene/shaders/unskinned.vert
FILE: ../../../flutter/impeller/scene/skin.cc
FILE: ../../../flutter/impeller/scene/skin.h
FILE: ../../../flutter/impeller/shader_archive/shader_archive.cc
FILE: ../../../flutter/impeller/shader_archive/shader_archive.fbs
FILE: ../../../flutter/impeller/shader_archive/shader_archive.h
FILE: ../../../flutter/impeller/shader_archive/shader_archive_main.cc
FILE: ../../../flutter/impeller/shader_archive/shader_archive_types.h
FILE: ../../../flutter/impeller/shader_archive/shader_archive_writer.cc
FILE: ../../../flutter/impeller/shader_archive/shader_archive_writer.h
FILE: ../../../flutter/impeller/tessellator/c/tessellator.cc
FILE: ../../../flutter/impeller/tessellator/c/tessellator.h
FILE: ../../../flutter/impeller/tessellator/dart/lib/tessellator.dart
Expand Down
2 changes: 1 addition & 1 deletion impeller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ impeller_component("impeller_unittests") {
deps = [
"archivist:archivist_unittests",
"base:base_unittests",
"blobcat:blobcat_unittests",
"compiler:compiler_unittests",
"core:allocator_unittests",
"display_list:skia_conversions_unittests",
"geometry:geometry_unittests",
"runtime_stage:runtime_stage_unittests",
"scene/importer:importer_unittests",
"shader_archive:shader_archive_unittests",
"tessellator:tessellator_unittests",
]

Expand Down
38 changes: 28 additions & 10 deletions impeller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,15 @@ states of completion:
package agnosticism in the Impeller interface. This sub-framework primarily
provides a custom implementation of the `flutter::DisplayListDispatcher` that
forwards Flutter rendering intent to Impeller.
* **`//impeller/typographer`**: Contains a backend agnostic interface for rendering typefaces. While Impeller does **not** do any text layout or shaping, it does render shaped glyph runs. The application specifies these glyph runs to Impeller using the Typographer subsystem.
* **`//impeller/typographer/backend`**: Contains code that interfaces with an underlying (usually platform-specific) library or toolkit to render glyphs in typefaces into texture atlases. Impeller will then reference these glyphs when rendering shaped glyph runs. No Impeller sub-frameworks may depend on these targets. There may be multiple typographer backends.
* **`//impeller/typographer`**: Contains a backend agnostic interface for
rendering typefaces. While Impeller does **not** do any text layout or
shaping, it does render shaped glyph runs. The application specifies these
glyph runs to Impeller using the Typographer subsystem.
* **`//impeller/typographer/backend`**: Contains code that interfaces with an
underlying (usually platform-specific) library or toolkit to render glyphs
in typefaces into texture atlases. Impeller will then reference these glyphs
when rendering shaped glyph runs. No Impeller sub-frameworks may depend on
these targets. There may be multiple typographer backends.
* **`//impeller/base`**: Contains C++ utilities that are used throughout the
Impeller family of frameworks. Ideally, these should go in `//flutter/fml` but
their use is probably not widespread enough to at this time.
Expand All @@ -114,14 +121,25 @@ states of completion:
removal and must not be used outside of tests.
* **`//fixtures`**: Contains test fixtures used by the various test harnesses.
This depends on `//flutter/testing`.
* **`//impeller/tools`**: Contains all GN rules and python scripts for working with
Impeller. These include GN rules processing GLSL shaders, including reflected
shader information as source set targets, and, including compiled shader
intermediate representations into the final executable as binary blobs for
easier packaging.
* **`//impeller/toolkit`**: Contains Impeller agnostic toolkits that provide more ergonomic wrappers around certain APIs like EGL. Toolkits must be dependency free so that an external component using a toolkit doesn't have to pull in a significant portion of Impeller itself.
* **`//impeller/blobcat`**: Concatenates shader blobs. This is primarily used by rendering backends that don't have the notion of a shader library. In Impeller, all shaders are packaged into a single library that contains a manifest of the shaders in the library along with the pre-compiled shaders themselves. Unlike Metal, backends like OpenGL ES and Vulkan don't have such a concept. For these backends, `//impeller/blobcat` is used to create a single shader library to be packaged with the engine.
* **`//impeller/scene`**: Contains an experimental 3D model renderer. This is currently only exposed via [a special build of the Flutter Engine](https://github.com/flutter/flutter/wiki/Impeller-Scene).
* **`//impeller/tools`**: Contains all GN rules and python scripts for working
with Impeller. These include GN rules processing GLSL shaders, including
reflected shader information as source set targets, and, including compiled
shader intermediate representations into the final executable as binary blobs
for easier packaging.
* **`//impeller/toolkit`**: Contains Impeller agnostic toolkits that provide
more ergonomic wrappers around certain APIs like EGL. Toolkits must be
dependency free so that an external component using a toolkit doesn't have to
pull in a significant portion of Impeller itself.
* **`//impeller/shader_archive`**: Create a persistent library of shader blobs.
This is primarily used by rendering backends that don't have the notion of a
shader library. In Impeller, all shaders are packaged into a single library
that contains a manifest of the shaders in the library along with the
pre-compiled shaders themselves. Unlike Metal, backends like OpenGL ES and
Vulkan don't have such a concept. For these backends, `//impeller/blobcat` is
used to create a single shader library to be packaged with the engine.
* **`//impeller/scene`**: Contains an experimental 3D model renderer. This is
currently only exposed via [a special build of the Flutter
Engine](https://github.com/flutter/flutter/wiki/Impeller-Scene).

## The Offline Shader Compilation Pipeline

Expand Down
101 changes: 0 additions & 101 deletions impeller/blobcat/blob_library.cc

This file was deleted.

43 changes: 0 additions & 43 deletions impeller/blobcat/blob_writer.h

This file was deleted.

2 changes: 1 addition & 1 deletion impeller/renderer/backend/gles/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impeller_component("gles") {

public_deps = [
"../../:renderer",
"../../../blobcat:blobcat_lib",
"../../../shader_archive",
"//flutter/fml",
]
}
14 changes: 7 additions & 7 deletions impeller/renderer/backend/gles/shader_library_gles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
#include "flutter/fml/closure.h"
#include "impeller/base/config.h"
#include "impeller/base/validation.h"
#include "impeller/blobcat/blob_library.h"
#include "impeller/renderer/backend/gles/shader_function_gles.h"
#include "impeller/shader_archive/shader_archive.h"

namespace impeller {

static ShaderStage ToShaderStage(BlobShaderType type) {
static ShaderStage ToShaderStage(ArchiveShaderType type) {
switch (type) {
case BlobShaderType::kVertex:
case ArchiveShaderType::kVertex:
return ShaderStage::kVertex;
case BlobShaderType::kFragment:
case ArchiveShaderType::kFragment:
return ShaderStage::kFragment;
case BlobShaderType::kCompute:
case ArchiveShaderType::kCompute:
return ShaderStage::kCompute;
}
FML_UNREACHABLE();
Expand Down Expand Up @@ -74,12 +74,12 @@ ShaderLibraryGLES::ShaderLibraryGLES(
return true;
};
for (auto library : shader_libraries) {
auto blob_library = BlobLibrary{std::move(library)};
auto blob_library = ShaderArchive{std::move(library)};
if (!blob_library.IsValid()) {
VALIDATION_LOG << "Could not construct blob library for shaders.";
return;
}
blob_library.IterateAllBlobs(iterator);
blob_library.IterateAllShaders(iterator);
}

functions_ = functions;
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/backend/vulkan/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impeller_component("vulkan") {

public_deps = [
"../../:renderer",
"../../../blobcat:blobcat_lib",
"../../../shader_archive",
"//flutter/flutter_vma",
"//flutter/fml",
"//third_party/vulkan-deps/vulkan-headers/src:vulkan_headers",
Expand Down
14 changes: 7 additions & 7 deletions impeller/renderer/backend/vulkan/shader_library_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@

#include "flutter/fml/logging.h"
#include "flutter/fml/trace_event.h"
#include "impeller/blobcat/blob_library.h"
#include "impeller/renderer/backend/vulkan/context_vk.h"
#include "impeller/renderer/backend/vulkan/shader_function_vk.h"
#include "impeller/shader_archive/shader_archive.h"

namespace impeller {

static ShaderStage ToShaderStage(BlobShaderType type) {
static ShaderStage ToShaderStage(ArchiveShaderType type) {
switch (type) {
case BlobShaderType::kVertex:
case ArchiveShaderType::kVertex:
return ShaderStage::kVertex;
case BlobShaderType::kFragment:
case ArchiveShaderType::kFragment:
return ShaderStage::kFragment;
case BlobShaderType::kCompute:
case ArchiveShaderType::kCompute:
return ShaderStage::kCompute;
}
FML_UNREACHABLE();
Expand Down Expand Up @@ -69,12 +69,12 @@ ShaderLibraryVK::ShaderLibraryVK(
return true;
};
for (const auto& library_data : shader_libraries_data) {
auto blob_library = BlobLibrary{library_data};
auto blob_library = ShaderArchive{library_data};
if (!blob_library.IsValid()) {
VALIDATION_LOG << "Could not construct shader blob library.";
return;
}
blob_library.IterateAllBlobs(iterator);
blob_library.IterateAllShaders(iterator);
}

if (!success) {
Expand Down
Loading