@ -28,21 +28,44 @@
# include <Corrade/Containers/StringView.h>
# include <Corrade/Containers/StringView.h>
# include "Magnum/GL/Context.h"
# include "Magnum/GL/Context.h"
# include "Magnum/GL/Extensions.h"
namespace Magnum { namespace GL { namespace Implementation {
namespace Magnum { namespace GL { namespace Implementation {
using namespace Containers : : Literals ;
using namespace Containers : : Literals ;
ContextState : : ContextState ( Context & context , Containers : : StaticArrayView < Implementation : : ExtensionCount , const char * > ) {
ContextState : : ContextState ( Context & context , const Containers : : StaticArrayView < Implementation : : ExtensionCount , const char * > extensions ) {
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( ( context . detectedDriver ( ) & Context : : DetectedDriver : : NVidia ) & &
if ( ( context . detectedDriver ( ) & Context : : DetectedDriver : : NVidia ) & &
! context . isDriverWorkaroundDisabled ( " nv-zero-context-profile-mask " _s ) )
! context . isDriverWorkaroundDisabled ( " nv-zero-context-profile-mask " _s ) )
{
{
isCoreProfileImplementation = & Context : : isCoreProfileImplementationNV ;
isCoreProfileImplementation = & Context : : isCoreProfileImplementationNV ;
} else isCoreProfileImplementation = & Context : : isCoreProfileImplementationDefault ;
} else isCoreProfileImplementation = & Context : : isCoreProfileImplementationDefault ;
# else
# endif
# ifdef MAGNUM_TARGET_WEBGL
/* The rendererStringUnmasked() and vendorStringUnmasked() branch on the
extension on their own , which is in - line with all other " limit " queries .
It wouldn ' t make sense to create four new * Implementation ( )
functions and two new pointers for something that gets called mostly
just on application startup ( and where it can ' t actually use the
function pointer because at that point the state is still yet to be
created ) .
But since there ' s nothing else would add the extension to the used
extension list , we ' re doing that here . */
if ( context . isExtensionSupported < Extensions : : WEBGL : : debug_renderer_info > ( ) ) {
extensions [ Extensions : : WEBGL : : debug_renderer_info : : Index ] =
Extensions : : WEBGL : : debug_renderer_info : : string ( ) ;
}
# endif
# if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL)
static_cast < void > ( context ) ;
static_cast < void > ( context ) ;
# endif
# endif
# ifndef MAGNUM_TARGET_WEBGL
static_cast < void > ( extensions ) ;
# endif
}
}
} } }
} } }