HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
smoothNormals.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 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_HD_ST_SMOOTH_NORMALS_H
8 #define PXR_IMAGING_HD_ST_SMOOTH_NORMALS_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/imaging/hdSt/api.h"
13 
15 
16 #include "pxr/base/tf/token.h"
17 
19 
20 
21 class Hd_VertexAdjacency;
22 class HdSt_VertexAdjacencyBuilder;
23 
24 /// \class HdSt_SmoothNormalsComputationCPU
25 ///
26 /// Smooth normal computation CPU.
27 ///
29 {
30 public:
31  HDST_API
33  Hd_VertexAdjacency const *adjacency,
35  TfToken const &dstName,
36  HdBufferSourceSharedPtr const &adjacencyBuilder,
37  bool packed);
38 
39  HDST_API
40  void GetBufferSpecs(HdBufferSpecVector *specs) const override;
41 
42  HDST_API
43  bool Resolve() override;
44 
45  HDST_API
46  TfToken const &GetName() const override;
47 
48 protected:
49  HDST_API
50  bool _CheckValid() const override;
51 
52 private:
53  Hd_VertexAdjacency const *_adjacency;
55  TfToken _dstName;
56  HdBufferSourceSharedPtr _adjacencyBuilder;
57  bool _packed;
58 };
59 
60 /// \class HdSt_SmoothNormalsComputationGPU
61 ///
62 /// Smooth normal computation GPU.
63 ///
65 {
66 public:
67  HDST_API
69  HdSt_VertexAdjacencyBuilder const *vertexAdjacencyBuilder,
70  TfToken const &srcName,
71  TfToken const &dstName,
72  HdType srcDataType,
73  bool packed);
74 
75  HDST_API
76  void GetBufferSpecs(HdBufferSpecVector *specs) const override;
77 
78  HDST_API
80  HdResourceRegistry *resourceRegistry) override;
81 
82  /// This computation doesn't generate buffer source (i.e. 2nd phase)
83  /// This is a gpu computation, but no need to resize the destination
84  /// since it belongs the same range as src buffer.
85  int GetNumOutputElements() const override { return 0; }
86 
87 private:
88  HdSt_VertexAdjacencyBuilder const *_vertexAdjacencyBuilder;
89  TfToken _srcName;
90  TfToken _dstName;
91  HdType _srcDataType;
92  HdType _dstDataType;
93 };
94 
95 
97 
98 #endif // PXR_IMAGING_HD_ST_SMOOTH_NORMALS_H
GLenum GLint * range
Definition: glcorearb.h:1925
GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glad.h:2676
HDST_API bool Resolve() override
HDST_API void GetBufferSpecs(HdBufferSpecVector *specs) const override
int GetNumOutputElements() const override
Definition: smoothNormals.h:85
HDST_API bool _CheckValid() const override
GLenum GLint GLint GLint GLint GLuint dstName
Definition: glcorearb.h:2510
Definition: token.h:70
HDST_API TfToken const & GetName() const override
Return the name of this buffer source.
HDST_API HdSt_SmoothNormalsComputationGPU(HdSt_VertexAdjacencyBuilder const *vertexAdjacencyBuilder, TfToken const &srcName, TfToken const &dstName, HdType srcDataType, bool packed)
VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 uint8_t packed(VULKAN_HPP_NAMESPACE::Format format)
std::vector< struct HdBufferSpec > HdBufferSpecVector
HDST_API HdSt_SmoothNormalsComputationCPU(Hd_VertexAdjacency const *adjacency, HdBufferSourceSharedPtr const &points, TfToken const &dstName, HdBufferSourceSharedPtr const &adjacencyBuilder, bool packed)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
HDST_API void Execute(HdBufferArrayRangeSharedPtr const &range, HdResourceRegistry *resourceRegistry) override
Execute computation.
#define HDST_API
Definition: api.h:23
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
std::shared_ptr< HdBufferArrayRange > HdBufferArrayRangeSharedPtr
Definition: bufferArray.h:27
std::shared_ptr< class HdBufferSource > HdBufferSourceSharedPtr
HdType
Definition: types.h:272
HDST_API void GetBufferSpecs(HdBufferSpecVector *specs) const override