| Flutter Impeller |

resource_binder.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_CORE_RESOURCE_BINDER_H_
6 #define FLUTTER_IMPELLER_CORE_RESOURCE_BINDER_H_
7
8 #include <memory>
9
10 #include "impeller/core/buffer_view.h"
11 #include "impeller/core/formats.h"
12 #include "impeller/core/sampler.h"
13 #include "impeller/core/shader_types.h"
14 #include "impeller/core/texture.h"
15
16 namespace impeller {
17
18 //------------------------------------------------------------------------------
19 /// @brief An interface for binding resources. This is implemented by
20 /// |Command| and |ComputeCommand| to make GPU resources available
21 /// to a given command's pipeline.
22 ///
23 struct ResourceBinder {
24 virtual ~ResourceBinder() = default;
25
26 virtual bool BindResource(ShaderStage stage,
27 DescriptorType type,
28 const ShaderUniformSlot& slot,
29 const ShaderMetadata& metadata,
30 BufferView view) = 0;
31
32 virtual bool BindResource(ShaderStage stage,
33 DescriptorType type,
34 const SampledImageSlot& slot,
35 const ShaderMetadata& metadata,
36 std::shared_ptr<const Texture> texture,
37 const std::unique_ptr<const Sampler>& sampler) = 0;
38 };
39
40 } // namespace impeller
41
42 #endif // FLUTTER_IMPELLER_CORE_RESOURCE_BINDER_H_
impeller::ShaderUniformSlot
Metadata required to bind a buffer.
Definition: shader_types.h:81
impeller::ShaderMetadata
Definition: shader_types.h:72
formats.h
impeller::ShaderStage
ShaderStage
Definition: shader_types.h:22
sampler.h
impeller::ResourceBinder
An interface for binding resources. This is implemented by |Command| and |ComputeCommand| to make GPU...
Definition: resource_binder.h:23
impeller::SampledImageSlot
Metadata required to bind a combined texture and sampler.
Definition: shader_types.h:98
type
GLenum type
Definition: blit_command_gles.cc:126
impeller::ResourceBinder::BindResource
virtual bool BindResource(ShaderStage stage, DescriptorType type, const ShaderUniformSlot &slot, const ShaderMetadata &metadata, BufferView view)=0
impeller::BufferView
Definition: buffer_view.h:15
buffer_view.h
impeller::ResourceBinder::~ResourceBinder
virtual ~ResourceBinder()=default
texture.h
shader_types.h
impeller
Definition: aiks_blend_unittests.cc:18
impeller::DescriptorType
DescriptorType
Definition: shader_types.h:153