Skip to content

KDGpuExample::ExampleEngineLayer

Module: KDGpuExample API

ExampleEngineLayer ...

#include <KDGpuExample/example_engine_layer.h>

Inherits from KDGpuExample::EngineLayer, KDFoundation::Object

Inherited by KDGpuExample::AdvancedExampleEngineLayer, KDGpuExample::SimpleExampleEngineLayer

Public Functions

Name
ExampleEngineLayer()
~ExampleEngineLayer() override
KDGpuKDGui::View * window()

Protected Functions

Name
virtual void initializeScene() =0
virtual void cleanupScene() =0
virtual void updateScene() =0
virtual void render() =0
virtual void resize() =0
virtual void drawImGuiOverlay(ImGuiContext * ctx)
virtual void renderImGuiOverlay(RenderPassCommandRecorder * recorder, uint32_t inFlightIndex =0, RenderPass * currentRenderPass =nullptr, int lastSubpassIndex =0)
void registerImGuiOverlayDrawFunction(const std::function< void(ImGuiContext *)> & func)
void clearImGuiOverlayDrawFunctions()
void recreateImGuiOverlay()
virtual void onAttached() override
virtual void onDetached() override
virtual void update() override
void event(KDFoundation::EventReceiver * target, KDFoundation::Event * ev) override
virtual void recreateSwapChain()
void recreateDepthTexture()
void recreateSampleDependentResources()
void uploadBufferData(const BufferUploadOptions & options)
void uploadTextureData(const TextureUploadOptions & options)
void releaseStagingBuffers()

Protected Attributes

Name
std::shared_ptr< spdlog::logger > m_logger
std::unique_ptr< GraphicsApi > m_api
std::unique_ptr< KDGpuKDGui::View > m_window
Extent2D m_swapchainExtent
KDBindings::Property< SampleCountFlagBits > m_samples
TextureUsageFlags m_swapchainUsageFlags
std::vector< SampleCountFlagBits > m_supportedSampleCounts
Instance m_instance
Surface m_surface
Device m_device
Queue m_queue
PresentMode m_presentMode
Swapchain m_swapchain
std::vector< TextureView > m_swapchainViews
Texture m_depthTexture
TextureView m_depthTextureView
std::unique_ptr< ImGuiItem > m_imguiOverlay
std::vector< std::function< void(ImGuiContext *)> > m_imGuiOverlayDrawFunctions
uint32_t m_currentSwapchainImageIndex
uint32_t m_inFlightIndex
std::array< GpuSemaphore, MAX_FRAMES_IN_FLIGHT > m_presentCompleteSemaphores
std::array< GpuSemaphore, MAX_FRAMES_IN_FLIGHT > m_renderCompleteSemaphores
TextureUsageFlags m_depthTextureUsageFlags
std::vector< UploadStagingBuffer > m_stagingBuffers
Format m_swapchainFormat
Format m_depthFormat
CompositeAlphaFlagBits m_compositeAlpha
bool m_showSurfaceCapabilities
std::string m_capabilitiesString

Additional inherited members

Public Functions inherited from KDGpuExample::EngineLayer

Name
~EngineLayer() override
const Engine * engine() const
Engine * engine()

Friends inherited from KDGpuExample::EngineLayer

Name
class Engine

Public Functions Documentation

function ExampleEngineLayer

1
ExampleEngineLayer()

function ~ExampleEngineLayer

1
~ExampleEngineLayer() override

function window

1
inline KDGpuKDGui::View * window()

Protected Functions Documentation

function initializeScene

1
virtual void initializeScene() =0

Reimplemented by: BindGroupIndexing::initializeScene, BindGroupPartiallyBound::initializeScene, BufferReference::initializeScene, ComputeOitTransparency::initializeScene, ComputeParticles::initializeScene, DepthBias::initializeScene, DepthTextureLookup::initializeScene, DynamicUBOTriangles::initializeScene, HelloSphereMesh::initializeScene, HelloSphereRt::initializeScene, HelloTriangle::initializeScene, HelloTriangle::initializeScene, HelloTriangle::initializeScene, HelloTriangle::initializeScene, HelloTriangleMSAA::initializeScene, HelloTriangleRt::initializeScene, HybridRasterRt::initializeScene, MultiView::initializeScene, MultiViewStereo::initializeScene, RenderToTexture::initializeScene, RenderToTextureSubpass::initializeScene, TexturedQuad::initializeScene

