|
|
@@ -1589,6 +1589,15 @@ get_compiled(unsigned int &format, string &binary) const {
|
|
|
return !binary.empty();
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * Called by the graphics back-end to specify the caps with which we will
|
|
|
+ * likely want to be compiling our shaders.
|
|
|
+ */
|
|
|
+void Shader::
|
|
|
+set_default_caps(const ShaderCaps &caps) {
|
|
|
+ _default_caps = caps;
|
|
|
+}
|
|
|
+
|
|
|
#ifdef HAVE_CG
|
|
|
/**
|
|
|
*
|
|
|
@@ -2364,9 +2373,15 @@ Shader(ShaderLanguage lang) :
|
|
|
_cg_fprofile = CG_PROFILE_UNKNOWN;
|
|
|
_cg_gprofile = CG_PROFILE_UNKNOWN;
|
|
|
if (_default_caps._ultimate_vprofile == 0 || _default_caps._ultimate_vprofile == CG_PROFILE_UNKNOWN) {
|
|
|
- _default_caps._active_vprofile = CG_PROFILE_GENERIC;
|
|
|
- _default_caps._active_fprofile = CG_PROFILE_GENERIC;
|
|
|
- _default_caps._active_gprofile = CG_PROFILE_GENERIC;
|
|
|
+ if (basic_shaders_only) {
|
|
|
+ _default_caps._active_vprofile = CG_PROFILE_ARBVP1;
|
|
|
+ _default_caps._active_fprofile = CG_PROFILE_ARBFP1;
|
|
|
+ _default_caps._active_gprofile = CG_PROFILE_UNKNOWN;
|
|
|
+ } else {
|
|
|
+ _default_caps._active_vprofile = CG_PROFILE_UNKNOWN;
|
|
|
+ _default_caps._active_fprofile = CG_PROFILE_UNKNOWN;
|
|
|
+ _default_caps._active_gprofile = CG_PROFILE_UNKNOWN;
|
|
|
+ }
|
|
|
_default_caps._ultimate_vprofile = cgGetProfile("glslv");
|
|
|
_default_caps._ultimate_fprofile = cgGetProfile("glslf");
|
|
|
_default_caps._ultimate_gprofile = cgGetProfile("glslg");
|