VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
vulkanRenderTarget.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3//
4// Vulkan render target — stub.
5//
6
7#ifdef VISUTWIN_HAS_VULKAN
8
10
11#include "spdlog/spdlog.h"
12
13namespace visutwin::canvas
14{
15 VulkanRenderTarget::VulkanRenderTarget(const RenderTargetOptions& options)
16 : RenderTarget(options)
17 {
18 // TODO: create VkRenderPass + VkFramebuffer from options
19 }
20
21 VulkanRenderTarget::~VulkanRenderTarget()
22 {
23 destroyFrameBuffers();
24 }
25
26 void VulkanRenderTarget::destroyFrameBuffers()
27 {
28 if (_vkDevice != VK_NULL_HANDLE) {
29 if (_framebuffer != VK_NULL_HANDLE) {
30 vkDestroyFramebuffer(_vkDevice, _framebuffer, nullptr);
31 _framebuffer = VK_NULL_HANDLE;
32 }
33 if (_renderPass != VK_NULL_HANDLE) {
34 vkDestroyRenderPass(_vkDevice, _renderPass, nullptr);
35 _renderPass = VK_NULL_HANDLE;
36 }
37 }
38 }
39
40 void VulkanRenderTarget::createFrameBuffers()
41 {
42 // TODO: create VkRenderPass + VkFramebuffer from color/depth attachments
43 }
44}
45
46#endif // VISUTWIN_HAS_VULKAN