VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
vulkanTexture.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: Apache-2.0
2
// Copyright 2025-2026 Arnis Lektauers
3
//
4
// Vulkan texture implementation — VkImage + VkImageView + VkSampler.
5
//
6
#pragma once
7
8
#ifdef VISUTWIN_HAS_VULKAN
9
10
#include <vulkan/vulkan.h>
11
#include <vk_mem_alloc.h>
12
13
#include "
platform/graphics/gpu.h
"
14
#include "
platform/graphics/constants.h
"
15
16
namespace
visutwin::canvas
17
{
18
class
GraphicsDevice
;
19
class
Texture
;
20
class
VulkanGraphicsDevice;
21
}
22
23
namespace
visutwin::canvas::gpu
24
{
25
class
VulkanTexture :
public
HardwareTexture
26
{
27
public
:
28
explicit
VulkanTexture(Texture* owner);
29
~VulkanTexture()
override
;
30
31
void
uploadImmediate(GraphicsDevice* device)
override
;
32
void
propertyChanged(uint32_t flag)
override
;
33
34
[[nodiscard]] VkImage image()
const
{
return
_image; }
35
[[nodiscard]] VkImageView imageView()
const
{
return
_imageView; }
36
[[nodiscard]] VkSampler sampler()
const
{
return
_sampler; }
37
38
private
:
39
void
createSampler(VulkanGraphicsDevice* device);
40
41
Texture* _owner =
nullptr
;
42
VkDevice _vkDevice = VK_NULL_HANDLE;
43
VmaAllocator _allocator = VK_NULL_HANDLE;
44
VkImage _image = VK_NULL_HANDLE;
45
VmaAllocation _allocation = VK_NULL_HANDLE;
46
VkImageView _imageView = VK_NULL_HANDLE;
47
VkSampler _sampler = VK_NULL_HANDLE;
48
};
49
}
50
51
#endif
// VISUTWIN_HAS_VULKAN
visutwin::canvas::GraphicsDevice
Abstract GPU interface for resource creation, state management, and draw submission.
Definition
graphicsDevice.h:239
visutwin::canvas::Texture
GPU texture resource supporting 2D, cubemap, volume, and array formats with mipmap management.
Definition
texture.h:57
visutwin::canvas::gpu::HardwareTexture
Definition
gpu.h:20
gpu.h
visutwin::canvas::gpu
Definition
gpu.h:18
visutwin::canvas
Definition
eventHandler.cpp:9
constants.h
platform
graphics
vulkan
vulkanTexture.h
Generated by
1.16.1