HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
contextCaps.h
Go to the documentation of this file.
1
//
2
// Copyright 2018 Pixar
3
//
4
// Licensed under the terms set forth in the LICENSE.txt file available at
5
// https://openusd.org/license.
6
//
7
#ifndef PXR_IMAGING_GLF_CONTEXT_CAPS_H
8
#define PXR_IMAGING_GLF_CONTEXT_CAPS_H
9
10
#include "
pxr/pxr.h
"
11
#include "
pxr/imaging/glf/api.h
"
12
#include "
pxr/base/tf/singleton.h
"
13
14
15
PXR_NAMESPACE_OPEN_SCOPE
16
17
18
/// \class GlfContextCaps
19
///
20
/// This class is intended to be a cache of the capabilites
21
/// (resource limits and features) of the underlying
22
/// GL context.
23
///
24
/// It serves two purposes. Firstly to reduce driver
25
/// transition overhead of querying these values.
26
/// Secondly to provide access to these values from other
27
/// threads that don't have the context bound.
28
///
29
/// In the event of failure (InitInstance() wasn't called
30
/// or an issue accessing the GL context), a reasonable
31
/// set of defaults, based on GL minimums, is provided.
32
///
33
///
34
/// TO DO (bug #124971):
35
/// - LoadCaps() should be called whenever the context
36
/// changes.
37
/// - Provide a mechanism where other Hd systems can
38
/// subscribe to when the caps changes, so they can
39
/// update and invalidate.
40
///
41
class
GlfContextCaps
42
{
43
public
:
44
45
/// InitInstance queries the GL context for its capabilities.
46
/// It should be called by the application before using systems
47
/// that depend on the caps, such as Hydra. A good example would be
48
/// to pair the call to initialize after a call to initialize GL
49
GLF_API
50
static
void
InitInstance
();
51
52
/// GetInstance() returns the filled capabilities structure.
53
/// This function will not populate the caps and will issue a
54
/// coding error if it hasn't been filled.
55
GLF_API
56
static
const
GlfContextCaps
&
GetInstance
();
57
58
// GL version
59
int
glVersion
;
// 400 (4.0), 410 (4.1), ...
60
61
// Whether or not we are running with core profile
62
bool
coreProfile
;
63
64
// Max constants
65
int
maxArrayTextureLayers
;
66
67
private
:
68
void
_LoadCaps();
69
GlfContextCaps
();
70
~
GlfContextCaps
() =
default
;
71
72
// Disallow copies
73
GlfContextCaps
(
const
GlfContextCaps
&) =
delete
;
74
GlfContextCaps
& operator=(
const
GlfContextCaps
&) =
delete
;
75
76
friend
class
TfSingleton
<
GlfContextCaps
>;
77
};
78
79
GLF_API_TEMPLATE_CLASS
(
TfSingleton<GlfContextCaps>
);
80
81
PXR_NAMESPACE_CLOSE_SCOPE
82
83
#endif // PXR_IMAGING_GLF_CONTEXT_CAPS_H
84
api.h
singleton.h
TfSingleton
Definition:
singleton.h:105
GlfContextCaps::GetInstance
static GLF_API const GlfContextCaps & GetInstance()
GLF_API
#define GLF_API
Definition:
api.h:23
GlfContextCaps::InitInstance
static GLF_API void InitInstance()
GlfContextCaps::glVersion
int glVersion
Definition:
contextCaps.h:59
pxr.h
GLF_API_TEMPLATE_CLASS
GLF_API_TEMPLATE_CLASS(TfSingleton< GlfContextCaps >)
GlfContextCaps
Definition:
contextCaps.h:41
PXR_NAMESPACE_OPEN_SCOPE
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition:
path.h:1425
GlfContextCaps::coreProfile
bool coreProfile
Definition:
contextCaps.h:62
PXR_NAMESPACE_CLOSE_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition:
pxr.h:74
GlfContextCaps::maxArrayTextureLayers
int maxArrayTextureLayers
Definition:
contextCaps.h:65
pxr
imaging
glf
contextCaps.h
Generated on Wed Sep 3 2025 02:34:49 for HDK by
1.8.6