ezEngine Release 26.9
Loading...
Searching...
No Matches
ezRenderWorld Class Reference

#include <RenderWorld.h>

Classes

struct  CameraConfig
 

Static Public Member Functions

static ezViewHandle CreateView (ezStringView sName, ezView *&out_pView)
 
static void DeleteView (const ezViewHandle &hView)
 
static bool TryGetView (const ezViewHandle &hView, ezView *&out_pView)
 
static ezViewGetViewByUsageHint (ezCameraUsageHint::Enum usageHint, ezCameraUsageHint::Enum alternativeUsageHint=ezCameraUsageHint::None, const ezWorld *pWorld=nullptr)
 Searches for an ezView with the desired usage hint or alternative usage hint.
 
static void AddMainView (const ezViewHandle &hView)
 
static void RemoveMainView (const ezViewHandle &hView)
 
static void ClearMainViews ()
 
static ezArrayPtr< ezViewHandleGetMainViews ()
 
static bool IsRenderingScheduled ()
 
static void CacheRenderData (const ezView &view, const ezGameObjectHandle &hOwnerObject, const ezComponentHandle &hOwnerComponent, ezUInt16 uiComponentVersion, ezArrayPtr< ezInternal::RenderDataCacheEntry > cacheEntries, ezArrayPtr< const ezTextureDependency > textureDependencies={}, ezArrayPtr< const ezBufferDependency > bufferDependencies={})
 
static void DeleteAllCachedRenderData ()
 Deletes all cached render data globally.
 
static void DeleteCachedRenderData (const ezGameObjectHandle &hOwnerObject, const ezComponentHandle &hOwnerComponent)
 Deletes cached render data for a specific component.
 
static void DeleteCachedRenderDataForObject (const ezGameObject *pOwnerObject)
 Deletes cached render data for a game object.
 
static void DeleteCachedRenderDataForObjectRecursive (const ezGameObject *pOwnerObject)
 Recursively deletes cached render data for a game object and all its children.
 
static void ResetRenderDataCache (ezView &ref_view)
 Resets the render data cache for a specific view.
 
static ezArrayPtr< const ezInternal::RenderDataCacheEntryGetCachedRenderData (const ezView &view, const ezGameObjectHandle &hOwner, ezUInt16 uiComponentVersion, ezArrayPtr< const ezTextureDependency > &out_textureDependencies, ezArrayPtr< const ezBufferDependency > &out_bufferDependencies)
 Retrieves cached render data if available and still valid.
 
static void AddViewToRender (const ezViewHandle &hView)
 
static void AddViewDependency (const ezView &consumerView, ezGALTextureHandle hTexture, ezBitflags< ezGALResourceState > requiredState, ezBitflags< ezGALShaderStageFlags > stage=ezGALShaderStageFlags::Auto)
 
static void AddViewDependency (const ezView &consumerView, ezGALBufferHandle hBuffer, ezBitflags< ezGALResourceState > requiredState, ezBitflags< ezGALShaderStageFlags > stage=ezGALShaderStageFlags::Auto)
 
static void ExtractMainViews ()
 
static void Render (ezRenderContext *pRenderContext)
 
static void BeginFrame ()
 
static void EndFrame ()
 
static const ezEvent< const ezRenderWorldExtractionEvent &, ezMutex > & GetExtractionEvent ()
 
static const ezEvent< const ezRenderWorldRenderEvent &, ezMutex > & GetRenderEvent ()
 
static bool GetUseMultithreadedRendering ()
 
static EZ_ALWAYS_INLINE void ResetFrameCounter ()
 Resets the frame counter to zero. Only for test purposes !
 
static EZ_ALWAYS_INLINE ezUInt64 GetFrameCounter ()
 
static EZ_FORCE_INLINE ezUInt32 GetDataIndexForExtraction ()
 
static EZ_FORCE_INLINE ezUInt32 GetDataIndexForRendering ()
 
static bool IsRenderingThread ()
 

Static Public Attributes

static ezEvent< ezView *, ezMutexs_ViewCreatedEvent
 
static ezEvent< ezView *, ezMutexs_ViewDeletedEvent
 

Friends

class ezView
 
class ezRenderPipeline
 

Render To Texture

static ezEvent< void * > s_CameraConfigsModifiedEvent
 
static void BeginModifyCameraConfigs ()
 
static void EndModifyCameraConfigs ()
 
static void ClearCameraConfigs ()
 
static void SetCameraConfig (const char *szName, const CameraConfig &config)
 
static const CameraConfigFindCameraConfig (const char *szName)
 

Detailed Description

Central hub for rendering operations and view management.

Manages views, render data extraction, and rendering execution. Handles double-buffering of render data when multithreaded rendering is enabled. Provides events for hooking into various stages of the rendering pipeline.

Member Function Documentation

◆ AddViewDependency() [1/2]

void ezRenderWorld::AddViewDependency ( const ezView consumerView,
ezGALBufferHandle  hBuffer,
ezBitflags< ezGALResourceState requiredState,
ezBitflags< ezGALShaderStageFlags stage = ezGALShaderStageFlags::Auto 
)
static

Declares that the given view needs the specified buffer in the given resource state when its render graph executes. Must be called during extraction. Usually this function is called alongside ezRenderWorld::AddViewToRender to declare the required state of the output the view produced.

◆ AddViewDependency() [2/2]

void ezRenderWorld::AddViewDependency ( const ezView consumerView,
ezGALTextureHandle  hTexture,
ezBitflags< ezGALResourceState requiredState,
ezBitflags< ezGALShaderStageFlags stage = ezGALShaderStageFlags::Auto 
)
static

Declares that the given view needs the specified texture in the given resource state when its render graph executes. Must be called during extraction. Usually this function is called alongside ezRenderWorld::AddViewToRender to declare the required state of the output the view produced.

◆ CacheRenderData()

void ezRenderWorld::CacheRenderData ( const ezView view,
const ezGameObjectHandle hOwnerObject,
const ezComponentHandle hOwnerComponent,
ezUInt16  uiComponentVersion,
ezArrayPtr< ezInternal::RenderDataCacheEntry cacheEntries,
ezArrayPtr< const ezTextureDependency textureDependencies = {},
ezArrayPtr< const ezBufferDependency bufferDependencies = {} 
)
static

Caches render data for an object to avoid re-extraction if unchanged.

Cached render data needs to be deleted/invalidated manually if any data changes. The dependency arrays carry per-category render-graph barrier dependencies that were recorded during extraction and are cached alongside the render data.

◆ Render()

void ezRenderWorld::Render ( ezRenderContext pRenderContext)
static

NOTE: (Only Applies When Tracy is Enabled.)Tracy Seems to declare Timers in the same scope, so dual profile macros can throw: '__tracy_scoped_zone' : redefinition; multitple initalization, so we must scope the two events.


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