This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
extCompGpuPrimvarBufferSource.h
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_EXT_COMP_GPU_PRIMVAR_BUFFER_SOURCE_H
8#define PXR_IMAGING_HD_ST_EXT_COMP_GPU_PRIMVAR_BUFFER_SOURCE_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdSt/api.h"
12#include "pxr/imaging/hd/bufferSource.h"
13#include "pxr/imaging/hd/types.h"
14
15#include "pxr/base/tf/token.h"
16
17#include "pxr/usd/sdf/path.h"
18
19PXR_NAMESPACE_OPEN_SCOPE
20
25public:
27 HdTupleType const & valueType,
28 int numElements,
29 SdfPath const& compId);
30
31 HDST_API
32 virtual ~HdStExtCompGpuPrimvarBufferSource() = default;
33
34 HDST_API
35 virtual size_t ComputeHash() const override;
36
37 HDST_API
38 virtual bool Resolve() override;
39
40 HDST_API
41 virtual TfToken const &GetName() const override;
42
43 HDST_API
44 virtual size_t GetNumElements() const override;
45
46 HDST_API
47 virtual HdTupleType GetTupleType() const override;
48
49 HDST_API
50 virtual void GetBufferSpecs(HdBufferSpecVector *specs) const override;
51
52protected:
53 virtual bool _CheckValid() const override;
54
55private:
56 TfToken _name;
57 HdTupleType _tupleType;
58 size_t _numElements;
59 SdfPath _compId;
60
63 const HdStExtCompGpuPrimvarBufferSource &) = delete;
65 const HdStExtCompGpuPrimvarBufferSource &) = delete;
66};
67
68PXR_NAMESPACE_CLOSE_SCOPE
69
70#endif // PXR_IMAGING_HD_ST_EXT_COMP_GPU_PRIMVAR_BUFFER_SOURCE_H
A abstract base class for pure cpu computation.
Definition: bufferSource.h:221
A buffer source mapped to an output of an ExtComp CPU computation.
virtual HDST_API size_t GetNumElements() const override
Returns the number of elements (e.g.
virtual HDST_API HdTupleType GetTupleType() const override
Returns the data type and count (array size) for this buffer source.
virtual HDST_API size_t ComputeHash() const override
Computes and returns a hash value for the underlying data.
virtual HDST_API void GetBufferSpecs(HdBufferSpecVector *specs) const override
Add the buffer spec for this buffer source into given bufferspec vector.
virtual bool _CheckValid() const override
Checks the validity of the source buffer.
virtual HDST_API TfToken const & GetName() const override
Return the name of this buffer source.
virtual HDST_API bool Resolve() override
Prepare the access of GetData().
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
HdTupleType represents zero, one, or more values of the same HdType.
Definition: types.h:343
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...