Nebula
Loading...
Searching...
No Matches
Frame::FrameScript Class Reference

#include <framescript.h>

Detailed Description

A FrameScript describes render operations being done to produce a single frame.

Frame scripts are loaded once like a template, and then compiled to produce an optimized result. When a pass is disabled or re-enabled, the script is rebuilt, so refrain from doing this frequently.

On DX12 and Vulkan, the compile process serves to insert proper barriers, events and semaphore operations such that shader resources are not stomped or read prematurely.

Inherits Core::RefCounted.

Public Member Functions

 FrameScript ()
 constructor
 
virtual ~FrameScript ()
 destructor
 
Memory::ArenaAllocator< BIG_CHUNK > & GetAllocator ()
 get allocator
 
void SetResourceName (const Resources::ResourceName &name)
 set name
 
const Resources::ResourceNameGetResourceName () const
 get name
 
void AddOp (Frame::FrameOp *op)
 add frame operation
 
Frame::FrameOpGetOp (const Util::String &search)
 get frame operation, searches hierarchies using /
 
void AddTexture (const Util::StringAtom &name, const CoreGraphics::TextureId tex)
 add texture
 
const CoreGraphics::TextureId GetTexture (const Util::StringAtom &name)
 get texture
 
const Util::Dictionary< Util::StringAtom, CoreGraphics::TextureId > & GetTextures () const
 get all textures
 
void AddBuffer (const Util::StringAtom &name, const CoreGraphics::BufferId buf)
 add buffer
 
const CoreGraphics::BufferId GetBuffer (const Util::StringAtom &name)
 get buffer
 
void Setup ()
 setup script
 
void Discard ()
 discard script
 
void Run (const IndexT frameIndex, const IndexT bufferIndex)
 run script
 
void Build ()
 build framescript, this will delete and replace the old frame used for Run()
 
- Public Member Functions inherited from Core::RefCounted
 RefCounted ()
 constructor
 
int GetRefCount () const
 get the current refcount
 
void AddRef ()
 increment refcount by one
 
void Release ()
 decrement refcount and destroy object if refcount is zero
 
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
 
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
 
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
 
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
 
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
 
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
 
const Util::StringGetClassName () const
 get the class name
 
Util::FourCC GetClassFourCC () const
 get the class FourCC code
 

Private Member Functions

 __DeclareClass (FrameScript)
 
void Cleanup ()
 cleanup script internally
 
void OnWindowResized ()
 handle resizing
 

Private Attributes

CoreGraphics::WindowId window
 
Memory::ArenaAllocator< BIG_CHUNKallocator
 
Util::Array< CoreGraphics::EventIdevents
 
Util::Array< CoreGraphics::BarrierIdbarriers
 
Memory::ArenaAllocator< BIG_CHUNKbuildAllocator
 
Resources::ResourceName resId
 
Util::Array< CoreGraphics::BufferIdbuffers
 
Util::Dictionary< Util::StringAtom, CoreGraphics::BufferIdbuffersByName
 
Util::Array< CoreGraphics::TextureIdtextures
 
Util::Dictionary< Util::StringAtom, CoreGraphics::TextureIdtexturesByName
 
Util::Array< Frame::FrameOp * > ops
 
Util::Dictionary< Util::StringAtom, Frame::FrameOp * > opsByName
 
Util::Array< Frame::FrameOp::Compiled * > compiled
 
Util::Array< CoreGraphics::BarrierIdresourceResetBarriers
 
IndexT frameOpCounter
 
bool subScript
 

Friends

class FrameScriptLoader
 
class FrameServer
 
class Graphics::View
 
class Graphics::GraphicsServer
 

Additional Inherited Members

- Static Public Member Functions inherited from Core::RefCounted
static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!)
 
- Protected Member Functions inherited from Core::RefCounted
virtual ~RefCounted ()
 destructor (called when refcount reaches zero)
 

Constructor & Destructor Documentation

◆ FrameScript()

Frame::FrameScript::FrameScript ( )

constructor

◆ ~FrameScript()

Frame::FrameScript::~FrameScript ( )
virtual

destructor

Member Function Documentation

◆ __DeclareClass()

Frame::FrameScript::__DeclareClass ( FrameScript )
private

