Allow binding of framebuffers without sRGB to linear transform. `GPU_framebuffer_bind_no_srgb`. This Patch removes color transform artifacts in node, image and sequence editor. When the framebuffer is an srgb framebuffer and it is bound without the transformation, the SRGB textures are bound as UNORM variants. As framebuffer, render pass and subpass recreation is ensured by `VKCommandBuffer` we don't need to mark the framebuffer dirty at this time. Later on we can optimize this by adding a state changed detection for framebuffers and render passes. Pull Request: https://projects.blender.org/blender/blender/pulls/113838
48 lines
920 B
C++
48 lines
920 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;
|
|
VkFormat vk_format_ = VK_FORMAT_UNDEFINED;
|
|
|
|
public:
|
|
VKImageView(VKTexture &texture,
|
|
eImageViewUsage usage,
|
|
IndexRange layer_range,
|
|
IndexRange mip_range,
|
|
bool use_stencil,
|
|
bool use_srgb,
|
|
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
|