Merge shader_glue into compositor.

This commit is contained in:
Chinmay Garde
2021-07-19 14:58:55 -07:00
committed by Dan Field
parent f5fb2b7468
commit 36cb61f523
18 changed files with 9 additions and 135 deletions

View File

@@ -15,7 +15,6 @@ group("impeller") {
"geometry",
"image",
"primitives",
"shader_glue",
]
}
@@ -32,6 +31,5 @@ executable("impeller_unittests") {
"image:image_unittests",
"playground",
"primitives:primitives_unittests",
"shader_glue:shader_glue_unittests",
]
}

View File

@@ -1,4 +1,3 @@
# The Impeller Base Library
---------------------------
Contains a number of utilities that should probably go in the base library in the buildroot but whose use is not extensive enough to warrant a move yet.

View File

@@ -1,4 +1,3 @@
# The Impeller Shader Compiler & Reflector
------------------------------------------
Host side tooling that consumes [GLSL 4.60 (Core Profile)](https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.pdf) shaders and generates libraries suitable for consumption by an Impeller backend. Along with said libraries, the reflector generates code and meta-data to construct rendering and compute pipelines at runtime.

View File

@@ -18,8 +18,8 @@ constexpr std::string_view kReflectionHeaderTemplate =
#include "impeller/compositor/buffer_view.h" // nogncheck
#include "impeller/compositor/command.h" // nogncheck
#include "impeller/compositor/sampler.h" // nogncheck
#include "impeller/compositor/shader_types.h" // nogncheck
#include "impeller/compositor/texture.h" // nogncheck
#include "impeller/shader_glue/shader_types.h" // nogncheck
namespace impeller {

View File

@@ -54,6 +54,8 @@ impeller_component("compositor") {
"shader_function.mm",
"shader_library.h",
"shader_library.mm",
"shader_types.cc",
"shader_types.h",
"surface.h",
"surface.mm",
"texture.h",
@@ -72,7 +74,6 @@ impeller_component("compositor") {
"../base",
"../geometry",
"../image",
"../shader_glue",
]
frameworks = [ "Metal.framework" ]

View File

@@ -14,9 +14,9 @@
#include "impeller/compositor/formats.h"
#include "impeller/compositor/pipeline.h"
#include "impeller/compositor/sampler.h"
#include "impeller/compositor/shader_types.h"
#include "impeller/compositor/texture.h"
#include "impeller/compositor/vertex_buffer.h"
#include "impeller/shader_glue/shader_types.h"
namespace impeller {

View File

@@ -17,7 +17,7 @@
#include "flutter/fml/macros.h"
#include "impeller/compositor/comparable.h"
#include "impeller/compositor/formats.h"
#include "impeller/shader_glue/shader_types.h"
#include "impeller/compositor/shader_types.h"
namespace impeller {

View File

@@ -13,7 +13,7 @@
#include "impeller/compositor/device_buffer.h"
#include "impeller/compositor/formats_metal.h"
#include "impeller/compositor/sampler.h"
#include "impeller/shader_glue/shader_types.h"
#include "impeller/compositor/shader_types.h"
namespace impeller {

View File

@@ -9,7 +9,7 @@
#include "flutter/fml/hash_combine.h"
#include "flutter/fml/macros.h"
#include "impeller/compositor/comparable.h"
#include "impeller/shader_glue/shader_types.h"
#include "impeller/compositor/shader_types.h"
namespace impeller {

View File

@@ -10,7 +10,7 @@
#include "flutter/fml/macros.h"
#include "impeller/compositor/comparable.h"
#include "impeller/shader_glue/shader_types.h"
#include "impeller/compositor/shader_types.h"
namespace impeller {

View File

@@ -1,4 +1,3 @@
# The Impeller Fixtures Set
---------------------------
Unlike other targets in the buildroot, all Impeller unit-tests use the same fixture set and are invoked using a single test harness (`impeller_unittest`). This is for convenience but also to make working with shader libraries easier.

View File

@@ -1,4 +1,3 @@
# The Impeller Geometry Library
-------------------------------
Set of utilities used by most graphics operations. While the utilities themselves are rendering backend agnostic, the layout and packing of the various POD structs is arranged such that these can be copied into device memory directly. The supported operations also mimic GLSL to some extent. For this reason, the Impeller shader compiler and reflector uses these utilities in generated code.

View File

@@ -1,4 +1,3 @@
The Impeller Image Library
--------------------------
Set of utilities for working with texture information. The library is indepenent of the rendering subsystem.

View File

@@ -1,4 +1,3 @@
The Impeller Playground
-----------------------
An extension of the testing fixtures set, provides utilities for interactive experimentation with the Impeller rendering subsystem. One the test author is satisfied with the behavior of component as verified in the playground, pixel test assertions can be added to before committing the new test case. Meant to provide a gentle-er on-ramp to testing Impeller components. The WSI in the playground allows for points at which third-party profiling and instrumentation tools can be used to examine isolated test cases.

View File

@@ -1,31 +0,0 @@
# 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.
import("//flutter/impeller/tools/impeller.gni")
config("shader_glue_public_config") {
include_dirs = [ "." ]
}
impeller_component("shader_glue") {
public_configs = [ ":shader_glue_public_config" ]
public = [ "shader_types.h" ]
sources = [
"shader_types.cc",
"shader_types.h",
]
deps = [ "../geometry" ]
}
impeller_component("shader_glue_unittests") {
testonly = true
sources = []
deps = [
":shader_glue",
"//flutter/testing",
]
}

View File

@@ -1,11 +0,0 @@
// 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/shader_glue/shader_types.h"
namespace impeller {
//
} // namespace impeller

View File

@@ -1,77 +0,0 @@
// 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 <array>
#include <cstddef>
#include <string_view>
#include "impeller/geometry/matrix.h"
namespace impeller {
enum class ShaderStage {
kUnknown,
kVertex,
kFragment,
};
enum class ShaderType {
kUnknown,
kVoid,
kBoolean,
kSignedByte,
kUnsignedByte,
kSignedShort,
kUnsignedShort,
kSignedInt,
kUnsignedInt,
kSignedInt64,
kUnsignedInt64,
kAtomicCounter,
kHalfFloat,
kFloat,
kDouble,
kStruct,
kImage,
kSampledImage,
kSampler,
};
template <class T>
struct ShaderUniformSlot {
using Type = T;
const char* name;
size_t binding;
};
struct ShaderStageIOSlot {
const char* name;
size_t location;
size_t set;
size_t binding;
ShaderType type;
size_t bit_width;
size_t vec_size;
size_t columns;
};
struct SampledImageSlot {
const char* name;
size_t texture_index;
size_t sampler_index;
constexpr bool HasTexture() const { return texture_index < 32u; }
constexpr bool HasSampler() const { return sampler_index < 32u; }
};
template <size_t Size>
struct Padding {
private:
uint8_t pad_[Size];
};
} // namespace impeller

View File

@@ -169,7 +169,7 @@ template("impeller_shaders") {
deps = [
":$impellerc_target_name",
"//flutter/impeller/shader_glue",
"//flutter/impeller/compositor",
]
}