Loading...
Searching...
No Matches
samplerObjectRegistry.h
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_HD_ST_SAMPLER_OBJECT_REGISTRY_H
8#define PXR_IMAGING_HD_ST_SAMPLER_OBJECT_REGISTRY_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdSt/api.h"
12
13#include <memory>
14#include <vector>
15
16PXR_NAMESPACE_OPEN_SCOPE
17
19using HdStTextureObjectSharedPtr =
20 std::shared_ptr<class HdStTextureObject>;
21using HdStSamplerObjectSharedPtr =
22 std::shared_ptr<class HdStSamplerObject>;
24
37class HdSt_SamplerObjectRegistry final
38{
39public:
40 HDST_API
41 explicit HdSt_SamplerObjectRegistry(HdStResourceRegistry * registry);
42
43 HDST_API
44 ~HdSt_SamplerObjectRegistry();
45
50 HDST_API
51 HdStSamplerObjectSharedPtr AllocateSampler(
52 HdStTextureObjectSharedPtr const &texture,
53 HdSamplerParameters const &samplerParameters);
54
56 HDST_API
57 void GarbageCollect();
58
59 HDST_API
60 void MarkGarbageCollectionNeeded();
61
64 HDST_API
65 HdStResourceRegistry * GetResourceRegistry() const;
66
67private:
68 std::vector<HdStSamplerObjectSharedPtr> _samplerObjects;
69
70 bool _garbageCollectionNeeded;
71 HdStResourceRegistry *_resourceRegistry;
72};
73
74PXR_NAMESPACE_CLOSE_SCOPE
75
76#endif
Collection of standard parameters such as wrap modes to sample a texture.
Definition: types.h:110
A central registry of all GPU resources.