function cleanupScene

1
virtual void cleanupScene() =0

Reimplemented by: BindGroupIndexing::cleanupScene, BindGroupPartiallyBound::cleanupScene, BufferReference::cleanupScene, ComputeOitTransparency::cleanupScene, ComputeParticles::cleanupScene, DepthBias::cleanupScene, DepthTextureLookup::cleanupScene, DynamicUBOTriangles::cleanupScene, HelloSphereMesh::cleanupScene, HelloSphereRt::cleanupScene, HelloTriangle::cleanupScene, HelloTriangle::cleanupScene, HelloTriangle::cleanupScene, HelloTriangle::cleanupScene, HelloTriangleMSAA::cleanupScene, HelloTriangleRt::cleanupScene, HybridRasterRt::cleanupScene, MultiView::cleanupScene, MultiViewStereo::cleanupScene, RenderToTexture::cleanupScene, RenderToTextureSubpass::cleanupScene, TexturedQuad::cleanupScene

function updateScene

1
virtual void updateScene() =0

Reimplemented by: BindGroupIndexing::updateScene, BindGroupPartiallyBound::updateScene, BufferReference::updateScene, ComputeOitTransparency::updateScene, ComputeParticles::updateScene, DepthBias::updateScene, DepthTextureLookup::updateScene, DynamicUBOTriangles::updateScene, HelloSphereMesh::updateScene, HelloSphereRt::updateScene, HelloTriangle::updateScene, HelloTriangle::updateScene, HelloTriangle::updateScene, HelloTriangle::updateScene, HelloTriangleMSAA::updateScene, HelloTriangleRt::updateScene, HybridRasterRt::updateScene, MultiView::updateScene, MultiViewStereo::updateScene, RenderToTexture::updateScene, RenderToTextureSubpass::updateScene, TexturedQuad::updateScene

function render

1
virtual void render() =0

Reimplemented by: BindGroupIndexing::render, BindGroupPartiallyBound::render, BufferReference::render, ComputeOitTransparency::render, ComputeParticles::render, DepthBias::render, DepthTextureLookup::render, DynamicUBOTriangles::render, HelloSphereMesh::render, HelloSphereRt::render, HelloTriangle::render, HelloTriangle::render, HelloTriangle::render, HelloTriangle::render, HelloTriangleMSAA::render, HelloTriangleRt::render, HybridRasterRt::render, MultiView::render, MultiViewStereo::render, RenderToTexture::render, RenderToTextureSubpass::render, TexturedQuad::render

function resize

1
virtual void resize() =0

Reimplemented by: BindGroupIndexing::resize, BindGroupPartiallyBound::resize, BufferReference::resize, ComputeOitTransparency::resize, ComputeParticles::resize, DepthBias::resize, DepthTextureLookup::resize, DynamicUBOTriangles::resize, HelloSphereMesh::resize, HelloSphereRt::resize, HelloTriangle::resize, HelloTriangle::resize, HelloTriangle::resize, HelloTriangle::resize, HelloTriangleMSAA::resize, HelloTriangleRt::resize, HybridRasterRt::resize, MultiView::resize, MultiViewStereo::resize, RenderToTexture::resize, RenderToTextureSubpass::resize, TexturedQuad::resize

function drawImGuiOverlay

1
2
3
virtual void drawImGuiOverlay(
    ImGuiContext * ctx
)

function renderImGuiOverlay

1
2
3
4
5
6
virtual void renderImGuiOverlay(
    RenderPassCommandRecorder * recorder,
    uint32_t inFlightIndex =0,
    RenderPass * currentRenderPass =nullptr,
    int lastSubpassIndex =0
)

function registerImGuiOverlayDrawFunction

1
2
3
void registerImGuiOverlayDrawFunction(
    const std::function< void(ImGuiContext *)> & func
)

