Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
Renderer.h
Go to the documentation of this file.
1#pragma once
2
9
10#include <chrono>
13#include <filesystem>
14#include <memory>
15#include <unordered_map>
16#include <vector>
17#include <vulkan/vulkan_core.h>
18
19#ifdef ENABLE_TRACY
20# include <tracy/TracyVulkan.hpp>
21#endif
22
24{
25 class TracyVkContextManager;
26} // namespace Engine::Debug::Tracy
27
28namespace Vulkan
29{
30 class BarrierBundle;
31} // namespace Vulkan
32
33namespace Engine
34{
35 class EngineKern;
36 class ParticleSystem;
37}
38
39namespace Engine::Core
40{
41 class RenderingDataManager;
42}
43
44namespace Engine::Rendering
45{
46 class ComputePassManager;
47 class RenderProcess;
48 class BufferManager;
49 class Headset;
50 class TimelineSynchronizer;
51
57 {
58 std::filesystem::path meshShaderPath;
59 std::filesystem::path fragmentShaderPath;
61 };
62
71 {
76 {
77 TaskConstants() = default;
78
79 explicit TaskConstants( const uint32_t drawCommandOffset = 0 )
81 {
82 }
83
89
90 uint32_t drawCommandOffset = 0u;
91 uint32_t cascadeIndex = 0u;
92 uint32_t _padding[2]{};
93 };
94
95
96 public:
104 explicit Renderer(
105 Core::ApplicationContext * context = nullptr,
106 Headset * headset = nullptr,
107 const EngineKern * engine = nullptr
108 );
109
114
121
123 void prepareTransferSubmission( uint32_t frameIndex ) const;
124
129 void updateViewMatrix() const;
130
131 // Compute pass resources are now created via ComputePassManager
132 // void createPrimitiveCullingResources(); // 1
133 // void createBinningAllocatorResources(); // 1.5 (Stage 1)
134 // void createMeshletUnpackingResources(); // 3 (Stage 2)
135 // void createMeshletCullingResources(); // 5
136 // void createPrepareDrawResources(); // 6
137 void createVertexShaderPathResources(); // Vertex shader path for single-meshlet geometry
138
143 // void createMeshletUnpackingDispatcherResources(); // 2 - Now in ComputePassManager
148 // void createMeshletCullingDispatcherResources(); // 4 - Now in ComputePassManager
149
155 void updateCpuRenderResources( float time );
156
161
162 void recordTonemapToSwapchain( uint32_t swapChainImageIndex ) const;
163
168 void recordRenderPass( size_t swapChainImageIndex );
169
173 const std::unique_ptr<Core::RenderingDataManager> & getRenderingDataManager() const;
174
178 const std::unique_ptr<BufferManager> & getBufferManager() const;
179
180 const std::unique_ptr<ComputePassManager> & getComputePassManager() const;
181
186 bool ensureOutputBufferSizes( uint32_t primitive_count ) const;
187
188 private:
189
190 std::unique_ptr<Core::RenderingDataManager> renderingDataManager_;
191 std::unique_ptr<BufferManager> bufferManager_;
192 std::unique_ptr<ComputePassManager> computePassManager_;
193
194 public:
195 [[nodiscard]] const Vulkan::Buffer & getObjectCullingDataBuffer() const;
196 [[nodiscard]] const Vulkan::Buffer & getObjectMeshletDataBuffer() const;
197 [[nodiscard]] const Vulkan::Buffer & getObjectIDsBuffer() const;
198 [[nodiscard]] const Vulkan::Buffer & getCounterBuffer() const;
199 [[nodiscard]] const Vulkan::Buffer & getDispatchBuffer() const;
200 [[nodiscard]] const Vulkan::Buffer & getMeshUnpackingDataBuffer() const;
201
202 [[nodiscard]] const Vulkan::Buffer & getPlaceholderBuffer() const;
203 [[nodiscard]] const Vulkan::Buffer & getPlaceholderUniformBuffer() const;
204
205 VkDependencyInfo getObjectCullingToMeshletUnpackingDispatchBarriers(Vulkan::BarrierBundle & bundle ) const;
206 VkDependencyInfo getMeshletUnpackingDispatchToMeshletUnpackingBarriers(Vulkan::BarrierBundle &bundle) const;
207 VkDependencyInfo getMeshletUnpackingToMeshletCullingDispatchBarriers( Vulkan::BarrierBundle & bundle ) const;
210
213
214 void renderToXr( size_t swapChainImageIndex, float time );
215
216 void recordTransfer( float time );
218 void uploadFrameData( float time );
219 void submitTransfer() const;
220
227
229 uint32_t swapChainImageIndex,
230 VkSemaphore mirrorAcquireSemaphore = VK_NULL_HANDLE
231 ) const;
233
239 [[nodiscard]] VkCommandBuffer getCurrentTransferCommandBuffer() const;
240 [[nodiscard]] VkCommandBuffer getCurrentRenderingCommandBuffer() const;
241 [[nodiscard]] VkSemaphore getCurrentMirrorViewSemaphore() const;
242 [[nodiscard]] VkSemaphore getCurrentPresentableSemaphore( uint32_t swapchainImageIndex ) const;
243
249 std::vector<VkCommandBuffer> getGraphicsCommandBuffers() const;
250 std::vector<VkCommandBuffer> getTransferCommandBuffers() const;
251
255 [[nodiscard]] const std::vector<RenderProcess*>& getRenderProcesses() const { return renderProcesses; }
256
262 [[nodiscard]] VkCommandPool getGraphicsCommandPool() const;
263
269 [[nodiscard]] VkCommandPool getTransferCommandPool() const;
270
274 void cleanup();
275
281 RenderProcess * getCurrentRenderProcess() const;
282
287
300
312 [[nodiscard]] bool shouldSkipMirrorView();
313
319
326
333 [[nodiscard]] int64_t getFrameElapsedMs() const;
334
341 [[nodiscard]] bool isInStallRecovery() const;
342
347 VkSemaphore getTimelineSemaphore() const;
348
354 const std::vector<GraphicsPipeline *> & getGraphicsPipelines() const;
355
361 [[nodiscard]] Headset* getHeadset() const { return headset_; }
362
363 [[nodiscard]] const ImageBasedLightingResources & getIBLResources() const { return iblResources_; }
364 [[nodiscard]] const SunShadowResources & getSunShadowResources() const { return sunShadowResources_; }
366
377 void setFreezeCulling(bool freeze);
378
384 [[nodiscard]] bool isFreezeCulling() const { return freezeCulling_; }
385
386 void setVertexShaderOnlyMode(bool enabled) { vertexShaderOnlyMode_ = enabled; }
387 [[nodiscard]] bool isVertexShaderOnlyMode() const { return vertexShaderOnlyMode_; }
388
389 void setParallelLodSelection(bool enabled ) const;
390
391 void setVSInstancedDrawing(bool enabled) { useVSInstancedDrawing_ = enabled; }
392 void setSkipMeshShaderDraw(bool skip) { skipMeshShaderDraw_ = skip; }
395
396 void registerWindTrailEmitter(std::shared_ptr<Entities::SceneNode> node) { windTrailEmitterNode_ = node; }
398
399 void setTracyContextManager( Debug::Tracy::TracyVkContextManager * manager ) { tracyContextManager_ = manager; }
400
405 [[nodiscard]] const TimelineSynchronizer& getTimelineSynchronizer() const;
406
413 bool getPipelineIndex( GraphicsPipeline * pipeline, uint32_t & pipelineIndex ) const;
414
421 bool getPipelineIndex( PipelineNames pipelineName, uint32_t & pipelineIndex ) const;
422
431
432 private:
433 Debug::Tracy::TracyVkContextManager * tracyContextManager_ = nullptr;
434
435#ifdef ENABLE_TRACY
436 TracyVkCtx getCurrentTracyVkContext() const;
437 TracyVkCtx getCurrentTracyTransferVkContext() const;
438#else
441#endif
442
443 std::unique_ptr<TimelineSynchronizer> timelineSynchronizer_;
444
447
449
453
455 static constexpr int SKIP_FRAMES_AFTER_STALL = 4;
456
458 std::chrono::steady_clock::time_point lastFrameStartTime_ = std::chrono::steady_clock::now();
459
461 static constexpr std::chrono::milliseconds STALL_THRESHOLD_MS{1000};
462
463 std::vector<Vulkan::StagedBufferSyncObjects> syncCopyObjects_{};
464
465 // Maps each graphics pipeline pointer to its index within the graphicsPipelines vector
466 std::unordered_map<GraphicsPipeline *, uint32_t> pipelineIndices_;
467
468 // Maps PipelineNames enum to the created GraphicsPipeline object
469 std::unordered_map<PipelineNames, GraphicsPipeline *> pipelinesByName_;
470
471 // Maps PipelineNames enum to VS pipeline index (for when mesh shader pipelines are unavailable)
472 std::unordered_map<PipelineNames, uint32_t> vsPipelineNameToIndex_;
473
474 const EngineKern * engine_ = nullptr;
475
486 const std::string & meshShader,
487 const std::string & fragShader,
488 const PipelineMaterialPayload & pipelineData
489 ) const;
490
494 VkCommandPool vkGraphicsCommandPool_ = VK_NULL_HANDLE;
495
499 VkCommandPool vkTransferCommandPool_ = VK_NULL_HANDLE;
500
504 VkDescriptorPool descriptorPool_ = VK_NULL_HANDLE;
505
506
507 // Vertex Shader Path for single-meshlet geometry
508 // Uses traditional vertex shader + instancing (faster than mesh shader for small meshes)
509 std::vector<VkPipeline> vsGraphicsPipelines_; // Per-material vertex shader pipelines (indexed by PipelineNames)
510 VkPipelineLayout vsPipelineLayout_ = VK_NULL_HANDLE; // Pipeline layout for VS path
511 bool useVertexShaderPath_ = true; // Enable VS path for single-meshlet geometry
512 bool vertexShaderOnlyMode_ = false; // Force ALL geometry through VS pipeline (bypass mesh shaders)
513
515 void recordVertexShaderDraws(size_t swapChainImageIndex) const;
516
517 bool useVSInstancedDrawing_ = true; // Enable VS instanced drawing optimization
518
521
522
524 void resetVisibilityBuffers(VkCommandBuffer commandBuffer) const;
525 void recordVisibilityComputeToGraphicsBarriers(VkCommandBuffer commandBuffer) const;
526
527 // IBL (Image-Based Lighting) resources
529 VkDescriptorPool iblDescriptorPool_ = VK_NULL_HANDLE;
530 VkDescriptorSet brdfLutDescriptorSet_ = VK_NULL_HANDLE;
531
533
534 // Cascaded sun shadow resources and pass state
539 VkPipeline sunShadowOpaquePipeline_ = VK_NULL_HANDLE;
540 VkPipeline sunShadowMovableAlphaPipeline_ = VK_NULL_HANDLE;
541 VkPipeline sunShadowStaticAlphaPipeline_ = VK_NULL_HANDLE;
542 VkPipeline vsSunShadowOpaquePipeline_ = VK_NULL_HANDLE;
543 VkPipeline vsSunShadowMovableAlphaPipeline_ = VK_NULL_HANDLE;
544 VkPipeline vsSunShadowStaticAlphaPipeline_ = VK_NULL_HANDLE;
545
550 void recordSunShadowVisibilityPipeline(uint32_t cascadeIndex) const;
551 void recordSunShadowPipelineDraws(VkCommandBuffer commandBuffer, PipelineNames pipelineName, VkPipeline shadowPipeline, uint32_t cascadeIndex);
552 void recordSunShadowVertexShaderDraws(VkCommandBuffer commandBuffer, uint32_t cascadeIndex, bool staticCastersOnly, bool dynamicCastersOnly) const;
553 [[nodiscard]] VkPipeline getSunShadowPipelineForCaster(PipelineNames pipelineName) const;
554 [[nodiscard]] VkPipeline getVSSunShadowPipelineForCaster(PipelineNames pipelineName) const;
555
556 // Debug line rendering pipeline
557 VkPipeline debugLinePipeline_ = VK_NULL_HANDLE;
558 VkPipeline debugLineOverlayPipeline_ = VK_NULL_HANDLE;
559
561 void recordDebugLineDraws(VkCommandBuffer commandBuffer ) const;
562
563 // Sky gradient pipeline
564 VkPipeline skyGradientPipeline_ = VK_NULL_HANDLE;
565 VkPipelineLayout skyGradientPipelineLayout_ = VK_NULL_HANDLE;
566
568 void recordSkyGradientDraw(VkCommandBuffer commandBuffer);
569
570 // Final scene color grading / display conversion pass
572 {
573 float exposure = 1.0f;
574 uint32_t tonemapMode = 0u;
575 uint32_t manualSrgbEncode = 0u;
576 uint32_t _padding = 0u;
577 };
578
579 VkDescriptorSetLayout tonemapDescriptorSetLayout_ = VK_NULL_HANDLE;
580 VkDescriptorSet tonemapDescriptorSet_ = VK_NULL_HANDLE;
581 VkPipelineLayout tonemapPipelineLayout_ = VK_NULL_HANDLE;
582 VkPipeline tonemapPipeline_ = VK_NULL_HANDLE;
583
585
586 // Wind trail particle system
587 ParticleSystem* particleSystem_ = nullptr;
588 std::weak_ptr<Entities::SceneNode> windTrailEmitterNode_;
589 float lastRenderTime_ = 0.0f;
590
592 bool freezeCulling_ = false;
593
597
598 VkDescriptorSetLayout graphicsDescriptorSetLayout = VK_NULL_HANDLE;
599
600#ifdef IS_IN_DEBUG
601 PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabelEXT = nullptr;
602 PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT = nullptr;
603#endif
604
609 {
610 MeshConstants() = default;
611
616
618 uint32_t _padding1 = 0u;
619 uint32_t _padding2 = 0u;
620 uint32_t _padding3 = 0u;
621 };
622
623 std::vector<VkPushConstantRange> pushConstants;
624
628 VkPipelineLayout computeObjectCullingPipelineLayout = VK_NULL_HANDLE;
629 VkPipelineLayout computeMeshletCullingPipelineLayout = VK_NULL_HANDLE;
630 VkPipelineLayout prepareDrawsComputePipelineLayout = VK_NULL_HANDLE;
631 VkPipelineLayout graphicsPipelineLayout = VK_NULL_HANDLE;
632
636 std::vector<RenderProcess *> renderProcesses;
637
641 //ComputePipeline * objectCullingComputePipeline = nullptr;
642 //ComputePipeline * meshletCullingComputePipeline = nullptr;
643 //ComputePipeline * prepareDrawsComputePipeline = nullptr;
644
645 std::vector<GraphicsPipeline *> graphicsPipelines;
646
647 uint32_t currentFrame = 0u;
648
650 Headset * headset_ = nullptr;
651
652 uint64_t frameCounter = 0u;
653
654 std::vector<VkSemaphore> renderFinishedSemaphores;
655 };
656} // namespace EngineCore
The application context is the core class which stores the basic openxr and vulkan objects.
const Vulkan::Buffer & getPlaceholderUniformBuffer() const
std::unique_ptr< TimelineSynchronizer > timelineSynchronizer_
Definition Renderer.h:443
VkPipelineLayout vsPipelineLayout_
Definition Renderer.h:510
VkDependencyInfo getMeshletUnpackingDispatchToMeshletUnpackingBarriers(Vulkan::BarrierBundle &bundle) const
void resetVisibilityBuffers(VkCommandBuffer commandBuffer) const
const std::unique_ptr< Core::RenderingDataManager > & getRenderingDataManager() const
Getter for the rendering data manager.
void setTracyContextManager(Debug::Tracy::TracyVkContextManager *manager)
Definition Renderer.h:399
std::vector< GraphicsPipeline * > graphicsPipelines
The pipelines.
Definition Renderer.h:645
VkPipelineLayout skyGradientPipelineLayout_
Definition Renderer.h:565
std::unordered_map< GraphicsPipeline *, uint32_t > pipelineIndices_
Definition Renderer.h:466
const SunShadowResources & getSunShadowResources() const
Definition Renderer.h:364
void uploadFrameData(float time)
RenderProcess * getCurrentRenderProcess() const
Gets the render process of the current frame.
void advanceFrameIndices()
advances the frame indices for the next frame in flight
void recordTonemapToSwapchain(uint32_t swapChainImageIndex) const
std::unique_ptr< BufferManager > bufferManager_
Definition Renderer.h:191
void markFrameStart()
Marks the start of a new frame for stall detection. Call this at the beginning of each render frame.
void allocateDescriptors()
allocates the first batch of mesh data to the shaders
void recordSunShadowVisibilityPipeline(uint32_t cascadeIndex) const
VkDescriptorSetLayout tonemapDescriptorSetLayout_
Definition Renderer.h:579
VkPipeline vsSunShadowOpaquePipeline_
Definition Renderer.h:542
const std::vector< RenderProcess * > & getRenderProcesses() const
Gets all render processes for cleanup/synchronization.
Definition Renderer.h:255
VkPipelineLayout computeObjectCullingPipelineLayout
The pipeline layout.
Definition Renderer.h:628
static constexpr int SKIP_FRAMES_AFTER_STALL
Number of frames to skip after detecting a stall (covers all swapchain images)
Definition Renderer.h:455
void resetFrameTimer()
Resets the frame timer to prevent false stall detection. Call after long blocking operations (e....
void setVSInstancedDrawing(bool enabled)
Definition Renderer.h:391
const Vulkan::Buffer & getMeshUnpackingDataBuffer() const
std::unique_ptr< ComputePassManager > computePassManager_
Definition Renderer.h:192
VkPipeline sunShadowOpaquePipeline_
Definition Renderer.h:539
void setSunShadowCasterDebugView(bool enabled)
Definition Renderer.h:394
const std::unique_ptr< BufferManager > & getBufferManager() const
Getter for the buffer manager of the renderer.
void updateCpuRenderResources(float time)
Creates the complete pipeline for the meshlet unpacker. This should only be called after the buffer h...
const Vulkan::Buffer & getPlaceholderBuffer() const
int findExistingPipeline(const std::string &meshShader, const std::string &fragShader, const PipelineMaterialPayload &pipelineData) const
Searches for the first existing pipeline which has the same vertex and fragment shader.
void recordSunShadowPipelineDraws(VkCommandBuffer commandBuffer, PipelineNames pipelineName, VkPipeline shadowPipeline, uint32_t cascadeIndex)
static PipelineConfig getPipelineConfig(PipelineNames pipelineName)
Gets the static configuration for a given pipeline type Returns shader paths and pipeline data for th...
std::vector< RenderProcess * > renderProcesses
The render processes.
Definition Renderer.h:636
VkDescriptorSetLayout graphicsDescriptorSetLayout
Definition Renderer.h:598
void setVertexShaderOnlyMode(bool enabled)
Definition Renderer.h:386
void updateViewMatrix() const
Requests an update of the current render processes view matrix. The matrix is pulled from the headset...
void resetMeshletCullingDispatchBuffers() const
void getCurrentTracyTransferVkContext() const
Definition Renderer.h:440
VkPipeline vsSunShadowMovableAlphaPipeline_
Definition Renderer.h:543
void renderToXr(size_t swapChainImageIndex, float time)
bool freezeCulling_
When true, culling data (frustum planes) is frozen for debugging.
Definition Renderer.h:592
std::vector< VkCommandBuffer > getGraphicsCommandBuffers() const
Gets all graphics command buffers from all owned render processes.
void recordSunShadowVertexShaderDraws(VkCommandBuffer commandBuffer, uint32_t cascadeIndex, bool staticCastersOnly, bool dynamicCastersOnly) const
VkDependencyInfo getMeshletCullingToPrepareDrawBarriers() const
VkPipelineLayout graphicsPipelineLayout
Definition Renderer.h:631
Core::ApplicationContext * context_
Definition Renderer.h:649
VkSemaphore getCurrentMirrorViewSemaphore() const
VkCommandBuffer getCurrentRenderingCommandBuffer() const
VkPipeline skyGradientPipeline_
Definition Renderer.h:564
VkDependencyInfo getMeshletCullingDispatchToMeshletCullingBarriers() const
void cleanup()
Cleans up all resources of the renderer.
VkPipelineLayout tonemapPipelineLayout_
Definition Renderer.h:581
void submitGraphics(uint32_t swapChainImageIndex, VkSemaphore mirrorAcquireSemaphore=VK_NULL_HANDLE) const
std::vector< VkSemaphore > renderFinishedSemaphores
Definition Renderer.h:654
VkPipeline getVSSunShadowPipelineForCaster(PipelineNames pipelineName) const
void registerWindTrailEmitter(std::shared_ptr< Entities::SceneNode > node)
Definition Renderer.h:396
SunShadowCascadeBuffer staticSunShadowCascadeData_
Definition Renderer.h:537
VkDescriptorPool descriptorPool_
The descriptor pool for all descriptors of the renderer.
Definition Renderer.h:504
const Vulkan::Buffer & getDispatchBuffer() const
const std::vector< GraphicsPipeline * > & getGraphicsPipelines() const
Gets the list of all graphics pipelines.
VkCommandPool vkGraphicsCommandPool_
The graphics and present command pool.
Definition Renderer.h:494
const Vulkan::Buffer & getObjectMeshletDataBuffer() const
std::chrono::steady_clock::time_point lastFrameStartTime_
Time when the last frame started, for stall detection.
Definition Renderer.h:458
const Vulkan::Buffer & getCounterBuffer() const
void initializeXrSwapchainFormats() const
bool getPipelineIndex(GraphicsPipeline *pipeline, uint32_t &pipelineIndex) const
Gets the index of a pipeline.
std::unique_ptr< Core::RenderingDataManager > renderingDataManager_
Definition Renderer.h:190
void recordSkyGradientDraw(VkCommandBuffer commandBuffer)
ParticleSystem * particleSystem_
Definition Renderer.h:587
void initializeGpuBuffers() const
VkDependencyInfo getObjectCullingToMeshletUnpackingDispatchBarriers(Vulkan::BarrierBundle &bundle) const
bool shouldSkipMirrorView()
Checks if mirror view should be skipped this frame.
std::vector< VkPushConstantRange > pushConstants
Definition Renderer.h:623
static constexpr std::chrono::milliseconds STALL_THRESHOLD_MS
Threshold for considering a frame as "stalled" (1 second)
Definition Renderer.h:461
void setParallelLodSelection(bool enabled) const
void setFreezeCulling(bool freeze)
Freezes culling data (frustum planes, view-projection)
const std::unique_ptr< ComputePassManager > & getComputePassManager() const
VkDependencyInfo getMeshletUnpackingToMeshletCullingDispatchBarriers(Vulkan::BarrierBundle &bundle) const
Headset * getHeadset() const
Gets the headset pointer.
Definition Renderer.h:361
void waitForPreviousFrame() const
Waits for the previous frame's transfer to complete before writing to GPU buffers....
VkPipeline sunShadowMovableAlphaPipeline_
Definition Renderer.h:540
int64_t getFrameElapsedMs() const
Gets the elapsed time since markFrameStart() was called. Used to check if the current frame has taken...
bool getPipelineIndex(PipelineNames pipelineName, uint32_t &pipelineIndex) const
Gets the pipeline index for a given PipelineNames enum.
VkPipeline debugLineOverlayPipeline_
Definition Renderer.h:558
void restartRenderCommandBuffers() const
Resets the command buffers of the active frame and begins a new write.
void recordVisibilityComputeToGraphicsBarriers(VkCommandBuffer commandBuffer) const
std::unordered_map< PipelineNames, uint32_t > vsPipelineNameToIndex_
Definition Renderer.h:472
ImageBasedLightingResources iblResources_
Definition Renderer.h:528
bool ensureOutputBufferSizes(uint32_t primitive_count) const
Calculates buffer sizes based on primitive count.
bool isVertexShaderOnlyMode() const
Definition Renderer.h:387
VkDescriptorSet tonemapDescriptorSet_
Definition Renderer.h:580
Renderer(Core::ApplicationContext *context=nullptr, Headset *headset=nullptr, const EngineKern *engine=nullptr)
Constructor.
VkPipelineLayout prepareDrawsComputePipelineLayout
Definition Renderer.h:630
std::vector< VkCommandBuffer > getTransferCommandBuffers() const
std::unordered_map< PipelineNames, GraphicsPipeline * > pipelinesByName_
Definition Renderer.h:469
const SunShadowResources & getDynamicSunShadowResources() const
Definition Renderer.h:365
const TimelineSynchronizer & getTimelineSynchronizer() const
Gets the timeline synchronizer for managing frame synchronization.
VkDescriptorPool iblDescriptorPool_
Definition Renderer.h:529
std::vector< Vulkan::StagedBufferSyncObjects > syncCopyObjects_
Definition Renderer.h:463
VkPipelineLayout computeMeshletCullingPipelineLayout
Definition Renderer.h:629
VkCommandPool vkTransferCommandPool_
The transfer command pool for all commands submitted to the transfer queue.
Definition Renderer.h:499
void recordVSInstancedDrawingPipeline() const
void recordDebugLineDraws(VkCommandBuffer commandBuffer) const
VkCommandPool getTransferCommandPool() const
gets the command pool used for recording data transfer at the beginning of a frame
VkCommandBuffer getCurrentTransferCommandBuffer() const
Gets the current frame in flight and retrieves the transfer command buffer.
void getCurrentTracyVkContext() const
Definition Renderer.h:439
const Vulkan::Buffer & getObjectCullingDataBuffer() const
SunShadowResources dynamicSunShadowResources_
Definition Renderer.h:536
void recordTransfer(float time)
bool isInStallRecovery() const
Checks if we're currently in stall recovery mode. During stall recovery, extra GPU synchronization sh...
const Vulkan::Buffer & getObjectIDsBuffer() const
uint64_t getTimelineSemaphoreValue() const
~Renderer()
cleans up the object
std::vector< VkPipeline > vsGraphicsPipelines_
Definition Renderer.h:509
void setSkipMeshShaderDraw(bool skip)
Definition Renderer.h:392
void syncTimelineAfterPause()
Synchronizes the frame counter with the timeline semaphore after pausing.
SunShadowResources sunShadowResources_
Definition Renderer.h:535
void setSkipVertexShaderDraw(bool skip)
Definition Renderer.h:393
VkDescriptorSet brdfLutDescriptorSet_
Definition Renderer.h:530
const EngineKern * engine_
Definition Renderer.h:474
Debug::Tracy::TracyVkContextManager * tracyContextManager_
Definition Renderer.h:433
VkCommandPool getGraphicsCommandPool() const
gets the graphics command pool
VkPipeline vsSunShadowStaticAlphaPipeline_
Definition Renderer.h:544
VkSemaphore getCurrentPresentableSemaphore(uint32_t swapchainImageIndex) const
VkPipeline sunShadowStaticAlphaPipeline_
Definition Renderer.h:541
VkSemaphore getTimelineSemaphore() const
Getter for the main timeline renderer semaphore.
void recordVertexShaderDraws(size_t swapChainImageIndex) const
void recordRenderPass(size_t swapChainImageIndex)
Records the main render pass using dynamic rendering.
VkPipeline getSunShadowPipelineForCaster(PipelineNames pipelineName) const
const ImageBasedLightingResources & getIBLResources() const
Definition Renderer.h:363
void prepareTransferSubmission(uint32_t frameIndex) const
bool isFreezeCulling() const
Checks if culling data is currently frozen.
Definition Renderer.h:384
std::weak_ptr< Entities::SceneNode > windTrailEmitterNode_
Definition Renderer.h:588
void recordParallelLodSelectionPipeline() const
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
Static configuration for a graphics pipeline Defines which shaders to use for a given PipelineNames e...
Definition Renderer.h:57
std::filesystem::path meshShaderPath
Definition Renderer.h:58
PipelineMaterialPayload pipelineData
Definition Renderer.h:60
std::filesystem::path fragmentShaderPath
Definition Renderer.h:59
MeshConstants(uint32_t baseVisibleMeshletIndex)
Definition Renderer.h:612
TaskConstants(const uint32_t drawCommandOffset, const uint32_t cascadeIndex)
Definition Renderer.h:84
TaskConstants(const uint32_t drawCommandOffset=0)
Definition Renderer.h:79