XLE  v0.02.0
Public Member Functions | List of all members
RenderCore::IThreadContext Class Referenceabstract

Represents the context state of a particular thread while rendering More...

#include <IThreadContext.h>

Public Member Functions

virtual virtual void * QueryInterface (const GUID &guid)=0
 
virtual bool IsImmediate () const =0
 
virtual std::shared_ptr< IDeviceGetDevice () const =0
 
virtual void ClearAllBoundTargets () const =0
 
virtual ThreadContextStateDesc GetStateDesc () const =0
 

Detailed Description

Represents the context state of a particular thread while rendering

There are 2 types of threadContext objects:

  1. immediate
  2. deferred

Each thread context is associated with a single CPU thread. As a result, the methods themselves are not-thread-safe – because they are only called from a single thread. We need to store the context state on a thread level, because each thread can be working with a different state, and each thread wants to assume that other threads won't interfere with it's own state.

Each device can have only one immediate context. But this can interact directly with the GPU, and send commands. The thread that owns the immediate context is the primary rendering thread.

Other threads can have a "deferred" context. In this context, GPU commands can be queued up. But, before the GPU can act upon them, their commands must be submitted to the immediate context.

This object is critical for hiding the metal layer from platform-independent libraries. Most objects require access to Metal::DeviceContext to perform rendering operations. But DeviceContext is a low-level "Metal" layer object. We need a higher level "RenderCore" object to wrap it.


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