Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
IBLResources.h
Go to the documentation of this file.
1#pragma once
2
10
11#include <vulkan/vulkan_core.h>
12#include <cstdint>
13
14namespace Engine::Core
15{
17} // namespace Engine::Core
18
19namespace Engine::Rendering
20{
22 {
23 public:
25
30 void createPlaceholders( Core::ApplicationContext * context, VkCommandPool commandPool);
31
42 VkCommandPool commandPool,
43 VkPipeline brdfLutComputePipeline,
44 VkPipelineLayout brdfLutPipelineLayout,
45 VkDescriptorSet brdfLutDescriptorSet
46 );
47
48 [[nodiscard]] const VkDescriptorImageInfo& getCubemapDescriptorInfo() const { return cubemapDescriptorInfo_; }
49 [[nodiscard]] const VkDescriptorImageInfo& getBrdfLutDescriptorInfo() const { return brdfLutDescriptorInfo_; }
50
51 void setCubemapDescriptorInfo( const VkDescriptorImageInfo & descriptorInfo );
52
53 [[nodiscard]] VkImageView getBrdfLutImageView() const { return brdfLutView_; }
54 [[nodiscard]] VkImage getBrdfLutImage() const { return brdfLutImage_; }
55
56 void cleanup(VkDevice device);
57
58 private:
59 // Placeholder cubemap (1x1 black, 6 faces)
60 VkImage placeholderCubemapImage_ = VK_NULL_HANDLE;
61 VkDeviceMemory placeholderCubemapMemory_ = VK_NULL_HANDLE;
62 VkImageView placeholderCubemapView_ = VK_NULL_HANDLE;
63 VkSampler cubemapSampler_ = VK_NULL_HANDLE;
64
65 // BRDF LUT (512x512, RG16F)
66 static constexpr uint32_t BRDF_LUT_SIZE = 512;
67 VkImage brdfLutImage_ = VK_NULL_HANDLE;
68 VkDeviceMemory brdfLutMemory_ = VK_NULL_HANDLE;
69 VkImageView brdfLutView_ = VK_NULL_HANDLE;
70 VkSampler brdfLutSampler_ = VK_NULL_HANDLE;
71
72 // Cached descriptor infos
73 VkDescriptorImageInfo cubemapDescriptorInfo_{};
74 VkDescriptorImageInfo brdfLutDescriptorInfo_{};
75
76 void createBrdfLutImage(VkDevice device, VkPhysicalDevice physicalDevice);
77 void createSamplers(VkDevice device);
79 };
80
81} // namespace EngineCore
The application context is the core class which stores the basic openxr and vulkan objects.
const VkDescriptorImageInfo & getBrdfLutDescriptorInfo() const
void generateBrdfLut(Core::ApplicationContext *context, VkCommandPool commandPool, VkPipeline brdfLutComputePipeline, VkPipelineLayout brdfLutPipelineLayout, VkDescriptorSet brdfLutDescriptorSet)
Generates the BRDF integration LUT via compute shader dispatch.
void setCubemapDescriptorInfo(const VkDescriptorImageInfo &descriptorInfo)
void createBrdfLutImage(VkDevice device, VkPhysicalDevice physicalDevice)
void createPlaceholders(Core::ApplicationContext *context, VkCommandPool commandPool)
Initializes placeholder (1x1 black cubemap + 1x1 white BRDF LUT) so that descriptor sets are always v...
const VkDescriptorImageInfo & getCubemapDescriptorInfo() const
Core audio subsystem owning the miniaudio engine and managing playback.
Definition AudioConfig.h:9