From: <re...@us...> - 2009-12-31 17:31:43
|
Revision: 33455 http://crystal.svn.sourceforge.net/crystal/?rev=33455&view=rev Author: res2002 Date: 2009-12-31 17:31:34 +0000 (Thu, 31 Dec 2009) Log Message: ----------- Add option to force Cg using the best profile available (useful if programs for lower profiles have been cached, but are undesired) Modified Paths: -------------- CS/trunk/data/config-plugins/shadermgr.cfg CS/trunk/plugins/video/render3d/shader/shaderplugins/glshader_cg/glshader_cg.cpp Modified: CS/trunk/data/config-plugins/shadermgr.cfg =================================================================== --- CS/trunk/data/config-plugins/shadermgr.cfg 2009-12-31 17:24:38 UTC (rev 33454) +++ CS/trunk/data/config-plugins/shadermgr.cfg 2009-12-31 17:31:34 UTC (rev 33455) @@ -26,6 +26,10 @@ ; Cg compiler options for specific profiles ;Video.OpenGL.Shader.Cg.CompilerOptions.Vertex.arbvp1 = +; Force using the best profile Cg can support on the current hardware. +; Specifically, any cached programs for lower profiles will be disregarded. +;Video.OpenGL.Shader.Cg.ForceBestProfile = true + ; "Coercion library" for the Cg combiner. The library contains Cg snippets ; for coercions between different data types. Usually, the best idea is to ; just stick to the default coercions... Modified: CS/trunk/plugins/video/render3d/shader/shaderplugins/glshader_cg/glshader_cg.cpp =================================================================== --- CS/trunk/plugins/video/render3d/shader/shaderplugins/glshader_cg/glshader_cg.cpp 2009-12-31 17:24:38 UTC (rev 33454) +++ CS/trunk/plugins/video/render3d/shader/shaderplugins/glshader_cg/glshader_cg.cpp 2009-12-31 17:31:34 UTC (rev 33455) @@ -454,6 +454,9 @@ enableVP = config->GetBool ("Video.OpenGL.Shader.Cg.Enable.Vertex", true); enableFP = config->GetBool ("Video.OpenGL.Shader.Cg.Enable.Fragment", true); + bool forceBestProfile = + config->GetBool ("Video.OpenGL.Shader.Cg.ForceBestProfile", false); + strictMatchVP = false; if (enableVP) { @@ -507,6 +510,7 @@ ProfileLimits limits (vendor, profile); limits.GetCurrentLimits (ext); currentLimits.vp = limits; + strictMatchVP = forceBestProfile; } enableVP = currentLimits.vp.profile != CG_PROFILE_UNKNOWN; if (doVerbose) @@ -572,6 +576,7 @@ cgGLGetLatestProfile (CG_GL_FRAGMENT)); limits.GetCurrentLimits (ext); currentLimits.fp = limits; + strictMatchFP = forceBestProfile; } } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |