blob: 8a24b9aba02f06fdfea46447632490673fcb517f [file] [log] [blame]
Timothy Liang2eb8e022018-08-09 12:55:28 -04001/*
2 * Copyright 2018 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef GrMtlSampler_DEFINED
9#define GrMtlSampler_DEFINED
10
11#import <metal/metal.h>
12
13class GrSamplerState;
14class GrMtlGpu;
15
16// This class only acts as a wrapper for a MTLSamplerState object for now, but will be more useful
17// once we start caching sampler states.
18class GrMtlSampler {
19public:
20 static GrMtlSampler* Create(const GrMtlGpu* gpu, const GrSamplerState&, uint32_t maxMipLevel);
21
22 id<MTLSamplerState> mtlSamplerState() const { return fMtlSamplerState; }
23
24private:
25 GrMtlSampler(id<MTLSamplerState> mtlSamplerState) : fMtlSamplerState(mtlSamplerState) {}
26
27 id<MTLSamplerState> fMtlSamplerState;
28};
29
30#endif