GSG::is_hardware()
This commit is contained in:
parent
003a3bf2f5
commit
bed33fb763
|
|
@ -141,6 +141,18 @@ get_threading_model() const {
|
|||
return _threading_model;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsStateGuardian::is_hardware
|
||||
// Access: Published
|
||||
// Description: Returns true if this GSG appears to be
|
||||
// hardware-accelerated, or false if it is known to be
|
||||
// software only.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool GraphicsStateGuardian::
|
||||
is_hardware() const {
|
||||
return _is_hardware;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsStateGuardian::prefers_triangle_strips
|
||||
// Access: Published, Virtual
|
||||
|
|
|
|||
|
|
@ -136,6 +136,7 @@ GraphicsStateGuardian(CoordinateSystem internal_coordinate_system,
|
|||
_prepared_objects = new PreparedGraphicsObjects;
|
||||
_stereo_buffer_mask = ~0;
|
||||
|
||||
_is_hardware = false;
|
||||
_prefers_triangle_strips = false;
|
||||
_max_vertices_per_array = INT_MAX;
|
||||
_max_vertices_per_primitive = INT_MAX;
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ PUBLISHED:
|
|||
INLINE GraphicsEngine *get_engine() const;
|
||||
INLINE const GraphicsThreadingModel &get_threading_model() const;
|
||||
|
||||
INLINE bool is_hardware() const;
|
||||
virtual INLINE bool prefers_triangle_strips() const;
|
||||
virtual INLINE int get_max_vertices_per_array() const;
|
||||
virtual INLINE int get_max_vertices_per_primitive() const;
|
||||
|
|
@ -356,6 +357,7 @@ protected:
|
|||
|
||||
PT(PreparedGraphicsObjects) _prepared_objects;
|
||||
|
||||
bool _is_hardware;
|
||||
bool _prefers_triangle_strips;
|
||||
int _max_vertices_per_array;
|
||||
int _max_vertices_per_primitive;
|
||||
|
|
|
|||
|
|
@ -85,6 +85,10 @@ DXGraphicsStateGuardian8::
|
|||
DXGraphicsStateGuardian8(GraphicsPipe *pipe) :
|
||||
GraphicsStateGuardian(CS_yup_left, pipe)
|
||||
{
|
||||
// Assume that we will get a hardware-accelerated context, unless
|
||||
// the window tells us otherwise.
|
||||
_is_hardware = true;
|
||||
|
||||
_screen = NULL;
|
||||
_d3d_device = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -103,6 +103,10 @@ DXGraphicsStateGuardian9(GraphicsPipe *pipe) :
|
|||
<< "DXGraphicsStateGuardian9 " << this << " constructing\n";
|
||||
}
|
||||
|
||||
// Assume that we will get a hardware-accelerated context, unless
|
||||
// the window tells us otherwise.
|
||||
_is_hardware = true;
|
||||
|
||||
_screen = NULL;
|
||||
_d3d_device = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -254,6 +254,10 @@ CLP(GraphicsStateGuardian)(GraphicsPipe *pipe) :
|
|||
// performance benefit it gives us.
|
||||
_prepared_objects->_support_released_buffer_cache = true;
|
||||
|
||||
// Assume that we will get a hardware-accelerated context, unless
|
||||
// the window tells us otherwise.
|
||||
_is_hardware = true;
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
if (CLP(finish)) {
|
||||
GLCAT.warning()
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@ OSMesaGraphicsStateGuardian(GraphicsPipe *pipe,
|
|||
}
|
||||
|
||||
_context = OSMesaCreateContext(OSMESA_RGBA, share_context);
|
||||
|
||||
// OSMesa is never hardware-accelerated.
|
||||
_is_hardware = false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
Loading…
Reference in New Issue