hook to _slang_compile()
authorMichal Krol <mjkrol@gmail.org>
Thu, 14 Apr 2005 10:31:36 +0000 (10:31 +0000)
committerMichal Krol <mjkrol@gmail.org>
Thu, 14 Apr 2005 10:31:36 +0000 (10:31 +0000)
src/mesa/shader/shaderobjects_3dlabs.c

index 203a006..e223977 100755 (executable)
@@ -41,6 +41,8 @@
 #if USE_3DLABS_FRONTEND\r
 #include "slang_mesa.h"\r
 #include "Public/ShaderLang.h"\r
+#else\r
+#include "slang_compile.h"\r
 #endif\r
 \r
 struct gl2_unknown_obj\r
@@ -545,6 +547,9 @@ _shader_Compile (struct gl2_shader_intf **intf)
 #if USE_3DLABS_FRONTEND\r
        char **strings;\r
        TBuiltInResource res;\r
+#else\r
+       slang_translation_unit unit;\r
+       slang_unit_type type;\r
 #endif\r
 \r
        impl->_obj.compile_status = GL_FALSE;\r
@@ -615,6 +620,19 @@ _shader_Compile (struct gl2_shader_intf **intf)
 \r
        impl->_obj._generic.info_log = _mesa_strdup (ShGetInfoLog (\r
                impl->_obj._3dlabs_shhandle._obj.handle));\r
+#else\r
+       if (impl->_vftbl->GetSubType (intf) == GL_FRAGMENT_SHADER)\r
+               type = slang_unit_fragment_shader;\r
+       else\r
+               type = slang_unit_vertex_shader;\r
+       if (_slang_compile (impl->_obj.source, &unit, type))\r
+       {\r
+               impl->_obj.compile_status = GL_TRUE;\r
+       }\r
+       else\r
+       {\r
+               impl->_obj._generic.info_log = _mesa_strdup ("error: invalid translation unit");\r
+       }\r
 #endif\r
 }\r
 \r