xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/vulkan/SamplerVk.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2016 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // SamplerVk.h:
7 //    Defines the class interface for SamplerVk, implementing SamplerImpl.
8 //
9 
10 #ifndef LIBANGLE_RENDERER_VULKAN_SAMPLERVK_H_
11 #define LIBANGLE_RENDERER_VULKAN_SAMPLERVK_H_
12 
13 #include "libANGLE/renderer/SamplerImpl.h"
14 #include "libANGLE/renderer/vulkan/ContextVk.h"
15 #include "libANGLE/renderer/vulkan/vk_helpers.h"
16 
17 namespace rx
18 {
19 
20 class SamplerVk : public SamplerImpl
21 {
22   public:
23     SamplerVk(const gl::SamplerState &state);
24     ~SamplerVk() override;
25 
26     void onDestroy(const gl::Context *context) override;
27     angle::Result syncState(const gl::Context *context, const bool dirty) override;
28 
getSampler()29     const vk::SamplerHelper &getSampler() const
30     {
31         ASSERT(mSampler);
32         ASSERT(mSampler->valid());
33         return *mSampler.get();
34     }
35 
36   private:
37     vk::SharedSamplerPtr mSampler;
38 };
39 
40 }  // namespace rx
41 
42 #endif  // LIBANGLE_RENDERER_VULKAN_SAMPLERVK_H_
43