Browse Source

Add a version check for 1502 and use the latest profile for now.

aignacio_sf 19 years ago
parent
commit
73b5c5ce6f
1 changed files with 7 additions and 2 deletions
  1. 7 2
      panda/src/dxgsg9/dxShaderContext9.cxx

+ 7 - 2
panda/src/dxgsg9/dxShaderContext9.cxx

@@ -117,8 +117,8 @@ CLP(ShaderContext)(ShaderExpansion *s, GSG *gsg) : ShaderContext(s) {
     }
     }
 
 
     // Parse any directives in the source.
     // Parse any directives in the source.
-    // IGNORE SPECIFIC PROFILES IN DX
-    if (!false) {
+    // IGNORE SPECIFIC PROFILES IN DX FOR NOW
+    if (false) {
       string directive;
       string directive;
       while (!s->parse_eof()) {
       while (!s->parse_eof()) {
         s->parse_line(directive, true, true);
         s->parse_line(directive, true, true);
@@ -256,8 +256,13 @@ parse_cg_profile(const string &id, bool vertex)
   CGprofile fprofiles[] = { CG_PROFILE_ARBFP1, CG_PROFILE_FP20, CG_PROFILE_FP30, CG_PROFILE_FP40, CG_PROFILE_UNKNOWN };
   CGprofile fprofiles[] = { CG_PROFILE_ARBFP1, CG_PROFILE_FP20, CG_PROFILE_FP30, CG_PROFILE_FP40, CG_PROFILE_UNKNOWN };
 
 
   // near equivalent DX profiles
   // near equivalent DX profiles
+#if (CG_VERSION_NUM >= 1502)
   CGprofile dx_vprofiles[] = { CG_PROFILE_VS_2_0, CG_PROFILE_VS_1_1, CG_PROFILE_VS_2_X, CG_PROFILE_VS_3_0, CG_PROFILE_UNKNOWN };
   CGprofile dx_vprofiles[] = { CG_PROFILE_VS_2_0, CG_PROFILE_VS_1_1, CG_PROFILE_VS_2_X, CG_PROFILE_VS_3_0, CG_PROFILE_UNKNOWN };
   CGprofile dx_fprofiles[] = { CG_PROFILE_PS_2_0, CG_PROFILE_PS_1_1, CG_PROFILE_PS_2_X, CG_PROFILE_PS_3_0, CG_PROFILE_UNKNOWN };
   CGprofile dx_fprofiles[] = { CG_PROFILE_PS_2_0, CG_PROFILE_PS_1_1, CG_PROFILE_PS_2_X, CG_PROFILE_PS_3_0, CG_PROFILE_UNKNOWN };
+#else
+  CGprofile dx_vprofiles[] = { CG_PROFILE_VS_2_0, CG_PROFILE_VS_1_1, CG_PROFILE_VS_2_X, CG_PROFILE_VS_2_X, CG_PROFILE_UNKNOWN };
+  CGprofile dx_fprofiles[] = { CG_PROFILE_PS_2_0, CG_PROFILE_PS_1_1, CG_PROFILE_PS_2_X, CG_PROFILE_PS_2_X, CG_PROFILE_UNKNOWN };
+#endif
 
 
   if (vertex) {
   if (vertex) {
     while (vprofiles[i] != CG_PROFILE_UNKNOWN) {
     while (vprofiles[i] != CG_PROFILE_UNKNOWN) {