Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
foray::scene::gcomp::DrawDirector Class Reference

Manages a collection of mesh instances, current and previous model matrices. More...

#include <foray_drawmanager.hpp>

Inheritance diagram for foray::scene::gcomp::DrawDirector:
foray::scene::GlobalComponent foray::scene::Component::UpdateCallback foray::scene::Component::DrawCallback foray::scene::Component foray::Polymorphic foray::Polymorphic foray::NoMoveDefaults foray::Polymorphic

Public Member Functions

 DrawDirector ()
 
void InitOrUpdate ()
 Collects mesh instances and rebuilds transform buffers.
 
virtual int32_t GetOrder () const override
 
virtual void Update (SceneUpdateInfo &) override
 Updates and uploads transform buffers.
 
virtual void Draw (SceneDrawInfo &) override
 Draws the scene using the currently bound pipeline and renderpass. Vertex and Index buffers must be bound.
 
VkDescriptorBufferInfo GetCurrentTransformsDescriptorInfo () const
 
VkDescriptorBufferInfo GetPreviousTransformsDescriptorInfo () const
 
VkBuffer GetCurrentTransformsVkBuffer () const
 
VkBuffer GetPreviousTransformsVkBuffer () const
 
- Public Member Functions inherited from foray::scene::GlobalComponent
virtual SceneGetScene () override
 Scene this component is a part of. Casts mRegistry to Scene.
 
virtual RegistryGetGlobals () override
 Global component registry. Returns mRegistry.
 
virtual core::ContextGetContext () override
 Vulkan Context. Casts mRegistry to Scene and returns Scene->GetContext()
 
- Public Member Functions inherited from foray::scene::Component
virtual ~Component ()
 Destructor. Provide virtual constructors in inheriting classes, to make sure they get finalized correctly.
 
- Public Member Functions inherited from foray::NoMoveDefaults
 NoMoveDefaults ()=default
 
 NoMoveDefaults (const NoMoveDefaults &other)=delete
 
 NoMoveDefaults (NoMoveDefaults &&other)=default
 
NoMoveDefaultsoperator= (const NoMoveDefaults &other)=delete
 
- Public Member Functions inherited from foray::scene::Component::UpdateCallback
virtual void Update (TArg updateInfo)=0
 Invoked first each frame. Use for changes to the node hierarchy and transforms.
 
void Invoke (TArg updateInfo)
 
- Public Member Functions inherited from foray::scene::Component::DrawCallback
virtual void Draw (TArg drawInfo)=0
 Invoked last each frame. Use to submit draw calls (and related)
 
void Invoke (TArg drawInfo)
 

Protected Member Functions

void CreateBuffers (size_t transformCount)
 
void DestroyBuffers ()
 
- Protected Member Functions inherited from foray::Polymorphic
virtual void __makeMePolymorphic ()
 

Protected Attributes

util::DualBuffer mCurrentTransformBuffer
 
core::ManagedBuffer mPreviousTransformBuffer
 
std::vector< DrawOpmDrawOps = {}
 Draw Op structs store draw operation.
 
bool mFirstSetup = true
 
GeometryStoremGeo = nullptr
 
uint32_t mTotalCount = 0
 
- Protected Attributes inherited from foray::scene::Component
RegistrymRegistry = nullptr
 
std::string mName = ""
 

Additional Inherited Members

- Public Types inherited from foray::scene::Component::UpdateCallback
using TArg = SceneUpdateInfo &
 
- Public Types inherited from foray::scene::Component::DrawCallback
using TArg = SceneDrawInfo &
 
- Public Attributes inherited from foray::scene::Component
friend Registry
 
- Static Public Attributes inherited from foray::scene::Component::UpdateCallback
static const bool ORDERED_EXECUTION = true
 
static const int32_t ORDER_TRANSFORM = 100
 
static const int32_t ORDER_DEVICEUPLOAD = 200
 
- Static Public Attributes inherited from foray::scene::Component::DrawCallback
static const bool ORDERED_EXECUTION = false
 

Detailed Description

Manages a collection of mesh instances, current and previous model matrices.

Constructor & Destructor Documentation

◆ DrawDirector()

foray::scene::gcomp::DrawDirector::DrawDirector ( )
inline

Member Function Documentation

◆ CreateBuffers()

void foray::scene::gcomp::DrawDirector::CreateBuffers ( size_t  transformCount)
protected

◆ DestroyBuffers()

void foray::scene::gcomp::DrawDirector::DestroyBuffers ( )
protected

◆ Draw()

virtual void foray::scene::gcomp::DrawDirector::Draw ( SceneDrawInfo )
overridevirtual

Draws the scene using the currently bound pipeline and renderpass. Vertex and Index buffers must be bound.

◆ GetCurrentTransformsDescriptorInfo()

VkDescriptorBufferInfo foray::scene::gcomp::DrawDirector::GetCurrentTransformsDescriptorInfo ( ) const
inline

◆ GetCurrentTransformsVkBuffer()

VkBuffer foray::scene::gcomp::DrawDirector::GetCurrentTransformsVkBuffer ( ) const
inline

◆ GetOrder()

virtual int32_t foray::scene::gcomp::DrawDirector::GetOrder ( ) const
inlineoverridevirtual

◆ GetPreviousTransformsDescriptorInfo()

VkDescriptorBufferInfo foray::scene::gcomp::DrawDirector::GetPreviousTransformsDescriptorInfo ( ) const
inline

◆ GetPreviousTransformsVkBuffer()

VkBuffer foray::scene::gcomp::DrawDirector::GetPreviousTransformsVkBuffer ( ) const
inline

◆ InitOrUpdate()

void foray::scene::gcomp::DrawDirector::InitOrUpdate ( )

Collects mesh instances and rebuilds transform buffers.

◆ Update()

virtual void foray::scene::gcomp::DrawDirector::Update ( SceneUpdateInfo )
overridevirtual

Updates and uploads transform buffers.

Member Data Documentation

◆ mCurrentTransformBuffer

util::DualBuffer foray::scene::gcomp::DrawDirector::mCurrentTransformBuffer
protected

◆ mDrawOps

std::vector<DrawOp> foray::scene::gcomp::DrawDirector::mDrawOps = {}
protected

Draw Op structs store draw operation.

◆ mFirstSetup

bool foray::scene::gcomp::DrawDirector::mFirstSetup = true
protected

◆ mGeo

GeometryStore* foray::scene::gcomp::DrawDirector::mGeo = nullptr
protected

◆ mPreviousTransformBuffer

core::ManagedBuffer foray::scene::gcomp::DrawDirector::mPreviousTransformBuffer
protected

◆ mTotalCount

uint32_t foray::scene::gcomp::DrawDirector::mTotalCount = 0
protected

The documentation for this class was generated from the following file: