MaterialX 1.39.1
Loading...
Searching...
No Matches
VkResourceBindingContext.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_VKRESOURCEBINDING_H
7#define MATERIALX_VKRESOURCEBINDING_H
8
11
13
15
16MATERIALX_NAMESPACE_BEGIN
17
19using VkResourceBindingContextPtr = shared_ptr<class VkResourceBindingContext>;
20
24{
25 public:
26 VkResourceBindingContext(size_t uniformBindingLocation);
27
28 static VkResourceBindingContextPtr create(size_t uniformBindingLocation = 0)
29 {
30 return std::make_shared<VkResourceBindingContext>(uniformBindingLocation);
31 }
32
33 // Initialize the context before generation starts.
34 void initialize() override;
35
36 // Emit directives for stage
37 void emitDirectives(GenContext& context, ShaderStage& stage) override;
38
39 // Emit uniforms with binding information
40 void emitResourceBindings(GenContext& context, const VariableBlock& uniforms, ShaderStage& stage) override;
41
42 // Emit structured uniforms with binding information and align members where possible
43 void emitStructuredResourceBindings(GenContext& context, const VariableBlock& uniforms,
44 ShaderStage& stage, const std::string& structInstanceName,
45 const std::string& arraySuffix) override;
46
47 protected:
48 // Binding location for uniform blocks
49 size_t _hwUniformBindLocation = 0;
50
51 // Initial value of uniform binding location
52 size_t _hwInitUniformBindLocation = 0;
53};
54
55MATERIALX_NAMESPACE_END
56
57#endif
Hardware shader generator base class.
Macros for declaring imported and exported symbols.
shared_ptr< class VkResourceBindingContext > VkResourceBindingContextPtr
Shared pointer to a VkResourceBindingContext.
Definition: VkResourceBindingContext.h:19
A context class for shader generation.
Definition: GenContext.h:31
Class representing a context for resource binding for hardware resources.
Definition: HwShaderGenerator.h:374
A shader stage, containing the state and resulting source code for the stage.
Definition: ShaderStage.h:139
A block of variables in a shader stage.
Definition: ShaderStage.h:61
Class representing a resource binding for Vulkan Glsl shader resources.
Definition: VkResourceBindingContext.h:24