Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
|
Intended as base class for demo applications. Compared to MinimalAppBase it offers a complete simple vulkan setup. More...
#include <foray_defaultappbase.hpp>
Public Member Functions | |
DefaultAppBase () | |
virtual | ~DefaultAppBase ()=default |
int32_t | Run () |
Runs through the entire application lifetime. | |
Protected Member Functions | |
virtual void | ApiBeforeInit () |
Called before any initialization happens. | |
virtual void | ApiBeforeWindowCreate (osi::Window &window) |
Override this method to alter vulkan instance creation parameters via the instance builder. | |
virtual void | ApiBeforeInstanceCreate (vkb::InstanceBuilder &instanceBuilder) |
Override this method to alter vulkan instance creation parameters via the instance builder. | |
virtual void | ApiBeforeDeviceSelection (vkb::PhysicalDeviceSelector &pds) |
Alter physical device selection. | |
virtual void | ApiBeforeDeviceBuilding (vkb::DeviceBuilder &deviceBuilder) |
Alter device selection. | |
virtual void | ApiBeforeSwapchainBuilding (vkb::SwapchainBuilder &swapchainBuilder) |
Before building the swapchain. | |
virtual void | ApiInit () |
Called after all DefaultAppBase members have been initialized, but before the renderloop starts. Initialize your application here. | |
virtual void | ApiOnResized (VkExtent2D size) |
Called whenever the swapchain has been resized. | |
virtual void | ApiOnEvent (const osi::Event *event) |
Override this method to react to events. | |
virtual void | ApiRender (FrameRenderInfo &renderInfo) |
Called once every frame. Render your application here. | |
virtual void | ApiFrameFinishedExecuting (uint64_t frameIndex) |
Called back once the frame of the index has finished executing on the GPU, so QueryResults etc. are ready to be obtained. | |
virtual void | ApiOnShadersRecompiled (std::unordered_set< uint64_t > &recompiledShaderKeys) |
Called whenever the shader compiler has detected a change and shaders have successfully been recompiled. | |
virtual void | ApiDestroy () |
Called after the application has been requested to shut down but before DefaultAppBase finalizes itself. | |
virtual void | RegisterRenderStage (stages::RenderStage *stage) |
Call this with a renderstage for automatic OnResized/OnShadersRecompiled calls. Register order is maintained for callbacks. | |
virtual void | UnregisterRenderStage (stages::RenderStage *stage) |
Call this with a renderstage to unsubscribe from automatic calls. | |
virtual void | Init () |
[Internal] Initializes DefaultAppBase | |
virtual void | InitGetQueue () |
[Internal] Initializes Queue | |
virtual void | InitCommandPool () |
[Internal] Initializes Command Pool | |
virtual void | InitCreateVma () |
[Internal] Initializes VmaAllocator | |
virtual void | InitSyncObjects () |
[Internal] Initializes Synchronization Objects (InFlightFrame vector) | |
virtual void | RecreateSwapchain () |
[Internal] Recreates the swapchain | |
void | OnResized (VkExtent2D size) |
[Internal] Handler for swapchain resize | |
virtual void | PollEvents () |
[Internal] Polls and distributes events from the SDL subsystem | |
virtual bool | CanRenderNextFrame () |
[Internal] Checks next frames InFlightFrame object for completed execution | |
virtual void | Render (RenderLoop::RenderInfo &renderInfo) |
[Internal] Image Acquire, Image Present | |
virtual void | OnShadersRecompiled (std::unordered_set< uint64_t > &recompiledShaderKeys) |
[Internal] Shader recompile handler | |
virtual void | Destroy () |
[Internal] Finalizer | |
Protected Attributes | |
RenderLoop | mRenderLoop |
osi::OsManager | mOsManager |
VulkanInstance | mInstance |
VulkanDevice | mDevice |
VulkanWindowSwapchain | mWindowSwapchain |
core::SamplerCollection | mSamplerCollection |
core::Context | mContext |
core::ShaderManager | mShaderManager |
uint32_t | mAuxiliaryCommandBufferCount = 0 |
Increase this in an early init method to get auxiliary command buffers. | |
std::array< InFlightFrame, INFLIGHT_FRAME_COUNT > | mInFlightFrames |
uint32_t | mInFlightFrameIndex = 0 |
uint64_t | mRenderedFrameCount = 0 |
std::vector< stages::RenderStage * > | mRegisteredStages |
fp64_t | mLastShadersCheckedTimestamp = 0.0 |
bool | mEnableFrameRecordBenchmark = false |
bench::HostBenchmark | mHostFrameRecordBenchmark |
Static Protected Attributes | |
static const char *const | FRAMERECORDBENCH_WAITONFENCE = "Wait On Fence" |
static const char *const | FRAMERECORDBENCH_ACQUIRESWAPIMAGE = "Acquire Swapimage" |
static const char *const | FRAMERECORDBENCH_RECORDCMDBUFFERS = "Record CmdBuffers" |
static const char *const | FRAMERECORDBENCH_PRESENT = "Present" |
Intended as base class for demo applications. Compared to MinimalAppBase it offers a complete simple vulkan setup.
foray::base::DefaultAppBase::DefaultAppBase | ( | ) |
|
virtualdefault |
|
inlineprotectedvirtual |
Alter device selection.
|
inlineprotectedvirtual |
Alter physical device selection.
|
inlineprotectedvirtual |
Called before any initialization happens.
|
inlineprotectedvirtual |
Override this method to alter vulkan instance creation parameters via the instance builder.
|
inlineprotectedvirtual |
Before building the swapchain.
|
inlineprotectedvirtual |
Override this method to alter vulkan instance creation parameters via the instance builder.
|
inlineprotectedvirtual |
Called after the application has been requested to shut down but before DefaultAppBase finalizes itself.
|
inlineprotectedvirtual |
Called back once the frame of the index has finished executing on the GPU, so QueryResults etc. are ready to be obtained.
frameIndex | Index of the frame that has finished executing |
|
inlineprotectedvirtual |
Called after all DefaultAppBase members have been initialized, but before the renderloop starts. Initialize your application here.
|
inlineprotectedvirtual |
Override this method to react to events.
|
inlineprotectedvirtual |
Called whenever the swapchain has been resized.
size | New size of the swapchain |
|
inlineprotectedvirtual |
Called whenever the shader compiler has detected a change and shaders have successfully been recompiled.
recompiledShaderKeys | Shader compilation keys as provided by the ShaderManager |
|
inlineprotectedvirtual |
Called once every frame. Render your application here.
renderInfo | Frame specific information |
Used command buffers must be fully recorded and submitted by the overrider. The swapchain image must be prepared for present In one of these command buffers!
|
protectedvirtual |
[Internal] Checks next frames InFlightFrame object for completed execution
|
protectedvirtual |
[Internal] Finalizer
|
protectedvirtual |
[Internal] Initializes DefaultAppBase
|
protectedvirtual |
[Internal] Initializes Command Pool
|
protectedvirtual |
[Internal] Initializes VmaAllocator
|
protectedvirtual |
[Internal] Initializes Queue
|
protectedvirtual |
[Internal] Initializes Synchronization Objects (InFlightFrame vector)
|
inlineprotected |
[Internal] Handler for swapchain resize
|
protectedvirtual |
[Internal] Shader recompile handler
|
protectedvirtual |
[Internal] Polls and distributes events from the SDL subsystem
|
protectedvirtual |
[Internal] Recreates the swapchain
|
protectedvirtual |
Call this with a renderstage for automatic OnResized/OnShadersRecompiled calls. Register order is maintained for callbacks.
|
protectedvirtual |
[Internal] Image Acquire, Image Present
int32_t foray::base::DefaultAppBase::Run | ( | ) |
Runs through the entire application lifetime.
|
protectedvirtual |
Call this with a renderstage to unsubscribe from automatic calls.
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
protected |
Increase this in an early init method to get auxiliary command buffers.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |