-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathSampler.h
More file actions
67 lines (53 loc) · 1.67 KB
/
Copy pathSampler.h
File metadata and controls
67 lines (53 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//===- Sampler.h - Offload API Texture ------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
//
//===----------------------------------------------------------------------===//
#ifndef OFFLOADTEST_API_SAMPLER_H
#define OFFLOADTEST_API_SAMPLER_H
#include "API/API.h"
#include "API/Resources.h"
namespace offloadtest {
enum class FilterMode { Nearest, Linear };
enum class AddressMode { Clamp, Repeat, Mirror, Border, MirrorOnce };
enum class CompareFunction {
Never,
Less,
Equal,
LessEqual,
Greater,
NotEqual,
GreaterEqual,
Always
};
enum class SamplerKind { Sampler, SamplerComparison };
struct SamplerCreateDesc {
FilterMode MinFilter = FilterMode::Linear;
FilterMode MagFilter = FilterMode::Linear;
AddressMode Address = AddressMode::Clamp;
float MinLOD = 0.0f;
float MaxLOD = std::numeric_limits<float>::max();
float MipLODBias = 0.0f;
CompareFunction ComparisonOp = CompareFunction::Never;
SamplerKind Kind = SamplerKind::Sampler;
};
class Sampler {
GPUAPI API;
public:
virtual ~Sampler();
Sampler(const Sampler &) = delete;
// Sampler(Sampler &&) = delete;
Sampler &operator=(const Sampler &) = delete;
// Sampler &operator=(Sampler &&) = delete;
GPUAPI getAPI() const { return API; }
virtual const SamplerCreateDesc &getDesc() const = 0;
protected:
explicit Sampler(GPUAPI API) : API(API) {}
};
} // namespace offloadtest
#endif // OFFLOADTEST_API_SAMPLER_H