|
Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
|
Base class for compute shaders. More...
#include <foray_computestage.hpp>
Public Member Functions | |
| void | Init (core::Context *context) |
| Init. | |
| virtual void | RecordFrame (VkCommandBuffer cmdBuffer, base::FrameRenderInfo &renderInfo) override |
| Calls ApiBeforeFrame(), binds pipeline and descriptor set, calls ApiBeforeDispatch() | |
| virtual void | Destroy () override |
| Destroy the render stage. Finalizes all components. | |
Public Member Functions inherited from foray::stages::RenderStage | |
| RenderStage ()=default | |
| virtual void | Resize (const VkExtent2D &extent) |
| Default implementation accesses mImageOutputs and calls ManagedImage::Resize(extent) on any set image. | |
| std::vector< core::ManagedImage * > | GetImageOutputs () |
| Gets a vector to all color attachments that will be included in a texture array and can be referenced in the shader pass. | |
| core::ManagedImage * | GetImageOutput (std::string_view name, bool noThrow=false) |
| Gets an image output. | |
| virtual void | OnShadersRecompiled (const std::unordered_set< uint64_t > &recompiled) |
| Notifies the stage that the shader compiler instance has recompiled a shader. | |
| virtual | ~RenderStage () |
Protected Member Functions | |
| virtual void | ApiInitShader () |
| Load a shader into mShader module. | |
| virtual void | ApiCreateDescriptorSet () |
| Create the descriptor set. | |
| virtual void | ApiCreatePipelineLayout () |
| Configure and create the pipelinelayout. | |
| virtual void | ApiBeforeFrame (VkCommandBuffer cmdBuffer, base::FrameRenderInfo &renderInfo) |
| Prepare resources used in the compute shader. | |
| virtual void | ApiBeforeDispatch (VkCommandBuffer cmdBuffer, base::FrameRenderInfo &renderInfo, glm::uvec3 &groupSize) |
| Push constants and configure the Group size. | |
| virtual void | CreatePipeline () |
| virtual void | ReloadShaders () override |
| Override this to reload all shaders and rebuild pipelines after a registered shader has been recompiled. | |
Protected Member Functions inherited from foray::stages::RenderStage | |
| virtual void | DestroyOutputImages () |
| Calls Destroy() on any image in mImageOutputs and clears mImageOutputs. | |
Protected Attributes | |
| core::ShaderModule | mShader |
| core::DescriptorSet | mDescriptorSet |
| util::PipelineLayout | mPipelineLayout |
| VkPipeline | mPipeline = nullptr |
Protected Attributes inherited from foray::stages::RenderStage | |
| std::unordered_map< std::string, core::ManagedImage * > | mImageOutputs |
| Inheriting types should emplace their images onto this collection to provide them in GetImageOutput interface. | |
| std::vector< uint64_t > | mShaderKeys |
| Inheriting types should emplace their shader keys onto this collection such that if a shader has been recompiled, ReloadShaders() will be called. | |
| core::Context * | mContext = nullptr |
| Context object the renderstage is built upon. | |
Base class for compute shaders.
|
inlineprotectedvirtual |
Push constants and configure the Group size.
| groupSize | Compute workgroup counts |
|
inlineprotectedvirtual |
Prepare resources used in the compute shader.
|
inlineprotectedvirtual |
Create the descriptor set.
|
inlineprotectedvirtual |
Configure and create the pipelinelayout.
|
inlineprotectedvirtual |
Load a shader into mShader module.
|
protectedvirtual |
|
overridevirtual |
Destroy the render stage. Finalizes all components.
Reimplemented from foray::stages::RenderStage.
| void foray::stages::ComputeStageBase::Init | ( | core::Context * | context | ) |
Init.
Calls ApiCreateDescriptorSet(), ApiCreatePipelineLayout(), ApiInitShader(), CreatePipeline() in this order
|
overridevirtual |
Calls ApiBeforeFrame(), binds pipeline and descriptor set, calls ApiBeforeDispatch()
Reimplemented from foray::stages::RenderStage.
|
overrideprotectedvirtual |
Override this to reload all shaders and rebuild pipelines after a registered shader has been recompiled.
Reimplemented from foray::stages::RenderStage.
|
protected |
|
protected |
|
protected |
|
protected |