HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sampler.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_HGIGL_SAMPLER_H
8 #define PXR_IMAGING_HGIGL_SAMPLER_H
9 
11 
12 #include "pxr/imaging/hgiGL/api.h"
13 
14 
16 
17 
19 
20 ///
21 /// \class HgiGLSampler
22 ///
23 /// OpenGL implementation of HgiSampler
24 ///
25 class HgiGLSampler final : public HgiSampler
26 {
27 public:
28  HGIGL_API
29  ~HgiGLSampler() override;
30 
31  HGIGL_API
32  uint64_t GetRawResource() const override;
33 
34  /// Returns the gl resource id of the sampler.
35  HGIGL_API
36  uint32_t GetSamplerId() const;
37 
38  /// Returns the bindless gpu handle (caller must verify extension support)
39  HGIGL_API
40  uint64_t GetBindlessHandle(HgiTextureHandle const &textureHandle);
41 
42 protected:
43  friend class HgiGL;
44 
45  HGIGL_API
46  HgiGLSampler(HgiSamplerDesc const& desc);
47 
48 private:
49  HgiGLSampler() = delete;
50  HgiGLSampler & operator=(const HgiGLSampler&) = delete;
51  HgiGLSampler(const HgiGLSampler&) = delete;
52 
53 private:
54  uint32_t _samplerId;
55  uint32_t _bindlessTextureId;
56  uint64_t _bindlessHandle;
57 };
58 
59 
61 
62 #endif
int HgiHandle< class HgiTexture > HgiTextureHandle
HGIGL_API uint32_t GetSamplerId() const
Returns the gl resource id of the sampler.
Definition: hgi.h:54
#define HGIGL_API
Definition: api.h:23
HGIGL_API uint64_t GetRawResource() const override
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HGIGL_API uint64_t GetBindlessHandle(HgiTextureHandle const &textureHandle)
Returns the bindless gpu handle (caller must verify extension support)
HGIGL_API ~HgiGLSampler() override