Files
test2/source/blender/gpu/vulkan/vk_sampler.hh
Jeroen Bakker 00f5ae2a8f Vulkan: Implement Samplers
Until now the Vulkan backend supported a single pre-configured sampler.
This PR realizes creation, caching and freeing of samplers based on what
is required by the state manager.

The implementation is similar to OpenGL or Metal. This fixes many issues
including:

- Textures in workbench and eevee use the correct extend and filtering
- Custom icons render correctly
- Depth sampling issues
- Removes artifacts using EEVEE world shader, lighting and indirect lighting.

Pull Request: https://projects.blender.org/blender/blender/pulls/114827
2023-11-14 11:12:19 +01:00

41 lines
688 B
C++

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*/
#pragma once
#include "gpu_shader_private.hh"
#include "vk_common.hh"
#include "BLI_utility_mixins.hh"
namespace blender::gpu {
class VKContext;
class VKSampler : public NonCopyable {
VkSampler vk_sampler_ = VK_NULL_HANDLE;
public:
virtual ~VKSampler();
void create(const GPUSamplerState &sampler_state);
void free();
VkSampler vk_handle() const
{
BLI_assert(vk_sampler_ != VK_NULL_HANDLE);
return vk_sampler_;
}
bool is_initialized() const
{
return vk_sampler_ != VK_NULL_HANDLE;
}
};
} // namespace blender::gpu