summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_compile.c
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2005-05-25 14:23:00 +0000
committerMichal Krol <[email protected]>2005-05-25 14:23:00 +0000
commitfc534034cc3403f3e597c49a0daa9965c07a0f72 (patch)
treeca8c23e87ff121b744bb9145e48bec16ed513c70 /src/mesa/shader/slang/slang_compile.c
parent1de60fe47f83b4397601b258c8587046085bca51 (diff)
more slang code
Diffstat (limited to 'src/mesa/shader/slang/slang_compile.c')
-rw-r--r--src/mesa/shader/slang/slang_compile.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 6835adea6d8..ed82712b20f 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -2093,7 +2093,6 @@ static int parse_function (slang_parse_ctx *C, int definition, slang_struct_scop
if (definition)
{
static int x = 0;
-const int y = 61; /* core 437 */
static
slang_assembly_file file;
slang_assembly_name_space space;
@@ -2104,16 +2103,16 @@ if (x == 1)
space.structs = structs;
space.vars = scope;
if (x == 1)
- xxx_first (&file);
-if (x == y)
- xxx_prolog (&file);
+xxx_first (&file);
+ (**parsed_func_ret).address = file.count;
if (!_slang_assemble_function (&file, *parsed_func_ret, &space))
{
slang_assembly_file_destruct (&file);
return 0;
}
-if (x == y)
-{
+if (slang_string_compare ("main", (**parsed_func_ret).header.name) == 0)
+{
+xxx_prolog (&file, (**parsed_func_ret).address);
_slang_execute (&file);
slang_assembly_file_destruct (&file);
exit (0);
@@ -2251,10 +2250,13 @@ static int compile_with_grammar (grammar id, const char *source, slang_translati
static const char *slang_shader_syn =
#include "library/slang_shader_syn.h"
;
-
+/*
static const byte slang_core_gc_bin[] = {
#include "library/slang_core_gc_bin.h"
-};
+};*/
+static const byte slang_core_gc[] = {
+#include "library/slang_core_gc.h"
+};
static const byte slang_common_builtin_gc_bin[] = {
#include "library/slang_common_builtin_gc_bin.h"
@@ -2267,7 +2269,7 @@ static const byte slang_fragment_builtin_gc_bin[] = {
static const byte slang_vertex_builtin_gc_bin[] = {
#include "library/slang_vertex_builtin_gc_bin.h"
};
-
+
int _slang_compile (const char *source, slang_translation_unit *unit, slang_unit_type type,
slang_info_log *log)
{
@@ -2298,8 +2300,10 @@ int _slang_compile (const char *source, slang_translation_unit *unit, slang_unit
/* if parsing user-specified shader, load built-in library */
if (type == slang_unit_fragment_shader || type == slang_unit_vertex_shader)
{
- if (!compile_binary (slang_core_gc_bin, builtin_units,
- slang_unit_fragment_builtin, log, NULL))
+ /*if (!compile_binary (slang_core_gc_bin, builtin_units,
+ slang_unit_fragment_builtin, log, NULL))*/
+ if (!compile_with_grammar (id, slang_core_gc, builtin_units, slang_unit_fragment_builtin,
+ log, NULL))
{
grammar_destroy (id);
return 0;
@@ -2314,7 +2318,7 @@ int _slang_compile (const char *source, slang_translation_unit *unit, slang_unit
if (type == slang_unit_fragment_shader)
{
if (!compile_binary (slang_fragment_builtin_gc_bin, builtin_units + 2,
- slang_unit_fragment_builtin, log, NULL))
+ slang_unit_fragment_builtin, log, NULL))
{
slang_translation_unit_destruct (builtin_units);
slang_translation_unit_destruct (builtin_units + 1);
@@ -2325,7 +2329,7 @@ int _slang_compile (const char *source, slang_translation_unit *unit, slang_unit
else if (type == slang_unit_vertex_shader)
{
if (!compile_binary (slang_vertex_builtin_gc_bin, builtin_units + 2,
- slang_unit_vertex_builtin, log, NULL))
+ slang_unit_vertex_builtin, log, NULL))
{
slang_translation_unit_destruct (builtin_units);
slang_translation_unit_destruct (builtin_units + 1);