Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
|
Displays two images of any type next to each other, and get a "pipette" readout at the mouse location. More...
#include <foray_comparerstage.hpp>
Classes | |
struct | InputInfo |
Argument struct for setting inputs. More... | |
struct | PipetteValue |
struct | PushConstant |
struct | SubStage |
Value between 0...1 defining the split value. More... | |
Public Types | |
enum class | EInputType { Float , Int , Uint } |
Public Member Functions | |
virtual void | Init (core::Context *context, bool flipY) |
Inits the comparer stage. SetInput() calls afterwards are required for function. | |
virtual void | RecordFrame (VkCommandBuffer cmdBuffer, base::FrameRenderInfo &renderInfo) override |
Pipeline barriers and compute shader dispatches. | |
virtual void | HandleEvent (const osi::Event *event) |
If called the comparer stage will filter for MouseMoved events to update the pipette value returned. | |
virtual void | Resize (const VkExtent2D &extent) override |
Default implementation accesses mImageOutputs and calls ManagedImage::Resize(extent) on any set image. | |
virtual void | Destroy () override |
Destroy the render stage. Finalizes all components. | |
virtual void | SetInput (uint32_t index, const InputInfo &input) |
Set the input. | |
![]() | |
RenderStage ()=default | |
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 () |
Static Public Attributes | |
static constexpr std::string_view | OutputName = "Comparer.Out" |
Image output name. | |
Protected Member Functions | |
void | CreateSubStage (SubStage &substage) |
void | DispatchSubStage (SubStage &substage, VkCommandBuffer buffer, base::FrameRenderInfo &renderInfo) |
void | DestroySubStage (SubStage &substage, bool final) |
void | CreateOutputImage () |
void | LoadShaders () |
void | CreatePipetteBuffer () |
![]() | |
virtual void | ReloadShaders () |
Override this to reload all shaders and rebuild pipelines after a registered shader has been recompiled. | |
virtual void | DestroyOutputImages () |
Calls Destroy() on any image in mImageOutputs and clears mImageOutputs. | |
Protected Attributes | |
std::array< SubStage, 2 > | mSubStages |
core::ManagedImage | mOutput |
core::ManagedBuffer | mPipetteBuffer |
void * | mPipetteMap = nullptr |
PipetteValue | mPipetteValue |
std::array< core::ShaderModule, 3 > | mShaders |
fp32_t | mMixValue = 0.5 |
glm::ivec2 | mMousePos = {} |
bool | mFlipY = false |
![]() | |
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. | |
Displays two images of any type next to each other, and get a "pipette" readout at the mouse location.
|
strong |
|
protected |
|
protected |
|
protected |
|
overridevirtual |
Destroy the render stage. Finalizes all components.
Reimplemented from foray::stages::RenderStage.
|
protected |
|
protected |
|
virtual |
If called the comparer stage will filter for MouseMoved events to update the pipette value returned.
|
virtual |
Inits the comparer stage. SetInput() calls afterwards are required for function.
|
protected |
|
overridevirtual |
Pipeline barriers and compute shader dispatches.
Reimplemented from foray::stages::RenderStage.
|
overridevirtual |
Default implementation accesses mImageOutputs and calls ManagedImage::Resize(extent) on any set image.
extent | New render size |
Reimplemented from foray::stages::RenderStage.
|
virtual |
Set the input.
index | 0 == left, 1 == right |
input | Image Input information |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inlinestaticconstexpr |
Image output name.