HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
flatNormals.h
Go to the documentation of this file.
1 //
2 // Copyright 2018 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_FLAT_NORMALS_H
8 #define PXR_IMAGING_HD_ST_FLAT_NORMALS_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/imaging/hdSt/api.h"
13 
16 
17 #include "pxr/base/tf/token.h"
18 
20 
21 
22 /// \class HdSt_FlatNormalsComputationCPU
23 ///
24 /// Flat normal computation CPU.
25 ///
27 {
28 public:
29  HDST_API
31  HdMeshTopology const *topology,
33  TfToken const &dstName,
34  bool packed);
35 
36  HDST_API
37  void GetBufferSpecs(HdBufferSpecVector *specs) const override;
38 
39  HDST_API
40  bool Resolve() override;
41 
42  HDST_API
43  TfToken const &GetName() const override;
44 
45 protected:
46  HDST_API
47  bool _CheckValid() const override;
48 
49 private:
50  HdMeshTopology const *_topology;
51  HdBufferSourceSharedPtr const _points;
52  TfToken _dstName;
53  bool _packed;
54 };
55 
56 /// \class HdSt_FlatNormalsComputationGPU
57 ///
58 /// Flat normal computation GPU.
59 ///
61 {
62 public:
63  HDST_API
65  HdBufferArrayRangeSharedPtr const &topologyRange,
66  HdBufferArrayRangeSharedPtr const &vertexRange,
67  int numFaces,
68  TfToken const &srcName,
69  TfToken const &dstName,
70  HdType srcDataType,
71  bool packed);
72 
73  HDST_API
74  void GetBufferSpecs(HdBufferSpecVector *specs) const override;
75 
76  HDST_API
78  HdResourceRegistry *resourceRegistry) override;
79 
80  int GetNumOutputElements() const override;
81 
82 private:
83  HdBufferArrayRangeSharedPtr const _topologyRange;
84  HdBufferArrayRangeSharedPtr const _vertexRange;
85  int _numFaces;
86  TfToken _srcName;
87  TfToken _dstName;
88  HdType _srcDataType;
89  HdType _dstDataType;
90 };
91 
92 
94 
95 #endif // PXR_IMAGING_HD_ST_FLAT_NORMALS_H
GLenum GLint * range
Definition: glcorearb.h:1925
HDST_API void GetBufferSpecs(HdBufferSpecVector *specs) const override
GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glad.h:2676
GLenum GLint GLint GLint GLint GLuint dstName
Definition: glcorearb.h:2510
Definition: token.h:70
HDST_API void GetBufferSpecs(HdBufferSpecVector *specs) const override
HDST_API bool Resolve() override
HDST_API bool _CheckValid() const override
GT_API const UT_StringHolder topology
HDST_API HdSt_FlatNormalsComputationGPU(HdBufferArrayRangeSharedPtr const &topologyRange, HdBufferArrayRangeSharedPtr const &vertexRange, int numFaces, TfToken const &srcName, TfToken const &dstName, HdType srcDataType, bool packed)
HDST_API HdSt_FlatNormalsComputationCPU(HdMeshTopology const *topology, HdBufferSourceSharedPtr const &points, TfToken const &dstName, bool packed)
VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 uint8_t packed(VULKAN_HPP_NAMESPACE::Format format)
std::vector< struct HdBufferSpec > HdBufferSpecVector
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
HDST_API void Execute(HdBufferArrayRangeSharedPtr const &range, HdResourceRegistry *resourceRegistry) override
Execute computation.
int GetNumOutputElements() const override
#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 TfToken const & GetName() const override
Return the name of this buffer source.