Adding support for Texture View in Vulkan backend. When a VKTexture is a texture view many options become irrelevant, but isn't actually clear via its API. Added asserts to make sure that the usage is supported. This patch allows rendering simple workbench-next scenes without any validation errors. Pull Request: https://projects.blender.org/blender/blender/pulls/110887
41 lines
785 B
C++
41 lines
785 B
C++
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "vk_common.hh"
|
|
|
|
#include "BLI_string_ref.hh"
|
|
#include "BLI_utility_mixins.hh"
|
|
|
|
namespace blender::gpu {
|
|
class VKTexture;
|
|
|
|
class VKImageView : NonCopyable {
|
|
VkImageView vk_image_view_ = VK_NULL_HANDLE;
|
|
|
|
public:
|
|
VKImageView(VKTexture &texture,
|
|
eImageViewUsage usage,
|
|
IndexRange layer_range,
|
|
IndexRange mip_range,
|
|
bool use_stencil,
|
|
StringRefNull name);
|
|
|
|
VKImageView(VKImageView &&other);
|
|
~VKImageView();
|
|
|
|
VkImageView vk_handle() const
|
|
{
|
|
BLI_assert(vk_image_view_ != VK_NULL_HANDLE);
|
|
return vk_image_view_;
|
|
}
|
|
};
|
|
|
|
} // namespace blender::gpu
|