2
0
rdb 13 жил өмнө
parent
commit
1b76a13784

+ 2 - 2
panda/src/display/graphicsStateGuardian.h

@@ -75,14 +75,14 @@ public:
 
 
 PUBLISHED:
 PUBLISHED:
 
 
-  enum ShaderModel
-  {
+  enum ShaderModel {
     SM_00,
     SM_00,
     SM_11,
     SM_11,
     SM_20,
     SM_20,
     SM_2X,
     SM_2X,
     SM_30,
     SM_30,
     SM_40,
     SM_40,
+    SM_50,
   };
   };
 
 
   INLINE void release_all();
   INLINE void release_all();

+ 6 - 3
panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx

@@ -2352,9 +2352,12 @@ reset() {
       _shader_model = SM_30;
       _shader_model = SM_30;
       break;
       break;
     case 4:
     case 4:
-    default:
       _shader_model = SM_40;
       _shader_model = SM_40;
       break;
       break;
+    case 5:
+    default:
+      _shader_model = SM_50;
+      break;
   }
   }
 
 
   _auto_detect_shader_model = _shader_model;
   _auto_detect_shader_model = _shader_model;
@@ -2382,8 +2385,8 @@ reset() {
     CGprofile vertex_profile;
     CGprofile vertex_profile;
     CGprofile pixel_profile;
     CGprofile pixel_profile;
     
     
-    vertex_profile = cgD3D9GetLatestVertexProfile( );
-    pixel_profile = cgD3D9GetLatestPixelProfile( );
+    vertex_profile = cgD3D9GetLatestVertexProfile();
+    pixel_profile = cgD3D9GetLatestPixelProfile();
     
     
     const char *vertex_profile_str =
     const char *vertex_profile_str =
       cgGetProfileString(vertex_profile);
       cgGetProfileString(vertex_profile);

+ 24 - 18
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -1714,38 +1714,44 @@ reset() {
   report_my_gl_errors();
   report_my_gl_errors();
 
 
   void gl_set_stencil_functions (StencilRenderStates *stencil_render_states);
   void gl_set_stencil_functions (StencilRenderStates *stencil_render_states);
-  gl_set_stencil_functions (_stencil_render_states);
+  gl_set_stencil_functions(_stencil_render_states);
 
 
 #if defined(HAVE_CG) && !defined(OPENGLES)
 #if defined(HAVE_CG) && !defined(OPENGLES)
 
 
-  typedef struct
-  {
+  typedef struct {
     CGprofile cg_profile;
     CGprofile cg_profile;
     int shader_model;
     int shader_model;
-  }
-  CG_PROFILE_TO_SHADER_MODEL;
+  } CG_PROFILE_TO_SHADER_MODEL;
+
+  static CG_PROFILE_TO_SHADER_MODEL cg_profile_to_shader_model_array[] = {
+    // gp5fp - OpenGL fragment profile for GeForce 400 Series and up
+    CG_PROFILE_GP5FP,
+    SM_50,
+
+    // gp4fp - OpenGL fragment profile for G8x (GeForce 8xxx and up)
+    CG_PROFILE_GP4FP,
+    SM_40,
 
 
-  static CG_PROFILE_TO_SHADER_MODEL cg_profile_to_shader_model_array [ ] = {
     // fp40 - OpenGL fragment profile for NV4x (GeForce 6xxx and 7xxx
     // fp40 - OpenGL fragment profile for NV4x (GeForce 6xxx and 7xxx
     // Series, NV4x-based Quadro FX, etc.)
     // Series, NV4x-based Quadro FX, etc.)
     CG_PROFILE_FP40,
     CG_PROFILE_FP40,
     SM_30,
     SM_30,
-    
+
     // fp30 - OpenGL fragment profile for NV3x (GeForce FX, Quadro FX, etc.)
     // fp30 - OpenGL fragment profile for NV3x (GeForce FX, Quadro FX, etc.)
     CG_PROFILE_FP30,
     CG_PROFILE_FP30,
     SM_2X,
     SM_2X,
-    
+
     // This OpenGL profile corresponds to the per-fragment
     // This OpenGL profile corresponds to the per-fragment
     // functionality introduced by GeForce FX and other DirectX 9
     // functionality introduced by GeForce FX and other DirectX 9
     // GPUs.
     // GPUs.
     CG_PROFILE_ARBFP1,
     CG_PROFILE_ARBFP1,
     SM_20,
     SM_20,
-    
+
     // fp20 - OpenGL fragment profile for NV2x (GeForce3, GeForce4 Ti,
     // fp20 - OpenGL fragment profile for NV2x (GeForce3, GeForce4 Ti,
     // Quadro DCC, etc.)
     // Quadro DCC, etc.)
     CG_PROFILE_FP20,
     CG_PROFILE_FP20,
     SM_11,
     SM_11,
-    
+
     // no shader support
     // no shader support
     CG_PROFILE_UNKNOWN,
     CG_PROFILE_UNKNOWN,
     SM_00,
     SM_00,
@@ -1756,9 +1762,9 @@ reset() {
 
 
   index = 0;
   index = 0;
   cg_profile_to_shader_model = cg_profile_to_shader_model_array;
   cg_profile_to_shader_model = cg_profile_to_shader_model_array;
-  while (cg_profile_to_shader_model -> shader_model != SM_00) {
-    if (cgGLIsProfileSupported(cg_profile_to_shader_model -> cg_profile)) {
-      _shader_model = cg_profile_to_shader_model -> shader_model;
+  while (cg_profile_to_shader_model->shader_model != SM_00) {
+    if (cgGLIsProfileSupported(cg_profile_to_shader_model->cg_profile)) {
+      _shader_model = cg_profile_to_shader_model->shader_model;
       break;
       break;
     }
     }
     cg_profile_to_shader_model++;
     cg_profile_to_shader_model++;
@@ -1769,16 +1775,16 @@ reset() {
     GraphicsPipe *pipe;
     GraphicsPipe *pipe;
     DisplayInformation *display_information;
     DisplayInformation *display_information;
     
     
-    pipe = this -> get_pipe ( );
+    pipe = this->get_pipe();
     if (pipe) {
     if (pipe) {
-      display_information = pipe -> get_display_information ( );
+      display_information = pipe->get_display_information ();
       if (display_information) {
       if (display_information) {
-        if (display_information -> get_shader_model ( ) > _shader_model) {
-          _shader_model = display_information -> get_shader_model ( );
+        if (display_information->get_shader_model() > _shader_model) {
+          _shader_model = display_information->get_shader_model();
         }
         }
       }
       }
     }
     }
-  }  
+  }
   _auto_detect_shader_model = _shader_model;
   _auto_detect_shader_model = _shader_model;
 
 
   CGprofile vertex_profile;
   CGprofile vertex_profile;