summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-06-21 11:29:15 -0700
committerEric Anholt <[email protected]>2010-06-24 17:23:21 -0700
commit0a1b54df7ac118722bb627c61cb322cb4e248ace (patch)
treec01794fe2833bbfa38a24e975d000ee00804271a /src/mesa
parent3d6012303c3ce24c75d209267e6914f706d025c5 (diff)
glsl2: Replace the GLSL compiler with the glsl2 project.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/Makefile19
-rw-r--r--src/mesa/drivers/dri/Makefile.template4
-rw-r--r--src/mesa/shader/ir_to_mesa.cpp1
-rw-r--r--src/mesa/shader/shader_api.c6
-rw-r--r--src/mesa/sources.mak21
5 files changed, 30 insertions, 21 deletions
diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index 4f81768924a..84ced279536 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -35,16 +35,24 @@ MESA_GALLIUM_OBJECTS := $(addprefix $(MESA_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS))
MESA_INCLUDES := $(INCLUDE_DIRS)
ES1_INCLUDES := -I$(TOP)/src/mapi/es1api $(INCLUDE_DIRS)
ES2_INCLUDES := -I$(TOP)/src/mapi/es2api $(INCLUDE_DIRS)
-
+MESA_INCLUDES := -I$(TOP)/src/glsl $(MESA_INCLUDES)
define mesa-cc-c
@mkdir -p $(dir $@)
$(CC) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_INCLUDES) $(CFLAGS)
endef
+define mesa-cxx-c
+ @mkdir -p $(dir $@)
+ $(CXX) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_INCLUDES) $(CXXFLAGS)
+endef
+
$(MESA_OBJ_DIR)/%.o: %.c
$(call mesa-cc-c,MESA)
+$(MESA_OBJ_DIR)/%.o: %.cpp
+ $(call mesa-cxx-c,MESA)
+
$(MESA_OBJ_DIR)/%.o: %.S
$(call mesa-cc-c,MESA)
@@ -63,7 +71,7 @@ $(ES2_OBJ_DIR)/%.o: %.S
# Default: build dependencies, then asm_subdirs, GLSL built-in lib,
# then convenience libs (.a) and finally the device drivers:
-default: $(DEPENDS) asm_subdirs glsl_builtin \
+default: $(DEPENDS) asm_subdirs \
$(MESA_LIBS) $(ES1_LIBS) $(ES2_LIBS) driver_subdirs
main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
@@ -114,12 +122,6 @@ asm_subdirs:
######################################################################
-# GLSL built-in library
-glsl_builtin:
- (cd shader/slang/library && $(MAKE)) || exit 1 ;
-
-
-######################################################################
# Dependency generation
depend: $(ALL_SOURCES)
@@ -234,7 +236,6 @@ clean: clean-es1 clean-es2
-rm -f depend depend.bak libmesa.a libmesagallium.a
-rm -f drivers/*/*.o
-rm -f *.pc
- -rm -f shader/slang/library/*_gc.h
-@cd drivers/dri && $(MAKE) clean
-@cd drivers/x11 && $(MAKE) clean
-@cd drivers/osmesa && $(MAKE) clean
diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template
index 8cb25439e48..35daacfacdc 100644
--- a/src/mesa/drivers/dri/Makefile.template
+++ b/src/mesa/drivers/dri/Makefile.template
@@ -54,9 +54,9 @@ lib: symlinks subdirs depend
$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) Makefile \
$(TOP)/src/mesa/drivers/dri/Makefile.template $(TOP)/src/mesa/drivers/dri/common/dri_test.o
- $(MKLIB) -o [email protected] -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
+ $(MKLIB) -o [email protected] -noprefix -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
$(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) $(DRI_LIB_DEPS)
- $(CC) $(CFLAGS) -o [email protected] $(TOP)/src/mesa/drivers/dri/common/dri_test.o [email protected] $(DRI_LIB_DEPS)
+ $(CXX) $(CFLAGS) -o [email protected] $(TOP)/src/mesa/drivers/dri/common/dri_test.o [email protected] $(DRI_LIB_DEPS)
diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp
index 26449c5a5c4..9fc1268e5ab 100644
--- a/src/mesa/shader/ir_to_mesa.cpp
+++ b/src/mesa/shader/ir_to_mesa.cpp
@@ -36,6 +36,7 @@
#include "glsl_types.h"
extern "C" {
+#include "main/mtypes.h"
#include "shader/prog_instruction.h"
#include "shader/prog_print.h"
}
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index c414e89825f..a584f6072c4 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -44,8 +44,6 @@
#include "shader/prog_uniform.h"
#include "shader/shader_api.h"
#include "shader/uniforms.h"
-#include "shader/slang/slang_compile.h"
-#include "shader/slang/slang_link.h"
/**
@@ -1100,7 +1098,7 @@ _mesa_compile_shader(GLcontext *ctx, GLuint shaderObj)
/* this call will set the sh->CompileStatus field to indicate if
* compilation was successful.
*/
- (void) _slang_compile(ctx, sh);
+ _mesa_glsl_compile_shader(ctx, sh);
}
@@ -1126,7 +1124,7 @@ _mesa_link_program(GLcontext *ctx, GLuint program)
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- _slang_link(ctx, program, shProg);
+ _mesa_glsl_link_shader(ctx, shProg);
/* debug code */
if (0) {
diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak
index ddd63cea0b4..117b3f3d2b9 100644
--- a/src/mesa/sources.mak
+++ b/src/mesa/sources.mak
@@ -250,6 +250,9 @@ SHADER_SOURCES = \
shader/shader_api.c \
shader/uniforms.c
+SHADER_CXX_SOURCES = \
+ shader/ir_to_mesa.cpp
+
SLANG_SOURCES = \
shader/slang/slang_builtin.c \
shader/slang/slang_codegen.c \
@@ -324,8 +327,10 @@ MESA_SOURCES = \
$(SWRAST_SOURCES) \
$(SWRAST_SETUP_SOURCES) \
$(COMMON_DRIVER_SOURCES)\
- $(ASM_C_SOURCES) \
- $(SLANG_SOURCES)
+ $(ASM_C_SOURCES)
+
+MESA_CXX_SOURCES = \
+ $(SHADER_CXX_SOURCES)
# Sources for building Gallium drivers
MESA_GALLIUM_SOURCES = \
@@ -335,12 +340,15 @@ MESA_GALLIUM_SOURCES = \
$(STATETRACKER_SOURCES) \
$(SHADER_SOURCES) \
ppc/common_ppc.c \
- x86/common_x86.c \
- $(SLANG_SOURCES)
+ x86/common_x86.c
+
+MESA_GALLIUM_CXX_SOURCES = \
+ $(SHADER_CXX_SOURCES)
# All the core C sources, for dependency checking
ALL_SOURCES = \
$(MESA_SOURCES) \
+ $(MESA_CXX_SOURCES) \
$(MESA_ASM_SOURCES) \
$(STATETRACKER_SOURCES)
@@ -349,10 +357,12 @@ ALL_SOURCES = \
MESA_OBJECTS = \
$(MESA_SOURCES:.c=.o) \
+ $(MESA_CXX_SOURCES:.cpp=.o) \
$(MESA_ASM_SOURCES:.S=.o)
MESA_GALLIUM_OBJECTS = \
$(MESA_GALLIUM_SOURCES:.c=.o) \
+ $(MESA_GALLIUM_CXX_SOURCES:.cpp=.o) \
$(MESA_ASM_SOURCES:.S=.o)
@@ -362,8 +372,7 @@ COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o)
### Other archives/libraries
GLSL_LIBS = \
- $(TOP)/src/glsl/pp/libglslpp.a \
- $(TOP)/src/glsl/cl/libglslcl.a
+ $(TOP)/src/glsl/libglsl.a
### Include directories