implement info log; parse #version directive

This commit is contained in:
Michal Krol
2005-04-15 10:23:10 +00:00
parent 65ce50897e
commit e3a846b0e3
3 changed files with 403 additions and 178 deletions

View File

@@ -550,6 +550,7 @@ _shader_Compile (struct gl2_shader_intf **intf)
#else
slang_translation_unit unit;
slang_unit_type type;
slang_info_log info_log;
#endif
impl->_obj.compile_status = GL_FALSE;
@@ -625,14 +626,16 @@ _shader_Compile (struct gl2_shader_intf **intf)
type = slang_unit_fragment_shader;
else
type = slang_unit_vertex_shader;
if (_slang_compile (impl->_obj.source, &unit, type))
slang_info_log_construct (&info_log);
if (_slang_compile (impl->_obj.source, &unit, type, &info_log))
{
impl->_obj.compile_status = GL_TRUE;
}
else
{
impl->_obj._generic.info_log = _mesa_strdup ("error: invalid translation unit");
impl->_obj._generic.info_log = _mesa_strdup (info_log.text);
}
slang_info_log_destruct (&info_log);
#endif
}

File diff suppressed because it is too large Load Diff

View File

@@ -225,7 +225,19 @@ typedef struct slang_translation_unit_
slang_unit_type type;
} slang_translation_unit;
int _slang_compile (const char *, slang_translation_unit *, slang_unit_type type);
typedef struct slang_info_log_
{
char *text;
int dont_free_text;
} slang_info_log;
void slang_info_log_construct (slang_info_log *);
void slang_info_log_destruct (slang_info_log *);
int slang_info_log_error (slang_info_log *, const char *, ...);
int slang_info_log_warning (slang_info_log *, const char *, ...);
void slang_info_log_memory (slang_info_log *);
int _slang_compile (const char *, slang_translation_unit *, slang_unit_type type, slang_info_log *);
#ifdef __cplusplus
}