function clearImGuiOverlayDrawFunctions

1
void clearImGuiOverlayDrawFunctions()

function recreateImGuiOverlay

1
void recreateImGuiOverlay()

function onAttached

1
virtual void onAttached() override

Reimplements: KDGpuExample::EngineLayer::onAttached

function onDetached

1
virtual void onDetached() override

Reimplements: KDGpuExample::EngineLayer::onDetached

function update

1
virtual void update() override

Reimplements: KDGpuExample::EngineLayer::update

Reimplemented by: KDGpuExample::SimpleExampleEngineLayer::update

function event

1
2
3
4
void event(
    KDFoundation::EventReceiver * target,
    KDFoundation::Event * ev
) override

function recreateSwapChain

1
virtual void recreateSwapChain()

Reimplemented by: MultiViewStereo::recreateSwapChain

function recreateDepthTexture

1
void recreateDepthTexture()

function recreateSampleDependentResources

1
void recreateSampleDependentResources()

function uploadBufferData

1
2
3
void uploadBufferData(
    const BufferUploadOptions & options
)

function uploadTextureData

1
2
3
void uploadTextureData(
    const TextureUploadOptions & options
)

function releaseStagingBuffers

1
void releaseStagingBuffers()

Protected Attributes Documentation

variable m_logger

1
std::shared_ptr< spdlog::logger > m_logger;

variable m_api

1
std::unique_ptr< GraphicsApi > m_api;

variable m_window

1
std::unique_ptr< KDGpuKDGui::View > m_window;

variable m_swapchainExtent

1
Extent2D m_swapchainExtent;

variable m_samples

1
KDBindings::Property< SampleCountFlagBits > m_samples { SampleCountFlagBits::Samples1Bit };

variable m_swapchainUsageFlags

1
TextureUsageFlags m_swapchainUsageFlags { TextureUsageFlagBits::ColorAttachmentBit };

variable m_supportedSampleCounts

1
std::vector< SampleCountFlagBits > m_supportedSampleCounts;

variable m_instance

1
Instance m_instance;

variable m_surface

1
Surface m_surface;

variable m_device

1
Device m_device;

variable m_queue

1
Queue m_queue;

variable m_presentMode

1
PresentMode m_presentMode;

variable m_swapchain

1
Swapchain m_swapchain;

variable m_swapchainViews

1
std::vector< TextureView > m_swapchainViews;

variable m_depthTexture

1
Texture m_depthTexture;

variable m_depthTextureView

1
TextureView m_depthTextureView;

variable m_imguiOverlay

1
std::unique_ptr< ImGuiItem > m_imguiOverlay;

variable m_imGuiOverlayDrawFunctions

1
std::vector< std::function< void(ImGuiContext *)> > m_imGuiOverlayDrawFunctions;

variable m_currentSwapchainImageIndex

1
uint32_t m_currentSwapchainImageIndex { 0 };

variable m_inFlightIndex

1
uint32_t m_inFlightIndex { 0 };

variable m_presentCompleteSemaphores

1
std::array< GpuSemaphore, MAX_FRAMES_IN_FLIGHT > m_presentCompleteSemaphores;

variable m_renderCompleteSemaphores

1
std::array< GpuSemaphore, MAX_FRAMES_IN_FLIGHT > m_renderCompleteSemaphores;

variable m_depthTextureUsageFlags

1
TextureUsageFlags m_depthTextureUsageFlags {};

variable m_stagingBuffers

1
std::vector< UploadStagingBuffer > m_stagingBuffers;

variable m_swapchainFormat

1
Format m_swapchainFormat { Format::B8G8R8A8_UNORM };

variable m_depthFormat

1
Format m_depthFormat;

variable m_compositeAlpha

1
CompositeAlphaFlagBits m_compositeAlpha { CompositeAlphaFlagBits::OpaqueBit };

variable m_showSurfaceCapabilities

1
bool m_showSurfaceCapabilities { false };

variable m_capabilitiesString

1
std::string m_capabilitiesString;

Updated on 2024-12-29 at 00:12:08 +0000