diff options
author | marha <marha@users.sourceforge.net> | 2012-06-22 08:35:52 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-06-22 08:35:52 +0200 |
commit | 2cb91952f6e94907b3614535edbfc3f979085694 (patch) | |
tree | 6d11e620b1c10564f344d469a5d730e1df7fbb90 /mesalib | |
parent | 7ec34a94883810e9f4a8e417f00300c2c31808b0 (diff) | |
parent | e1a407256a5c1571d8f4871fd981a51cfbd46e37 (diff) | |
download | vcxsrv-2cb91952f6e94907b3614535edbfc3f979085694.tar.gz vcxsrv-2cb91952f6e94907b3614535edbfc3f979085694.tar.bz2 vcxsrv-2cb91952f6e94907b3614535edbfc3f979085694.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/mapi/glapi/gen/.gitignore
Diffstat (limited to 'mesalib')
35 files changed, 846 insertions, 524 deletions
diff --git a/mesalib/.emacs-dirvars b/mesalib/.emacs-dirvars deleted file mode 100644 index 33945f91e..000000000 --- a/mesalib/.emacs-dirvars +++ /dev/null @@ -1,10 +0,0 @@ -;; -*- emacs-lisp -*- -;; -;; This file is processed by the dirvars emacs package. Each variable -;; setting below is performed when this dirvars file is loaded. -;; -indent-tabs-mode: nil -tab-width: 8 -c-basic-offset: 3 -kde-emacs-after-parent-string: "" -evaluate: (c-set-offset 'inline-open '0) diff --git a/mesalib/Makefile.am b/mesalib/Makefile.am index 9c9e9f6cf..8210fccd4 100644 --- a/mesalib/Makefile.am +++ b/mesalib/Makefile.am @@ -44,7 +44,6 @@ clean-local: distclean-local: -rm -rf lib* -rm -f $(top_builddir)/configs/current - -rm -f $(top_builddir)/configs/autoconf -find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \ -name depend -o -name depend.bak ')' -exec rm -f '{}' ';' diff --git a/mesalib/configs/autoconf.in b/mesalib/configs/current.in index 48f4504a2..f4858bdfa 100644 --- a/mesalib/configs/autoconf.in +++ b/mesalib/configs/current.in @@ -11,13 +11,12 @@ CC = @CC@ CXX = @CXX@ OPT_FLAGS = @OPT_FLAGS@ ARCH_FLAGS = @ARCH_FLAGS@ -ASM_FLAGS = @ASM_FLAGS@ PIC_FLAGS = @PIC_FLAGS@ DEFINES = @DEFINES@ API_DEFINES = @API_DEFINES@ SHARED_GLAPI = @SHARED_GLAPI@ CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \ - $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) + $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \ $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@ @@ -42,8 +41,6 @@ LLVM_LIBS = @LLVM_LIBS@ LLVM_INCLUDEDIR = @LLVM_INCLUDEDIR@ GLW_CFLAGS = @GLW_CFLAGS@ GLX_TLS = @GLX_TLS@ -DRI_CFLAGS = @DRI_CFLAGS@ -DRI_CXXFLAGS = @DRI_CXXFLAGS@ # dlopen DLOPEN_LIBS = @DLOPEN_LIBS@ @@ -125,8 +122,6 @@ GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drive # Driver specific build vars DRI_DIRS = @DRI_DIRS@ -DRICORE_LIBS = @DRICORE_LIBS@ -DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@ EGL_PLATFORMS = @EGL_PLATFORMS@ EGL_CLIENT_APIS = @EGL_CLIENT_APIS@ diff --git a/mesalib/configs/default b/mesalib/configs/default index 20ba79642..734b2f62e 100644 --- a/mesalib/configs/default +++ b/mesalib/configs/default @@ -19,11 +19,9 @@ DRM_SOURCE_PATH=$(TOP)/../drm # Compiler and flags CC = cc CXX = CC -HOST_CC = $(CC) CFLAGS = -O CXXFLAGS = -O LDFLAGS = -HOST_CFLAGS = $(CFLAGS) GLU_CFLAGS = GLX_TLS = no @@ -85,9 +83,6 @@ GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)* VG_LIB_GLOB = $(VG_LIB_NAME)* GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)* -DRI_CFLAGS = $(CFLAGS) -DRI_CXXFLAGS = $(CXXFLAGS) - # Optional assembly language optimization files for libGL MESA_ASM_FILES = diff --git a/mesalib/configure.ac b/mesalib/configure.ac index d5f8cd719..b78eb1555 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -10,7 +10,7 @@ AC_INIT([Mesa], [8.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa]) AC_CONFIG_AUX_DIR([bin]) AC_CANONICAL_HOST -AM_INIT_AUTOMAKE([foreign -Wall]) +AM_INIT_AUTOMAKE([foreign]) dnl http://people.gnome.org/~walters/docs/build-api.txt dnl We don't support srcdir != builddir. @@ -453,7 +453,6 @@ AC_ARG_ENABLE([asm], [enable_asm=yes] ) asm_arch="" -ASM_FLAGS="" MESA_ASM_FILES="" GLAPI_ASM_SOURCES="" AC_MSG_CHECKING([whether to enable assembly]) @@ -502,19 +501,19 @@ if test "x$enable_asm" = xyes; then case "$asm_arch" in x86) - ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM" + DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM" MESA_ASM_FILES='$(X86_FILES)' GLAPI_ASM_SOURCES='$(X86_API)' AC_MSG_RESULT([yes, x86]) ;; x86_64) - ASM_FLAGS="-DUSE_X86_64_ASM" + DEFINES="$DEFINES -DUSE_X86_64_ASM" MESA_ASM_FILES='$(X86_64_FILES)' GLAPI_ASM_SOURCES='$(X86-64_API)' AC_MSG_RESULT([yes, x86_64]) ;; sparc) - ASM_FLAGS="-DUSE_SPARC_ASM" + DEFINES="$DEFINES -DUSE_SPARC_ASM" MESA_ASM_FILES='$(SPARC_FILES)' GLAPI_ASM_SOURCES='$(SPARC_API)' AC_MSG_RESULT([yes, sparc]) @@ -524,7 +523,6 @@ if test "x$enable_asm" = xyes; then ;; esac fi -AC_SUBST([ASM_FLAGS]) AC_SUBST([MESA_ASM_FILES]) AC_SUBST([GLAPI_ASM_SOURCES]) @@ -881,12 +879,7 @@ if test "x$enable_dri" = xyes; then fi if test "x$enable_osmesa" = xyes; then - # the empty space matters for osmesa... (see src/mesa/Makefile) - if test -n "$DRIVER_DIRS"; then - DRIVER_DIRS="$DRIVER_DIRS osmesa" - else - DRIVER_DIRS="osmesa" - fi + DRIVER_DIRS="$DRIVER_DIRS osmesa" fi AC_SUBST([SRC_DIRS]) @@ -1092,25 +1085,15 @@ AC_SUBST([GLAPI_LIB_DEPS]) dnl Setup default DRI CFLAGS -DRI_CFLAGS='$(CFLAGS)' -DRI_CXXFLAGS='$(CXXFLAGS)' DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a' MESA_MODULES='$(TOP)/src/mesa/libmesa.a' if test "x$enable_dri" = xyes && test "x$driglx_direct" = xyes ; then - DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so' - DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR)' - DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore' - DRI_CFLAGS='$(CFLAGS_NOVISIBILITY) -DUSE_DRICORE' - DRI_CXXFLAGS='$(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE' - MESA_MODULES='$(DRICORE_LIBS)' + DRI_LIB_DEPS="-L\$(TOP)/\$(LIB_DIR) -ldricore$VERSION" + MESA_MODULES="\$(TOP)/\$(LIB_DIR)/libdricore$VERSION.so" HAVE_DRICORE=yes fi AM_CONDITIONAL(HAVE_DRICORE, test x$HAVE_DRICORE = xyes) -AC_SUBST([DRICORE_LIBS]) -AC_SUBST([DRICORE_LIB_DEPS]) -AC_SUBST([DRI_CXXFLAGS]) -AC_SUBST([DRI_CFLAGS]) AC_SUBST([MESA_MODULES]) AC_SUBST([HAVE_XF86VIDMODE]) @@ -2128,9 +2111,9 @@ AM_CONDITIONAL(HAVE_X11_DRIVER, echo "$DRIVER_DIRS" | grep 'x11' >/dev/null 2>&1 AM_CONDITIONAL(HAVE_DRI_DRIVER, echo "$DRIVER_DIRS" | grep 'dri' >/dev/null 2>&1) AM_CONDITIONAL(HAVE_OSMESA_DRIVER, echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1) -AM_CONDITIONAL(HAVE_X86_ASM, echo "$ASM_FLAGS" | grep 'X86_ASM' >/dev/null 2>&1) -AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$ASM_FLAGS" | grep 'X86_64_ASM' >/dev/null 2>&1) -AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$ASM_FLAGS" | grep 'SPARC_ASM' >/dev/null 2>&1) +AM_CONDITIONAL(HAVE_X86_ASM, echo "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1) +AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1) +AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$DEFINES" | grep 'SPARC_ASM' >/dev/null 2>&1) dnl prepend CORE_DIRS to SRC_DIRS SRC_DIRS="$CORE_DIRS $SRC_DIRS" @@ -2144,9 +2127,10 @@ CFLAGS="$CFLAGS $USER_CFLAGS" CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS" dnl Substitute the config -AC_CONFIG_FILES([configs/autoconf +AC_CONFIG_FILES([configs/current Makefile src/Makefile + src/gallium/Makefile src/gallium/auxiliary/pipe-loader/Makefile src/gallium/state_trackers/clover/Makefile src/gallium/drivers/Makefile @@ -2158,6 +2142,7 @@ AC_CONFIG_FILES([configs/autoconf src/egl/drivers/Makefile src/egl/drivers/dri2/Makefile src/egl/drivers/glx/Makefile + src/egl/Makefile src/egl/main/Makefile src/egl/main/egl.pc src/egl/wayland/Makefile @@ -2167,11 +2152,16 @@ AC_CONFIG_FILES([configs/autoconf src/glsl/tests/Makefile src/glx/Makefile src/glx/tests/Makefile + src/mapi/glapi/gen/Makefile src/mapi/shared-glapi/Makefile src/mapi/glapi/tests/Makefile src/gtest/Makefile + src/mesa/Makefile src/mesa/libdricore/Makefile src/mesa/main/tests/Makefile + src/mesa/x86/Makefile + src/mesa/x86-64/Makefile + src/mesa/drivers/Makefile src/mesa/drivers/dri/dri.pc src/mesa/drivers/dri/Makefile src/mesa/drivers/dri/common/Makefile @@ -2180,15 +2170,10 @@ AC_CONFIG_FILES([configs/autoconf src/mesa/drivers/dri/nouveau/Makefile src/mesa/drivers/dri/r200/Makefile src/mesa/drivers/dri/radeon/Makefile - src/mesa/drivers/dri/swrast/Makefile]) - -dnl Replace the configs/current symlink -AC_CONFIG_COMMANDS([configs],[ -if test -f configs/current || test -L configs/current; then - rm -f configs/current -fi -ln -s autoconf configs/current -]) + src/mesa/drivers/dri/swrast/Makefile + src/mesa/drivers/x11/Makefile + src/mesa/gl.pc + src/mesa/osmesa.pc]) dnl Sort the dirs alphabetically GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "` @@ -2302,7 +2287,7 @@ cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \ $SED 's/^ *//;s/ */ /;s/ *$//'` cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \ $SED 's/^ *//;s/ */ /;s/ *$//'` -defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'` +defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'` echo "" echo " CFLAGS: $cflags" echo " CXXFLAGS: $cxxflags" diff --git a/mesalib/src/gallium/.gitignore b/mesalib/src/gallium/.gitignore new file mode 100644 index 000000000..5fc607b9e --- /dev/null +++ b/mesalib/src/gallium/.gitignore @@ -0,0 +1 @@ +/Makefile diff --git a/mesalib/src/gallium/Makefile b/mesalib/src/gallium/Makefile deleted file mode 100644 index 79ca767f7..000000000 --- a/mesalib/src/gallium/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# src/gallium/Makefile -TOP = ../.. -include $(TOP)/configs/current - -SUBDIRS = $(GALLIUM_DIRS) - -default install clean: - @for dir in $(SUBDIRS) ; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE) $@) || exit 1; \ - fi \ - done diff --git a/mesalib/src/gallium/Makefile.am b/mesalib/src/gallium/Makefile.am new file mode 100644 index 000000000..e7cff8920 --- /dev/null +++ b/mesalib/src/gallium/Makefile.am @@ -0,0 +1,22 @@ +# Copyright © 2012 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +SUBDIRS = $(GALLIUM_DIRS) diff --git a/mesalib/src/mapi/glapi/gen/.gitignore b/mesalib/src/mapi/glapi/gen/.gitignore index b209a3ec7..906ce45d9 100644 --- a/mesalib/src/mapi/glapi/gen/.gitignore +++ b/mesalib/src/mapi/glapi/gen/.gitignore @@ -1,22 +1,23 @@ -enums.c
-glapi_mapi_tmp.h
-mapi_abi.py
-remap_helper.h
-dispatch.h
-glapitable.h
-glapitemp.h
-glprocs.h
-indirect.c
-indirect.h
-indirect_dispatch.c
-indirect_dispatch.h
-indirect_dispatch_swap.c
-indirect_init.c
-indirect_reqsize.c
-indirect_reqsize.h
-indirect_size.c
-indirect_size.h
-indirect_size_get.c
-indirect_size_get.h
-indirect_table.c
-glapi_gentable.c
+enums.c +glapi_mapi_tmp.h +mapi_abi.py +remap_helper.h +dispatch.h +glapitable.h +glapitemp.h +glprocs.h +indirect.c +indirect.h +indirect_dispatch.c +indirect_dispatch.h +indirect_dispatch_swap.c +indirect_init.c +indirect_reqsize.c +indirect_reqsize.h +indirect_size.c +indirect_size.h +indirect_size_get.c +indirect_size_get.h +indirect_table.c +glapi_gentable.c +/Makefile diff --git a/mesalib/src/mapi/glapi/gen/ARB_uniform_buffer_object.xml b/mesalib/src/mapi/glapi/gen/ARB_uniform_buffer_object.xml new file mode 100644 index 000000000..cbcd339e7 --- /dev/null +++ b/mesalib/src/mapi/glapi/gen/ARB_uniform_buffer_object.xml @@ -0,0 +1,97 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd"> + +<OpenGLAPI> + +<category name="GL_ARB_uniform_buffer_object" number="57"> + +<enum name="UNIFORM_BUFFER" value="0x8A11" /> +<enum name="UNIFORM_BUFFER_BINDING" value="0x8A28" /> +<enum name="UNIFORM_BUFFER_START" value="0x8A29" /> +<enum name="UNIFORM_BUFFER_SIZE" value="0x8A2A" /> +<enum name="MAX_VERTEX_UNIFORM_BLOCKS" value="0x8A2B" /> +<enum name="MAX_GEOMETRY_UNIFORM_BLOCKS" value="0x8A2C" /> +<enum name="MAX_FRAGMENT_UNIFORM_BLOCKS" value="0x8A2D" /> +<enum name="MAX_COMBINED_UNIFORM_BLOCKS" value="0x8A2E" /> +<enum name="MAX_UNIFORM_BUFFER_BINDINGS" value="0x8A2F" /> +<enum name="MAX_UNIFORM_BLOCK_SIZE" value="0x8A30" /> +<enum name="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS" value="0x8A31" /> +<enum name="MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS" value="0x8A32" /> +<enum name="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS" value="0x8A33" /> +<enum name="UNIFORM_BUFFER_OFFSET_ALIGNMENT" value="0x8A34" /> +<enum name="ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH" value="0x8A35" /> +<enum name="ACTIVE_UNIFORM_BLOCKS" value="0x8A36" /> +<enum name="UNIFORM_TYPE" value="0x8A37" /> +<enum name="UNIFORM_SIZE" value="0x8A38" /> +<enum name="UNIFORM_NAME_LENGTH" value="0x8A39" /> +<enum name="UNIFORM_BLOCK_INDEX" value="0x8A3A" /> +<enum name="UNIFORM_OFFSET" value="0x8A3B" /> +<enum name="UNIFORM_ARRAY_STRIDE" value="0x8A3C" /> +<enum name="UNIFORM_MATRIX_STRIDE" value="0x8A3D" /> +<enum name="UNIFORM_IS_ROW_MAJOR" value="0x8A3E" /> +<enum name="UNIFORM_BLOCK_BINDING" value="0x8A3F" /> +<enum name="UNIFORM_BLOCK_DATA_SIZE" value="0x8A40" /> +<enum name="UNFIROM_BLOCK_NAME_LENGTH" value="0x8A41" /> +<enum name="UNIFORM_BLOCK_ACTIVE_UNIFORMS" value="0x8A42" /> +<enum name="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES" value="0x8A43" /> +<enum name="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER" value="0x8A44" /> +<enum name="UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER" value="0x8A45" /> +<enum name="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER" value="0x8A46" /> +<enum name="INVALID_INDEX" value="0xFFFFFFFF" /> + +<function name="GetUniformIndices" offset="assign"> + <param name="program" type="GLuint" /> + <param name="uniformCount" type="GLsizei" /> + <param name="uniformNames" type="const GLchar **" /> + <param name="uniformIndices" type="GLuint *" /> +</function> + +<function name="GetActiveUniformsiv" offset="assign"> + <param name="program" type="GLuint" /> + <param name="uniformCount" type="GLsizei" /> + <param name="uniformIndices" type="const GLuint *" /> + <param name="pname" type="GLenum" /> + <param name="params" type="GLint *" /> +</function> + +<function name="GetActiveUniformName" offset="assign"> + <param name="program" type="GLuint" /> + <param name="uniformIndex" type="GLuint" /> + <param name="bufSize" type="GLsizei" /> + <param name="length" type="GLsizei *" /> + <param name="uniformName" type="GLchar *" /> +</function> + +<function name="GetUniformBlockIndex" offset="assign"> + <return type="GLuint"/> + <param name="program" type="GLuint" /> + <param name="uniformBlockName" type="const GLchar *" /> +</function> + +<function name="GetActiveUniformBlockiv" offset="assign"> + <param name="program" type="GLuint" /> + <param name="uniformBlockIndex" type="GLuint" /> + <param name="pname" type="GLenum" /> + <param name="params" type="GLint *" /> +</function> + +<function name="GetActiveUniformBlockName" offset="assign"> + <param name="program" type="GLuint" /> + <param name="uniformBlockIndex" type="GLuint" /> + <param name="bufSize" type="GLsizei" /> + <param name="length" type="GLsizei *" /> + <param name="uniformBlockName" type="GLchar *" /> +</function> + +<!-- Duplicated with GL3x.xml: BindBufferRange, BindBufferBase, + GetIntegeri_v --> + +<function name="UniformBlockBinding" offset="assign" > + <param name="program" type="GLuint" /> + <param name="uniformBlockIndex" type="GLuint" /> + <param name="uniformBlockBinding" type="GLuint" /> +</function> + +</category> + +</OpenGLAPI> diff --git a/mesalib/src/mapi/glapi/gen/Makefile b/mesalib/src/mapi/glapi/gen/Makefile.am index 0ac798957..d0d0a7ba0 100644 --- a/mesalib/src/mapi/glapi/gen/Makefile +++ b/mesalib/src/mapi/glapi/gen/Makefile.am @@ -5,7 +5,6 @@ TOP = ../../../.. -include $(TOP)/configs/current MESA_DIR = $(TOP)/src/mesa MESA_GLAPI_DIR = $(TOP)/src/mapi/glapi @@ -91,6 +90,7 @@ API_XML = \ ARB_vertex_type_2_10_10_10_rev.xml \ APPLE_object_purgeable.xml \ APPLE_vertex_array_object.xml \ + ARB_uniform_buffer_object.xml \ EXT_draw_buffers2.xml \ EXT_framebuffer_object.xml \ EXT_gpu_shader4.xml \ @@ -120,12 +120,11 @@ COMMON_ES = \ COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py -###################################################################### +PYTHON_GEN = $(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) -default: mesa -install: mesa +###################################################################### -mesa: $(MESA_OUTPUTS) +all-local: $(MESA_OUTPUTS) xorg: check-xorg-source $(XORG_OUTPUTS) @@ -138,7 +137,7 @@ check-xorg-source: exit 1; \ fi -clean: +clean-local: -rm -f *~ *.pyo -rm -f $(MESA_OUTPUTS) @@ -156,86 +155,86 @@ $(XORG_GLAPI_DIR)/%.h: $(MESA_GLAPI_DIR)/%.h ###################################################################### $(MESA_GLAPI_DIR)/glapi_mapi_tmp.h: $(MESA_MAPI_DIR)/mapi_abi.py $(COMMON_ES) - $(PYTHON2) $(PYTHON_FLAGS) $< \ + $(PYTHON_GEN) $< \ --printer glapi --mode lib gl_and_es_API.xml > $@ $(MESA_GLAPI_DIR)/glprocs.h: gl_procs.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + $(PYTHON_GEN) $< > $@ $(MESA_GLAPI_DIR)/glapitemp.h: gl_apitemp.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + $(PYTHON_GEN) $< > $@ $(MESA_GLAPI_DIR)/glapitable.h: gl_table.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + $(PYTHON_GEN) $< > $@ $(MESA_GLAPI_DIR)/glapi_gentable.c: gl_gentable.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + $(PYTHON_GEN) $< > $@ ###################################################################### $(MESA_GLAPI_DIR)/glapi_x86.S: gl_x86_asm.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + $(PYTHON_GEN) $< > $@ $(MESA_GLAPI_DIR)/glapi_x86-64.S: gl_x86-64_asm.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + $(PYTHON_GEN) $< > $@ $(MESA_GLAPI_DIR)/glapi_sparc.S: gl_SPARC_asm.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + $(PYTHON_GEN) $< > $@ ###################################################################### $(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON_ES) - $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_and_es_API.xml > $@ + $(PYTHON_GEN) $< -f gl_and_es_API.xml > $@ $(MESA_DIR)/main/dispatch.h: gl_table.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@ + $(PYTHON_GEN) $< -m remap_table > $@ $(MESA_DIR)/main/remap_helper.h: remap_helper.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + $(PYTHON_GEN) $< > $@ ###################################################################### $(MESA_GLX_DIR)/indirect.c: glX_proto_send.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m proto | $(INDENT) $(INDENT_FLAGS) > $@ + $(PYTHON_GEN) $< -m proto | $(INDENT) $(INDENT_FLAGS) > $@ $(MESA_GLX_DIR)/indirect.h: glX_proto_send.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m init_h > $@ + $(PYTHON_GEN) $< -m init_h > $@ $(MESA_GLX_DIR)/indirect_init.c: glX_proto_send.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m init_c > $@ + $(PYTHON_GEN) $< -m init_c > $@ $(MESA_GLX_DIR)/indirect_size.h $(XORG_GLX_DIR)/indirect_size.h: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-set -h _INDIRECT_SIZE_H_ \ + $(PYTHON_GEN) $< -m size_h --only-set -h _INDIRECT_SIZE_H_ \ | $(INDENT) $(INDENT_FLAGS) > $@ $(MESA_GLX_DIR)/indirect_size.c: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c --only-set \ + $(PYTHON_GEN) $< -m size_c --only-set \ | $(INDENT) $(INDENT_FLAGS) > $@ ###################################################################### $(XORG_GLX_DIR)/indirect_dispatch.c: glX_proto_recv.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c > $@ + $(PYTHON_GEN) $< -m dispatch_c > $@ $(XORG_GLX_DIR)/indirect_dispatch_swap.c: glX_proto_recv.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c -s > $@ + $(PYTHON_GEN) $< -m dispatch_c -s > $@ $(XORG_GLX_DIR)/indirect_dispatch.h: glX_proto_recv.py gl_and_glX_API.xml $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_h -f gl_and_glX_API.xml -s > $@ + $(PYTHON_GEN) $< -m dispatch_h -f gl_and_glX_API.xml -s > $@ $(XORG_GLX_DIR)/indirect_size_get.h: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ + $(PYTHON_GEN) $< -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ | $(INDENT) $(INDENT_FLAGS) > $@ $(XORG_GLX_DIR)/indirect_size_get.c: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c | $(INDENT) $(INDENT_FLAGS) > $@ + $(PYTHON_GEN) $< -m size_c | $(INDENT) $(INDENT_FLAGS) > $@ $(XORG_GLX_DIR)/indirect_reqsize.h: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ + $(PYTHON_GEN) $< -m reqsize_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ | $(INDENT) $(INDENT_FLAGS) -l200 > $@ $(XORG_GLX_DIR)/indirect_reqsize.c: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_c | $(INDENT) $(INDENT_FLAGS) > $@ + $(PYTHON_GEN) $< -m reqsize_c | $(INDENT) $(INDENT_FLAGS) > $@ $(XORG_GLX_DIR)/indirect_table.c: glX_server_table.py gl_and_glX_API.xml $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_and_glX_API.xml > $@ + $(PYTHON_GEN) $< -f gl_and_glX_API.xml > $@ diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml index 10b6ba91a..62799d399 100644 --- a/mesalib/src/mapi/glapi/gen/gl_API.xml +++ b/mesalib/src/mapi/glapi/gen/gl_API.xml @@ -7927,7 +7927,9 @@ <!-- ARB extension number 55 is a GLX extension. --> <!-- ARB extension number 56 is a WGL extension. --> -<!-- 57. GL_ARB_uniform_buffer_object --> + +<xi:include href="ARB_uniform_buffer_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + <!-- 58. GL_ARB_compatibility --> <xi:include href="ARB_copy_buffer.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> diff --git a/mesalib/src/mesa/.gitignore b/mesalib/src/mesa/.gitignore index ce83eaf47..5fc607b9e 100644 --- a/mesalib/src/mesa/.gitignore +++ b/mesalib/src/mesa/.gitignore @@ -1,5 +1 @@ -*/gen_matypes -*/matypes.h -depend.es* -depend.es* -objs-es* +/Makefile diff --git a/mesalib/src/mesa/Makefile b/mesalib/src/mesa/Makefile deleted file mode 100644 index b0b461fdd..000000000 --- a/mesalib/src/mesa/Makefile +++ /dev/null @@ -1,238 +0,0 @@ -# src/mesa/Makefile - -TOP = ../.. -include $(TOP)/configs/current - -MESA_LIBS := libmesa.a libmesagallium.a -DEPENDS := depend - -SRCDIR = . -include sources.mak - -# define preprocessor flags -MESA_CPPFLAGS := $(API_DEFINES) $(DEFINES) - -# append include dirs -MESA_CPPFLAGS += $(INCLUDE_DIRS) - -# tidy compiler flags -CFLAGS := $(filter-out $(DEFINES), $(CFLAGS)) -CXXFLAGS := $(filter-out $(DEFINES), $(CXXFLAGS)) - -# LLVM is needed for the state tracker -MESA_CFLAGS := $(LLVM_CFLAGS) $(CFLAGS) -MESA_CXXFLAGS := $(LLVM_CFLAGS) $(CXXFLAGS) - -%.o: %.c - $(CC) -c -o $@ $< $(MESA_CPPFLAGS) $(MESA_CFLAGS) - -%.o: %.cpp - $(CXX) -c -o $@ $< $(MESA_CPPFLAGS) $(MESA_CXXFLAGS) - -%.o: %.S - $(CC) -c -o $@ $< $(MESA_CPPFLAGS) $(MESA_CFLAGS) - -# Default: build dependencies, then asm_subdirs, GLSL built-in lib, -# then convenience libs (.a) and finally the device drivers: -default: $(DEPENDS) asm_subdirs $(MESA_LIBS) driver_subdirs - -.PHONY: main/git_sha1.h.tmp -main/git_sha1.h.tmp: - @touch main/git_sha1.h.tmp - @if test -d ../../.git; then \ - if which git > /dev/null; then \ - git log -n 1 --oneline | \ - sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \ - > main/git_sha1.h.tmp ; \ - fi \ - fi - -main/git_sha1.h: main/git_sha1.h.tmp - @echo "updating main/git_sha1.h" - @if ! cmp -s main/git_sha1.h.tmp main/git_sha1.h; then \ - mv main/git_sha1.h.tmp main/git_sha1.h ;\ - fi - -# include glapi_gen.mk for generating glapi headers for GLES -GLAPI := $(TOP)/src/mapi/glapi/gen -include $(GLAPI)/glapi_gen.mk - -BUILT_SOURCES = \ - main/api_exec_es1_dispatch.h \ - main/api_exec_es1_remap_helper.h \ - main/api_exec_es2_dispatch.h \ - main/api_exec_es2_remap_helper.h \ - main/api_exec_es1.c \ - main/api_exec_es2.c \ - program/program_parse.tab.c \ - program/program_parse.tab.h \ - program/lex.yy.c - -main/api_exec_es1_dispatch.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_dispatch_deps) - $(call glapi_gen_dispatch,$<,es1) - -main/api_exec_es1_remap_helper.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_remap_deps) - $(call glapi_gen_remap,$<,es1) - -main/api_exec_es1.o: main/api_exec_es1_dispatch.h main/api_exec_es1_remap_helper.h - -main/api_exec_es2_dispatch.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_dispatch_deps) - $(call glapi_gen_dispatch,$<,es2) - -main/api_exec_es2_remap_helper.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_remap_deps) - $(call glapi_gen_remap,$<,es2) - -main/api_exec_es2.o: main/api_exec_es2_dispatch.h main/api_exec_es2_remap_helper.h - -main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py - $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES1.1 > $@ - -main/api_exec_es2.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py - $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES2.0 > $@ - -program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y - $(BISON) -v -d --output=program/program_parse.tab.c $< - -program/lex.yy.c: program/program_lexer.l - $(FLEX) --never-interactive --outfile=$@ $< - -ifneq (,$(DRICORE_LIBS)) -DRICORE_TARGET = dricore -DRICORE_INSTALL_TARGET = install-dricore -endif - -###################################################################### -# Helper libraries used by many drivers: - -# Make archive of core mesa object files -libmesa.a: $(MESA_OBJECTS) $(GLSL_LIBS) - @ $(MKLIB) -o mesa -static $(MESA_OBJECTS) $(GLSL_LIBS) - -# Make archive of subset of core mesa object files for gallium -libmesagallium.a: $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS) - @ $(MKLIB) -o mesagallium -static $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS) - -dricore: $(BUILT_SOURCES) - @ (cd libdricore && $(MAKE)) - -###################################################################### -# Device drivers -driver_subdirs: $(MESA_LIBS) $(DRICORE_TARGET) - @ (cd drivers && $(MAKE)) - - -###################################################################### -# Assembly subdirs -asm_subdirs: - @ if echo "$(ASM_FLAGS)" | grep -q USE_X86_ASM ; then \ - (cd x86 && $(MAKE)) || exit 1 ; \ - fi - @ if echo "$(ASM_FLAGS)" | grep -q USE_X86_64_ASM ; then \ - (cd x86 && $(MAKE)) || exit 1 ; \ - (cd x86-64 && $(MAKE)) || exit 1 ; \ - fi - -###################################################################### -# Dependency generation - -depend: $(ALL_FILES) main/git_sha1.h - @ echo "running $(MKDEP)" - @ touch depend - @$(MKDEP) $(MKDEP_OPTIONS) $(MESA_CPPFLAGS) \ - $(ALL_FILES) > /dev/null 2>/dev/null - -###################################################################### -# Installation rules - -# this isn't fleshed out yet but is probably the way to go in the future -new_install: - (cd drivers && $(MAKE) install) - -# XXX replace this with new_install above someday -install: default $(DRICORE_INSTALL_TARGET) - @for driver in $(DRIVER_DIRS) ; do \ - case "$$driver" in \ - osmesa) if [ "$(DRIVER_DIRS)" = osmesa ]; then \ - $(MAKE) install-headers install-osmesa || exit 1 ; \ - else \ - $(MAKE) install-osmesa || exit 1 ; \ - fi ;; \ - dri) $(MAKE) install-libgl-pc install-dri || exit 1 ;; \ - *) $(MAKE) install-libgl-pc install-libgl || exit 1 ;; \ - esac ; \ - done - -pcedit = \ - -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ - -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ - -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ - -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \ - - -gl_pcedit = sed \ - $(pcedit) \ - -e 's,@GL_PC_REQ_PRIV@,$(GL_PC_REQ_PRIV),' \ - -e 's,@GL_PC_LIB_PRIV@,$(GL_PC_LIB_PRIV),' \ - -e 's,@GL_PC_CFLAGS@,$(GL_PC_CFLAGS),' \ - -e 's,@GLX_TLS@,$(GLX_TLS),' \ - -e 's,@GL_LIB@,$(GL_LIB),' - -gl.pc: gl.pc.in - $(gl_pcedit) $< > $@ - -osmesa_pcedit = sed \ - $(pcedit) \ - -e 's,@OSMESA_LIB@,$(OSMESA_LIB),' \ - -e 's,@OSMESA_PC_REQ@,$(OSMESA_PC_REQ),' \ - -e 's,@OSMESA_PC_LIB_PRIV@,$(OSMESA_PC_LIB_PRIV),' - -osmesa.pc: osmesa.pc.in - $(osmesa_pcedit) $< > $@ - -install-headers: - $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL - $(INSTALL) -m 644 $(TOP)/include/GL/*.h \ - $(DESTDIR)$(INSTALL_INC_DIR)/GL - -install-libgl: default - $(MINSTALL) $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB) \ - $(DESTDIR)$(INSTALL_LIB_DIR) - -install-libgl-pc: gl.pc install-headers - $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) - $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - -install-osmesa: default osmesa.pc - $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) - $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - $(MINSTALL) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_GLOB) \ - $(DESTDIR)$(INSTALL_LIB_DIR) - $(INSTALL) -m 644 osmesa.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - -install-dri: default - cd drivers/dri && $(MAKE) install - -install-dricore: default - @ (cd libdricore && $(MAKE) install) - -# Emacs tags -tags: - etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h - -clean: - -rm -f */*.o - -rm -f */*/*.o - -rm -f depend depend.bak libmesa.a libmesagallium.a - -rm -f drivers/*/*.o - -rm -f *.pc - -rm -f $(BUILT_SOURCES) - -@cd drivers/dri && $(MAKE) clean - -@cd drivers/x11 && $(MAKE) clean - -@cd drivers/osmesa && $(MAKE) clean - -@cd x86 && $(MAKE) clean - -@cd x86-64 && $(MAKE) clean - -@cd libdricore && $(MAKE) clean - - --include $(DEPENDS) diff --git a/mesalib/src/mesa/Makefile.am b/mesalib/src/mesa/Makefile.am new file mode 100644 index 000000000..e52678d58 --- /dev/null +++ b/mesalib/src/mesa/Makefile.am @@ -0,0 +1,107 @@ +# Copyright © 2012 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +SUBDIRS = x86 x86-64 . libdricore drivers + +gldir = $(includedir)/GL +gl_HEADERS = $(top_srcdir)/include/GL/*.h + +.PHONY: main/git_sha1.h.tmp +main/git_sha1.h.tmp: + @touch main/git_sha1.h.tmp + @if test -d ../../.git; then \ + if which git > /dev/null; then \ + git log -n 1 --oneline | \ + sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \ + > main/git_sha1.h.tmp ; \ + fi \ + fi + +main/git_sha1.h: main/git_sha1.h.tmp + @echo "updating main/git_sha1.h" + @if ! cmp -s main/git_sha1.h.tmp main/git_sha1.h; then \ + mv main/git_sha1.h.tmp main/git_sha1.h ;\ + fi + +# include glapi_gen.mk for generating glapi headers for GLES +TOP = $(top_srcdir) +GLAPI = $(TOP)/src/mapi/glapi/gen +include $(GLAPI)/glapi_gen.mk + +BUILT_SOURCES = \ + main/git_sha1.h \ + main/api_exec_es1_dispatch.h \ + main/api_exec_es1_remap_helper.h \ + main/api_exec_es2_dispatch.h \ + main/api_exec_es2_remap_helper.h \ + main/api_exec_es1.c \ + main/api_exec_es2.c \ + program/program_parse.tab.c \ + program/program_parse.tab.h \ + program/lex.yy.c +CLEANFILES = \ + $(BUILT_SOURCES) \ + git_sha1.h.tmp + +main/api_exec_es1_dispatch.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_dispatch_deps) + $(call glapi_gen_dispatch,$<,es1) + +main/api_exec_es1_remap_helper.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_remap_deps) + $(call glapi_gen_remap,$<,es1) + +main/api_exec_es1.o: main/api_exec_es1_dispatch.h main/api_exec_es1_remap_helper.h + +main/api_exec_es2_dispatch.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_dispatch_deps) + $(call glapi_gen_dispatch,$<,es2) + +main/api_exec_es2_remap_helper.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_remap_deps) + $(call glapi_gen_remap,$<,es2) + +main/api_exec_es2.o: main/api_exec_es2_dispatch.h main/api_exec_es2_remap_helper.h + +main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py + $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES1.1 > $@ + +main/api_exec_es2.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py + $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES2.0 > $@ + +program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y + $(YACC) -v -d --output=program/program_parse.tab.c $< + +program/lex.yy.c: program/program_lexer.l + $(LEX) --never-interactive --outfile=$@ $< + +all-local: + $(MAKE) -f Makefile.old + +install-exec-local: + $(MAKE) -f Makefile.old install + +clean-local: + $(MAKE) -f Makefile.old clean + +pkgconfigdir = $(libdir)/pkgconfig + +if HAVE_OSMESA_DRIVER +pkgconfig_DATA = osmesa.pc +else +pkgconfig_DATA = gl.pc +endif diff --git a/mesalib/src/mesa/Makefile.old b/mesalib/src/mesa/Makefile.old new file mode 100644 index 000000000..4ea70d43d --- /dev/null +++ b/mesalib/src/mesa/Makefile.old @@ -0,0 +1,82 @@ +# src/mesa/Makefile + +TOP = ../.. +include $(TOP)/configs/current + +MESA_LIBS := libmesa.a libmesagallium.a +DEPENDS := depend + +SRCDIR = . +include sources.mak + +# define preprocessor flags +MESA_CPPFLAGS := $(API_DEFINES) $(DEFINES) + +# append include dirs +MESA_CPPFLAGS += $(INCLUDE_DIRS) + +# tidy compiler flags +CFLAGS := $(filter-out $(DEFINES), $(CFLAGS)) +CXXFLAGS := $(filter-out $(DEFINES), $(CXXFLAGS)) + +# LLVM is needed for the state tracker +MESA_CFLAGS := $(LLVM_CFLAGS) $(CFLAGS) +MESA_CXXFLAGS := $(LLVM_CFLAGS) $(CXXFLAGS) + +%.o: %.c + $(CC) -c -o $@ $< $(MESA_CPPFLAGS) $(MESA_CFLAGS) + +%.o: %.cpp + $(CXX) -c -o $@ $< $(MESA_CPPFLAGS) $(MESA_CXXFLAGS) + +%.o: %.S + $(CC) -c -o $@ $< $(MESA_CPPFLAGS) $(MESA_CFLAGS) + +# Default: build dependencies, then asm_subdirs, GLSL built-in lib, +# then convenience libs (.a) and finally the device drivers: +default: $(DEPENDS) $(MESA_LIBS) + +###################################################################### +# Helper libraries used by many drivers: + +# Make archive of core mesa object files +libmesa.a: $(MESA_OBJECTS) $(GLSL_LIBS) + @ $(MKLIB) -o mesa -static $(MESA_OBJECTS) $(GLSL_LIBS) + +# Make archive of subset of core mesa object files for gallium +libmesagallium.a: $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS) + @ $(MKLIB) -o mesagallium -static $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS) + +###################################################################### +# Dependency generation + +depend: $(ALL_FILES) main/git_sha1.h + @ echo "running $(MKDEP)" + @ touch depend + @$(MKDEP) $(MKDEP_OPTIONS) $(MESA_CPPFLAGS) \ + $(ALL_FILES) > /dev/null 2>/dev/null + +###################################################################### +# Installation rules + +install: default $(DRICORE_INSTALL_TARGET) + @for driver in $(DRIVER_DIRS) ; do \ + case "$$driver" in \ + osmesa) $(MAKE) -f Makefile.old install-osmesa || exit 1 ;; \ + esac ; \ + done + +install-osmesa: default + $(MINSTALL) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_GLOB) \ + $(DESTDIR)$(INSTALL_LIB_DIR) + +# Emacs tags +tags: + etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h + +clean: + -rm -f */*.o + -rm -f */*/*.o + -rm -f depend depend.bak libmesa.a libmesagallium.a + +-include $(DEPENDS) diff --git a/mesalib/src/mesa/drivers/.gitignore b/mesalib/src/mesa/drivers/.gitignore new file mode 100644 index 000000000..5fc607b9e --- /dev/null +++ b/mesalib/src/mesa/drivers/.gitignore @@ -0,0 +1 @@ +/Makefile diff --git a/mesalib/src/mesa/drivers/Makefile b/mesalib/src/mesa/drivers/Makefile deleted file mode 100644 index c5998413e..000000000 --- a/mesalib/src/mesa/drivers/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# src/mesa/drivers/Makefile - -TOP = ../../.. -include $(TOP)/configs/current - - -default: - @for dir in $(DRIVER_DIRS) ; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE)) || exit 1; \ - fi \ - done - - -clean: - @for dir in $(DRIVER_DIRS) ; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE) clean) || exit 1; \ - fi \ - done - - -install: - @for dir in $(DRIVER_DIRS) ; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE) install) || exit 1; \ - fi \ - done - diff --git a/mesalib/src/mesa/drivers/Makefile.am b/mesalib/src/mesa/drivers/Makefile.am new file mode 100644 index 000000000..1bc74eadf --- /dev/null +++ b/mesalib/src/mesa/drivers/Makefile.am @@ -0,0 +1,22 @@ +# Copyright © 2012 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +SUBDIRS = $(DRIVER_DIRS) diff --git a/mesalib/src/mesa/drivers/dri/common/Makefile.am b/mesalib/src/mesa/drivers/dri/common/Makefile.am index 27c3e3d42..d81bc0e3f 100644 --- a/mesalib/src/mesa/drivers/dri/common/Makefile.am +++ b/mesalib/src/mesa/drivers/dri/common/Makefile.am @@ -25,7 +25,6 @@ AM_CFLAGS = \ -I$(top_srcdir)/src/mapi \ -I$(top_srcdir)/src/mesa/ \ $(DEFINES) \ - $(ASM_FLAGS) \ $(API_DEFINES) \ $(LIBDRM_CFLAGS) diff --git a/mesalib/src/mesa/drivers/dri/swrast/Makefile.am b/mesalib/src/mesa/drivers/dri/swrast/Makefile.am index 3dc7c1044..16a34413b 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/Makefile.am +++ b/mesalib/src/mesa/drivers/dri/swrast/Makefile.am @@ -34,7 +34,6 @@ AM_CFLAGS = \ -I$(top_srcdir)/src/mesa/ \ -I$(top_srcdir)/src/mesa/drivers/dri/common \ $(DEFINES) \ - $(ASM_FLAGS) \ $(API_DEFINES) dridir = $(DRI_DRIVER_INSTALL_DIR) diff --git a/mesalib/src/mesa/gl.pc.in b/mesalib/src/mesa/gl.pc.in index 2d3bc917e..181724b97 100644 --- a/mesalib/src/mesa/gl.pc.in +++ b/mesalib/src/mesa/gl.pc.in @@ -1,12 +1,12 @@ -prefix=@INSTALL_DIR@ +prefix=@prefix@ exec_prefix=${prefix} -libdir=@INSTALL_LIB_DIR@ -includedir=@INSTALL_INC_DIR@ +libdir=@libdir@ +includedir=@includedir@ Name: gl Description: Mesa OpenGL library Requires.private: @GL_PC_REQ_PRIV@ -Version: @VERSION@ +Version: @PACKAGE_VERSION@ Libs: -L${libdir} -l@GL_LIB@ Libs.private: @GL_PC_LIB_PRIV@ Cflags: -I${includedir} @GL_PC_CFLAGS@ diff --git a/mesalib/src/mesa/main/api_exec.c b/mesalib/src/mesa/main/api_exec.c index 15b9f6974..19e7f9807 100644 --- a/mesalib/src/mesa/main/api_exec.c +++ b/mesalib/src/mesa/main/api_exec.c @@ -579,17 +579,7 @@ _mesa_create_exec_table(void) #endif /* ARB 28. GL_ARB_vertex_buffer_object */ - SET_BindBufferARB(exec, _mesa_BindBufferARB); - SET_BufferDataARB(exec, _mesa_BufferDataARB); - SET_BufferSubDataARB(exec, _mesa_BufferSubDataARB); - SET_DeleteBuffersARB(exec, _mesa_DeleteBuffersARB); - SET_GenBuffersARB(exec, _mesa_GenBuffersARB); - SET_GetBufferParameterivARB(exec, _mesa_GetBufferParameterivARB); - SET_GetBufferPointervARB(exec, _mesa_GetBufferPointervARB); - SET_GetBufferSubDataARB(exec, _mesa_GetBufferSubDataARB); - SET_IsBufferARB(exec, _mesa_IsBufferARB); - SET_MapBufferARB(exec, _mesa_MapBufferARB); - SET_UnmapBufferARB(exec, _mesa_UnmapBufferARB); + _mesa_init_bufferobj_dispatch(exec); /* ARB 29. GL_ARB_occlusion_query */ _mesa_init_queryobj_dispatch(exec); diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c index 3f7db8605..8b69ca3a1 100644 --- a/mesalib/src/mesa/main/bufferobj.c +++ b/mesalib/src/mesa/main/bufferobj.c @@ -43,6 +43,7 @@ #include "mtypes.h" #include "texobj.h" #include "transformfeedback.h" +#include "dispatch.h" /* Debug flags */ @@ -92,6 +93,11 @@ get_buffer_target(struct gl_context *ctx, GLenum target) return &ctx->Texture.BufferObject; } break; + case GL_UNIFORM_BUFFER: + if (ctx->Extensions.ARB_uniform_buffer_object) { + return &ctx->UniformBuffer; + } + break; default: return NULL; } @@ -598,6 +604,8 @@ _mesa_copy_buffer_subdata(struct gl_context *ctx, void _mesa_init_buffer_objects( struct gl_context *ctx ) { + GLuint i; + memset(&DummyBufferObject, 0, sizeof(DummyBufferObject)); _glthread_INIT_MUTEX(DummyBufferObject.Mutex); DummyBufferObject.RefCount = 1000*1000*1000; /* never delete */ @@ -609,16 +617,43 @@ _mesa_init_buffer_objects( struct gl_context *ctx ) ctx->Shared->NullBufferObj); _mesa_reference_buffer_object(ctx, &ctx->CopyWriteBuffer, ctx->Shared->NullBufferObj); + + ctx->UniformBufferBindings = calloc(ctx->Const.MaxUniformBufferBindings, + sizeof(*ctx->UniformBufferBindings)); + + _mesa_reference_buffer_object(ctx, &ctx->UniformBuffer, + ctx->Shared->NullBufferObj); + + for (i = 0; i < ctx->Const.MaxUniformBufferBindings; i++) { + _mesa_reference_buffer_object(ctx, + &ctx->UniformBufferBindings[i].BufferObject, + ctx->Shared->NullBufferObj); + ctx->UniformBufferBindings[i].Offset = -1; + ctx->UniformBufferBindings[i].Size = -1; + } } void _mesa_free_buffer_objects( struct gl_context *ctx ) { + GLuint i; + _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL); _mesa_reference_buffer_object(ctx, &ctx->CopyReadBuffer, NULL); _mesa_reference_buffer_object(ctx, &ctx->CopyWriteBuffer, NULL); + + _mesa_reference_buffer_object(ctx, &ctx->UniformBuffer, NULL); + + for (i = 0; i < ctx->Const.MaxUniformBufferBindings; i++) { + _mesa_reference_buffer_object(ctx, + &ctx->UniformBufferBindings[i].BufferObject, + NULL); + } + + free(ctx->UniformBufferBindings); + ctx->UniformBufferBindings = NULL; } @@ -840,6 +875,10 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) } } + if (ctx->UniformBuffer == bufObj) { + _mesa_BindBufferARB( GL_UNIFORM_BUFFER, 0 ); + } + /* unbind any pixel pack/unpack pointers bound to this buffer */ if (ctx->Pack.BufferObj == bufObj) { _mesa_BindBufferARB( GL_PIXEL_PACK_BUFFER_EXT, 0 ); @@ -1954,3 +1993,204 @@ _mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, } #endif /* FEATURE_APPLE_object_purgeable */ + +static void +set_ubo_binding(struct gl_context *ctx, + int index, + struct gl_buffer_object *bufObj, + GLintptr offset, + GLsizeiptr size, + GLboolean autoSize) +{ + struct gl_uniform_buffer_binding *binding; + + binding = &ctx->UniformBufferBindings[index]; + if (binding->BufferObject == bufObj && + binding->Offset == offset && + binding->Size == size && + binding->AutomaticSize == autoSize) { + return; + } + + FLUSH_VERTICES(ctx, _NEW_BUFFER_OBJECT); + + _mesa_reference_buffer_object(ctx, &binding->BufferObject, bufObj); + binding->Offset = offset; + binding->Size = size; + binding->AutomaticSize = autoSize; +} + +/** + * Specify a buffer object to receive vertex shader results. Plus, + * specify the starting offset to place the results, and max size. + */ +static void +bind_buffer_range_uniform_buffer(struct gl_context *ctx, + GLuint index, + struct gl_buffer_object *bufObj, + GLintptr offset, + GLsizeiptr size) +{ + if (index >= ctx->Const.MaxUniformBufferBindings) { + _mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferRange(index=%d)", index); + return; + } + + if (offset & (ctx->Const.UniformBufferOffsetAlignment - 1)) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glBindBufferRange(offset misalgned %d/%d)", (int) offset, + ctx->Const.UniformBufferOffsetAlignment); + return; + } + + if (bufObj == ctx->Shared->NullBufferObj) { + offset = -1; + size = -1; + } + + _mesa_reference_buffer_object(ctx, &ctx->UniformBuffer, bufObj); + set_ubo_binding(ctx, index, bufObj, offset, size, GL_FALSE); +} + + +/** + * Specify a buffer object to receive vertex shader results. + * As above, but start at offset = 0. + */ +static void +bind_buffer_base_uniform_buffer(struct gl_context *ctx, + GLuint index, + struct gl_buffer_object *bufObj) +{ + if (index >= ctx->Const.MaxUniformBufferBindings) { + _mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferBase(index=%d)", index); + return; + } + + _mesa_reference_buffer_object(ctx, &ctx->UniformBuffer, bufObj); + if (bufObj == ctx->Shared->NullBufferObj) + set_ubo_binding(ctx, index, bufObj, -1, -1, GL_TRUE); + else + set_ubo_binding(ctx, index, bufObj, 0, 0, GL_TRUE); +} + +void GLAPIENTRY +_mesa_BindBufferRange(GLenum target, GLuint index, + GLuint buffer, GLintptr offset, GLsizeiptr size) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_buffer_object *bufObj; + + if (buffer == 0) { + bufObj = ctx->Shared->NullBufferObj; + } else { + bufObj = _mesa_lookup_bufferobj(ctx, buffer); + } + + if (!bufObj) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBindBufferRange(invalid buffer=%u)", buffer); + return; + } + + if (size <= 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferRange(size=%d)", + (int) size); + return; + } + + if (offset + size > bufObj->Size) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glBindBufferRange(offset + size %d > buffer size %d)", + (int) (offset + size), (int) (bufObj->Size)); + return; + } + + switch (target) { + case GL_TRANSFORM_FEEDBACK_BUFFER: + _mesa_bind_buffer_range_transform_feedback(ctx, index, bufObj, + offset, size); + return; + case GL_UNIFORM_BUFFER: + bind_buffer_range_uniform_buffer(ctx, index, bufObj, offset, size); + return; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferRange(target)"); + return; + } +} + +void GLAPIENTRY +_mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_buffer_object *bufObj; + + if (buffer == 0) { + bufObj = ctx->Shared->NullBufferObj; + } else { + bufObj = _mesa_lookup_bufferobj(ctx, buffer); + } + + if (!bufObj) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBindBufferBase(invalid buffer=%u)", buffer); + return; + } + + /* Note that there's some oddness in the GL 3.1-GL 3.3 specifications with + * regards to BindBufferBase. It says (GL 3.1 core spec, page 63): + * + * "BindBufferBase is equivalent to calling BindBufferRange with offset + * zero and size equal to the size of buffer." + * + * but it says for glGetIntegeri_v (GL 3.1 core spec, page 230): + * + * "If the parameter (starting offset or size) was not specified when the + * buffer object was bound, zero is returned." + * + * What happens if the size of the buffer changes? Does the size of the + * buffer at the moment glBindBufferBase was called still play a role, like + * the first quote would imply, or is the size meaningless in the + * glBindBufferBase case like the second quote would suggest? The GL 4.1 + * core spec page 45 says: + * + * "It is equivalent to calling BindBufferRange with offset zero, while + * size is determined by the size of the bound buffer at the time the + * binding is used." + * + * My interpretation is that the GL 4.1 spec was a clarification of the + * behavior, not a change. In particular, this choice will only make + * rendering work in cases where it would have had undefined results. + */ + + switch (target) { + case GL_TRANSFORM_FEEDBACK_BUFFER: + _mesa_bind_buffer_base_transform_feedback(ctx, index, bufObj); + return; + case GL_UNIFORM_BUFFER: + bind_buffer_base_uniform_buffer(ctx, index, bufObj); + return; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferBase(target)"); + return; + } +} + +void +_mesa_init_bufferobj_dispatch(struct _glapi_table *disp) +{ + SET_BindBufferARB(disp, _mesa_BindBufferARB); + SET_BufferDataARB(disp, _mesa_BufferDataARB); + SET_BufferSubDataARB(disp, _mesa_BufferSubDataARB); + SET_DeleteBuffersARB(disp, _mesa_DeleteBuffersARB); + SET_GenBuffersARB(disp, _mesa_GenBuffersARB); + SET_GetBufferParameterivARB(disp, _mesa_GetBufferParameterivARB); + SET_GetBufferPointervARB(disp, _mesa_GetBufferPointervARB); + SET_GetBufferSubDataARB(disp, _mesa_GetBufferSubDataARB); + SET_IsBufferARB(disp, _mesa_IsBufferARB); + SET_MapBufferARB(disp, _mesa_MapBufferARB); + SET_UnmapBufferARB(disp, _mesa_UnmapBufferARB); + SET_BindBufferRangeEXT(disp, _mesa_BindBufferRange); + SET_BindBufferBaseEXT(disp, _mesa_BindBufferBase); +} diff --git a/mesalib/src/mesa/main/bufferobj.h b/mesalib/src/mesa/main/bufferobj.h index 66343c3cd..e1d0f7a97 100644 --- a/mesalib/src/mesa/main/bufferobj.h +++ b/mesalib/src/mesa/main/bufferobj.h @@ -159,4 +159,14 @@ extern void GLAPIENTRY _mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, GLint* params); #endif +void GLAPIENTRY +_mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer); + +void GLAPIENTRY +_mesa_BindBufferRange(GLenum target, GLuint index, + GLuint buffer, GLintptr offset, GLsizeiptr size); + +extern void +_mesa_init_bufferobj_dispatch(struct _glapi_table *disp); + #endif diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index 3bcedecd9..643476b94 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -542,6 +542,9 @@ init_program_limits(GLenum type, struct gl_program_constants *prog) prog->MediumInt.RangeMax = 24; prog->MediumInt.Precision = 0; prog->LowInt = prog->HighInt = prog->MediumInt; + + prog->MaxUniformBlocks = 12; + prog->MaxCombinedUniformComponents = prog->MaxUniformComponents; } @@ -653,6 +656,12 @@ _mesa_init_constants(struct gl_context *ctx) ctx->Const.MaxTransformFeedbackSeparateComponents = 4 * MAX_FEEDBACK_ATTRIBS; ctx->Const.MaxTransformFeedbackInterleavedComponents = 4 * MAX_FEEDBACK_ATTRIBS; + /** GL_ARB_uniform_buffer_object */ + ctx->Const.MaxCombinedUniformBlocks = 36; + ctx->Const.MaxUniformBufferBindings = 36; + ctx->Const.MaxUniformBlockSize = 16384; + ctx->Const.UniformBufferOffsetAlignment = 1; + /* GL 3.2: hard-coded for now: */ ctx->Const.ProfileMask = GL_CONTEXT_COMPATIBILITY_PROFILE_BIT; diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index 079316145..e4fe73307 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -141,7 +141,7 @@ static const struct extension extension_table[] = { { "GL_ARB_texture_swizzle", o(EXT_texture_swizzle), GL, 2008 }, { "GL_ARB_transform_feedback2", o(ARB_transform_feedback2), GL, 2010 }, { "GL_ARB_transpose_matrix", o(ARB_transpose_matrix), GL, 1999 }, - { "GL_ARB_uniform_buffer_object", o(ARB_uniform_buffer_object), GL, 2002 }, + { "GL_ARB_uniform_buffer_object", o(ARB_uniform_buffer_object), GL, 2009 }, { "GL_ARB_vertex_array_bgra", o(EXT_vertex_array_bgra), GL, 2008 }, { "GL_ARB_vertex_array_object", o(ARB_vertex_array_object), GL, 2006 }, { "GL_ARB_vertex_buffer_object", o(dummy_true), GL, 2003 }, diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c index 8dc47306f..67732521c 100644 --- a/mesalib/src/mesa/main/get.c +++ b/mesalib/src/mesa/main/get.c @@ -289,6 +289,12 @@ static const int extra_ARB_sampler_objects[] = { EXTRA_END }; +static const int extra_ARB_uniform_buffer_object_and_geometry_shader[] = { + EXT(ARB_uniform_buffer_object), + EXT(ARB_geometry_shader4), + EXTRA_END +}; + EXTRA_EXT(ARB_ES2_compatibility); EXTRA_EXT(ARB_texture_cube_map); @@ -335,6 +341,7 @@ EXTRA_EXT(EXT_framebuffer_sRGB); EXTRA_EXT(ARB_texture_buffer_object); EXTRA_EXT(OES_EGL_image_external); EXTRA_EXT(ARB_blend_func_extended); +EXTRA_EXT(ARB_uniform_buffer_object); static const int extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = { @@ -1321,6 +1328,31 @@ static const struct value_desc values[] = { { GL_MAX_DUAL_SOURCE_DRAW_BUFFERS, CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended }, + /* GL_ARB_uniform_buffer_object */ + { GL_MAX_VERTEX_UNIFORM_BLOCKS, CONTEXT_INT(Const.VertexProgram.MaxUniformBlocks), + extra_ARB_uniform_buffer_object }, + { GL_MAX_FRAGMENT_UNIFORM_BLOCKS, CONTEXT_INT(Const.FragmentProgram.MaxUniformBlocks), + extra_ARB_uniform_buffer_object }, + { GL_MAX_GEOMETRY_UNIFORM_BLOCKS, CONTEXT_INT(Const.GeometryProgram.MaxUniformBlocks), + extra_ARB_uniform_buffer_object_and_geometry_shader }, + { GL_MAX_COMBINED_UNIFORM_BLOCKS, CONTEXT_INT(Const.MaxCombinedUniformBlocks), + extra_ARB_uniform_buffer_object }, + { GL_MAX_UNIFORM_BLOCK_SIZE, CONTEXT_INT(Const.MaxUniformBlockSize), + extra_ARB_uniform_buffer_object }, + { GL_MAX_UNIFORM_BUFFER_BINDINGS, CONTEXT_INT(Const.MaxUniformBufferBindings), + extra_ARB_uniform_buffer_object }, + + { GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS, CONTEXT_INT(Const.VertexProgram.MaxCombinedUniformComponents), + extra_ARB_uniform_buffer_object }, + { GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, CONTEXT_INT(Const.FragmentProgram.MaxCombinedUniformComponents), + extra_ARB_uniform_buffer_object }, + { GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS, CONTEXT_INT(Const.GeometryProgram.MaxCombinedUniformComponents), + extra_ARB_uniform_buffer_object_and_geometry_shader }, + { GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, CONTEXT_INT(Const.UniformBufferOffsetAlignment), + extra_ARB_uniform_buffer_object }, + + { GL_UNIFORM_BUFFER_BINDING, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_uniform_buffer_object }, + #endif /* FEATURE_GL */ }; @@ -1771,6 +1803,10 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu v->value_int = samp ? samp->Name : 0; } break; + /* GL_ARB_uniform_buffer_object */ + case GL_UNIFORM_BUFFER_BINDING: + v->value_int = ctx->UniformBuffer->Name; + break; } } @@ -2530,6 +2566,30 @@ find_value_indexed(const char *func, GLenum pname, int index, union value *v) goto invalid_enum; v->value_int = ctx->TransformFeedback.CurrentObject->BufferNames[index]; return TYPE_INT; + + case GL_UNIFORM_BUFFER_BINDING: + if (index >= ctx->Const.MaxUniformBufferBindings) + goto invalid_value; + if (!ctx->Extensions.ARB_uniform_buffer_object) + goto invalid_enum; + v->value_int = ctx->UniformBufferBindings[index].BufferObject->Name; + return TYPE_INT; + + case GL_UNIFORM_BUFFER_START: + if (index >= ctx->Const.MaxUniformBufferBindings) + goto invalid_value; + if (!ctx->Extensions.ARB_uniform_buffer_object) + goto invalid_enum; + v->value_int = ctx->UniformBufferBindings[index].Offset; + return TYPE_INT; + + case GL_UNIFORM_BUFFER_SIZE: + if (index >= ctx->Const.MaxUniformBufferBindings) + goto invalid_value; + if (!ctx->Extensions.ARB_uniform_buffer_object) + goto invalid_enum; + v->value_int = ctx->UniformBufferBindings[index].Size; + return TYPE_INT; } invalid_enum: diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index d52ab151a..def0db1aa 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -2709,6 +2709,9 @@ struct gl_program_constants /* ES 2.0 and GL_ARB_ES2_compatibility */ struct gl_precision LowFloat, MediumFloat, HighFloat; struct gl_precision LowInt, MediumInt, HighInt; + /* GL_ARB_uniform_buffer_object */ + GLuint MaxUniformBlocks; + GLuint MaxCombinedUniformComponents; }; @@ -2774,6 +2777,15 @@ struct gl_constants GLuint MaxVertexVaryingComponents; /**< Between vert and geom shader */ GLuint MaxGeometryVaryingComponents; /**< Between geom and frag shader */ + /** @{ + * GL_ARB_uniform_buffer_object + */ + GLuint MaxCombinedUniformBlocks; + GLuint MaxUniformBufferBindings; + GLuint MaxUniformBlockSize; + GLuint UniformBufferOffsetAlignment; + /** @} */ + /** GL_ARB_geometry_shader4 */ GLuint MaxGeometryOutputVertices; GLuint MaxGeometryTotalOutputComponents; @@ -3283,6 +3295,20 @@ struct gl_driver_flags GLbitfield NewArray; /**< Vertex array state */ }; +struct gl_uniform_buffer_binding +{ + struct gl_buffer_object *BufferObject; + /** Start of uniform block data in the buffer */ + GLintptr Offset; + /** Size of data allowed to be referenced from the buffer (in bytes) */ + GLsizeiptr Size; + /** + * glBindBufferBase() indicates that the Size should be ignored and only + * limited by the current size of the BufferObject. + */ + GLboolean AutomaticSize; +}; + /** * Mesa rendering context. * @@ -3418,6 +3444,21 @@ struct gl_context struct gl_buffer_object *CopyReadBuffer; /**< GL_ARB_copy_buffer */ struct gl_buffer_object *CopyWriteBuffer; /**< GL_ARB_copy_buffer */ + + /** + * Current GL_ARB_uniform_buffer_object binding referenced by + * GL_UNIFORM_BUFFER target for glBufferData, glMapBuffer, etc. + */ + struct gl_buffer_object *UniformBuffer; + + /** + * Array of uniform buffers for GL_ARB_uniform_buffer_object and GL 3.1. + * This is set up using glBindBufferRange() or glBindBufferBase(). They are + * associated with uniform blocks by glUniformBlockBinding()'s state in the + * shader program. + */ + struct gl_uniform_buffer_binding *UniformBufferBindings; + /*@}*/ struct gl_meta_state *Meta; /**< for "meta" operations */ diff --git a/mesalib/src/mesa/main/transformfeedback.c b/mesalib/src/mesa/main/transformfeedback.c index 1bd76d130..84c409185 100644 --- a/mesalib/src/mesa/main/transformfeedback.c +++ b/mesalib/src/mesa/main/transformfeedback.c @@ -291,8 +291,6 @@ _mesa_init_transform_feedback_dispatch(struct _glapi_table *disp) /* EXT_transform_feedback */ SET_BeginTransformFeedbackEXT(disp, _mesa_BeginTransformFeedback); SET_EndTransformFeedbackEXT(disp, _mesa_EndTransformFeedback); - SET_BindBufferRangeEXT(disp, _mesa_BindBufferRange); - SET_BindBufferBaseEXT(disp, _mesa_BindBufferBase); SET_BindBufferOffsetEXT(disp, _mesa_BindBufferOffsetEXT); SET_TransformFeedbackVaryingsEXT(disp, _mesa_TransformFeedbackVaryings); SET_GetTransformFeedbackVaryingEXT(disp, _mesa_GetTransformFeedbackVarying); @@ -431,18 +429,14 @@ bind_buffer_range(struct gl_context *ctx, GLuint index, * Specify a buffer object to receive vertex shader results. Plus, * specify the starting offset to place the results, and max size. */ -void GLAPIENTRY -_mesa_BindBufferRange(GLenum target, GLuint index, - GLuint buffer, GLintptr offset, GLsizeiptr size) +void +_mesa_bind_buffer_range_transform_feedback(struct gl_context *ctx, + GLuint index, + struct gl_buffer_object *bufObj, + GLintptr offset, + GLsizeiptr size) { struct gl_transform_feedback_object *obj; - struct gl_buffer_object *bufObj; - GET_CURRENT_CONTEXT(ctx); - - if (target != GL_TRANSFORM_FEEDBACK_BUFFER) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferRange(target)"); - return; - } obj = ctx->TransformFeedback.CurrentObject; @@ -457,8 +451,8 @@ _mesa_BindBufferRange(GLenum target, GLuint index, return; } - if ((size <= 0) || (size & 0x3)) { - /* must be positive and multiple of four */ + if (size & 0x3) { + /* must a multiple of four */ _mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferRange(size=%d)", (int) size); return; } @@ -470,25 +464,6 @@ _mesa_BindBufferRange(GLenum target, GLuint index, return; } - if (buffer == 0) { - bufObj = ctx->Shared->NullBufferObj; - } else { - bufObj = _mesa_lookup_bufferobj(ctx, buffer); - } - - if (!bufObj) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBindBufferRange(invalid buffer=%u)", buffer); - return; - } - - if (offset + size > bufObj->Size) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glBindBufferRange(offset + size %d > buffer size %d)", - (int) (offset + size), (int) (bufObj->Size)); - return; - } - bind_buffer_range(ctx, index, bufObj, offset, size); } @@ -497,18 +472,13 @@ _mesa_BindBufferRange(GLenum target, GLuint index, * Specify a buffer object to receive vertex shader results. * As above, but start at offset = 0. */ -void GLAPIENTRY -_mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer) +void +_mesa_bind_buffer_base_transform_feedback(struct gl_context *ctx, + GLuint index, + struct gl_buffer_object *bufObj) { struct gl_transform_feedback_object *obj; - struct gl_buffer_object *bufObj; GLsizeiptr size; - GET_CURRENT_CONTEXT(ctx); - - if (target != GL_TRANSFORM_FEEDBACK_BUFFER) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferBase(target)"); - return; - } obj = ctx->TransformFeedback.CurrentObject; @@ -523,18 +493,6 @@ _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer) return; } - if (buffer == 0) { - bufObj = ctx->Shared->NullBufferObj; - } else { - bufObj = _mesa_lookup_bufferobj(ctx, buffer); - } - - if (!bufObj) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBindBufferBase(invalid buffer=%u)", buffer); - return; - } - /* default size is the buffer size rounded down to nearest * multiple of four. */ diff --git a/mesalib/src/mesa/main/transformfeedback.h b/mesalib/src/mesa/main/transformfeedback.h index 7d63de017..85f4cbc77 100644 --- a/mesalib/src/mesa/main/transformfeedback.h +++ b/mesalib/src/mesa/main/transformfeedback.h @@ -60,12 +60,17 @@ _mesa_BeginTransformFeedback(GLenum mode); extern void GLAPIENTRY _mesa_EndTransformFeedback(void); -extern void GLAPIENTRY -_mesa_BindBufferRange(GLenum target, GLuint index, - GLuint buffer, GLintptr offset, GLsizeiptr size); +extern void +_mesa_bind_buffer_range_transform_feedback(struct gl_context *ctx, + GLuint index, + struct gl_buffer_object *bufObj, + GLintptr offset, + GLsizeiptr size); -extern void GLAPIENTRY -_mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer); +extern void +_mesa_bind_buffer_base_transform_feedback(struct gl_context *ctx, + GLuint index, + struct gl_buffer_object *bufObj); extern void GLAPIENTRY _mesa_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer, diff --git a/mesalib/src/mesa/osmesa.pc.in b/mesalib/src/mesa/osmesa.pc.in index 05327f40a..307255ffc 100644 --- a/mesalib/src/mesa/osmesa.pc.in +++ b/mesalib/src/mesa/osmesa.pc.in @@ -1,12 +1,12 @@ -prefix=@INSTALL_DIR@ +prefix=@prefix@ exec_prefix=${prefix} -libdir=@INSTALL_LIB_DIR@ -includedir=@INSTALL_INC_DIR@ +libdir=@libdir@ +includedir=@includedir@ Name: osmesa Description: Mesa Off-screen Rendering library Requires: @OSMESA_PC_REQ@ -Version: @VERSION@ +Version: @PACKAGE_VERSION@ Libs: -L${libdir} -l@OSMESA_LIB@ Libs.private: @OSMESA_PC_LIB_PRIV@ Cflags: -I${includedir} diff --git a/mesalib/src/mesa/x86/.gitignore b/mesalib/src/mesa/x86/.gitignore new file mode 100644 index 000000000..ba7486c0b --- /dev/null +++ b/mesalib/src/mesa/x86/.gitignore @@ -0,0 +1,3 @@ +Makefile +gen_matypes +matypes.h diff --git a/mesalib/src/mesa/x86/Makefile b/mesalib/src/mesa/x86/Makefile deleted file mode 100644 index 9716dc27f..000000000 --- a/mesalib/src/mesa/x86/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -# src/mesa/x86/Makefile - -TOP = ../../.. -include $(TOP)/configs/current - - -INCLUDE_DIRS = \ - -I$(TOP)/include/GL \ - -I$(TOP)/include \ - -I$(TOP)/src/mapi \ - -I.. \ - -I../main \ - -I../math \ - -I../tnl - - -default: gen_matypes matypes.h - -clean: - -rm -f matypes.h gen_matypes - - -gen_matypes: gen_matypes.c - $(HOST_CC) $(ARCH_FLAGS) $(INCLUDE_DIRS) $(HOST_CFLAGS) gen_matypes.c -o gen_matypes - -# need some special rules here, unfortunately -matypes.h: ../main/mtypes.h ../tnl/t_context.h gen_matypes - ./gen_matypes > matypes.h - -common_x86_asm.o: matypes.h -3dnow_normal.o: matypes.h -3dnow_xform1.o: matypes.h -3dnow_xform2.o: matypes.h -3dnow_xform3.o: matypes.h -3dnow_xform4.o: matypes.h -mmx_blend.o: matypes.h -sse_normal.o: matypes.h -sse_xform1.o: matypes.h -sse_xform2.o: matypes.h -sse_xform3.o: matypes.h -sse_xform4.o: matypes.h -x86_cliptest.o: matypes.h -x86_xform2.o: matypes.h -x86_xform3.o: matypes.h -x86_xform4.o: matypes.h - diff --git a/mesalib/src/mesa/x86/Makefile.am b/mesalib/src/mesa/x86/Makefile.am new file mode 100644 index 000000000..f241de505 --- /dev/null +++ b/mesalib/src/mesa/x86/Makefile.am @@ -0,0 +1,39 @@ +# Copyright © 2012 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +if HAVE_X86_ASM + +AM_CPPFLAGS = \ + -I$(top_srcdir)/src/mesa \ + -I$(top_srcdir)/src/mapi \ + $(API_DEFINES) \ + $(DEFINES) + +noinst_PROGRAMS = gen_matypes + +gen_matypes_SOURCES = gen_matypes.c +BUILT_SOURCES = matypes.h +CLEANFILES = matypes.h + +matypes.h: gen_matypes + $(AM_V_GEN)./gen_matypes > $@ + +endif |