Flutter Engine
 
Loading...
Searching...
No Matches
recording_render_pass.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_IMPELLER_ENTITY_CONTENTS_TEST_RECORDING_RENDER_PASS_H_
6#define FLUTTER_IMPELLER_ENTITY_CONTENTS_TEST_RECORDING_RENDER_PASS_H_
7
9
10namespace impeller::testing {
11
13 public:
14 explicit RecordingRenderPass(std::shared_ptr<RenderPass> delegate,
15 const std::shared_ptr<const Context>& context,
16 const RenderTarget& render_target);
17
19
20 const std::vector<Command>& GetCommands() const override { return commands_; }
21
22 // |RenderPass|
23 void SetPipeline(PipelineRef pipeline) override;
24
25 void SetCommandLabel(std::string_view label) override;
26
27 // |RenderPass|
28 void SetStencilReference(uint32_t value) override;
29
30 // |RenderPass|
31 void SetBaseVertex(uint64_t value) override;
32
33 // |RenderPass|
34 void SetViewport(Viewport viewport) override;
35
36 // |RenderPass|
37 void SetScissor(IRect32 scissor) override;
38
39 // |RenderPass|
40 void SetInstanceCount(size_t count) override;
41
42 // |RenderPass|
43 bool SetVertexBuffer(VertexBuffer buffer) override;
44
45 // |RenderPass|
46 fml::Status Draw() override;
47
48 bool BindResource(ShaderStage stage,
50 const ShaderUniformSlot& slot,
51 const ShaderMetadata* metadata,
52 BufferView view) override;
53
54 bool BindResource(ShaderStage stage,
56 const SampledImageSlot& slot,
57 const ShaderMetadata* metadata,
58 std::shared_ptr<const Texture> texture,
59 raw_ptr<const Sampler> sampler) override;
60
61 // |RenderPass|
64 const ShaderUniformSlot& slot,
65 std::unique_ptr<ShaderMetadata> metadata,
66 BufferView view) override;
67
68 // |RenderPass|
71 const SampledImageSlot& slot,
72 std::unique_ptr<ShaderMetadata> metadata,
73 std::shared_ptr<const Texture> texture,
74 raw_ptr<const Sampler> sampler) override;
75
76 // |RenderPass|
77 void OnSetLabel(std::string_view label) override;
78
79 // |RenderPass|
80 bool OnEncodeCommands(const Context& context) const override;
81
82 bool IsValid() const override { return true; }
83
84 private:
85 Command pending_;
86 std::shared_ptr<RenderPass> delegate_;
87 std::vector<Command> commands_;
88};
89
90} // namespace impeller::testing
91
92#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_TEST_RECORDING_RENDER_PASS_H_
GLenum type
To do anything rendering related with Impeller, you need a context.
Definition context.h:65
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition render_pass.h:30
void SetBaseVertex(uint64_t value) override
fml::Status Draw() override
Record the currently pending command.
void SetCommandLabel(std::string_view label) override
The debugging label to use for the command.
bool BindDynamicResource(ShaderStage stage, DescriptorType type, const ShaderUniformSlot &slot, std::unique_ptr< ShaderMetadata > metadata, BufferView view) override
Bind with dynamically generated shader metadata.
void SetScissor(IRect32 scissor) override
void SetViewport(Viewport viewport) override
bool BindResource(ShaderStage stage, DescriptorType type, const ShaderUniformSlot &slot, const ShaderMetadata *metadata, BufferView view) override
bool SetVertexBuffer(VertexBuffer buffer) override
Specify the vertex and index buffer to use for this command.
bool OnEncodeCommands(const Context &context) const override
void OnSetLabel(std::string_view label) override
void SetStencilReference(uint32_t value) override
void SetPipeline(PipelineRef pipeline) override
The pipeline to use for this command.
const std::vector< Command > & GetCommands() const override
Accessor for the current Commands.
FlView * view
FlTexture * texture
An object used to specify work to the GPU along with references to resources the GPU will used when d...
Definition command.h:80
Metadata required to bind a combined texture and sampler.
Metadata required to bind a buffer.