summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichal Krol <mjkrol@gmail.org>2005-04-14 10:31:36 +0000
committerMichal Krol <mjkrol@gmail.org>2005-04-14 10:31:36 +0000
commit99b329ca13f92bc723c3e67d35a974adac235323 (patch)
tree5af105dd8a1a36bb75a59b1dd32a7d0e101dd075 /src
parented5f790919da3ca982a0c3d2f0c705093ed6163f (diff)
downloadexternal_mesa3d-99b329ca13f92bc723c3e67d35a974adac235323.zip
external_mesa3d-99b329ca13f92bc723c3e67d35a974adac235323.tar.gz
external_mesa3d-99b329ca13f92bc723c3e67d35a974adac235323.tar.bz2
hook to _slang_compile()
Diffstat (limited to 'src')
-rwxr-xr-xsrc/mesa/shader/shaderobjects_3dlabs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/shader/shaderobjects_3dlabs.c b/src/mesa/shader/shaderobjects_3dlabs.c
index 203a006..e223977 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
}