This PR hooks up the vulkan backend with the render graph for drawing. It can run Blender better than the previous implementation so we also flipped it to be the default implementation. **Some highlights** - Adds support for framebuffer load/store operations - Adds support for framebuffer subpass transitions - Fixes workbench shadows - Performance is just below OpenGL performance when comparing fps. But the screen feels more fluent when using complex scenes. - Current performance is without doing any optimizations so will improve in the future. - EEVEE will not crash but has artifacts and many parts that require more work. **Related to** - #121648 - #118330 **Known Limitation** - Similar to previous implementation resources can be freed when still in use crashing Blender. This is typically the case when playing back an animation or updating a material icon. **Next steps** - Remove old implementation - Get EEVEE to work - Fix double resource freeing - Improve performance by identifying hotspots and change them Pull Request: https://projects.blender.org/blender/blender/pulls/121787
63 lines
1.3 KiB
C++
63 lines
1.3 KiB
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;
|
|
|
|
struct VKImageViewInfo {
|
|
eImageViewUsage usage;
|
|
IndexRange layer_range;
|
|
IndexRange mip_range;
|
|
union {
|
|
char swizzle[4];
|
|
uint32_t swizzle_data;
|
|
};
|
|
bool use_stencil;
|
|
bool use_srgb;
|
|
|
|
bool operator==(const VKImageViewInfo &other) const
|
|
{
|
|
return usage == other.usage && layer_range == other.layer_range &&
|
|
mip_range == other.mip_range && swizzle_data == other.swizzle_data &&
|
|
use_stencil == other.use_stencil && use_srgb == other.use_srgb;
|
|
}
|
|
};
|
|
|
|
class VKImageView : NonCopyable {
|
|
VkImageView vk_image_view_ = VK_NULL_HANDLE;
|
|
VkFormat vk_format_ = VK_FORMAT_UNDEFINED;
|
|
|
|
public:
|
|
const VKImageViewInfo info;
|
|
|
|
VKImageView(VKTexture &texture, const VKImageViewInfo &info, StringRefNull name);
|
|
|
|
VKImageView(VKImageView &&other);
|
|
~VKImageView();
|
|
|
|
VkImageView vk_handle() const
|
|
{
|
|
BLI_assert(vk_image_view_ != VK_NULL_HANDLE);
|
|
return vk_image_view_;
|
|
}
|
|
|
|
VkFormat vk_format() const
|
|
{
|
|
return vk_format_;
|
|
}
|
|
};
|
|
|
|
} // namespace blender::gpu
|