diff options
author | Jeroen Bakker <jbakker> | 2022-10-31 18:01:02 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-10-31 18:01:15 +0300 |
commit | 0e6f2d9fe0f49de658414bf16a9babab61f1895a (patch) | |
tree | 47a30bcda15392e7472b556b742200aff18aae93 /source/blender/gpu/vulkan/vk_framebuffer.hh | |
parent | c2e36c09b993fc0678eaf6a65b2cbd8ea9132cdb (diff) |
GPU: Add placeholder for Vulkan backend.
This patch adds a placeholder for the vulkan backend.
When activated (`WITH_VULKAN_BACKEND=On` and `--gpu-backend vulkan`)
it might open a blender screen, but nothing should be visible as
none of the functions are implemented or otherwise crash on a nullptr.
This is expected as this is just a placeholder. The goal is to add shader compilation
+validation to this backend as one of the next steps so we can validate
changes to existing shaders on OpenGL, Metal and Vulkan at the same time.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D16338
Diffstat (limited to 'source/blender/gpu/vulkan/vk_framebuffer.hh')
-rw-r--r-- | source/blender/gpu/vulkan/vk_framebuffer.hh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/source/blender/gpu/vulkan/vk_framebuffer.hh b/source/blender/gpu/vulkan/vk_framebuffer.hh new file mode 100644 index 00000000000..632d45ce709 --- /dev/null +++ b/source/blender/gpu/vulkan/vk_framebuffer.hh @@ -0,0 +1,50 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright 2022 Blender Foundation. All rights reserved. */ + +/** \file + * \ingroup gpu + */ + +#pragma once + +#include "gpu_framebuffer_private.hh" + +namespace blender::gpu { + +class VKFrameBuffer : public FrameBuffer { + public: + VKFrameBuffer(const char *name) : FrameBuffer(name) + { + } + + void bind(bool enabled_srgb) override; + bool check(char err_out[256]) override; + void clear(eGPUFrameBufferBits buffers, + const float clear_col[4], + float clear_depth, + uint clear_stencil) override; + void clear_multi(const float (*clear_col)[4]) override; + void clear_attachment(GPUAttachmentType type, + eGPUDataFormat data_format, + const void *clear_value) override; + + void attachment_set_loadstore_op(GPUAttachmentType type, + eGPULoadOp load_action, + eGPUStoreOp store_action) override; + + void read(eGPUFrameBufferBits planes, + eGPUDataFormat format, + const int area[4], + int channel_len, + int slot, + void *r_data) override; + + void blit_to(eGPUFrameBufferBits planes, + int src_slot, + FrameBuffer *dst, + int dst_slot, + int dst_offset_x, + int dst_offset_y) override; +}; + +} // namespace blender::gpu
\ No newline at end of file |