glgsg: Disable Cg support when using EGL instead of GLX
Cg is hard-wired to use GLX instead of EGL, so without hacky monkey-patching it is not possible to use it under EGL
This commit is contained in:
parent
f2c680ca29
commit
300090e457
|
|
@ -377,3 +377,12 @@ void *eglGraphicsStateGuardian::
|
||||||
do_get_extension_func(const char *name) {
|
do_get_extension_func(const char *name) {
|
||||||
return (void *)eglGetProcAddress(name);
|
return (void *)eglGetProcAddress(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this implementation may support Cg shaders.
|
||||||
|
*/
|
||||||
|
bool eglGraphicsStateGuardian::
|
||||||
|
may_support_cg_shaders() {
|
||||||
|
// Never supported under EGL as CgGL is hard-wired to use GLX functions.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ protected:
|
||||||
virtual void query_gl_version();
|
virtual void query_gl_version();
|
||||||
virtual void get_extra_extensions();
|
virtual void get_extra_extensions();
|
||||||
virtual void *do_get_extension_func(const char *name);
|
virtual void *do_get_extension_func(const char *name);
|
||||||
|
virtual bool may_support_cg_shaders();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _egl_version_major, _egl_version_minor;
|
int _egl_version_major, _egl_version_minor;
|
||||||
|
|
|
||||||
|
|
@ -2059,7 +2059,8 @@ reset() {
|
||||||
// Check for support for other types of shaders that can be used by Cg.
|
// Check for support for other types of shaders that can be used by Cg.
|
||||||
_supports_basic_shaders = false;
|
_supports_basic_shaders = false;
|
||||||
#if defined(HAVE_CG) && !defined(OPENGLES)
|
#if defined(HAVE_CG) && !defined(OPENGLES)
|
||||||
if (has_extension("GL_ARB_vertex_program") &&
|
if (may_support_cg_shaders() &&
|
||||||
|
has_extension("GL_ARB_vertex_program") &&
|
||||||
has_extension("GL_ARB_fragment_program")) {
|
has_extension("GL_ARB_fragment_program")) {
|
||||||
_supports_basic_shaders = true;
|
_supports_basic_shaders = true;
|
||||||
_shader_caps._active_vprofile = (int)CG_PROFILE_ARBVP1;
|
_shader_caps._active_vprofile = (int)CG_PROFILE_ARBVP1;
|
||||||
|
|
@ -10236,6 +10237,18 @@ do_get_extension_func(const char *) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this implementation may support Cg shaders.
|
||||||
|
*/
|
||||||
|
bool CLP(GraphicsStateGuardian)::
|
||||||
|
may_support_cg_shaders() {
|
||||||
|
#if defined(HAVE_CG) && !defined(OPENGLES)
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets up the glDrawBuffer to render into the buffer indicated by the
|
* Sets up the glDrawBuffer to render into the buffer indicated by the
|
||||||
* RenderBuffer object. This only sets up the color and aux bits; it does not
|
* RenderBuffer object. This only sets up the color and aux bits; it does not
|
||||||
|
|
|
||||||
|
|
@ -525,6 +525,7 @@ protected:
|
||||||
INLINE bool is_at_least_gles_version(int major_version, int minor_version) const;
|
INLINE bool is_at_least_gles_version(int major_version, int minor_version) const;
|
||||||
void *get_extension_func(const char *name);
|
void *get_extension_func(const char *name);
|
||||||
virtual void *do_get_extension_func(const char *name);
|
virtual void *do_get_extension_func(const char *name);
|
||||||
|
virtual bool may_support_cg_shaders();
|
||||||
|
|
||||||
virtual void reissue_transforms();
|
virtual void reissue_transforms();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -572,6 +572,18 @@ do_get_extension_func(const char *name) {
|
||||||
return PosixGraphicsStateGuardian::do_get_extension_func(name);
|
return PosixGraphicsStateGuardian::do_get_extension_func(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this implementation may support Cg shaders.
|
||||||
|
*/
|
||||||
|
bool glxGraphicsStateGuardian::
|
||||||
|
may_support_cg_shaders() {
|
||||||
|
#ifdef HAVE_CG
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Queries the GLX extension pointers.
|
* Queries the GLX extension pointers.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,7 @@ protected:
|
||||||
virtual void query_gl_version();
|
virtual void query_gl_version();
|
||||||
virtual void get_extra_extensions();
|
virtual void get_extra_extensions();
|
||||||
virtual void *do_get_extension_func(const char *name);
|
virtual void *do_get_extension_func(const char *name);
|
||||||
|
virtual bool may_support_cg_shaders();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void query_glx_extensions();
|
void query_glx_extensions();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue