Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
SunShadowResources.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <array>
7#include <cstdint>
8#include <optional>
9#include <vulkan/vulkan_core.h>
10
11namespace Engine::Core
12{
14}
15
16namespace Engine::Rendering
17{
19 {
20 public:
21 void create(Core::ApplicationContext * context, uint32_t mapSize, uint32_t cascadeCount);
22 void cleanup(VkDevice device);
23
25
26 [[nodiscard]] const Vulkan::Buffer & getCascadeBuffer() const { return cascadeBuffer_.value(); }
27 [[nodiscard]] const VkDescriptorImageInfo & getDescriptorInfo() const { return descriptorInfo_; }
28 [[nodiscard]] VkImage getImage() const { return shadowImage_; }
29 [[nodiscard]] VkImageView getCascadeImageView(uint32_t cascadeIndex) const { return cascadeViews_.at(cascadeIndex); }
30 [[nodiscard]] uint32_t getCascadeCount() const { return cascadeCount_; }
31 [[nodiscard]] uint32_t getMapSize() const { return mapSize_; }
32 [[nodiscard]] bool isCreated() const { return shadowImage_ != VK_NULL_HANDLE; }
33 [[nodiscard]] bool hasRendered() const { return hasRendered_; }
34 void markRendered() { hasRendered_ = true; }
35
36 private:
37 uint32_t mapSize_ = 0u;
38 uint32_t cascadeCount_ = 0u;
39 bool hasRendered_ = false;
40
41 VkImage shadowImage_ = VK_NULL_HANDLE;
42 VkDeviceMemory shadowMemory_ = VK_NULL_HANDLE;
43 VkImageView shadowArrayView_ = VK_NULL_HANDLE;
44 std::array<VkImageView, GpuBuffers::MAX_SUN_SHADOW_CASCADES> cascadeViews_{};
45 VkSampler shadowSampler_ = VK_NULL_HANDLE;
46 VkDescriptorImageInfo descriptorInfo_{};
47 std::optional<Vulkan::Buffer> cascadeBuffer_;
48 };
49}
The application context is the core class which stores the basic openxr and vulkan objects.
const Vulkan::Buffer & getCascadeBuffer() const
std::optional< Vulkan::Buffer > cascadeBuffer_
VkImageView getCascadeImageView(uint32_t cascadeIndex) const
const VkDescriptorImageInfo & getDescriptorInfo() const
std::array< VkImageView, GpuBuffers::MAX_SUN_SHADOW_CASCADES > cascadeViews_
void create(Core::ApplicationContext *context, uint32_t mapSize, uint32_t cascadeCount)
void uploadCascadeData(const SunShadowCascadeBuffer &data)
RAII wrapper for Vulkan buffer and device memory.
Definition Buffer.h:26
Core audio subsystem owning the miniaudio engine and managing playback.
Definition AudioConfig.h:9
GpuBuffers::SunShadowCascadeBuffer SunShadowCascadeBuffer
Definition RenderData.h:545