Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
render_pipeline.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_LIB_GPU_RENDER_PIPELINE_H_
6#define FLUTTER_LIB_GPU_RENDER_PIPELINE_H_
7
8#include <memory>
9
16
17namespace flutter {
18namespace gpu {
19
20class RenderPipeline : public RefCountedDartWrappable<RenderPipeline> {
21 DEFINE_WRAPPERTYPEINFO();
23
24 public:
27 std::shared_ptr<impeller::VertexDescriptor> vertex_descriptor);
28
29 ~RenderPipeline() override;
30
33
34 private:
36 fml::RefPtr<flutter::gpu::Shader> fragment_shader_;
37 // Vertex descriptor used at pipeline-build time. When the caller passes
38 // a custom `VertexLayout` to `GpuContext.createRenderPipeline`, this is
39 // built from that layout against the vertex shader's reflection metadata.
40 // Otherwise it is the impellerc-generated default for the vertex shader.
41 //
42 // Shared rather than unique because `impeller::PipelineDescriptor::
43 // SetVertexDescriptor` stores its argument as `shared_ptr<VertexDescriptor>`
44 // and `impeller::VertexDescriptor` is non-copyable; we have to keep a
45 // reference here so the descriptor remains valid across the many
46 // `BindToPipelineDescriptor` calls a single pipeline may participate in.
47 std::shared_ptr<impeller::VertexDescriptor> vertex_descriptor_;
48
50};
51
52} // namespace gpu
53} // namespace flutter
54
55//----------------------------------------------------------------------------
56/// Exports
57///
58
59extern "C" {
60
63 Dart_Handle wrapper,
64 flutter::gpu::Context* gpu_context,
65 flutter::gpu::Shader* vertex_shader,
66 flutter::gpu::Shader* fragment_shader,
67 Dart_Handle buffer_layouts_handle,
68 Dart_Handle attributes_handle,
69 Dart_Handle attribute_names_handle);
70
71} // extern "C"
72
73#endif // FLUTTER_LIB_GPU_RENDER_PIPELINE_H_
void BindToPipelineDescriptor(impeller::ShaderLibrary &library, impeller::PipelineDescriptor &desc)
An immutable collection of shaders loaded from a shader bundle asset.
Definition shader.h:23
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
#define FLUTTER_GPU_EXPORT
Definition export.h:13
#define FML_FRIEND_MAKE_REF_COUNTED(T)
FLUTTER_GPU_EXPORT Dart_Handle InternalFlutterGpu_RenderPipeline_Initialize(Dart_Handle wrapper, flutter::gpu::Context *gpu_context, flutter::gpu::Shader *vertex_shader, flutter::gpu::Shader *fragment_shader, Dart_Handle buffer_layouts_handle, Dart_Handle attributes_handle, Dart_Handle attribute_names_handle)