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