mojoshader.c
changeset 458 b91904879798
parent 455 d99f47386d51
child 463 6f3a82d7e3d2
--- a/mojoshader.c	Fri Nov 07 19:32:24 2008 -0500
+++ b/mojoshader.c	Fri Nov 07 20:48:47 2008 -0500
@@ -7708,5 +7708,21 @@
     return MOJOSHADER_CHANGESET;
 } // MOJOSHADER_changeset
 
+
+int MOJOSHADER_maxShaderModel(const char *profile)
+{
+    #define PROFILE_SHADER_MODEL(p,v) if (strcmp(profile, p) == 0) return v;
+    PROFILE_SHADER_MODEL(MOJOSHADER_PROFILE_D3D, 3);
+    PROFILE_SHADER_MODEL(MOJOSHADER_PROFILE_PASSTHROUGH, 3);
+    PROFILE_SHADER_MODEL(MOJOSHADER_PROFILE_GLSL, 3);
+    PROFILE_SHADER_MODEL(MOJOSHADER_PROFILE_GLSL120, 3);
+    PROFILE_SHADER_MODEL(MOJOSHADER_PROFILE_ARB1, 2);
+    PROFILE_SHADER_MODEL(MOJOSHADER_PROFILE_NV2, 2);
+    PROFILE_SHADER_MODEL(MOJOSHADER_PROFILE_NV3, 2);
+    PROFILE_SHADER_MODEL(MOJOSHADER_PROFILE_NV4, 3);
+    #undef PROFILE_SHADER_MODEL
+    return -1;  // unknown profile?
+} // MOJOSHADER_maxShaderModel
+
 // end of mojoshader.c ...