Loading...
Searching...
No Matches
GlfContextCaps Class Reference

This class is intended to be a cache of the capabilites (resource limits and features) of the underlying GL context. More...

#include <contextCaps.h>

Static Public Member Functions

static GLF_API void InitInstance ()
 InitInstance queries the GL context for its capabilities.
 
static GLF_API const GlfContextCapsGetInstance ()
 GetInstance() returns the filled capabilities structure.
 

Public Attributes

int glVersion
 
bool coreProfile
 
int maxArrayTextureLayers
 

Friends

class TfSingleton< GlfContextCaps >
 

Detailed Description

This class is intended to be a cache of the capabilites (resource limits and features) of the underlying GL context.

It serves two purposes. Firstly to reduce driver transition overhead of querying these values. Secondly to provide access to these values from other threads that don't have the context bound.

In the event of failure (InitInstance() wasn't called or an issue accessing the GL context), a reasonable set of defaults, based on GL minimums, is provided.

TO DO (bug #124971):

  • LoadCaps() should be called whenever the context changes.
  • Provide a mechanism where other Hd systems can subscribe to when the caps changes, so they can update and invalidate.

Definition at line 58 of file contextCaps.h.

Member Function Documentation

◆ GetInstance()

static GLF_API const GlfContextCaps & GetInstance ( )
static

GetInstance() returns the filled capabilities structure.

This function will not populate the caps and will issue a coding error if it hasn't been filled.

◆ InitInstance()

static GLF_API void InitInstance ( )
static

InitInstance queries the GL context for its capabilities.

It should be called by the application before using systems that depend on the caps, such as Hydra. A good example would be to pair the call to initialize after a call to initialize GL

Friends And Related Function Documentation

◆ TfSingleton< GlfContextCaps >

friend class TfSingleton< GlfContextCaps >
friend

Definition at line 91 of file contextCaps.h.

Member Data Documentation

◆ coreProfile

bool coreProfile

Definition at line 79 of file contextCaps.h.

◆ glVersion

int glVersion

Definition at line 76 of file contextCaps.h.

◆ maxArrayTextureLayers

int maxArrayTextureLayers

Definition at line 82 of file contextCaps.h.


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