Loading...
Searching...
No Matches
sampler.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_HGI_SAMPLER_H
8#define PXR_IMAGING_HGI_SAMPLER_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hgi/api.h"
12#include "pxr/imaging/hgi/enums.h"
13#include "pxr/imaging/hgi/handle.h"
14#include "pxr/imaging/hgi/types.h"
15
16#include <string>
17#include <vector>
18
19PXR_NAMESPACE_OPEN_SCOPE
20
21
48{
50 : magFilter(HgiSamplerFilterNearest)
51 , minFilter(HgiSamplerFilterNearest)
52 , mipFilter(HgiMipFilterNotMipmapped)
53 , addressModeU(HgiSamplerAddressModeClampToEdge)
54 , addressModeV(HgiSamplerAddressModeClampToEdge)
55 , addressModeW(HgiSamplerAddressModeClampToEdge)
56 , borderColor(HgiBorderColorTransparentBlack)
57 , enableCompare(false)
58 , compareFunction(HgiCompareFunctionNever)
59 {}
60
61 std::string debugName;
62 HgiSamplerFilter magFilter;
63 HgiSamplerFilter minFilter;
64 HgiMipFilter mipFilter;
65 HgiSamplerAddressMode addressModeU;
66 HgiSamplerAddressMode addressModeV;
67 HgiSamplerAddressMode addressModeW;
68 HgiBorderColor borderColor;
69 bool enableCompare;
70 HgiCompareFunction compareFunction;
71};
72
73HGI_API
74bool operator==(
75 const HgiSamplerDesc& lhs,
76 const HgiSamplerDesc& rhs);
77
78HGI_API
79bool operator!=(
80 const HgiSamplerDesc& lhs,
81 const HgiSamplerDesc& rhs);
82
83
92{
93public:
94 HGI_API
95 virtual ~HgiSampler();
96
98 HGI_API
100
111 HGI_API
112 virtual uint64_t GetRawResource() const = 0;
113
114protected:
115 HGI_API
116 HgiSampler(HgiSamplerDesc const& desc);
117
118 HgiSamplerDesc _descriptor;
119
120private:
121 HgiSampler() = delete;
122 HgiSampler & operator=(const HgiSampler&) = delete;
123 HgiSampler(const HgiSampler&) = delete;
124};
125
127using HgiSamplerHandleVector = std::vector<HgiSamplerHandle>;
128
129
130PXR_NAMESPACE_CLOSE_SCOPE
131
132#endif
Represents a graphics platform independent GPU sampler resource that perform texture sampling operati...
Definition: sampler.h:92
virtual HGI_API uint64_t GetRawResource() const =0
This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t.
HGI_API HgiSamplerDesc const & GetDescriptor() const
The descriptor describes the object.
Describes the properties needed to create a GPU sampler.
Definition: sampler.h:48