From: Michal Krol Date: Thu, 14 Apr 2005 10:31:36 +0000 (+0000) Subject: hook to _slang_compile() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=99b329ca13f92bc723c3e67d35a974adac235323;p=mesa.git hook to _slang_compile() --- diff --git a/src/mesa/shader/shaderobjects_3dlabs.c b/src/mesa/shader/shaderobjects_3dlabs.c index 203a006f502..e2239773ff2 100755 --- a/src/mesa/shader/shaderobjects_3dlabs.c +++ b/src/mesa/shader/shaderobjects_3dlabs.c @@ -41,6 +41,8 @@ #if USE_3DLABS_FRONTEND #include "slang_mesa.h" #include "Public/ShaderLang.h" +#else +#include "slang_compile.h" #endif struct gl2_unknown_obj @@ -545,6 +547,9 @@ _shader_Compile (struct gl2_shader_intf **intf) #if USE_3DLABS_FRONTEND char **strings; TBuiltInResource res; +#else + slang_translation_unit unit; + slang_unit_type type; #endif impl->_obj.compile_status = GL_FALSE; @@ -615,6 +620,19 @@ _shader_Compile (struct gl2_shader_intf **intf) impl->_obj._generic.info_log = _mesa_strdup (ShGetInfoLog ( impl->_obj._3dlabs_shhandle._obj.handle)); +#else + if (impl->_vftbl->GetSubType (intf) == GL_FRAGMENT_SHADER) + type = slang_unit_fragment_shader; + else + type = slang_unit_vertex_shader; + if (_slang_compile (impl->_obj.source, &unit, type)) + { + impl->_obj.compile_status = GL_TRUE; + } + else + { + impl->_obj._generic.info_log = _mesa_strdup ("error: invalid translation unit"); + } #endif }