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 
11 #include "impeller/core/formats.h"
12 #include "impeller/core/sampler.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 ///
24  virtual ~ResourceBinder() = default;
25 
26  virtual bool BindResource(ShaderStage stage,
27  const ShaderUniformSlot& slot,
28  const ShaderMetadata& metadata,
29  BufferView view) = 0;
30 
31  virtual bool BindResource(ShaderStage stage,
32  const SampledImageSlot& slot,
33  const ShaderMetadata& metadata,
34  std::shared_ptr<const Texture> texture,
35  std::shared_ptr<const Sampler> sampler) = 0;
36 };
37 
38 } // namespace impeller
39 
40 #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::ResourceBinder::BindResource
virtual bool BindResource(ShaderStage stage, const ShaderUniformSlot &slot, const ShaderMetadata &metadata, BufferView view)=0
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
impeller::BufferView
Definition: buffer_view.h:13
buffer_view.h
impeller::ResourceBinder::~ResourceBinder
virtual ~ResourceBinder()=default
texture.h
shader_types.h
impeller
Definition: aiks_context.cc:10