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 #pragma once
6 
7 #include <map>
8 #include <memory>
9 #include <optional>
10 #include <string>
11 
12 #include "flutter/fml/logging.h"
13 #include "flutter/fml/macros.h"
15 #include "impeller/core/formats.h"
16 #include "impeller/core/sampler.h"
18 #include "impeller/core/texture.h"
19 
20 namespace impeller {
21 
22 //------------------------------------------------------------------------------
23 /// @brief An interface for binding resources. This is implemented by
24 /// |Command| and |ComputeCommand| to make GPU resources available
25 /// to a given command's pipeline.
26 ///
28  virtual ~ResourceBinder() = default;
29 
30  virtual bool BindResource(ShaderStage stage,
31  const ShaderUniformSlot& slot,
32  const ShaderMetadata& metadata,
33  const BufferView& view) = 0;
34 
35  virtual bool BindResource(ShaderStage stage,
36  const SampledImageSlot& slot,
37  const ShaderMetadata& metadata,
38  const std::shared_ptr<const Texture>& texture,
39  const std::shared_ptr<const Sampler>& sampler) = 0;
40 };
41 
42 } // namespace impeller
impeller::ShaderUniformSlot
Definition: shader_types.h:81
impeller::ShaderMetadata
Definition: shader_types.h:76
impeller::ResourceBinder::BindResource
virtual bool BindResource(ShaderStage stage, const ShaderUniformSlot &slot, const ShaderMetadata &metadata, const BufferView &view)=0
formats.h
impeller::ShaderStage
ShaderStage
Definition: shader_types.h:20
sampler.h
impeller::ResourceBinder
An interface for binding resources. This is implemented by |Command| and |ComputeCommand| to make GPU...
Definition: resource_binder.h:27
impeller::SampledImageSlot
Definition: shader_types.h:129
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