mojoshader_opengl.c
branchtrunk
changeset 421 bfd3d95273ec
parent 420 bfcebc3bf560
child 422 1d5eaf3a4c98
--- a/mojoshader_opengl.c	Thu Jul 03 12:08:40 2008 -0400
+++ b/mojoshader_opengl.c	Thu Jul 03 12:09:26 2008 -0400
@@ -141,6 +141,7 @@
     int have_GL_ARB_fragment_program:1;
     int have_GL_NV_vertex_program2_option:1;
     int have_GL_NV_fragment_program2:1;
+    int have_GL_NV_vertex_program3:1;
     int have_GL_ARB_shader_objects:1;
     int have_GL_ARB_vertex_shader:1;
     int have_GL_ARB_fragment_shader:1;
@@ -694,6 +695,7 @@
     ctx->have_GL_ARB_fragment_program = 1;
     ctx->have_GL_NV_vertex_program2_option = 1;
     ctx->have_GL_NV_fragment_program2 = 1;
+    ctx->have_GL_NV_vertex_program3 = 1;
     ctx->have_GL_ARB_shader_objects = 1;
     ctx->have_GL_ARB_vertex_shader = 1;
     ctx->have_GL_ARB_fragment_shader = 1;
@@ -724,6 +726,7 @@
     VERIFY_EXT(GL_ARB_shading_language_100, 2, 0);
     VERIFY_EXT(GL_NV_vertex_program2_option, -1, -1);
     VERIFY_EXT(GL_NV_fragment_program2, -1, -1);
+    VERIFY_EXT(GL_NV_vertex_program3, -1, -1);
     VERIFY_EXT(GL_NV_half_float, -1, -1);
 
     #undef VERIFY_EXT
@@ -758,6 +761,14 @@
         MUST_HAVE(MOJOSHADER_PROFILE_NV2, GL_NV_vertex_program2_option);
         MUST_HAVE(MOJOSHADER_PROFILE_NV2, GL_NV_fragment_program2);
     } // else if
+
+    else if (strcmp(profile, MOJOSHADER_PROFILE_NV3) == 0)
+    {
+        MUST_HAVE(MOJOSHADER_PROFILE_NV3, GL_ARB_vertex_program);
+        MUST_HAVE(MOJOSHADER_PROFILE_NV3, GL_ARB_fragment_program);
+        MUST_HAVE(MOJOSHADER_PROFILE_NV3, GL_NV_vertex_program3);
+        MUST_HAVE(MOJOSHADER_PROFILE_NV3, GL_NV_fragment_program2);
+    } // else if
     #endif
 
     #if SUPPORT_PROFILE_GLSL
@@ -808,6 +819,7 @@
         static const char *priority[] = {
             MOJOSHADER_PROFILE_GLSL120,
             MOJOSHADER_PROFILE_GLSL,
+            MOJOSHADER_PROFILE_NV3,
             MOJOSHADER_PROFILE_NV2,
             MOJOSHADER_PROFILE_ARB1,
         };
@@ -889,7 +901,8 @@
 
 #if SUPPORT_PROFILE_ARB1
     else if ( (strcmp(profile, MOJOSHADER_PROFILE_ARB1) == 0) ||
-              (strcmp(profile, MOJOSHADER_PROFILE_NV2) == 0) )
+              (strcmp(profile, MOJOSHADER_PROFILE_NV2) == 0) ||
+              (strcmp(profile, MOJOSHADER_PROFILE_NV3) == 0) )
     {
         ctx->profileMaxUniforms = impl_ARB1_MaxUniforms;
         ctx->profileCompileShader = impl_ARB1_CompileShader;