◆ AddBuffer()

void Frame::FrameScript::AddBuffer ( const Util::StringAtom & name,
const CoreGraphics::BufferId buf )

add buffer

◆ AddOp()

void Frame::FrameScript::AddOp ( Frame::FrameOp * op)

add frame operation

◆ AddTexture()

void Frame::FrameScript::AddTexture ( const Util::StringAtom & name,
const CoreGraphics::TextureId tex )

add texture

◆ Build()

void Frame::FrameScript::Build ( )

build framescript, this will delete and replace the old frame used for Run()

◆ Cleanup()

void Frame::FrameScript::Cleanup ( )
private

cleanup script internally

◆ Discard()

void Frame::FrameScript::Discard ( )

discard script

◆ GetAllocator()

Memory::ArenaAllocator< BIG_CHUNK > & Frame::FrameScript::GetAllocator ( )
inline

get allocator

◆ GetBuffer()

const CoreGraphics::BufferId Frame::FrameScript::GetBuffer ( const Util::StringAtom & name)
inline

get buffer

◆ GetOp()

Frame::FrameOp * Frame::FrameScript::GetOp ( const Util::String & search)

get frame operation, searches hierarchies using /

◆ GetResourceName()

const Resources::ResourceName & Frame::FrameScript::GetResourceName ( ) const
inline

get name

◆ GetTexture()

const CoreGraphics::TextureId Frame::FrameScript::GetTexture ( const Util::StringAtom & name)
inline

get texture

◆ GetTextures()

const Util::Dictionary< Util::StringAtom, CoreGraphics::TextureId > & Frame::FrameScript::GetTextures ( ) const
inline

get all textures

◆ OnWindowResized()

void Frame::FrameScript::OnWindowResized ( )
private

handle resizing

◆ Run()

void Frame::FrameScript::Run ( const IndexT frameIndex,
const IndexT bufferIndex )

run script

◆ SetResourceName()

void Frame::FrameScript::SetResourceName ( const Resources::ResourceName & name)
inline

set name

◆ Setup()

void Frame::FrameScript::Setup ( )

setup script

Friends And Related Symbol Documentation

◆ FrameScriptLoader

friend class FrameScriptLoader
friend

◆ FrameServer

friend class FrameServer
friend

◆ Graphics::GraphicsServer

friend class Graphics::GraphicsServer
friend

◆ Graphics::View

friend class Graphics::View
friend

Member Data Documentation

◆ allocator

Memory::ArenaAllocator<BIG_CHUNK> Frame::FrameScript::allocator
private

◆ barriers

Util::Array<CoreGraphics::BarrierId> Frame::FrameScript::barriers
private

◆ buffers

Util::Array<CoreGraphics::BufferId> Frame::FrameScript::buffers
private

◆ buffersByName

Util::Dictionary<Util::StringAtom, CoreGraphics::BufferId> Frame::FrameScript::buffersByName
private

◆ buildAllocator

Memory::ArenaAllocator<BIG_CHUNK> Frame::FrameScript::buildAllocator
private

◆ compiled

Util::Array<Frame::FrameOp::Compiled*> Frame::FrameScript::compiled
private

◆ events

Util::Array<CoreGraphics::EventId> Frame::FrameScript::events
private

◆ frameOpCounter

IndexT Frame::FrameScript::frameOpCounter
private

◆ ops

Util::Array<Frame::FrameOp*> Frame::FrameScript::ops
private

◆ opsByName

Util::Dictionary<Util::StringAtom, Frame::FrameOp*> Frame::FrameScript::opsByName
private

◆ resId

Resources::ResourceName Frame::FrameScript::resId
private

◆ resourceResetBarriers

Util::Array<CoreGraphics::BarrierId> Frame::FrameScript::resourceResetBarriers
private

◆ subScript

bool Frame::FrameScript::subScript
private

◆ textures

Util::Array<CoreGraphics::TextureId> Frame::FrameScript::textures
private

◆ texturesByName

Util::Dictionary<Util::StringAtom, CoreGraphics::TextureId> Frame::FrameScript::texturesByName
private

◆ window

CoreGraphics::WindowId Frame::FrameScript::window
private

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