HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
computePipeline.h
Go to the documentation of this file.
1 //
2 // Copyright 2020 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_IMAGING_HGI_COMPUTE_PIPELINE_H
8 #define PXR_IMAGING_HGI_COMPUTE_PIPELINE_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/imaging/hgi/api.h"
13 #include "pxr/imaging/hgi/enums.h"
14 #include "pxr/imaging/hgi/handle.h"
17 #include "pxr/imaging/hgi/types.h"
18 
19 #include <string>
20 #include <vector>
21 
23 
24 
25 /// \struct HgiComputeShaderConstantsDesc
26 ///
27 /// A small, but fast buffer of uniform data for shaders.
28 ///
29 /// <ul>
30 /// <li>byteSize:
31 /// Size of the constants in bytes. (max 256 bytes)</li>
32 /// </ul>
33 ///
35  HGI_API
37 
38  uint32_t byteSize;
39 };
40 
41 HGI_API
42 bool operator==(
45 
46 HGI_API
47 bool operator!=(
50 
51 /// \struct HgiComputePipelineDesc
52 ///
53 /// Describes the properties needed to create a GPU compute pipeline.
54 ///
55 /// <ul>
56 /// <li>shaderProgram:
57 /// Shader function used in this pipeline.</li>
58 /// <li>shaderConstantsDesc:
59 /// Describes the shader uniforms.</li>
60 /// </ul>
61 ///
63 {
64  HGI_API
66 
67  std::string debugName;
70 };
71 
72 HGI_API
73 bool operator==(
74  const HgiComputePipelineDesc& lhs,
75  const HgiComputePipelineDesc& rhs);
76 
77 HGI_API
78 bool operator!=(
79  const HgiComputePipelineDesc& lhs,
80  const HgiComputePipelineDesc& rhs);
81 
82 
83 ///
84 /// \class HgiComputePipeline
85 ///
86 /// Represents a graphics platform independent GPU compute pipeline resource.
87 ///
88 /// Base class for Hgi compute pipelines.
89 /// To the client (HdSt) compute pipeline resources are referred to via
90 /// opaque, stateless handles (HgiComputePipelineHandle).
91 ///
93 {
94 public:
95  HGI_API
96  virtual ~HgiComputePipeline();
97 
98  /// The descriptor describes the object.
99  HGI_API
100  HgiComputePipelineDesc const& GetDescriptor() const;
101 
102 protected:
103  HGI_API
105 
107 
108 private:
109  HgiComputePipeline() = delete;
110  HgiComputePipeline & operator=(const HgiComputePipeline&) = delete;
111  HgiComputePipeline(const HgiComputePipeline&) = delete;
112 };
113 
115 using HgiComputePipelineHandleVector = std::vector<HgiComputePipelineHandle>;
116 
117 
119 
120 #endif
HgiShaderProgramHandle shaderProgram
virtual HGI_API ~HgiComputePipeline()
HgiComputePipelineDesc _descriptor
HgiComputeShaderConstantsDesc shaderConstantsDesc
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:556
#define HGI_API
Definition: api.h:23
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
std::vector< HgiComputePipelineHandle > HgiComputePipelineHandleVector
HGI_API HgiComputePipelineDesc()
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:542
HGI_API HgiComputePipelineDesc const & GetDescriptor() const
The descriptor describes the object.