Blender V4.3
vk_sampler.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include "gpu_shader_private.hh"
12
13#include "vk_common.hh"
14
15#include "BLI_utility_mixins.hh"
16
17namespace blender::gpu {
18class VKContext;
19
20class VKSampler : public NonCopyable {
21 VkSampler vk_sampler_ = VK_NULL_HANDLE;
22
23 public:
24 virtual ~VKSampler();
25 void create(const GPUSamplerState &sampler_state);
26 void free();
27
28 VkSampler vk_handle() const
29 {
30 BLI_assert(vk_sampler_ != VK_NULL_HANDLE);
31 return vk_sampler_;
32 }
33
34 bool is_initialized() const
35 {
36 return vk_sampler_ != VK_NULL_HANDLE;
37 }
38};
39
40} // namespace blender::gpu
#define BLI_assert(a)
Definition BLI_assert.h:50
VkSampler vk_handle() const
Definition vk_sampler.hh:28
bool is_initialized() const
Definition vk_sampler.hh:34
void create(const GPUSamplerState &sampler_state)
Definition vk_sampler.cc:22