2#include "../bench/foray_hostbenchmark.hpp"
3#include "../core/foray_samplercollection.hpp"
4#include "../core/foray_shadermanager.hpp"
5#include "../foray_vma.hpp"
6#include "../osi/foray_osmanager.hpp"
7#include "../stages/foray_stages_declares.hpp"
Intended as base class for demo applications. Compared to MinimalAppBase it offers a complete simple ...
Definition foray_defaultappbase.hpp:20
virtual void InitCommandPool()
[Internal] Initializes Command Pool
uint64_t mRenderedFrameCount
Definition foray_defaultappbase.hpp:116
virtual void ApiBeforeDeviceSelection(vkb::PhysicalDeviceSelector &pds)
Alter physical device selection.
Definition foray_defaultappbase.hpp:44
virtual void Render(RenderLoop::RenderInfo &renderInfo)
[Internal] Image Acquire, Image Present
std::vector< stages::RenderStage * > mRegisteredStages
Definition foray_defaultappbase.hpp:118
virtual void ApiBeforeDeviceBuilding(vkb::DeviceBuilder &deviceBuilder)
Alter device selection.
Definition foray_defaultappbase.hpp:46
virtual void InitCreateVma()
[Internal] Initializes VmaAllocator
std::array< InFlightFrame, INFLIGHT_FRAME_COUNT > mInFlightFrames
Definition foray_defaultappbase.hpp:114
virtual void ApiDestroy()
Called after the application has been requested to shut down but before DefaultAppBase finalizes itse...
Definition foray_defaultappbase.hpp:67
static const char *const FRAMERECORDBENCH_WAITONFENCE
Definition foray_defaultappbase.hpp:122
virtual void ApiOnEvent(const osi::Event *event)
Override this method to react to events.
Definition foray_defaultappbase.hpp:55
virtual void ApiBeforeInit()
Called before any initialization happens.
Definition foray_defaultappbase.hpp:37
void OnResized(VkExtent2D size)
[Internal] Handler for swapchain resize
core::SamplerCollection mSamplerCollection
Definition foray_defaultappbase.hpp:108
virtual void Destroy()
[Internal] Finalizer
fp64_t mLastShadersCheckedTimestamp
Definition foray_defaultappbase.hpp:120
osi::OsManager mOsManager
Definition foray_defaultappbase.hpp:104
VulkanWindowSwapchain mWindowSwapchain
Definition foray_defaultappbase.hpp:107
virtual void ApiInit()
Called after all DefaultAppBase members have been initialized, but before the renderloop starts....
Definition foray_defaultappbase.hpp:50
RenderLoop mRenderLoop
Definition foray_defaultappbase.hpp:103
bench::HostBenchmark mHostFrameRecordBenchmark
Definition foray_defaultappbase.hpp:128
virtual void RecreateSwapchain()
[Internal] Recreates the swapchain
virtual void UnregisterRenderStage(stages::RenderStage *stage)
Call this with a renderstage to unsubscribe from automatic calls.
virtual void ApiOnResized(VkExtent2D size)
Called whenever the swapchain has been resized.
Definition foray_defaultappbase.hpp:53
virtual void ApiBeforeWindowCreate(osi::Window &window)
Override this method to alter vulkan instance creation parameters via the instance builder.
Definition foray_defaultappbase.hpp:40
virtual void ApiOnShadersRecompiled(std::unordered_set< uint64_t > &recompiledShaderKeys)
Called whenever the shader compiler has detected a change and shaders have successfully been recompil...
Definition foray_defaultappbase.hpp:65
virtual void ApiBeforeInstanceCreate(vkb::InstanceBuilder &instanceBuilder)
Override this method to alter vulkan instance creation parameters via the instance builder.
Definition foray_defaultappbase.hpp:42
virtual void Init()
[Internal] Initializes DefaultAppBase
bool mEnableFrameRecordBenchmark
Definition foray_defaultappbase.hpp:127
virtual void InitGetQueue()
[Internal] Initializes Queue
uint32_t mAuxiliaryCommandBufferCount
Increase this in an early init method to get auxiliary command buffers.
Definition foray_defaultappbase.hpp:113
virtual void RegisterRenderStage(stages::RenderStage *stage)
Call this with a renderstage for automatic OnResized/OnShadersRecompiled calls. Register order is mai...
uint32_t mInFlightFrameIndex
Definition foray_defaultappbase.hpp:115
static const char *const FRAMERECORDBENCH_RECORDCMDBUFFERS
Definition foray_defaultappbase.hpp:124
core::ShaderManager mShaderManager
Definition foray_defaultappbase.hpp:110
static const char *const FRAMERECORDBENCH_ACQUIRESWAPIMAGE
Definition foray_defaultappbase.hpp:123
VulkanDevice mDevice
Definition foray_defaultappbase.hpp:106
static const char *const FRAMERECORDBENCH_PRESENT
Definition foray_defaultappbase.hpp:125
virtual ~DefaultAppBase()=default
virtual void ApiFrameFinishedExecuting(uint64_t frameIndex)
Called back once the frame of the index has finished executing on the GPU, so QueryResults etc....
Definition foray_defaultappbase.hpp:62
int32_t Run()
Runs through the entire application lifetime.
virtual void OnShadersRecompiled(std::unordered_set< uint64_t > &recompiledShaderKeys)
[Internal] Shader recompile handler
virtual void InitSyncObjects()
[Internal] Initializes Synchronization Objects (InFlightFrame vector)
virtual void PollEvents()
[Internal] Polls and distributes events from the SDL subsystem
virtual void ApiBeforeSwapchainBuilding(vkb::SwapchainBuilder &swapchainBuilder)
Before building the swapchain.
Definition foray_defaultappbase.hpp:48
virtual void ApiRender(FrameRenderInfo &renderInfo)
Called once every frame. Render your application here.
Definition foray_defaultappbase.hpp:59
core::Context mContext
Definition foray_defaultappbase.hpp:109
virtual bool CanRenderNextFrame()
[Internal] Checks next frames InFlightFrame object for completed execution
VulkanInstance mInstance
Definition foray_defaultappbase.hpp:105
Context used for render processes. This object is rebuilt for every frame. /.
Definition foray_framerenderinfo.hpp:14
Manages a single threaded, automatically balancing application lifetime.
Definition foray_renderloop.hpp:47
Wraps selection and creation of a vulkan logical device.
Definition foray_vulkandevice.hpp:9
Wraps creation and lifetime of a vulkan instance. Includes default debug callback logging setup.
Definition foray_vulkaninstance.hpp:9
Combines Window, Surface and Swapchain into one managing object.
Definition foray_vulkanwindowswapchain.hpp:12
A host (CPU time) benchmark based on std::chrono::high_resolution_clock. Timestamps are recorded in m...
Definition foray_hostbenchmark.hpp:8
Provides sampler objects based on VkSamplerCreateInfo specifications.
Definition foray_samplercollection.hpp:100
Shader manager maintains a structure of shader compilations.
Definition foray_shadermanager.hpp:32
Base class for operating system events.
Definition foray_event.hpp:13
Class of which a single instance needs to be present for interaction with the operating system via SD...
Definition foray_osmanager.hpp:10
Window class. Provides access to common properties of operating system level windows.
Definition foray_window.hpp:15
Render stage base class giving a common interface for rendering processes.
Definition foray_renderstage.hpp:15
#define FORAY_GETTER_MR(member)
Return mutable reference.
Definition foray_basics.hpp:54
Definition foray_base_declares.hpp:3
double fp64_t
stdint.h style 64 bit floating point type alias (double)
Definition foray_basics.hpp:15
Definition foray_renderloop.hpp:50
Non owning context object.
Definition foray_context.hpp:16