This PR adds support for `GPU_framebuffer_blit` When used with `GPU_DEPTH_BIT`. The challenge with is that not all GPUs support using a depth texture as a blit destination. An AMD GPU doesn't support a depth buffer with stencil buffer as blit destination.  > NOTE: AMD GPUs don't support 24 bit unsigned normalized depth textures at all. In all cases when we use depth blitting we are blitting the whole texture and in stead we can use a texture copy. A negative effect is that we need to unbind the framebuffer when copying depth textures, but a positive effect is that we can use a data transfer function what should theoretically be faster. This should be revisited when we are investigating in areas to improve the performance of the Vulkan backend. Pull Request: https://projects.blender.org/blender/blender/pulls/112674
34 lines
541 B
C++
34 lines
541 B
C++
/* SPDX-FileCopyrightText: 2022 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "gpu_texture_private.hh"
|
|
|
|
#include "vk_buffer.hh"
|
|
|
|
namespace blender::gpu {
|
|
|
|
class VKPixelBuffer : public PixelBuffer {
|
|
VKBuffer buffer_;
|
|
|
|
public:
|
|
VKPixelBuffer(int64_t size);
|
|
void *map() override;
|
|
void unmap() override;
|
|
int64_t get_native_handle() override;
|
|
size_t get_size() override;
|
|
|
|
VKBuffer &buffer_get()
|
|
{
|
|
return buffer_;
|
|
}
|
|
};
|
|
|
|
} // namespace blender::gpu
|