HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HwResourceBindingContext.h
Go to the documentation of this file.
1 //
2 // Copyright Contributors to the MaterialX Project
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 
6 #ifndef MATERIALX_HWRESOURCEBINDINGCONTEXT_H
7 #define MATERIALX_HWRESOURCEBINDINGCONTEXT_H
8 
9 /// @file
10 /// Hardware resource bindings context base class
11 
12 #include <MaterialXGenHw/Export.h>
13 
15 
16 #include <MaterialXCore/Util.h>
17 
19 
20 class VariableBlock;
21 
23 /// Shared pointer to a HwResourceBindingContext
24 using HwResourceBindingContextPtr = shared_ptr<class HwResourceBindingContext>;
25 
26 /// @class HwResourceBindingContext
27 /// Class representing a context for resource binding for hardware resources.
29 {
30  public:
32 
33  // Initialize the context before generation starts.
34  virtual void initialize() = 0;
35 
36  // Emit directives required for binding support
37  virtual void emitDirectives(GenContext& context, ShaderStage& stage) = 0;
38 
39  // Emit uniforms with binding information
40  virtual void emitResourceBindings(GenContext& context, const VariableBlock& uniforms, ShaderStage& stage) = 0;
41 
42  // Emit struct uniforms with binding information
43  virtual void emitStructuredResourceBindings(GenContext& context, const VariableBlock& uniforms,
44  ShaderStage& stage, const std::string& structInstanceName,
45  const std::string& arraySuffix = EMPTY_STRING) = 0;
46 };
47 
49 
50 #endif
shared_ptr< class HwResourceBindingContext > HwResourceBindingContextPtr
Shared pointer to a HwResourceBindingContext.
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string EMPTY_STRING
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
Definition: logging.h:294
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:26
#define MX_GENHW_API
Definition: Export.h:18