Commit 296adbd5 authored by Chia-I Wu's avatar Chia-I Wu

glapi: Move to src/mapi/.

Move glapi to src/mapi/{glapi,es1api,es2api}.
parent 73ded062
......@@ -52,7 +52,7 @@ GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
SRC_DIRS = glsl glx/apple mesa gallium glu glut/glx glew
SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa gallium glu glut/glx glew
GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri
......
......@@ -86,7 +86,8 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2
# Directories to build
LIB_DIR = lib
SRC_DIRS = glsl mesa gallium egl gallium/winsys gallium/targets glu glut/glx glew glw
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium egl gallium/winsys gallium/targets glu glut/glx glew glw
GLU_DIRS = sgi
DRIVER_DIRS = x11 osmesa
# Which subdirs under $(TOP)/progs/ to enter:
......
......@@ -37,7 +37,8 @@ CXXFLAGS = $(COMMON_C_CPP_FLAGS)
# Omitting glw here:
SRC_DIRS = glsl mesa gallium gallium/winsys gallium/targets glu glut/glx glew
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium gallium/winsys gallium/targets glu glut/glx glew
# Build no traditional Mesa drivers:
DRIVER_DIRS =
......
......@@ -6,7 +6,8 @@ CONFIG_NAME = linux-opengl-es
# Directories to build
LIB_DIR = lib
SRC_DIRS = egl glsl mesa/es gallium gallium/winsys gallium/targets
SRC_DIRS = egl glsl mapi/es1api mapi/es2api mesa/es \
gallium gallium/winsys gallium/targets
PROGRAM_DIRS = egl/eglut egl/opengles1 egl/opengles2
# egl st needs this
......
......@@ -463,7 +463,7 @@ dnl Driver specific build directories
dnl
dnl this variable will be prepended to SRC_DIRS and is not exported
CORE_DIRS="glsl mesa"
CORE_DIRS="mapi/glapi glsl mesa"
SRC_DIRS="glew"
GLU_DIRS="sgi"
......@@ -763,6 +763,7 @@ if test "x$enable_gles2" = xyes; then
APIS="$APIS es2"
fi
if test "x$enable_gles1" = xyes -o "x$enable_gles2" = xyes; then
CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
SRC_DIRS="$SRC_DIRS gles"
fi
AC_SUBST([API_DEFINES])
......@@ -1308,6 +1309,9 @@ yes)
HAVE_ST_XORG="yes"
;;
es)
if test "x$enable_gles1" != xyes -a "x$enable_gles2" != xyes; then
CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
fi
# mesa/es is required to build es state tracker
CORE_DIRS="$CORE_DIRS mesa/es"
;;
......
Import('*')
SConscript('glsl/SConscript')
SConscript('mapi/glapi/SConscript')
if 'mesa' in env['statetrackers']:
SConscript('mesa/SConscript')
......
......@@ -11,9 +11,9 @@ INCLUDE_DIRS = \
$(shell pkg-config --cflags-only-I libdrm) \
-I$(TOP)/include \
-I$(TOP)/include/GL/internal \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mesa \
-I$(TOP)/src/mesa/main \
-I$(TOP)/src/mesa/glapi \
-I$(TOP)/src/mesa/math \
-I$(TOP)/src/mesa/transform \
-I$(TOP)/src/mesa/shader \
......
......@@ -9,7 +9,7 @@ EGL_SOURCES = egl_dri2.c
EGL_INCLUDES = \
-I$(TOP)/include \
-I$(TOP)/src/egl/main \
-I$(TOP)/src/mesa \
-I$(TOP)/src/mapi \
-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
$(EGL_DRI2_CFLAGS)
......
......@@ -5,6 +5,7 @@ LIBNAME = dridrm
LIBRARY_INCLUDES = \
-I$(TOP)/include \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mesa \
-I$(TOP)/src/gallium/state_trackers/dri/common \
-I$(TOP)/src/mesa/drivers/dri/common \
......
......@@ -10,6 +10,7 @@ if env['dri']:
env.ParseConfig('pkg-config --cflags --libs libdrm')
env.Append(CPPPATH = [
'#/src/mapi',
'#/src/mesa',
'#/src/gallium/state_trackers/dri/common',
'#/src/mesa/drivers/dri/common',
......
......@@ -8,6 +8,7 @@ LIBRARY_DEFINES = -D__NOT_HAVE_DRM_H
LIBRARY_INCLUDES = \
-I../dri \
-I$(TOP)/include \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mesa \
-I$(TOP)/src/gallium/state_trackers/dri/common \
-I$(TOP)/src/mesa/drivers/dri/common \
......
......@@ -8,6 +8,7 @@ if env['dri']:
env = env.Clone()
env.Append(CPPPATH = [
'#/src/mapi',
'#/src/mesa',
'#/src/gallium/state_trackers/dri/common',
'#/src/mesa/drivers/dri/common',
......
......@@ -15,6 +15,7 @@ common_OBJECTS = $(common_SOURCES:.c=.o)
x11_INCLUDES = \
-I$(TOP)/src/gallium/drivers \
-I$(TOP)/src/glx \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mesa \
$(X11_CFLAGS) \
$(shell pkg-config --cflags-only-I libdrm)
......
......@@ -30,17 +30,18 @@ ES2_OBJECTS = st_es2.o
ES1_LIBS = \
$(TOP)/src/mesa/es/libes1gallium.a \
$(TOP)/src/mesa/es/libes1api.a
$(TOP)/src/mapi/es1api/libes1api.a
ES2_LIBS = \
$(TOP)/src/mesa/es/libes2gallium.a \
$(TOP)/src/mesa/es/libes2api.a
$(TOP)/src/mapi/es2api/libes2api.a
SYS_LIBS = -lm -pthread
INCLUDE_DIRS = \
-I$(TOP)/include \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mesa \
-I$(TOP)/src/gallium/include
......
......@@ -5,6 +5,7 @@ LIBNAME = xlib
LIBRARY_INCLUDES = \
-I$(TOP)/include \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mesa \
$(X11_CFLAGS)
......
......@@ -9,6 +9,7 @@ if env['platform'] == 'linux' \
env = env.Clone()
env.Append(CPPPATH = [
'#/src/mapi',
'#/src/mesa',
'#/src/mesa/main',
])
......
......@@ -42,13 +42,13 @@ SHARED_INCLUDES = \
-Iserver \
-I$(TOP)/include \
-I$(TOP)/include/GL/internal \
-I$(TOP)/src/mapi \
-I$(TOP)/src/gallium/include \
-I$(TOP)/src/gallium/auxiliary \
-I$(TOP)/src/gallium/drivers \
-I$(TOP)/src/gallium/winsys \
-I$(TOP)/src/mesa \
-I$(TOP)/src/mesa/main \
-I$(TOP)/src/mesa/glapi \
-I$(TOP)/src/mesa/math \
-I$(TOP)/src/mesa/transform \
-I$(TOP)/src/mesa/shader \
......
......@@ -9,6 +9,7 @@ drienv.Replace(CPPPATH = [
'#src/mesa/drivers/dri/common',
'#include',
'#include/GL/internal',
'#src/mapi',
'#src/gallium/include',
'#src/gallium/auxiliary',
'#src/gallium/drivers',
......
......@@ -15,6 +15,7 @@ GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
INCLUDE_DIRS = \
-I$(TOP)/include \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mesa \
-I$(TOP)/src/mesa/main \
-I$(TOP)/src/gallium/include \
......@@ -42,7 +43,7 @@ LIBS = \
$(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/drivers/identity/libidentity.a \
$(TOP)/src/mesa/libglapi.a \
$(TOP)/src/mapi/glapi/libglapi.a \
$(TOP)/src/mesa/libmesagallium.a \
$(GALLIUM_AUXILIARIES) \
$(CELL_SPU_LIB) \
......
......@@ -17,6 +17,7 @@ if env['dri']:
env = env.Clone()
env.Append(CPPPATH = [
'#/src/mapi',
'#/src/mesa',
'#/src/mesa/main',
'#src/gallium/state_trackers/glx/xlib',
......
......@@ -38,7 +38,7 @@ LIBS = \
$(TOP)/src/gallium/drivers/i965/libi965.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/state_trackers/glx/xlib/libxlib.a \
$(TOP)/src/mesa/libglapi.a \
$(TOP)/src/mapi/glapi/libglapi.a \
$(TOP)/src/mesa/libmesagallium.a \
$(GALLIUM_AUXILIARIES)
......
TOP = ../..
MESA = $(TOP)/src/mesa
MAPI = $(TOP)/src/mapi
include $(TOP)/configs/current
include $(MESA)/sources.mak
GLESv1_CM_ASM := $(addprefix $(MESA)/es/glapi/glapi-es1/,$(GLAPI_ASM_SOURCES))
GLESv2_ASM := $(addprefix $(MESA)/es/glapi/glapi-es2/,$(GLAPI_ASM_SOURCES))
API_SOURCES := $(addprefix $(MESA)/,$(GLAPI_SOURCES))
include $(MAPI)/glapi/sources.mak
GLESv1_CM_ASM := $(addprefix $(MAPI)/es1api/glapi/,$(GLAPI_ASM_SOURCES))
GLESv2_ASM := $(addprefix $(MAPI)/es2api/glapi/,$(GLAPI_ASM_SOURCES))
API_SOURCES := $(addprefix $(MAPI)/glapi/,$(GLAPI_SOURCES))
$(TOP)/$(LIB_DIR)/$(GLESv1_CM_LIB_NAME) : PREFIX = es1
$(TOP)/$(LIB_DIR)/$(GLESv1_CM_LIB_NAME) : NAME = GLESv1_CM
......@@ -13,7 +13,7 @@ $(TOP)/$(LIB_DIR)/$(GLESv1_CM_LIB_NAME) : NAME = GLESv1_CM
$(TOP)/$(LIB_DIR)/$(GLESv2_LIB_NAME) : PREFIX = es2
$(TOP)/$(LIB_DIR)/$(GLESv2_LIB_NAME) : NAME = GLESv2
INCLUDES = -I$(TOP)/include -I$(MESA)/es/glapi/glapi-$(PREFIX) -I$(MESA)
INCLUDES = -I$(TOP)/include -I$(MAPI)/$(PREFIX)api -I$(MAPI) -I$(TOP)/src/mesa
OBJECTS = \
$(notdir $(GLAPI_ASM_SOURCES:%.S=%.o)) \
......@@ -24,12 +24,12 @@ GLESv2_OBJECTS = $(addprefix es2-,$(OBJECTS))
es1-%.o: $(dir $(GLESv1_CM_ASM))%.S
$(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $<
es1-%.o: $(MESA)/glapi/%.c
es1-%.o: $(MAPI)/glapi/%.c
$(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $<
es2-%.o: $(dir $(GLESv2_ASM))%.S
$(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $<
es2-%.o: $(MESA)/glapi/%.c
es2-%.o: $(MAPI)/glapi/%.c
$(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $<
default: depend \
......
......@@ -39,7 +39,7 @@ SOURCES = \
dri2_glx.c \
dri2.c
GLAPI_LIB = $(TOP)/src/mesa/libglapi.a
GLAPI_LIB = $(TOP)/src/mapi/glapi/libglapi.a
OBJECTS = $(SOURCES:.c=.o)
......@@ -47,7 +47,8 @@ INCLUDES = -I. \
-I$(TOP)/include \
-I$(TOP)/include/GL/internal \
-I$(TOP)/src/mesa \
-I$(TOP)/src/mesa/glapi \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mapi/glapi \
$(LIBDRM_CFLAGS) \
$(DRI2PROTO_CFLAGS) \
$(X11_INCLUDES)
......@@ -73,7 +74,7 @@ $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) $(GLAPI_LIB) Makefile
$(GL_LIB_DEPS) $(OBJECTS) $(GLAPI_LIB)
$(GLAPI_LIB):
@$(MAKE) -C $(TOP)/src/mesa libglapi.a
@$(MAKE) -C $(TOP)/src/mapi/glapi
depend: $(SOURCES) Makefile
rm -f depend
......
# src/mapi/es1api/Makefile
TOP := ../../..
include $(TOP)/configs/current
# this Makefile can build both libes1api.a and libes2api.a
ifeq ($(ES),)
ES := es1
endif
ESAPI = $(ES)api
GLAPI := ../glapi
include $(GLAPI)/sources.mak
ESAPI_SOURCES := $(addprefix $(GLAPI)/, $(GLAPI_SOURCES))
ESAPI_OBJECTS := $(GLAPI_SOURCES:.c=.o)
ESAPI_ASM_SOURCES := $(addprefix glapi/, $(GLAPI_ASM_SOURCES))
ESAPI_ASM_OBJECTS := $(GLAPI_ASM_SOURCES:.S=.o)
INCLUDE_DIRS = \
-I$(TOP)/include \
-I$(TOP)/src/mapi/$(ESAPI) \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mesa
.PHONY: default
default: depend lib$(ESAPI).a
lib$(ESAPI).a: $(ESAPI_OBJECTS) $(ESAPI_ASM_OBJECTS)
@$(MKLIB) -o $(ESAPI) -static $(ESAPI_OBJECTS) $(ESAPI_ASM_OBJECTS)
$(ESAPI_OBJECTS): %.o: $(GLAPI)/%.c
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
$(ESAPI_ASM_OBJECTS): %.o: glapi/%.S
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
$(ESAPI_SOURCES) $(ESAPI_ASM_SOURCES): | glapi-stamp
glapi-stamp:
@$(MAKE) -C $(GLAPI)/gen-es $(ES)
@touch $@
.PHONY: clean
clean:
-rm -f $(ESAPI_OBJECTS) $(ESAPI_ASM_OBJECTS)
-rm -f lib$(ESAPI).a
-rm -f depend depend.bak
@$(MAKE) -C $(GLAPI)/gen-es clean-$(ES)
-rm -f glapi-stamp
# nothing to install
install:
depend: $(ESAPI_SOURCES)
@echo "running $(MKDEP)"
@touch depend
@$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(INCLUDE_DIRS) \
$(ESAPI_SOURCES) 2>/dev/null | \
sed -e 's,^$(GLAPI)/,,' > depend
# src/mapi/es2api/Makefile
ES := es2
include ../es1api/Makefile
# src/mapi/glapi/Makefile
TOP = ../../..
include $(TOP)/configs/current
include sources.mak
GLAPI_OBJECTS = $(GLAPI_SOURCES:.c=.o)
GLAPI_ASM_OBJECTS = $(GLAPI_ASM_SOURCES:.S=.o)
INCLUDE_DIRS = \
-I$(TOP)/include \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mesa
default: depend libglapi.a
libglapi.a: $(GLAPI_OBJECTS) $(GLAPI_ASM_OBJECTS)
@ $(MKLIB) -o glapi -static $(GLAPI_OBJECTS) $(GLAPI_ASM_OBJECTS)
$(GLAPI_OBJECTS): %.o: %.c
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
$(GLAPI_ASM_OBJECTS): %.o: %.S
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
install:
clean:
-rm -f $(GLAPI_OBJECTS) $(GLAPI_ASM_OBJECTS)
-rm -f depend depend.bak libglapi.a
depend: $(GLAPI_SOURCES)
@ echo "running $(MKDEP)"
@ touch depend
@$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(GLAPI_SOURCES) \
> /dev/null 2>/dev/null
-include depend
#######################################################################
# SConscript for Mesa
Import('*')
if env['platform'] != 'winddk':
env = env.Clone()
env.Append(CPPPATH = [
'#/src/mapi',
'#/src/mesa',
])
glapi_sources = [
'glapi.c',
'glapi_dispatch.c',
'glapi_entrypoint.c',
'glapi_execmem.c',
'glapi_getproc.c',
'glapi_nop.c',
'glthread.c',
]
#
# Assembly sources
#
if gcc and env['machine'] == 'x86':
env.Append(CPPDEFINES = [
'USE_X86_ASM',
'USE_MMX_ASM',
'USE_3DNOW_ASM',
'USE_SSE_ASM',
])
glapi_sources += [
'glapi_x86.S',
]
elif gcc and env['machine'] == 'x86_64':
env.Append(CPPDEFINES = [
'USE_X86_64_ASM',
])
glapi_sources += [
'glapi_x86-64.S'
]
elif gcc and env['machine'] == 'ppc':
env.Append(CPPDEFINES = [
'USE_PPC_ASM',
'USE_VMX_ASM',
])
glapi_sources += [
]
elif gcc and env['machine'] == 'sparc':
glapi_sources += [
'glapi_sparc.S'
]
else:
pass
glapi = env.ConvenienceLibrary(
target = 'glapi',
source = glapi_sources,
)
Export('glapi')
TOP = ../../../..
GLAPI = ../../glapi/gen
GLAPI = ../gen
include $(TOP)/configs/current
OUTPUTS := \
......@@ -18,8 +18,8 @@ COMMON := $(addprefix $(GLAPI)/, $(COMMON))
ES1_APIXML := es1_API.xml
ES2_APIXML := es2_API.xml
ES1_OUTPUT_DIR := glapi-es1
ES2_OUTPUT_DIR := glapi-es2
ES1_OUTPUT_DIR := $(TOP)/src/mapi/es1api
ES2_OUTPUT_DIR := $(TOP)/src/mapi/es2api
ES1_DEPS = $(ES1_APIXML) base1_API.xml es1_EXT.xml es_EXT.xml \
es1_COMPAT.xml es_COMPAT.xml
......@@ -84,6 +84,13 @@ verify_xml:
@$(PYTHON2) $(PYTHON_FLAGS) gl_compare.py difference tmp.xml es2_API.xml
@rm -f tmp.xml
clean:
-rm -rf $(ES1_OUTPUT_DIR) $(ES2_OUTPUT_DIR)
clean-es1:
-rm -rf $(ES1_OUTPUT_DIR)/glapi
-rm -rf $(ES1_OUTPUT_DIR)/main
clean-es2:
-rm -rf $(ES2_OUTPUT_DIR)/glapi
-rm -rf $(ES2_OUTPUT_DIR)/main
clean: clean-es1 clean-es2
-rm -f *~ *.pyc *.pyo
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gen/gl_API.dtd">
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<!-- OpenGL and OpenGL ES 1.x APIs
This file defines the base categories that can be shared by all APIs.
......
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gen/gl_API.dtd">
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<!-- OpenGL and OpenGL ES 2.x APIs -->
......
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gen/gl_API.dtd">
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<!-- OpenGL ES 1.x API -->
......
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gen/gl_API.dtd">
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<OpenGLAPI>
......
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gen/gl_API.dtd">
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<!-- OpenGL ES 1.x extensions -->
......
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gen/gl_API.dtd">
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<!-- OpenGL ES 2.x API -->
......
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gen/gl_API.dtd">
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<OpenGLAPI>
......
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gen/gl_API.dtd">
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<!-- OpenGL ES 2.x extensions -->
......
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gen/gl_API.dtd">
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<OpenGLAPI>
......@@ -2641,6 +2641,6 @@
</function>
</category>
<xi:include href="../../glapi/gen/APPLE_vertex_array_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="../gen/APPLE_vertex_array_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</OpenGLAPI>
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gen/gl_API.dtd">
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<!-- OpenGL ES extensions -->
......@@ -19,7 +19,7 @@
</category>
<!-- 23. GL_OES_EGL_image -->
<xi:include href="../../glapi/gen/OES_EGL_image.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="../gen/OES_EGL_image.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<category name="GL_OES_depth24" number="24">
<enum name="DEPTH_COMPONENT24_OES" value="0x81A6"/>
......