Compare commits
1 Commits
mesa-9.0.1
...
instanced_
Author | SHA1 | Date | |
---|---|---|---|
|
c988bf94bc |
@@ -3,7 +3,6 @@
|
||||
(tab-width . 8)
|
||||
(c-basic-offset . 3)
|
||||
(c-file-style . "stroustrup")
|
||||
(fill-column . 78)
|
||||
(eval . (progn
|
||||
(c-set-offset 'innamespace '0)
|
||||
(c-set-offset 'inline-open '0)))
|
||||
|
@@ -40,16 +40,14 @@ LOCAL_CFLAGS += \
|
||||
-DANDROID_VERSION=0x0$(major)0$(minor)
|
||||
|
||||
LOCAL_CFLAGS += \
|
||||
-DHAVE_PTHREAD=1 \
|
||||
-DPTHREADS \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
ifeq ($(strip $(MESA_ENABLE_ASM)),true)
|
||||
ifeq ($(TARGET_ARCH),x86)
|
||||
LOCAL_CFLAGS += \
|
||||
-DUSE_X86_ASM \
|
||||
-DHAVE_DLOPEN \
|
||||
|
||||
-DUSE_X86_ASM
|
||||
endif
|
||||
endif
|
||||
|
||||
|
71
Makefile.am
71
Makefile.am
@@ -21,14 +21,11 @@
|
||||
|
||||
SUBDIRS = src
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
doxygen:
|
||||
cd doxygen && $(MAKE)
|
||||
|
||||
check-local:
|
||||
$(MAKE) -C src/mapi/glapi/tests check
|
||||
$(MAKE) -C src/mapi/shared-glapi/tests check
|
||||
$(MAKE) -C src/mesa/main/tests check
|
||||
$(MAKE) -C src/glsl/tests check
|
||||
$(MAKE) -C src/glx/tests check
|
||||
@@ -54,25 +51,16 @@ distclean-local:
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
PACKAGE_VERSION=9.0.1
|
||||
PACKAGE_VERSION=8.1-devel
|
||||
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
|
||||
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
|
||||
|
||||
EXTRA_FILES = \
|
||||
aclocal.m4 \
|
||||
configure \
|
||||
bin/ar-lib \
|
||||
bin/compile \
|
||||
bin/config.sub \
|
||||
bin/config.guess \
|
||||
bin/depcomp \
|
||||
bin/install-sh \
|
||||
bin/ltmain.sh \
|
||||
bin/missing \
|
||||
bin/ylwrap \
|
||||
src/glsl/glsl_parser.cc \
|
||||
src/glsl/glsl_parser.cpp \
|
||||
src/glsl/glsl_parser.h \
|
||||
src/glsl/glsl_lexer.cc \
|
||||
src/glsl/glsl_lexer.cpp \
|
||||
src/glsl/glcpp/glcpp-lex.c \
|
||||
src/glsl/glcpp/glcpp-parse.c \
|
||||
src/glsl/glcpp/glcpp-parse.h \
|
||||
@@ -84,56 +72,7 @@ EXTRA_FILES = \
|
||||
src/mesa/main/api_exec_es2_remap_helper.h \
|
||||
src/mesa/program/lex.yy.c \
|
||||
src/mesa/program/program_parse.tab.c \
|
||||
src/mesa/program/program_parse.tab.h \
|
||||
src/gallium/drivers/r600/Makefile.in \
|
||||
src/gallium/drivers/r300/Makefile.in \
|
||||
src/gallium/drivers/Makefile.in \
|
||||
src/gallium/Makefile.in \
|
||||
src/gallium/auxiliary/pipe-loader/Makefile.in \
|
||||
src/gallium/targets/opencl/Makefile.in \
|
||||
src/gallium/state_trackers/clover/Makefile.in \
|
||||
src/mapi/glapi/tests/Makefile.in \
|
||||
src/mapi/glapi/Makefile.in \
|
||||
src/mapi/glapi/gen/Makefile.in \
|
||||
src/mapi/es1api/Makefile.in \
|
||||
src/mapi/shared-glapi/tests/Makefile.in \
|
||||
src/mapi/shared-glapi/Makefile.in \
|
||||
src/mapi/vgapi/Makefile.in \
|
||||
src/mapi/es2api/Makefile.in \
|
||||
src/glsl/tests/Makefile.in \
|
||||
src/glsl/glcpp/Makefile.in \
|
||||
src/glsl/Makefile.in \
|
||||
src/gtest/Makefile.in \
|
||||
src/egl/drivers/Makefile.in \
|
||||
src/egl/drivers/glx/Makefile.in \
|
||||
src/egl/drivers/dri2/Makefile.in \
|
||||
src/egl/Makefile.in \
|
||||
src/egl/main/Makefile.in \
|
||||
src/egl/wayland/Makefile.in \
|
||||
src/egl/wayland/wayland-drm/Makefile.in \
|
||||
src/egl/wayland/wayland-egl/Makefile.in \
|
||||
src/Makefile.in \
|
||||
src/glx/tests/Makefile.in \
|
||||
src/glx/Makefile.in \
|
||||
src/gbm/Makefile.in \
|
||||
src/mesa/drivers/Makefile.in \
|
||||
src/mesa/drivers/dri/common/Makefile.in \
|
||||
src/mesa/drivers/dri/i965/Makefile.in \
|
||||
src/mesa/drivers/dri/r200/Makefile.in \
|
||||
src/mesa/drivers/dri/Makefile.in \
|
||||
src/mesa/drivers/dri/radeon/Makefile.in \
|
||||
src/mesa/drivers/dri/swrast/Makefile.in \
|
||||
src/mesa/drivers/dri/nouveau/Makefile.in \
|
||||
src/mesa/drivers/dri/i915/Makefile.in \
|
||||
src/mesa/drivers/osmesa/Makefile.in \
|
||||
src/mesa/drivers/x11/Makefile.in \
|
||||
src/mesa/Makefile.in \
|
||||
src/mesa/libdricore/Makefile.in \
|
||||
src/mesa/x86-64/Makefile.in \
|
||||
src/mesa/main/tests/Makefile.in \
|
||||
src/mesa/x86/Makefile.in \
|
||||
Makefile.in
|
||||
|
||||
src/mesa/program/program_parse.tab.h
|
||||
|
||||
IGNORE_FILES = \
|
||||
-x autogen.sh
|
||||
@@ -141,7 +80,7 @@ IGNORE_FILES = \
|
||||
|
||||
parsers: configure
|
||||
-@touch $(top_builddir)/configs/current
|
||||
$(MAKE) -C src/glsl glsl_parser.cc glsl_parser.h glsl_lexer.cc
|
||||
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
|
||||
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
|
||||
$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
|
||||
|
||||
|
10
autogen.sh
10
autogen.sh
@@ -3,11 +3,17 @@
|
||||
srcdir=`dirname "$0"`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
SRCDIR=`(cd "$srcdir" && pwd)`
|
||||
ORIGDIR=`pwd`
|
||||
cd "$srcdir"
|
||||
|
||||
if test "x$SRCDIR" != "x$ORIGDIR"; then
|
||||
echo "Mesa cannot be built when srcdir != builddir" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MAKEFLAGS=""
|
||||
|
||||
autoreconf -v --install || exit 1
|
||||
cd $ORIGDIR || exit $?
|
||||
|
||||
if test -z "$NOCONFIGURE"; then
|
||||
"$srcdir"/configure "$@"
|
||||
|
@@ -1,10 +0,0 @@
|
||||
# These commits were cherry picked without using -x.
|
||||
# TBD
|
||||
|
||||
# Causes too many regressions...
|
||||
413c4914129cd26ca87960852d8c0264c0fb29e7 intel: Improve teximage perf for Google Chrome paint rects (v3)
|
||||
b1d0fe022dc4826dadce014ab8fe062a82f75a16 intel: Fix segfault in intel_texsubimage_tiled_memcpy
|
||||
b5891286202987dfc2606ac716050c0ee426de11 intel: Fix yet-another-bug in intel_texsubimage_tiled_memcpy
|
||||
|
||||
# Introduces performance regressions for other games... don't cherry-pick for now
|
||||
fa58644855e44830e0b91dc627703c236fa6712a r600g: fix abysmal performance in Reaction Quake
|
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Script for generating a list of candidates for cherry-picking to a stable branch
|
||||
|
||||
# Grep for commits with "cherry picked from commit" in the commit message.
|
||||
git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\
|
||||
grep "cherry picked from commit" |\
|
||||
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
|
||||
|
||||
# Grep for commits that were marked as a candidate for the stable tree.
|
||||
git log --reverse --pretty=%H -i --grep='^[[:space:]]*NOTE: This is a candidate' HEAD..origin/master |\
|
||||
while read sha
|
||||
do
|
||||
# Check to see whether the patch is on the ignore list.
|
||||
if [ -f bin/.cherry-ignore ] ; then
|
||||
if grep -q ^$sha bin/.cherry-ignore ; then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check to see if it has already been picked over.
|
||||
if grep -q ^$sha already_picked ; then
|
||||
continue
|
||||
fi
|
||||
|
||||
git log -n1 --pretty=oneline $sha | cat
|
||||
done
|
||||
|
||||
rm -f already_picked
|
42
bin/mklib
42
bin/mklib
@@ -319,25 +319,6 @@ case $ARCH in
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if objects are 32-bit and we're running in 64-bit
|
||||
# environment. If so, pass -m32 flag to linker.
|
||||
add_abi_flag_to_opts() {
|
||||
case $(file $1) in
|
||||
*32-bit*x86-64*)
|
||||
# x86_64 x32 ABI.
|
||||
OPTS="-mx32 ${OPTS}"
|
||||
;;
|
||||
*64-bit*x86-64*)
|
||||
# x86_64 64-bit ABI.
|
||||
OPTS="-m64 ${OPTS}"
|
||||
;;
|
||||
*32-bit*Intel*)
|
||||
# x86 32-bit ABI.
|
||||
OPTS="-m32 ${OPTS}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
if [ $NOPREFIX = 1 ] ; then
|
||||
# No "lib" or ".so" part
|
||||
echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}
|
||||
@@ -349,8 +330,15 @@ case $ARCH in
|
||||
;;
|
||||
esac
|
||||
|
||||
# Check to see if we are building for a different ABI.
|
||||
add_abi_flag_to_opts ${OBJECTS}
|
||||
# Check if objects are 32-bit and we're running in 64-bit
|
||||
# environment. If so, pass -m32 flag to linker.
|
||||
set ${OBJECTS}
|
||||
ABI32=`file $1 | grep 32-bit`
|
||||
ARM=`file $1 | grep ARM`
|
||||
# Do not add "-m32" option for arm.
|
||||
if [ -z "$ARM" -a "${ABI32}" -a `uname -m` = "x86_64" ] ; then
|
||||
OPTS="-m32 ${OPTS}"
|
||||
fi
|
||||
|
||||
if [ "${ALTOPTS}" ] ; then
|
||||
OPTS=${ALTOPTS}
|
||||
@@ -401,9 +389,15 @@ case $ARCH in
|
||||
# exptmp is removed below
|
||||
fi
|
||||
|
||||
# Check to see if we are building for a different ABI.
|
||||
add_abi_flag_to_opts ${OBJECTS}
|
||||
|
||||
# Check if objects are 32-bit and we're running in 64-bit
|
||||
# environment. If so, pass -m32 flag to linker.
|
||||
set ${OBJECTS}
|
||||
ABI32=`file $1 | grep 32-bit`
|
||||
ARM=`file $1 | grep ARM`
|
||||
# Do not add "-m32" option for arm.
|
||||
if [ -z "$ARM" -a "${ABI32}" -a `uname -m` = "x86_64" ] ; then
|
||||
OPTS="-m32 ${OPTS}"
|
||||
fi
|
||||
if [ "${ALTOPTS}" ] ; then
|
||||
OPTS=${ALTOPTS}
|
||||
fi
|
||||
|
@@ -98,6 +98,5 @@ def AddOptions(opts):
|
||||
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
|
||||
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
|
||||
opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
|
||||
opts.Add(BoolOption('texture_float', 'enable floating-point textures and renderbuffers', 'no'))
|
||||
if host_platform == 'windows':
|
||||
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
|
||||
|
@@ -9,17 +9,20 @@ CONFIG_NAME = autoconf
|
||||
# Compiler and flags
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
OPT_FLAGS = @OPT_FLAGS@
|
||||
ARCH_FLAGS = @ARCH_FLAGS@
|
||||
PIC_FLAGS = @PIC_FLAGS@
|
||||
DEFINES = @DEFINES@
|
||||
API_DEFINES = @API_DEFINES@
|
||||
SHARED_GLAPI = @SHARED_GLAPI@
|
||||
CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \
|
||||
$(PIC_FLAGS) $(DEFINES)
|
||||
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
|
||||
CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
|
||||
$(PIC_FLAGS) $(DEFINES)
|
||||
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
|
||||
CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@
|
||||
CXXFLAGS = $(CXXFLAGS_NOVISIBILITY) @VISIBILITY_CXXFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
|
||||
RADEON_CFLAGS = @RADEON_CFLAGS@
|
||||
RADEON_LIBS = @RADEON_LIBS@
|
||||
NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@
|
||||
@@ -44,6 +47,7 @@ DLOPEN_LIBS = @DLOPEN_LIBS@
|
||||
|
||||
# Source selection
|
||||
MESA_ASM_FILES = @MESA_ASM_FILES@
|
||||
GLAPI_ASM_SOURCES = @GLAPI_ASM_SOURCES@
|
||||
|
||||
# Misc tools and flags
|
||||
MAKE = @MAKE@
|
||||
@@ -96,6 +100,7 @@ GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
|
||||
GL_LIB_GLOB = @GL_LIB_GLOB@
|
||||
GLU_LIB_GLOB = @GLU_LIB_GLOB@
|
||||
GLW_LIB_GLOB = @GLW_LIB_GLOB@
|
||||
OSMESA_LIB_GLOB = @OSMESA_LIB_GLOB@
|
||||
EGL_LIB_GLOB = @EGL_LIB_GLOB@
|
||||
GLESv1_CM_LIB_GLOB = @GLESv1_CM_LIB_GLOB@
|
||||
GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
|
||||
@@ -105,6 +110,7 @@ GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
|
||||
# Directories to build
|
||||
LIB_DIR = @LIB_DIR@
|
||||
SRC_DIRS = @SRC_DIRS@
|
||||
GLU_DIRS = @GLU_DIRS@
|
||||
DRIVER_DIRS = @DRIVER_DIRS@
|
||||
GALLIUM_DIRS = @GALLIUM_DIRS@
|
||||
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
|
||||
@@ -127,22 +133,22 @@ GLW_SOURCES = @GLW_SOURCES@
|
||||
MOTIF_CFLAGS = @MOTIF_CFLAGS@
|
||||
|
||||
# Library/program dependencies
|
||||
GL_LIB_DEPS = @GL_LIB_DEPS@
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) @GL_LIB_DEPS@
|
||||
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \
|
||||
@OSMESA_LIB_DEPS@
|
||||
EGL_LIB_DEPS = @EGL_LIB_DEPS@
|
||||
$(EXTRA_LIB_PATH) @OSMESA_LIB_DEPS@
|
||||
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @EGL_LIB_DEPS@
|
||||
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLU_MESA_DEPS@ \
|
||||
@GLU_LIB_DEPS@
|
||||
$(EXTRA_LIB_PATH) @GLU_LIB_DEPS@
|
||||
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLW_MESA_DEPS@ \
|
||||
@GLW_LIB_DEPS@
|
||||
GLESv1_CM_LIB_DEPS = @GLESv1_CM_LIB_DEPS@
|
||||
GLESv2_LIB_DEPS = @GLESv2_LIB_DEPS@
|
||||
VG_LIB_DEPS = @VG_LIB_DEPS@
|
||||
GLAPI_LIB_DEPS = @GLAPI_LIB_DEPS@
|
||||
$(EXTRA_LIB_PATH) @GLW_LIB_DEPS@
|
||||
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
|
||||
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
|
||||
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
|
||||
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
|
||||
|
||||
# DRI dependencies
|
||||
DRI_LIB_DEPS = @DRI_LIB_DEPS@
|
||||
GALLIUM_DRI_LIB_DEPS = @GALLIUM_DRI_LIB_DEPS@
|
||||
MESA_MODULES = @MESA_MODULES@
|
||||
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
|
||||
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
|
||||
LIBDRM_LIB = @LIBDRM_LIBS@
|
||||
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
|
||||
|
@@ -8,9 +8,9 @@
|
||||
CONFIG_NAME = default
|
||||
|
||||
# Version info
|
||||
MESA_MAJOR=9
|
||||
MESA_MINOR=0
|
||||
MESA_TINY=1
|
||||
MESA_MAJOR=8
|
||||
MESA_MINOR=1
|
||||
MESA_TINY=0
|
||||
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
|
||||
|
||||
# external projects. This should be useless now that we use libdrm.
|
||||
@@ -76,6 +76,7 @@ GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
|
||||
GL_LIB_GLOB = $(GL_LIB_NAME)*
|
||||
GLU_LIB_GLOB = $(GLU_LIB_NAME)*
|
||||
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
|
||||
OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)*
|
||||
EGL_LIB_GLOB = $(EGL_LIB_NAME)*
|
||||
GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
|
||||
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
|
||||
@@ -94,7 +95,8 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2
|
||||
# Directories to build
|
||||
LIB_DIR = lib
|
||||
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
|
||||
gallium egl gallium/winsys gallium/targets
|
||||
gallium egl gallium/winsys gallium/targets glu
|
||||
GLU_DIRS = sgi
|
||||
DRIVER_DIRS = x11 osmesa
|
||||
|
||||
# Gallium directories and
|
||||
@@ -112,15 +114,15 @@ EGL_CLIENT_APIS = $(GL_LIB)
|
||||
|
||||
# Library dependencies
|
||||
#EXTRA_LIB_PATH ?=
|
||||
GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
|
||||
EGL_LIB_DEPS = -ldl -lpthread
|
||||
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
|
||||
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
|
||||
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
|
||||
GLESv1_CM_LIB_DEPS = -lpthread
|
||||
GLESv2_LIB_DEPS = -lpthread
|
||||
VG_LIB_DEPS = -lpthread
|
||||
GLAPI_LIB_DEPS = -lpthread
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
|
||||
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -ldl -lpthread
|
||||
OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
|
||||
GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
|
||||
GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
|
||||
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
||||
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
||||
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
||||
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
||||
|
||||
# Program dependencies - specific GL libraries added in Makefiles
|
||||
X11_LIBS = -lX11
|
||||
|
551
configure.ac
551
configure.ac
@@ -6,10 +6,9 @@ dnl Tell the user about autoconf.html in the --help output
|
||||
m4_divert_once([HELP_END], [
|
||||
See docs/autoconf.html for more details on the options for Mesa.])
|
||||
|
||||
AC_INIT([Mesa], [9.0.1],
|
||||
AC_INIT([Mesa], [8.1.0],
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
|
||||
AC_CONFIG_AUX_DIR([bin])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CANONICAL_HOST
|
||||
AM_INIT_AUTOMAKE([foreign])
|
||||
|
||||
@@ -27,14 +26,14 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
|
||||
LT_PREREQ([2.2])
|
||||
LT_INIT([disable-static])
|
||||
|
||||
dnl Set internal versions
|
||||
OSMESA_VERSION=8
|
||||
AC_SUBST([OSMESA_VERSION])
|
||||
dnl Save user CFLAGS and CXXFLAGS so one can override the default ones
|
||||
USER_CFLAGS="$CFLAGS"
|
||||
USER_CXXFLAGS="$CXXFLAGS"
|
||||
|
||||
dnl Versions for external dependencies
|
||||
LIBDRM_REQUIRED=2.4.24
|
||||
LIBDRM_RADEON_REQUIRED=2.4.39
|
||||
LIBDRM_INTEL_REQUIRED=2.4.38
|
||||
LIBDRM_RADEON_REQUIRED=2.4.31
|
||||
LIBDRM_INTEL_REQUIRED=2.4.34
|
||||
LIBDRM_NVVIEUX_REQUIRED=2.4.33
|
||||
LIBDRM_NOUVEAU_REQUIRED=2.4.33
|
||||
DRI2PROTO_REQUIRED=2.6
|
||||
@@ -60,7 +59,7 @@ fi
|
||||
|
||||
AC_PROG_YACC
|
||||
AC_PATH_PROG([YACC_INST], $YACC)
|
||||
if test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"; then
|
||||
if test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.y"; then
|
||||
if test -z "$YACC_INST"; then
|
||||
AC_MSG_ERROR([yacc not found - unable to compile glcpp-parse.y])
|
||||
fi
|
||||
@@ -151,22 +150,28 @@ dnl LIB_DIR - library basename
|
||||
LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
|
||||
AC_SUBST([LIB_DIR])
|
||||
|
||||
dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
|
||||
dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later
|
||||
_SAVE_LDFLAGS="$LDFLAGS"
|
||||
AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker])
|
||||
AC_SUBST([EXTRA_LIB_PATH])
|
||||
|
||||
dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later
|
||||
_SAVE_CPPFLAGS="$CPPFLAGS"
|
||||
AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers])
|
||||
AC_SUBST([X11_INCLUDES])
|
||||
|
||||
dnl Compiler macros
|
||||
DEFINES=""
|
||||
AC_SUBST([DEFINES])
|
||||
case "$host_os" in
|
||||
linux*|*-gnu*|gnu*)
|
||||
DEFINES="$DEFINES -D_GNU_SOURCE -DHAVE_PTHREAD"
|
||||
DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
|
||||
;;
|
||||
solaris*)
|
||||
DEFINES="$DEFINES -DHAVE_PTHREAD -DSVR4"
|
||||
DEFINES="$DEFINES -DPTHREADS -DSVR4"
|
||||
;;
|
||||
cygwin*)
|
||||
DEFINES="$DEFINES -DHAVE_PTHREAD"
|
||||
DEFINES="$DEFINES -DPTHREADS"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -241,6 +246,14 @@ esac
|
||||
AC_SUBST([VISIBILITY_CFLAGS])
|
||||
AC_SUBST([VISIBILITY_CXXFLAGS])
|
||||
|
||||
dnl These should be unnecessary, but let the user set them if they want
|
||||
AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
|
||||
Default is to use CFLAGS.])
|
||||
AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
|
||||
compiler. Default is to use CFLAGS.])
|
||||
AC_SUBST([OPT_FLAGS])
|
||||
AC_SUBST([ARCH_FLAGS])
|
||||
|
||||
dnl
|
||||
dnl Hacks to enable 32 or 64 bit build
|
||||
dnl
|
||||
@@ -253,6 +266,7 @@ AC_ARG_ENABLE([32-bit],
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
if test "x$GCC" = xyes; then
|
||||
CFLAGS="$CFLAGS -m32"
|
||||
ARCH_FLAGS="$ARCH_FLAGS -m32"
|
||||
CCASFLAGS="$CCASFLAGS -m32"
|
||||
fi
|
||||
if test "x$GXX" = xyes; then
|
||||
@@ -279,17 +293,15 @@ dnl explicitly requested. If both disabled, set to static since shared
|
||||
dnl was explicitly requested.
|
||||
case "x$enable_static$enable_shared" in
|
||||
xyesyes )
|
||||
AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
|
||||
AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
|
||||
enable_shared=no
|
||||
;;
|
||||
xnono )
|
||||
AC_MSG_WARN([Cannot disable both static and shared libraries, enabling static])
|
||||
AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
|
||||
enable_static=yes
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
|
||||
|
||||
dnl
|
||||
dnl mklib options
|
||||
dnl
|
||||
@@ -345,12 +357,18 @@ AC_ARG_WITH([gl-lib-name],
|
||||
[specify GL library name @<:@default=GL@:>@])],
|
||||
[GL_LIB=$withval],
|
||||
[GL_LIB=GL])
|
||||
AC_ARG_WITH([glu-lib-name],
|
||||
[AS_HELP_STRING([--with-glu-lib-name@<:@=NAME@:>@],
|
||||
[specify GLU library name @<:@default=GLU@:>@])],
|
||||
[GLU_LIB=$withval],
|
||||
[GLU_LIB=GLU])
|
||||
AC_ARG_WITH([osmesa-lib-name],
|
||||
[AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@],
|
||||
[specify OSMesa library name @<:@default=OSMesa@:>@])],
|
||||
[OSMESA_LIB=$withval],
|
||||
[OSMESA_LIB=OSMesa])
|
||||
AS_IF([test "x$GL_LIB" = xyes], [GL_LIB=GL])
|
||||
AS_IF([test "x$GLU_LIB" = xyes], [GLU_LIB=GLU])
|
||||
AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa])
|
||||
|
||||
dnl
|
||||
@@ -365,10 +383,13 @@ AC_ARG_ENABLE([mangling],
|
||||
if test "x${enable_mangling}" = "xyes" ; then
|
||||
DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
|
||||
GL_LIB="Mangled${GL_LIB}"
|
||||
GLU_LIB="Mangled${GLU_LIB}"
|
||||
OSMESA_LIB="Mangled${OSMESA_LIB}"
|
||||
fi
|
||||
AC_SUBST([GL_LIB])
|
||||
AC_SUBST([GLU_LIB])
|
||||
AC_SUBST([OSMESA_LIB])
|
||||
AM_CONDITIONAL(HAVE_MANGLED_GL, test "x${enable_mangling}" = "xyes")
|
||||
|
||||
dnl
|
||||
dnl potentially-infringing-but-nobody-knows-for-sure stuff
|
||||
@@ -386,6 +407,7 @@ if test "x$enable_texture_float" = xyes; then
|
||||
fi
|
||||
|
||||
GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
|
||||
GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
|
||||
OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
|
||||
EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
|
||||
GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
|
||||
@@ -394,6 +416,8 @@ VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
|
||||
GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
|
||||
|
||||
GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
|
||||
GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
|
||||
OSMESA_LIB_GLOB=${LIB_PREFIX_GLOB}'$(OSMESA_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
|
||||
EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
|
||||
EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
|
||||
GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
|
||||
@@ -402,6 +426,7 @@ VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENS
|
||||
GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
|
||||
|
||||
AC_SUBST([GL_LIB_NAME])
|
||||
AC_SUBST([GLU_LIB_NAME])
|
||||
AC_SUBST([OSMESA_LIB_NAME])
|
||||
AC_SUBST([EGL_LIB_NAME])
|
||||
AC_SUBST([GLESv1_CM_LIB_NAME])
|
||||
@@ -410,6 +435,8 @@ AC_SUBST([VG_LIB_NAME])
|
||||
AC_SUBST([GLAPI_LIB_NAME])
|
||||
|
||||
AC_SUBST([GL_LIB_GLOB])
|
||||
AC_SUBST([GLU_LIB_GLOB])
|
||||
AC_SUBST([OSMESA_LIB_GLOB])
|
||||
AC_SUBST([EGL_LIB_GLOB])
|
||||
AC_SUBST([GLESv1_CM_LIB_GLOB])
|
||||
AC_SUBST([GLESv2_LIB_GLOB])
|
||||
@@ -427,6 +454,7 @@ AC_ARG_ENABLE([asm],
|
||||
)
|
||||
asm_arch=""
|
||||
MESA_ASM_FILES=""
|
||||
GLAPI_ASM_SOURCES=""
|
||||
AC_MSG_CHECKING([whether to enable assembly])
|
||||
test "x$enable_asm" = xno && AC_MSG_RESULT([no])
|
||||
# disable if cross compiling on x86/x86_64 since we must run gen_matypes
|
||||
@@ -455,6 +483,13 @@ if test "x$enable_asm" = xyes; then
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
powerpc)
|
||||
case "$host_os" in
|
||||
linux*)
|
||||
asm_arch=ppc
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sparc*)
|
||||
case "$host_os" in
|
||||
linux*)
|
||||
@@ -468,16 +503,19 @@ if test "x$enable_asm" = xyes; then
|
||||
x86)
|
||||
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)
|
||||
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)
|
||||
DEFINES="$DEFINES -DUSE_SPARC_ASM"
|
||||
MESA_ASM_FILES='$(SPARC_FILES)'
|
||||
GLAPI_ASM_SOURCES='$(SPARC_API)'
|
||||
AC_MSG_RESULT([yes, sparc])
|
||||
;;
|
||||
*)
|
||||
@@ -486,27 +524,20 @@ if test "x$enable_asm" = xyes; then
|
||||
esac
|
||||
fi
|
||||
AC_SUBST([MESA_ASM_FILES])
|
||||
AC_SUBST([GLAPI_ASM_SOURCES])
|
||||
|
||||
dnl PIC code macro
|
||||
MESA_PIC_FLAGS
|
||||
|
||||
dnl Check to see if dlopen is in default libraries (like Solaris, which
|
||||
dnl has it in libc), or if libdl is needed to get it.
|
||||
AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
|
||||
[AC_CHECK_LIB([dl], [dlopen],
|
||||
[DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])])
|
||||
AC_CHECK_FUNC([dlopen], [],
|
||||
[AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
|
||||
AC_SUBST([DLOPEN_LIBS])
|
||||
|
||||
dnl See if posix_memalign is available
|
||||
AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
|
||||
|
||||
dnl Check for pthreads
|
||||
AX_PTHREAD
|
||||
dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
|
||||
dnl to -pthread, which causes problems if we need -lpthread to appear in
|
||||
dnl pkgconfig files.
|
||||
test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
|
||||
|
||||
dnl SELinux awareness.
|
||||
AC_ARG_ENABLE([selinux],
|
||||
[AS_HELP_STRING([--enable-selinux],
|
||||
@@ -521,7 +552,6 @@ if test "x$enable_selinux" = "xyes"; then
|
||||
SELINUX_LIBS="-lselinux"
|
||||
DEFINES="$DEFINES -DMESA_SELINUX"
|
||||
fi
|
||||
AC_SUBST([SELINUX_LIBS])
|
||||
|
||||
dnl Options for APIs
|
||||
AC_ARG_ENABLE([opengl],
|
||||
@@ -547,19 +577,19 @@ AC_ARG_ENABLE([openvg],
|
||||
|
||||
AC_ARG_ENABLE([dri],
|
||||
[AS_HELP_STRING([--enable-dri],
|
||||
[enable DRI modules @<:@default=enabled@:>@])],
|
||||
[enable DRI modules @<:@default=auto@:>@])],
|
||||
[enable_dri="$enableval"],
|
||||
[enable_dri=yes])
|
||||
[enable_dri=auto])
|
||||
AC_ARG_ENABLE([glx],
|
||||
[AS_HELP_STRING([--enable-glx],
|
||||
[enable GLX library @<:@default=enabled@:>@])],
|
||||
[enable GLX library @<:@default=auto@:>@])],
|
||||
[enable_glx="$enableval"],
|
||||
[enable_glx=yes])
|
||||
[enable_glx=auto])
|
||||
AC_ARG_ENABLE([osmesa],
|
||||
[AS_HELP_STRING([--enable-osmesa],
|
||||
[enable OSMesa library @<:@default=disabled@:>@])],
|
||||
[enable OSMesa library @<:@default=auto@:>@])],
|
||||
[enable_osmesa="$enableval"],
|
||||
[enable_osmesa=no])
|
||||
[enable_osmesa=auto])
|
||||
AC_ARG_ENABLE([egl],
|
||||
[AS_HELP_STRING([--disable-egl],
|
||||
[disable EGL library @<:@default=enabled@:>@])],
|
||||
@@ -609,9 +639,9 @@ AC_ARG_ENABLE([opencl],
|
||||
[enable_opencl=no])
|
||||
AC_ARG_ENABLE([xlib_glx],
|
||||
[AS_HELP_STRING([--enable-xlib-glx],
|
||||
[make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])],
|
||||
[make GLX library Xlib-based instead of DRI-based @<:@default=disable@:>@])],
|
||||
[enable_xlib_glx="$enableval"],
|
||||
[enable_xlib_glx=no])
|
||||
[enable_xlib_glx=auto])
|
||||
AC_ARG_ENABLE([gallium_egl],
|
||||
[AS_HELP_STRING([--enable-gallium-egl],
|
||||
[enable optional EGL state tracker (not required
|
||||
@@ -645,7 +675,7 @@ GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
|
||||
AC_ARG_WITH([gallium-drivers],
|
||||
[AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
|
||||
[comma delimited Gallium drivers list, e.g.
|
||||
"i915,nouveau,r300,r600,radeonsi,svga,swrast"
|
||||
"i915,nouveau,r300,r600,svga,swrast"
|
||||
@<:@default=r300,r600,swrast@:>@])],
|
||||
[with_gallium_drivers="$withval"],
|
||||
[with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
|
||||
@@ -685,61 +715,125 @@ if test "x$enable_gles2" = xyes; then
|
||||
fi
|
||||
AC_SUBST([API_DEFINES])
|
||||
|
||||
if test "x$enable_glx" = xno; then
|
||||
AC_MSG_WARN([GLX disabled, disabling Xlib-GLX])
|
||||
enable_xlib_glx=no
|
||||
fi
|
||||
|
||||
if test "x$enable_dri$enable_xlib_glx" = xyesyes; then
|
||||
AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together])
|
||||
fi
|
||||
|
||||
# Disable GLX if DRI and Xlib-GLX are not enabled
|
||||
if test "x$enable_glx" = xyes -a \
|
||||
"x$enable_dri" = xno -a \
|
||||
"x$enable_xlib_glx" = xno; then
|
||||
AC_MSG_WARN([Neither DRI nor Xlib-GLX enabled, disabling GLX])
|
||||
enable_glx=no
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes)
|
||||
AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
|
||||
"x$enable_osmesa" = xyes)
|
||||
|
||||
AC_ARG_ENABLE([shared-glapi],
|
||||
[AS_HELP_STRING([--enable-shared-glapi],
|
||||
[Enable shared glapi for OpenGL @<:@default=yes@:>@])],
|
||||
[EXPERIMENTAL. Enable shared glapi for OpenGL @<:@default=no@:>@])],
|
||||
[enable_shared_glapi="$enableval"],
|
||||
[enable_shared_glapi="$enable_dri"])
|
||||
[enable_shared_glapi=no])
|
||||
|
||||
# Shared GLAPI is only useful for DRI
|
||||
if test "x$enable_dri" = xno; then
|
||||
AC_MSG_NOTICE([Shared GLAPI is only useful for DRI, disabling])
|
||||
enable_shared_glapi=no
|
||||
fi
|
||||
|
||||
# TODO: Get rid of SHARED_GLAPI variable
|
||||
SHARED_GLAPI="0"
|
||||
if test "x$enable_shared_glapi" = xyes; then
|
||||
SHARED_GLAPI="1"
|
||||
# libGL will use libglapi for function lookups (IN_DRI_DRIVER means to use
|
||||
# the remap table)
|
||||
DEFINES="$DEFINES -DIN_DRI_DRIVER"
|
||||
CORE_DIRS="mapi/shared-glapi"
|
||||
SRC_DIRS="$SRC_DIRS mapi/shared-glapi"
|
||||
fi
|
||||
AC_SUBST([SHARED_GLAPI])
|
||||
AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
|
||||
AM_CONDITIONAL(HAVE_SHARED_GLAPI, test $SHARED_GLAPI = 1)
|
||||
|
||||
dnl
|
||||
dnl Driver configuration. Options are xlib, dri and osmesa right now.
|
||||
dnl More later: fbdev, ...
|
||||
dnl
|
||||
default_driver="xlib"
|
||||
|
||||
case "$host_os" in
|
||||
linux*)
|
||||
case "$host_cpu" in
|
||||
i*86|x86_64|powerpc*|sparc*|ia64*) default_driver="dri";;
|
||||
esac
|
||||
;;
|
||||
*freebsd* | dragonfly* | *netbsd*)
|
||||
case "$host_cpu" in
|
||||
i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "x$enable_opengl" = xno; then
|
||||
default_driver="no"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([driver],
|
||||
[AS_HELP_STRING([--with-driver=DRIVER], [DEPRECATED])],
|
||||
[mesa_driver="$withval"],
|
||||
[mesa_driver=auto])
|
||||
dnl Check for valid option
|
||||
case "x$mesa_driver" in
|
||||
xxlib|xdri|xosmesa|xno)
|
||||
if test "x$enable_dri" != xauto -o \
|
||||
"x$enable_glx" != xauto -o \
|
||||
"x$enable_osmesa" != xauto -o \
|
||||
"x$enable_xlib_glx" != xauto; then
|
||||
AC_MSG_ERROR([--with-driver=$mesa_driver is deprecated])
|
||||
fi
|
||||
;;
|
||||
xauto)
|
||||
mesa_driver="$default_driver"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
|
||||
;;
|
||||
esac
|
||||
|
||||
# map $mesa_driver to APIs
|
||||
if test "x$enable_dri" = xauto; then
|
||||
case "x$mesa_driver" in
|
||||
xdri) enable_dri=yes ;;
|
||||
*) enable_dri=no ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$enable_glx" = xauto; then
|
||||
case "x$mesa_driver" in
|
||||
xdri|xxlib) enable_glx=yes ;;
|
||||
*) enable_glx=no ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$enable_osmesa" = xauto; then
|
||||
case "x$mesa_driver" in
|
||||
xxlib|xosmesa) enable_osmesa=yes ;;
|
||||
*) enable_osmesa=no ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$enable_xlib_glx" = xauto; then
|
||||
case "x$mesa_driver" in
|
||||
xxlib) enable_xlib_glx=yes ;;
|
||||
*) enable_xlib_glx=no ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$enable_glx" = xno; then
|
||||
enable_xlib_glx=no
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(HAVE_DRI, test x"$enable_dri" = xyes)
|
||||
|
||||
dnl
|
||||
dnl Driver specific build directories
|
||||
dnl
|
||||
|
||||
dnl this variable will be prepended to SRC_DIRS and is not exported
|
||||
CORE_DIRS=""
|
||||
|
||||
SRC_DIRS="gtest"
|
||||
GLU_DIRS="sgi"
|
||||
GALLIUM_DIRS="auxiliary drivers state_trackers"
|
||||
GALLIUM_TARGET_DIRS=""
|
||||
GALLIUM_WINSYS_DIRS="sw"
|
||||
GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
|
||||
GALLIUM_STATE_TRACKERS_DIRS=""
|
||||
|
||||
# build shared-glapi if enabled for OpenGL or if OpenGL ES is enabled
|
||||
case "x$enable_shared_glapi$enable_gles1$enable_gles2" in
|
||||
x*yes*)
|
||||
CORE_DIRS="$CORE_DIRS mapi/shared-glapi"
|
||||
;;
|
||||
esac
|
||||
|
||||
# build glapi if OpenGL is enabled
|
||||
if test "x$enable_opengl" = xyes; then
|
||||
CORE_DIRS="$CORE_DIRS mapi/glapi"
|
||||
@@ -789,6 +883,7 @@ if test "x$enable_osmesa" = xyes; then
|
||||
fi
|
||||
|
||||
AC_SUBST([SRC_DIRS])
|
||||
AC_SUBST([GLU_DIRS])
|
||||
AC_SUBST([DRIVER_DIRS])
|
||||
AC_SUBST([GALLIUM_DIRS])
|
||||
AC_SUBST([GALLIUM_TARGET_DIRS])
|
||||
@@ -804,7 +899,7 @@ PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
|
||||
if test "x$enable_dri" = xyes; then
|
||||
# DRI must be shared, I think
|
||||
if test "$enable_static" = yes; then
|
||||
AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
|
||||
AC_MSG_ERROR([Can't use static libraries for DRI drivers])
|
||||
fi
|
||||
|
||||
# not a hard requirement as swrast does not depend on it
|
||||
@@ -813,8 +908,32 @@ if test "x$enable_dri" = xyes; then
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Find out if X is available.
|
||||
PKG_CHECK_MODULES([X11], [x11])
|
||||
dnl
|
||||
dnl Find out if X is available. The variable have_x is set if libX11 is
|
||||
dnl found to mimic AC_PATH_XTRA.
|
||||
dnl
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
AC_MSG_CHECKING([pkg-config files for X11 are available])
|
||||
PKG_CHECK_EXISTS([x11],[
|
||||
x11_pkgconfig=yes
|
||||
have_x=yes
|
||||
],[
|
||||
x11_pkgconfig=no
|
||||
])
|
||||
AC_MSG_RESULT([$x11_pkgconfig])
|
||||
else
|
||||
x11_pkgconfig=no
|
||||
fi
|
||||
dnl Use the autoconf macro if no pkg-config files
|
||||
if test "$x11_pkgconfig" = yes; then
|
||||
PKG_CHECK_MODULES([X11], [x11])
|
||||
else
|
||||
AC_PATH_XTRA
|
||||
test -z "$X11_CFLAGS" && X11_CFLAGS="$X_CFLAGS"
|
||||
test -z "$X11_LIBS" && X11_LIBS="$X_LIBS -lX11"
|
||||
AC_SUBST([X11_CFLAGS])
|
||||
AC_SUBST([X11_LIBS])
|
||||
fi
|
||||
|
||||
dnl Try to tell the user that the --x-* options are only used when
|
||||
dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
|
||||
@@ -858,52 +977,98 @@ dnl
|
||||
case "x$enable_glx$enable_xlib_glx" in
|
||||
xyesyes)
|
||||
# Xlib-based GLX
|
||||
PKG_CHECK_MODULES([XLIBGL], [x11 xext])
|
||||
GL_PC_REQ_PRIV="x11 xext"
|
||||
X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
|
||||
GL_LIB_DEPS="$XLIBGL_LIBS"
|
||||
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
|
||||
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS"
|
||||
if test "$x11_pkgconfig" = yes; then
|
||||
PKG_CHECK_MODULES([XLIBGL], [x11 xext])
|
||||
GL_PC_REQ_PRIV="x11 xext"
|
||||
X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
|
||||
GL_LIB_DEPS="$XLIBGL_LIBS"
|
||||
else
|
||||
# should check these...
|
||||
X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
|
||||
GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
|
||||
GL_PC_LIB_PRIV="$GL_LIB_DEPS"
|
||||
GL_PC_CFLAGS="$X11_INCLUDES"
|
||||
fi
|
||||
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS"
|
||||
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
|
||||
;;
|
||||
xyesno)
|
||||
# DRI-based GLX
|
||||
PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
|
||||
GL_PC_REQ_PRIV="glproto >= $GLPROTO_REQUIRED"
|
||||
if test x"$driglx_direct" = xyes; then
|
||||
if test "x$have_libdrm" != xyes; then
|
||||
AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
|
||||
fi
|
||||
PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
|
||||
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
|
||||
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
|
||||
fi
|
||||
|
||||
# find the DRI deps for libGL
|
||||
dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1"
|
||||
if test "$x11_pkgconfig" = yes; then
|
||||
dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx"
|
||||
|
||||
# add xf86vidmode if available
|
||||
PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
|
||||
if test "$HAVE_XF86VIDMODE" = yes ; then
|
||||
dri_modules="$dri_modules xxf86vm"
|
||||
# add xf86vidmode if available
|
||||
PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
|
||||
if test "$HAVE_XF86VIDMODE" = yes ; then
|
||||
dri_modules="$dri_modules xxf86vm"
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES([DRIGL], [$dri_modules])
|
||||
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
|
||||
X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
|
||||
GL_LIB_DEPS="$DRIGL_LIBS"
|
||||
else
|
||||
# should check these...
|
||||
X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
|
||||
if test "x$HAVE_XF86VIDMODE" == xyes; then
|
||||
GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
|
||||
else
|
||||
GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXdamage -lXfixes"
|
||||
fi
|
||||
GL_PC_LIB_PRIV="$GL_LIB_DEPS"
|
||||
GL_PC_CFLAGS="$X11_INCLUDES"
|
||||
|
||||
# XCB can only be used from pkg-config
|
||||
PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
|
||||
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
|
||||
X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
|
||||
GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES([DRIGL], [$dri_modules])
|
||||
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
|
||||
X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
|
||||
GL_LIB_DEPS="$DRIGL_LIBS"
|
||||
# Check to see if the xcb-glx library is new enough to support
|
||||
# GLX_ARB_create_context. This bit of hackery is necessary until XCB 1.8
|
||||
# is released.
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
save_LDFLAGS="$LDFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $X11_INCLUDES"
|
||||
LDFLAGS="$LDFLAGS $GL_LIB_DEPS"
|
||||
AC_CHECK_LIB(xcb-glx, xcb_glx_create_context_attribs_arb_checked,
|
||||
[HAVE_XCB_GLX_CREATE_CONTEXT=yes],
|
||||
[HAVE_XCB_GLX_CREATE_CONTEXT=no])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
|
||||
# need DRM libs, $PTHREAD_LIBS, etc.
|
||||
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
|
||||
GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
|
||||
if test x$HAVE_XCB_GLX_CREATE_CONTEXT = xyes; then
|
||||
X11_INCLUDES="$X11_INCLUDES -DHAVE_XCB_GLX_CREATE_CONTEXT"
|
||||
fi
|
||||
|
||||
# need DRM libs, -lpthread, etc.
|
||||
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
|
||||
GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
|
||||
;;
|
||||
esac
|
||||
|
||||
# This is outside the case (above) so that it is invoked even for non-GLX
|
||||
# builds.
|
||||
AM_CONDITIONAL(HAVE_XCB_GLX_CREATE_CONTEXT,
|
||||
test x$HAVE_XCB_GLX_CREATE_CONTEXT = xyes)
|
||||
AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
|
||||
|
||||
GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
|
||||
GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
|
||||
GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
|
||||
GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
|
||||
GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
|
||||
GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
|
||||
GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
|
||||
GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
|
||||
|
||||
AC_SUBST([GL_LIB_DEPS])
|
||||
AC_SUBST([GL_PC_REQ_PRIV])
|
||||
@@ -915,7 +1080,21 @@ AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
|
||||
AC_SUBST([GLESv2_LIB_DEPS])
|
||||
AC_SUBST([GLESv2_PC_LIB_PRIV])
|
||||
|
||||
DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la"
|
||||
GLAPI_LIB_DEPS="-lpthread $SELINUX_LIBS"
|
||||
AC_SUBST([GLAPI_LIB_DEPS])
|
||||
|
||||
|
||||
dnl Setup default DRI CFLAGS
|
||||
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
|
||||
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([MESA_MODULES])
|
||||
|
||||
AC_SUBST([HAVE_XF86VIDMODE])
|
||||
|
||||
@@ -945,8 +1124,8 @@ AC_ARG_ENABLE([glx-tls],
|
||||
[GLX_USE_TLS=no])
|
||||
AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
|
||||
|
||||
AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
|
||||
[DEFINES="${DEFINES} -DGLX_USE_TLS -DHAVE_PTHREAD"])
|
||||
AS_IF([test "x$GLX_USE_TLS" = xyes],
|
||||
[DEFINES="${DEFINES} -DGLX_USE_TLS -DPTHREADS"])
|
||||
|
||||
dnl
|
||||
dnl More DRI setup
|
||||
@@ -992,7 +1171,7 @@ yes)
|
||||
dri_drivers=`IFS=', '; echo $with_dri_drivers`
|
||||
for driver in $dri_drivers; do
|
||||
test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
|
||||
AC_MSG_ERROR([DRI driver directory '$driver' does not exist])
|
||||
AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
|
||||
done
|
||||
DRI_DIRS="$dri_drivers"
|
||||
if test -n "$DRI_DIRS" -a "x$enable_opengl" != xyes; then
|
||||
@@ -1030,7 +1209,7 @@ if test "x$enable_dri" = xyes; then
|
||||
esac
|
||||
;;
|
||||
freebsd* | dragonfly* | *netbsd*)
|
||||
DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1"
|
||||
DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
|
||||
DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
|
||||
|
||||
if test "x$DRI_DIRS" = "xyes"; then
|
||||
@@ -1089,14 +1268,11 @@ if test "x$enable_dri" = xyes; then
|
||||
fi
|
||||
|
||||
# put all the necessary libs together
|
||||
DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
|
||||
GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
|
||||
DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
|
||||
fi
|
||||
AM_CONDITIONAL(NEED_LIBDRICORE, test -n "$DRI_DIRS")
|
||||
AC_SUBST([DRI_DIRS])
|
||||
AC_SUBST([EXPAT_INCLUDES])
|
||||
AC_SUBST([DRI_LIB_DEPS])
|
||||
AC_SUBST([GALLIUM_DRI_LIB_DEPS])
|
||||
|
||||
case $DRI_DIRS in
|
||||
*i915*|*i965*)
|
||||
@@ -1187,14 +1363,13 @@ esac
|
||||
if test "x$enable_osmesa" = xyes; then
|
||||
# only link libraries with osmesa if shared
|
||||
if test "$enable_static" = no; then
|
||||
OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
|
||||
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
|
||||
else
|
||||
OSMESA_LIB_DEPS=""
|
||||
fi
|
||||
OSMESA_MESA_DEPS=""
|
||||
OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
|
||||
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
|
||||
fi
|
||||
|
||||
AC_SUBST([OSMESA_LIB_DEPS])
|
||||
AC_SUBST([OSMESA_MESA_DEPS])
|
||||
AC_SUBST([OSMESA_PC_REQ])
|
||||
@@ -1219,7 +1394,7 @@ if test "x$enable_gbm" = xyes; then
|
||||
|
||||
if test "x$enable_dri" = xyes; then
|
||||
GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
|
||||
if test "x$enable_shared_glapi" = xno; then
|
||||
if test "$SHARED_GLAPI" -eq 0; then
|
||||
AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
|
||||
fi
|
||||
fi
|
||||
@@ -1236,7 +1411,7 @@ EGL_CLIENT_APIS=""
|
||||
|
||||
if test "x$enable_egl" = xyes; then
|
||||
SRC_DIRS="$SRC_DIRS egl"
|
||||
EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
|
||||
EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS -lpthread"
|
||||
|
||||
AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
|
||||
|
||||
@@ -1359,12 +1534,10 @@ if test "x$enable_openvg" = xyes; then
|
||||
fi
|
||||
|
||||
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
|
||||
VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
|
||||
VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS -lpthread"
|
||||
CORE_DIRS="$CORE_DIRS mapi/vgapi"
|
||||
GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
|
||||
HAVE_ST_VEGA=yes
|
||||
VG_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
|
||||
AC_SUBST([VG_PC_LIB_PRIV])
|
||||
fi
|
||||
|
||||
dnl
|
||||
@@ -1459,13 +1632,66 @@ if test "x$enable_opencl" = xyes; then
|
||||
enable_gallium_loader=yes
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl GLU configuration
|
||||
dnl
|
||||
AC_ARG_ENABLE([glu],
|
||||
[AS_HELP_STRING([--disable-glu],
|
||||
[enable OpenGL Utility library @<:@default=enabled@:>@])],
|
||||
[enable_glu="$enableval"],
|
||||
[enable_glu=yes])
|
||||
|
||||
if test "x$enable_glu" = xyes; then
|
||||
if test "x$enable_glx" = xno -a "x$enable_osmesa" = xno; then
|
||||
AC_MSG_NOTICE([Disabling GLU since there is no OpenGL driver])
|
||||
enable_glu=no
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_glu" = xyes; then
|
||||
SRC_DIRS="$SRC_DIRS glu"
|
||||
|
||||
if test "x$enable_glx" = xno; then
|
||||
# Link libGLU to libOSMesa instead of libGL
|
||||
GLU_LIB_DEPS=""
|
||||
GLU_PC_REQ="osmesa"
|
||||
if test "$enable_static" = no; then
|
||||
GLU_MESA_DEPS='-l$(OSMESA_LIB)'
|
||||
else
|
||||
GLU_MESA_DEPS=""
|
||||
fi
|
||||
else
|
||||
# If static, empty GLU_LIB_DEPS and add libs for programs to link
|
||||
GLU_PC_REQ="gl"
|
||||
GLU_PC_LIB_PRIV="-lm"
|
||||
if test "$enable_static" = no; then
|
||||
GLU_LIB_DEPS="-lm"
|
||||
GLU_MESA_DEPS='-l$(GL_LIB)'
|
||||
else
|
||||
GLU_LIB_DEPS=""
|
||||
GLU_MESA_DEPS=""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "$enable_static" = no; then
|
||||
GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
|
||||
fi
|
||||
GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
|
||||
AC_SUBST([GLU_LIB_DEPS])
|
||||
AC_SUBST([GLU_MESA_DEPS])
|
||||
AC_SUBST([GLU_PC_REQ])
|
||||
AC_SUBST([GLU_PC_REQ_PRIV])
|
||||
AC_SUBST([GLU_PC_LIB_PRIV])
|
||||
AC_SUBST([GLU_PC_CFLAGS])
|
||||
|
||||
AC_SUBST([PROGRAM_DIRS])
|
||||
|
||||
dnl
|
||||
dnl Gallium configuration
|
||||
dnl
|
||||
if test "x$with_gallium_drivers" != x; then
|
||||
SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_GALLIUM, test "x$with_gallium_drivers" != x)
|
||||
|
||||
AC_SUBST([LLVM_BINDIR])
|
||||
AC_SUBST([LLVM_CFLAGS])
|
||||
@@ -1516,13 +1742,12 @@ for plat in $egl_platforms; do
|
||||
;;
|
||||
|
||||
wayland)
|
||||
PKG_CHECK_MODULES([WAYLAND], [wayland-client >= 0.99.0 wayland-server >= 0.99.0],, \
|
||||
PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
|
||||
[AC_MSG_ERROR([cannot find libwayland-client])])
|
||||
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
|
||||
|
||||
WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
|
||||
AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
|
||||
[${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
|
||||
m4_ifdef([WAYLAND_SCANNER_RULES],
|
||||
[WAYLAND_SCANNER_RULES(['$(top_srcdir)/src/egl/wayland/wayland-drm/protocol'])])
|
||||
;;
|
||||
|
||||
x11)
|
||||
@@ -1621,13 +1846,6 @@ AC_ARG_WITH([llvm-shared-libs],
|
||||
[with_llvm_shared_libs=yes],
|
||||
[with_llvm_shared_libs=no])
|
||||
|
||||
AC_ARG_WITH([llvm-prefix],
|
||||
[AS_HELP_STRING([--with-llvm-prefix],
|
||||
[Prefix for LLVM installations in non-standard locations])],
|
||||
[llvm_prefix="$withval"],
|
||||
[llvm_prefix=""])
|
||||
|
||||
|
||||
if test "x$with_gallium_drivers" = x; then
|
||||
enable_gallium_llvm=no
|
||||
fi
|
||||
@@ -1637,11 +1855,7 @@ if test "x$enable_gallium_llvm" = xauto; then
|
||||
esac
|
||||
fi
|
||||
if test "x$enable_gallium_llvm" = xyes; then
|
||||
if test "x$llvm_prefix" != x; then
|
||||
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
|
||||
else
|
||||
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
|
||||
fi
|
||||
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
|
||||
|
||||
if test "x$LLVM_CONFIG" != xno; then
|
||||
LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
|
||||
@@ -1650,14 +1864,10 @@ if test "x$enable_gallium_llvm" = xyes; then
|
||||
dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
|
||||
LLVM_LIBS="-lLLVM-`$LLVM_CONFIG --version`"
|
||||
else
|
||||
LLVM_COMPONENTS="engine bitwriter"
|
||||
if $LLVM_CONFIG --components | grep -q '\<mcjit\>'; then
|
||||
LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
|
||||
fi
|
||||
LLVM_LIBS="`$LLVM_CONFIG --libs engine bitwriter`"
|
||||
if test "x$enable_opencl" = xyes; then
|
||||
LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
|
||||
LLVM_LIBS="${LLVM_LIBS} `llvm-config --libs ipo linker instrumentation`"
|
||||
fi
|
||||
LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
|
||||
fi
|
||||
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
|
||||
LLVM_BINDIR=`$LLVM_CONFIG --bindir`
|
||||
@@ -1814,7 +2024,7 @@ if test "x$with_gallium_drivers" != x; then
|
||||
USE_R600_LLVM_COMPILER=yes;
|
||||
fi
|
||||
if test "x$enable_opencl" = xyes -a "x$with_llvm_shared_libs" = xno; then
|
||||
LLVM_LIBS="${LLVM_LIBS} `$LLVM_CONFIG --libs bitreader asmparser`"
|
||||
LLVM_LIBS="${LLVM_LIBS} `llvm-config --libs bitreader asmparser`"
|
||||
fi
|
||||
gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600" "va-r600"
|
||||
;;
|
||||
@@ -1826,7 +2036,7 @@ if test "x$with_gallium_drivers" != x; then
|
||||
AC_MSG_ERROR([LLVM 3.1 is required to build the radeonsi driver.])
|
||||
fi
|
||||
NEED_RADEON_GALLIUM=yes;
|
||||
gallium_check_st "radeon/drm" "dri-radeonsi" "xorg-radeonsi" "" "" "vdpau-radeonsi" ""
|
||||
gallium_check_st "radeon/drm" "dri-radeonsi" "xorg-radeonsi"
|
||||
;;
|
||||
xnouveau)
|
||||
PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
|
||||
@@ -1880,12 +2090,6 @@ if test "x$enable_gallium_loader" = xyes; then
|
||||
|
||||
if test "x$enable_gallium_drm_loader" = xyes; then
|
||||
GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM"
|
||||
PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2],
|
||||
pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no)
|
||||
if test "x$pipe_loader_have_xcb" = xyes; then
|
||||
GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DPIPE_LOADER_HAVE_XCB"
|
||||
GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
|
||||
@@ -1921,6 +2125,8 @@ AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
|
||||
AC_SUBST([GALLIUM_MAKE_DIRS])
|
||||
|
||||
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 "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1)
|
||||
AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1)
|
||||
@@ -1940,62 +2146,51 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
|
||||
dnl Substitute the config
|
||||
AC_CONFIG_FILES([configs/current
|
||||
Makefile
|
||||
src/egl/Makefile
|
||||
src/egl/drivers/Makefile
|
||||
src/egl/drivers/dri2/Makefile
|
||||
src/egl/drivers/glx/Makefile
|
||||
src/egl/main/Makefile
|
||||
src/egl/main/egl.pc
|
||||
src/egl/wayland/Makefile
|
||||
src/egl/wayland/wayland-drm/Makefile
|
||||
src/egl/wayland/wayland-egl/Makefile
|
||||
src/egl/wayland/wayland-egl/wayland-egl.pc
|
||||
src/Makefile
|
||||
src/gallium/Makefile
|
||||
src/gallium/auxiliary/pipe-loader/Makefile
|
||||
src/gallium/state_trackers/clover/Makefile
|
||||
src/gallium/drivers/Makefile
|
||||
src/gallium/drivers/r300/Makefile
|
||||
src/gallium/drivers/r600/Makefile
|
||||
src/gallium/state_trackers/clover/Makefile
|
||||
src/gallium/targets/opencl/Makefile
|
||||
src/gbm/Makefile
|
||||
src/gbm/main/gbm.pc
|
||||
src/glsl/Makefile
|
||||
src/glsl/glcpp/Makefile
|
||||
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
|
||||
src/egl/wayland/wayland-egl/Makefile
|
||||
src/egl/wayland/wayland-egl/wayland-egl.pc
|
||||
src/egl/wayland/wayland-drm/Makefile
|
||||
src/glsl/tests/Makefile
|
||||
src/glx/Makefile
|
||||
src/glx/tests/Makefile
|
||||
src/gtest/Makefile
|
||||
src/Makefile
|
||||
src/mapi/es1api/Makefile
|
||||
src/mapi/es1api/glesv1_cm.pc
|
||||
src/mapi/es2api/Makefile
|
||||
src/mapi/es2api/glesv2.pc
|
||||
src/mapi/glapi/Makefile
|
||||
src/mapi/glapi/gen/Makefile
|
||||
src/mapi/glapi/tests/Makefile
|
||||
src/mapi/shared-glapi/Makefile
|
||||
src/mapi/shared-glapi/tests/Makefile
|
||||
src/mapi/vgapi/Makefile
|
||||
src/mapi/vgapi/vg.pc
|
||||
src/mapi/glapi/tests/Makefile
|
||||
src/gtest/Makefile
|
||||
src/mesa/Makefile
|
||||
src/mesa/gl.pc
|
||||
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
|
||||
src/mesa/drivers/dri/i915/Makefile
|
||||
src/mesa/drivers/dri/i965/Makefile
|
||||
src/mesa/drivers/dri/Makefile
|
||||
src/mesa/drivers/dri/nouveau/Makefile
|
||||
src/mesa/drivers/dri/r200/Makefile
|
||||
src/mesa/drivers/dri/radeon/Makefile
|
||||
src/mesa/drivers/dri/swrast/Makefile
|
||||
src/mesa/drivers/osmesa/Makefile
|
||||
src/mesa/drivers/osmesa/osmesa.pc
|
||||
src/mesa/drivers/x11/Makefile
|
||||
src/mesa/libdricore/Makefile
|
||||
src/mesa/main/tests/Makefile
|
||||
src/mesa/x86-64/Makefile
|
||||
src/mesa/x86/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" " "`
|
||||
@@ -2051,6 +2246,9 @@ xyesno)
|
||||
;;
|
||||
esac
|
||||
|
||||
echo ""
|
||||
echo " GLU: $enable_glu"
|
||||
|
||||
dnl EGL
|
||||
echo ""
|
||||
echo " EGL: $enable_egl"
|
||||
@@ -2099,13 +2297,12 @@ dnl Libraries
|
||||
echo ""
|
||||
echo " Shared libs: $enable_shared"
|
||||
echo " Static libs: $enable_static"
|
||||
echo " Shared-glapi: $enable_shared_glapi"
|
||||
|
||||
dnl Compiler options
|
||||
# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
|
||||
cflags=`echo $CFLAGS $PIC_FLAGS | \
|
||||
cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
|
||||
$SED 's/^ *//;s/ */ /;s/ *$//'`
|
||||
cxxflags=`echo $CXXFLAGS $PIC_FLAGS | \
|
||||
cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
|
||||
$SED 's/^ *//;s/ */ /;s/ *$//'`
|
||||
defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'`
|
||||
echo ""
|
||||
|
54
docs/GL3.txt
54
docs/GL3.txt
@@ -42,21 +42,21 @@ GLX_ARB_create_context (GLX 1.4 is required) DONE
|
||||
|
||||
GL 3.1:
|
||||
|
||||
GLSL 1.40 DONE (i965)
|
||||
Forward compatibile context support/deprecations DONE (i965)
|
||||
GLSL 1.40 missing: UBOS, inverse(),
|
||||
highp change
|
||||
Instanced drawing (GL_ARB_draw_instanced) DONE (i965, gallium, swrast)
|
||||
Buffer copying (GL_ARB_copy_buffer) DONE (i965, r300, r600, swrast)
|
||||
Primitive restart (GL_NV_primitive_restart) DONE (i965, r600)
|
||||
16 vertex texture image units DONE
|
||||
Texture buffer objs (GL_ARB_texture_buffer_object) DONE for OpenGL 3.1 contexts (i965)
|
||||
Texture buffer objs (GL_ARB_texture_buffer_object) needs GL3.1 enabling (i965)
|
||||
Rectangular textures (GL_ARB_texture_rectangle) DONE (i965, r300, r600, swrast)
|
||||
Uniform buffer objs (GL_ARB_uniform_buffer_object) DONE (i965)
|
||||
Uniform buffer objs (GL_ARB_uniform_buffer_object) not started
|
||||
Signed normalized textures (GL_EXT_texture_snorm) DONE (i965, r300, r600)
|
||||
|
||||
|
||||
GL 3.2:
|
||||
|
||||
Core/compatibility profiles DONE
|
||||
Core/compatibility profiles not started
|
||||
GLSL 1.50 not started
|
||||
Geometry shaders (GL_ARB_geometry_shader4) partially done (Zack)
|
||||
BGRA vertex order (GL_ARB_vertex_array_bgra) DONE (i965, r300, r600, swrast)
|
||||
@@ -75,13 +75,13 @@ GL 3.3:
|
||||
GLSL 3.30 new features in this version pretty much done
|
||||
GL_ARB_blend_func_extended DONE (i965, r600, softpipe)
|
||||
GL_ARB_explicit_attrib_location DONE (i915, i965, r300, r600, swrast)
|
||||
GL_ARB_occlusion_query2 DONE (i965, r300, r600, swrast)
|
||||
GL_ARB_occlusion_query2 DONE (r300, r600, swrast)
|
||||
GL_ARB_sampler_objects DONE (i965, r300, r600)
|
||||
GL_ARB_shader_bit_encoding DONE
|
||||
GL_ARB_texture_rgb10_a2ui DONE (i965, r600)
|
||||
GL_ARB_texture_rgb10_a2ui DONE (r600)
|
||||
GL_ARB_texture_swizzle DONE (same as EXT version) (i965, r300, r600, swrast)
|
||||
GL_ARB_timer_query DONE (i965)
|
||||
GL_ARB_instanced_arrays DONE (i965, r300, r600)
|
||||
GL_ARB_timer_query ~60% done (the EXT variant)
|
||||
GL_ARB_instanced_arrays DONE (r300, r600)
|
||||
GL_ARB_vertex_type_2_10_10_10_rev DONE (r600)
|
||||
|
||||
|
||||
@@ -91,7 +91,6 @@ GLSL 4.0 not started
|
||||
GL_ARB_texture_query_lod not started
|
||||
GL_ARB_draw_buffers_blend DONE (i965, r600, softpipe)
|
||||
GL_ARB_draw_indirect not started
|
||||
GL_ARB_gpu_shader5 not started
|
||||
GL_ARB_gpu_shader_fp64 not started
|
||||
GL_ARB_sample_shading not started
|
||||
GL_ARB_shader_subroutine not started
|
||||
@@ -100,7 +99,7 @@ GL_ARB_texture_buffer_object_rgb32 not started
|
||||
GL_ARB_texture_cube_map_array not started
|
||||
GL_ARB_texture_gather not started
|
||||
GL_ARB_transform_feedback2 DONE
|
||||
GL_ARB_transform_feedback3 DONE
|
||||
GL_ARB_transform_feedback3 not started
|
||||
|
||||
|
||||
GL 4.1:
|
||||
@@ -115,13 +114,12 @@ GL_ARB_viewport_array not started
|
||||
|
||||
|
||||
GL 4.2:
|
||||
|
||||
GLSL 4.2 not started
|
||||
GL_ARB_texture_compression_bptc not started
|
||||
GL_ARB_compressed_texture_pixel_storage not started
|
||||
GL_ARB_shader_atomic_counters not started
|
||||
GL_ARB_texture_storage DONE (r300, r600, swrast)
|
||||
GL_ARB_transform_feedback_instanced DONE
|
||||
GL_ARB_transform_feedback_instanced not started
|
||||
GL_ARB_base_instance DONE (nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_shader_image_load_store not started
|
||||
GL_ARB_conservative_depth DONE (softpipe)
|
||||
@@ -130,35 +128,5 @@ GL_ARB_internalformat_query not started
|
||||
GL_ARB_map_buffer_alignment not started
|
||||
|
||||
|
||||
GL 4.3:
|
||||
|
||||
GLSL 4.3 not started
|
||||
ARB_arrays_of_arrays not started
|
||||
ARB_ES3_compatibility not started
|
||||
ARB_clear_buffer_object not started
|
||||
ARB_compute_shader started (gallium)
|
||||
ARB_copy_image not started
|
||||
ARB_debug_group not started
|
||||
ARB_debug_label not started
|
||||
ARB_debug_output DONE
|
||||
ARB_debug_output2 not started
|
||||
ARB_explicit_uniform_location not started
|
||||
ARB_fragment_layer_viewport not started
|
||||
ARB_framebuffer_no_attachments not started
|
||||
ARB_internalformat_query2 not started
|
||||
ARB_invalidate_subdata not started
|
||||
ARB_multi_draw_indirect not started
|
||||
ARB_program_interface_query not started
|
||||
ARB_robust_buffer_access_behavior not started
|
||||
ARB_shader_image_size not started
|
||||
ARB_shader_storage_buffer_object not started
|
||||
ARB_stencil_texturing not started
|
||||
ARB_texture_buffer_range not started
|
||||
ARB_texture_query_levels not started
|
||||
ARB_texture_storage_multisample not started
|
||||
ARB_texture_view not started
|
||||
ARB_vertex_attrib_binding not started
|
||||
|
||||
|
||||
More info about these features and the work involved can be found at
|
||||
http://dri.freedesktop.org/wiki/MissingFunctionality
|
||||
|
@@ -56,27 +56,12 @@ New Procedures and Functions
|
||||
EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
|
||||
struct wl_display *display);
|
||||
|
||||
EGLBoolean eglQueryWaylandBufferWL(EGLDisplay dpy,
|
||||
struct wl_buffer *buffer,
|
||||
EGLint attribute, EGLint *value);
|
||||
|
||||
New Tokens
|
||||
|
||||
Accepted as <target> in eglCreateImageKHR
|
||||
|
||||
EGL_WAYLAND_BUFFER_WL 0x31D5
|
||||
|
||||
Accepted in the <attrib_list> parameter of eglCreateImageKHR:
|
||||
|
||||
EGL_WAYLAND_PLANE_WL 0x31D6
|
||||
|
||||
Possible values for EGL_TEXTURE_FORMAT:
|
||||
|
||||
EGL_TEXTURE_Y_U_V_WL 0x31D7
|
||||
EGL_TEXTURE_Y_UV_WL 0x31D8
|
||||
EGL_TEXTURE_Y_XUXV_WL 0x31D9
|
||||
|
||||
|
||||
Additions to the EGL 1.4 Specification:
|
||||
|
||||
To bind a server side wl_display to an EGLDisplay, call
|
||||
@@ -95,67 +80,9 @@ Additions to the EGL 1.4 Specification:
|
||||
eglUnbindWaylandDisplayWL returns EGL_FALSE when there is no
|
||||
wl_display bound to the EGLDisplay currently otherwise EGL_TRUE.
|
||||
|
||||
A wl_buffer can have several planes, typically in case of planar
|
||||
YUV formats. Depending on the exact YUV format in use, the
|
||||
compositor will have to create one or more EGLImages for the
|
||||
various planes. The eglQueryWaylandBufferWL function should be
|
||||
used to first query the wl_buffer texture format using
|
||||
EGL_TEXTURE_FORMAT as the attribute. If the wl_buffer object is
|
||||
not an EGL wl_buffer (wl_shm and other wayland extensions can
|
||||
create wl_buffer objects of different types), this query will
|
||||
return EGL_FALSE. In that case the wl_buffer can not be used with
|
||||
EGL and the compositor should have another way to get the buffer
|
||||
contents.
|
||||
|
||||
If eglQueryWaylandBufferWL succeeds, the returned value will be
|
||||
one of EGL_TEXTURE_RGB, EGL_TEXTURE_RGBA, EGL_TEXTURE_Y_U_V_WL,
|
||||
EGL_TEXTURE_Y_UV_WL, EGL_TEXTURE_Y_XUXV_WL. The value returned
|
||||
describes how many EGLImages must be used, which components will
|
||||
be sampled from each EGLImage and how they map to rgba components
|
||||
in the shader. The naming conventions separates planes by _ and
|
||||
within each plane, the order or R, G, B, A, Y, U, and V indicates
|
||||
how those components map to the rgba value returned by the
|
||||
sampler. X indicates that the corresponding component in the rgba
|
||||
value isn't used.
|
||||
|
||||
RGB and RGBA buffer types:
|
||||
|
||||
EGL_TEXTURE_RGB
|
||||
One plane, samples RGB from the texture to rgb in the
|
||||
shader. Alpha channel is not valid.
|
||||
|
||||
EGL_TEXTURE_RGBA
|
||||
One plane, samples RGBA from the texture to rgba in the
|
||||
shader.
|
||||
|
||||
YUV buffer types:
|
||||
|
||||
EGL_TEXTURE_Y_U_V_WL
|
||||
Three planes, samples Y from the first plane to r in
|
||||
the shader, U from the second plane to r, and V from
|
||||
the third plane to r.
|
||||
|
||||
EGL_TEXTURE_Y_UV_WL
|
||||
Two planes, samples Y from the first plane to r in
|
||||
the shader, U and V from the second plane to rg.
|
||||
|
||||
EGL_TEXTURE_Y_XUXV_WL
|
||||
Two planes, samples Y from the first plane to r in
|
||||
the shader, U and V from the second plane to g and a.
|
||||
|
||||
After querying the wl_buffer layout, create EGLImages for the
|
||||
planes by calling eglCreateImageKHR with wl_buffer as
|
||||
EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target, NULL
|
||||
context. If no attributes are given, an EGLImage will be created
|
||||
for the first plane. For multi-planar buffers, specify the plane
|
||||
to create the EGLImage for by using the EGL_WAYLAND_PLANE_WL
|
||||
attribute. The value of the attribute is the index of the plane,
|
||||
as defined by the buffer format. Writing to an EGLImage created
|
||||
from a wl_buffer in any way (such as glTexImage2D, binding the
|
||||
EGLImage as a renderbuffer etc) will result in undefined behavior.
|
||||
|
||||
Further, eglQueryWaylandBufferWL accepts attributes EGL_WIDTH and
|
||||
EGL_HEIGHT to query the width and height of the wl_buffer.
|
||||
Import a wl_buffer by calling eglCreateImageKHR with
|
||||
wl_buffer as EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target,
|
||||
NULL context and an empty attribute_list.
|
||||
|
||||
Issues
|
||||
|
||||
@@ -163,13 +90,3 @@ Revision History
|
||||
|
||||
Version 1, March 1, 2011
|
||||
Initial draft (Benjamin Franzke)
|
||||
Version 2, July 5, 2012
|
||||
Add EGL_WAYLAND_PLANE_WL attribute to allow creating an EGLImage
|
||||
for different planes of planar buffer. (Kristian Høgsberg)
|
||||
Version 3, July 10, 2012
|
||||
Add eglQueryWaylandBufferWL and the various buffer
|
||||
formats. (Kristian Høgsberg)
|
||||
Version 4, July 19, 2012
|
||||
Use EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB, and EGL_TEXTURE_RGBA,
|
||||
and just define the new YUV texture formats. Add support for
|
||||
EGL_WIDTH and EGL_HEIGHT in the query attributes (Kristian Høgsberg)
|
||||
|
@@ -17,6 +17,10 @@
|
||||
<li><a href="#dri">DRI Driver Options</a></li>
|
||||
<li><a href="#osmesa">OSMesa Driver Options</a></li>
|
||||
</ul>
|
||||
<li><p><a href="#library">Library Options</a>
|
||||
<ul>
|
||||
<li><a href="#glu">GLU</a></li>
|
||||
</ul>
|
||||
<li><p><a href="#demos">Demo Program Options</a>
|
||||
</ol>
|
||||
|
||||
@@ -215,6 +219,12 @@ libraries that will be built. More details on the specific GL libraries
|
||||
can be found in the <a href="install.html">basic installation
|
||||
instructions</a>.
|
||||
|
||||
<dl>
|
||||
<dt id="glu">GLU <dd><p> The libGLU library will be built by default
|
||||
on all drivers. This can be disable with the option
|
||||
<code>--disable-glu</code>.
|
||||
</dl>
|
||||
|
||||
|
||||
<h2 id="demos">4. Demo Program Options</h2>
|
||||
|
||||
|
@@ -74,6 +74,7 @@
|
||||
<li><a href="http://sourceforge.net/projects/mesa3d" target="_parent">SourceForge homepage</a>
|
||||
<li><a href="repository.html" target="MainFrame">Source Code Repository</a>
|
||||
<li><a href="sourcetree.html" target="MainFrame">Source Code Tree</a>
|
||||
<li><a href="glu.html" target="MainFrame">SGI's GLU</a>
|
||||
<li><a href="utilities.html" target="MainFrame">Utilities</a>
|
||||
<li><a href="helpwanted.html" target="MainFrame">Help Wanted</a>
|
||||
<li><a href="devinfo.html" target="MainFrame">Development Notes</a>
|
||||
|
@@ -169,7 +169,7 @@ branch is relevant.
|
||||
<dd>MESA_MAJOR, MESA_MINOR and MESA_TINY</dd>
|
||||
<dt>Makefile.am</dt>
|
||||
<dd>PACKAGE_VERSION</dd>
|
||||
<dt>configure.ac</dt>
|
||||
<dt>autoconf.ac</dt>
|
||||
<dd>AC_INIT</dd>
|
||||
<dt>src/mesa/main/version.h</dt>
|
||||
<dd>MESA_MAJOR, MESA_MINOR, MESA_PATCH and MESA_VERSION_STRING</dd>
|
||||
|
@@ -197,7 +197,7 @@ few preprocessor defines.</p>
|
||||
|
||||
<ul>
|
||||
<li>If <tt>GLX_USE_TLS</tt> is defined, method #4 is used.</li>
|
||||
<li>If <tt>HAVE_PTHREAD</tt> is defined, method #3 is used.</li>
|
||||
<li>If <tt>PTHREADS</tt> is defined, method #3 is used.</li>
|
||||
<li>If <tt>WIN32_THREADS</tt> is defined, method #2 is used.</li>
|
||||
<li>If none of the preceeding are defined, method #1 is used.</li>
|
||||
</ul>
|
||||
|
@@ -69,6 +69,7 @@ docs/ - documentation
|
||||
src/ - source code for libraries
|
||||
src/mesa - sources for the main Mesa library and device drivers
|
||||
src/gallium - sources for Gallium and Gallium drivers
|
||||
src/glu - libGLU source code
|
||||
src/glx - sources for building libGL with full GLX and DRI support
|
||||
</pre>
|
||||
|
||||
@@ -79,12 +80,7 @@ instructions</a>.
|
||||
</p>
|
||||
|
||||
|
||||
<h1>Demos, GLUT, and GLU</h1>
|
||||
|
||||
<p>
|
||||
A package of SGI's GLU library is available
|
||||
<a href="ftp://ftp.freedesktop.org/pub/mesa/glu/" target="_parent">here</a>
|
||||
</p>
|
||||
<h1>Demos and GLUT</h1>
|
||||
|
||||
<p>
|
||||
A package of Mark Kilgard's GLUT library is available
|
||||
@@ -97,13 +93,9 @@ The Mesa demos collection is available
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In the past, GLUT, GLU and the Mesa demos were released in conjunction with
|
||||
Mesa releases. But since GLUT, GLU and the demos change infrequently, they
|
||||
were split off into their own git repositories:
|
||||
|
||||
<a href="http://cgit.freedesktop.org/mesa/glut/">GLUT</a>,
|
||||
<a href="http://cgit.freedesktop.org/mesa/glu/">GLU</a> and
|
||||
<a href="http://cgit.freedesktop.org/mesa/demos/">Demos</a>,
|
||||
In the past, GLUT and the Mesa demos were released in conjunction with
|
||||
Mesa releases. But since GLUT and the demos change infrequently, they
|
||||
were split off some time ago.
|
||||
</p>
|
||||
|
||||
|
||||
|
@@ -226,6 +226,10 @@ Basically you'll want the following:
|
||||
</li><li>/usr/lib/libGL.so.1 - a symlink to libGL.so.1.xyz
|
||||
</li><li>/usr/lib/libGL.so.xyz - the actual OpenGL/Mesa library. xyz denotes the
|
||||
Mesa version number.
|
||||
</li><li>/usr/lib/libGLU.so - a symlink to libGLU.so.1
|
||||
</li><li>/usr/lib/libGLU.so.1 - a symlink to libGLU.so.1.3.xyz
|
||||
</li><li>/usr/lib/libGLU.so.xyz - the OpenGL Utility library. xyz denotes the Mesa
|
||||
version number.
|
||||
</li></ul>
|
||||
<p>
|
||||
After installing XFree86/X.org and the DRI drivers, some of these files
|
||||
|
46
docs/glu.html
Normal file
46
docs/glu.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>SGI GLU</title>
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>SGI SI GLU</h1>
|
||||
|
||||
(Silicon Graphics, Inc. Sample Implementation of the OpenGL Utility library)
|
||||
|
||||
<p>
|
||||
SGI open-sourced their OpenGL Sample Implementation (SI) in January, 2000.
|
||||
This includes the GLU library.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The SI GLU library implements GLU version 1.3 whereas the original
|
||||
Mesa GLU library only implemented version 1.2.
|
||||
We recommend using the SI GLU library instead of Mesa's GLU library
|
||||
since it's more up-to-date, complete and reliable.
|
||||
We're no longer developing the original Mesa GLU library.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The SI GLU library code is included in the Mesa distribution.
|
||||
You don't have to download it separately.
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
<b>Olivier Michel</b> has made Linux RPMs of GLU for i386 and PowerPC.
|
||||
You can download them from the
|
||||
<a href="http://www.sourceforge.net/project/showfiles.php?group_id=3"
|
||||
target="_parent">download area</a> under <b>Miscellaneous</b>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Visit the <a href="http://oss.sgi.com/projects/ogl-sample/" target="_parent">
|
||||
OpenGL Sample Implementation home page</a> for more information about the SI.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -31,8 +31,13 @@ issues in the code.
|
||||
<b>Windows driver building, testing and maintenance.</b>
|
||||
Fixing MSVC builds.
|
||||
<li>
|
||||
<b>Maintenance and testing of lesser-used drivers.</b>
|
||||
Drivers such as i810, mach64, mga, r128, savage, sis, tdfx, unichrome, etc that aren't being maintained are being
|
||||
deprecated starting in Mesa 8.0.<br>
|
||||
They have to be ported to DRI2 to be accepted in mesa master again.
|
||||
<li>
|
||||
<b>Contribute more tests to
|
||||
<a href="http://piglit.freedesktop.org/" target="_parent">Piglit</a>.</b>
|
||||
<a href="http://people.freedesktop.org/~nh/piglit/" target="_parent">Piglit</a>.</b>
|
||||
<li>
|
||||
<b>Automatic testing.
|
||||
</b>
|
||||
@@ -41,25 +46,6 @@ the latest Mesa code and run tests (such as piglit) then report issues to
|
||||
the mailing list.
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
You can find some further To-do lists here:
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="http://cgit.freedesktop.org/mesa/mesa/tree/docs/GL3.txt"
|
||||
target="_parent"><b>GL3.txt</b></a></li>
|
||||
<li><a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/docs/llvm-todo.txt"
|
||||
target="_parent"><b>LLVMpipe - todo</b></a></li>
|
||||
<li><a href="http://dri.freedesktop.org/wiki/MissingFunctionality"
|
||||
target="_parent"><b>MissingFunctionality</b></a></li>
|
||||
<li><a href="http://dri.freedesktop.org/wiki/RadeonsiToDo"
|
||||
target="_parent"><b>RadeonsiToDo</b></a></li>
|
||||
<li><a href="http://dri.freedesktop.org/wiki/R600ToDo"
|
||||
target="_parent"><b>R600ToDo</b></a></li>
|
||||
<li><a href="http://dri.freedesktop.org/wiki/R300ToDo"
|
||||
target="_parent"><b>R300ToDo</b></a></li>
|
||||
<li><a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/i915/TODO"
|
||||
target="_parent"><b>i915g TODO</b></a></li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
If you want to do something new in Mesa, first join the Mesa developer's
|
||||
|
@@ -151,6 +151,9 @@ You'll see a set of library files similar to this:
|
||||
lrwxrwxrwx 1 brian users 10 Mar 26 07:53 libGL.so -> libGL.so.1*
|
||||
lrwxrwxrwx 1 brian users 19 Mar 26 07:53 libGL.so.1 -> libGL.so.1.5.060100*
|
||||
-rwxr-xr-x 1 brian users 3375861 Mar 26 07:53 libGL.so.1.5.060100*
|
||||
lrwxrwxrwx 1 brian users 11 Mar 26 07:53 libGLU.so -> libGLU.so.1*
|
||||
lrwxrwxrwx 1 brian users 20 Mar 26 07:53 libGLU.so.1 -> libGLU.so.1.3.060100*
|
||||
-rwxr-xr-x 1 brian users 549269 Mar 26 07:53 libGLU.so.1.3.060100*
|
||||
lrwxrwxrwx 1 brian users 14 Mar 26 07:53 libOSMesa.so -> libOSMesa.so.6*
|
||||
lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSMesa.so.6.1.060100*
|
||||
-rwxr-xr-x 1 brian users 23871 Mar 26 07:53 libOSMesa.so.6.1.060100*
|
||||
@@ -159,6 +162,8 @@ lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSM
|
||||
<p>
|
||||
<b>libGL</b> is the main OpenGL library (i.e. Mesa).
|
||||
<br>
|
||||
<b>libGLU</b> is the OpenGL Utility library.
|
||||
<br>
|
||||
<b>libOSMesa</b> is the OSMesa (Off-Screen) interface library.
|
||||
</p>
|
||||
|
||||
|
@@ -166,17 +166,6 @@ of the OpenGL specification is implemented.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>Version 9.x features</h2>
|
||||
<p>
|
||||
Version 9.x of Mesa implements the OpenGL 3.1 API.
|
||||
While the driver for Intel Sandy Bridge and Ivy Bridge is the only
|
||||
driver to support OpenGL 3.1, many developers across the open-source
|
||||
community contributed features required for OpenGL 3.1. The primary
|
||||
features added since the Mesa 8.0 release are
|
||||
GL_ARB_texture_buffer_object and GL_ARB_uniform_buffer_object.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>Version 8.x features</h2>
|
||||
<p>
|
||||
Version 8.x of Mesa implements the OpenGL 3.0 API.
|
||||
|
@@ -95,6 +95,8 @@ Device drivers src/mesa/drivers/* MIT, generally
|
||||
|
||||
Ext headers include/GL/glext.h Khronos
|
||||
include/GL/glxext.h
|
||||
|
||||
SGI GLU library src/glu/sgi/ SGI Free B
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
|
@@ -9,24 +9,6 @@
|
||||
|
||||
<h1>News</h1>
|
||||
|
||||
<h2>October 8, 2012</h2>
|
||||
|
||||
<p>
|
||||
<a href="relnotes-9.0.html">Mesa 9.0</a> is released.
|
||||
This is the first version of Mesa to support OpenGL 3.1 and GLSL 1.40
|
||||
(with the i965 driver).
|
||||
See the release notes for more information about the release.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>July 10, 2012</h2>
|
||||
|
||||
<p>
|
||||
<a href="relnotes-8.0.4.html">Mesa 8.0.4</a> is released.
|
||||
This is a bug fix release.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>May 18, 2012</h2>
|
||||
|
||||
<p>
|
||||
|
@@ -1,201 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>Mesa 8.0.4 Release Notes / July 10, 2012</h1>
|
||||
|
||||
<p>
|
||||
Mesa 8.0.4 is a bug fix release which fixes bugs found since the 8.0.2 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 8.0.4 implements the OpenGL 3.0 API, but the version reported by
|
||||
glGetString(GL_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 3.0.
|
||||
</p>
|
||||
<p>
|
||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
|
||||
for DRI hardware acceleration.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
02b96082d2f1ad72e7385f4022afafb9 MesaLib-8.0.4.tar.gz
|
||||
d546f988adfdf986cff45b1efa2d8a46 MesaLib-8.0.4.tar.bz2
|
||||
1f0fdabe6e8019d4de6c16e20e74d163 MesaLib-8.0.4.zip
|
||||
</pre>
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None.</p>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<p>This list is likely incomplete.</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45967">Bug 45967</a> - piglit getteximage-invalid-format-for-packed-type regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47742">Bug 47742</a> - [softpipe] piglit fbo-generatemipmap-array regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48141">Bug 48141</a> - [vmwgfx] src/gallium/auxiliary/util/u_inlines.h:256:pipe_buffer_map_range: Assertion `offset + length <= buffer->width0' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48472">Bug 48472</a> - GPU Lockup while running demo (rzr - the scene is dead) in wine</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50033">Bug 50033</a> - src/mesa/state_tracker/st_cb_fbo.c:379:st_render_texture: Assertion `strb->rtt_level <= strb->texture->last_level' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50621">Bug 50621</a> - Mesa fails its test suite with a buffer overflow.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50298">Bug 50298</a> - [ILK IVB bisected]Ogles2conform GL/sin/sin_float_vert_xvary.test regressed</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=51574">Bug 51574</a> - ir_loop_jump constructor assigns member variable to itself</li>
|
||||
|
||||
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
<p>The full set of changes can be viewed by using the following GIT command:</p>
|
||||
|
||||
<pre>
|
||||
git log mesa-8.0.3..mesa-8.0.4
|
||||
</pre>
|
||||
|
||||
<p>Andreas Betz (1):</p>
|
||||
<ul>
|
||||
<li>vega: fix 565 color unpacking bug</li>
|
||||
</ul>
|
||||
|
||||
<p>Antoine Labour (2):</p>
|
||||
<ul>
|
||||
<li>meta: Cleanup the resources we allocate.</li>
|
||||
<li>mesa: Free uniforms correclty.</li>
|
||||
</ul>
|
||||
|
||||
<p>Brian Paul (22):</p>
|
||||
<ul>
|
||||
<li>docs: add link to 8.0.3 release notes</li>
|
||||
<li>mesa: fix Z32_FLOAT -> uint conversion functions</li>
|
||||
<li>draw: fix primitive restart bug by using the index buffer offset</li>
|
||||
<li>st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color output</li>
|
||||
<li>svga: fix synchronization bug between sampler views and surfaces</li>
|
||||
<li>mesa: new _mesa_error_check_format_and_type() function</li>
|
||||
<li>mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case</li>
|
||||
<li>mesa: fix missing return value in getteximage_error_check()</li>
|
||||
<li>st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers</li>
|
||||
<li>svga: add 0.5 in float->int conversion of sample min/max lod</li>
|
||||
<li>svga: fix min/max lod clamping</li>
|
||||
<li>svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0</li>
|
||||
<li>st/mesa: add fallback pipe formats for (compressed) R, RG formats</li>
|
||||
<li>st/mesa: copy num_immediates field when copying the immediates array</li>
|
||||
<li>svga: move svga_texture() casts/calls in svga_surface_copy()</li>
|
||||
<li>svga: reset vertex buffer offset in svga_release_user_upl_buffers()</li>
|
||||
<li>st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers</li>
|
||||
<li>st/mesa: use private pipe_sampler_view in decompress_with_blit()</li>
|
||||
<li>st/mesa: add null pointer check in st_texture_image_map()</li>
|
||||
<li>st/mesa: fix mipmap image size computation w.r.t. texture arrays</li>
|
||||
<li>draw: fix missing immediates bug in polygon stipple code</li>
|
||||
<li>st/mesa: fix max_offset computation for base vertex</li>
|
||||
</ul>
|
||||
|
||||
<p>Christoph Bumiller (1):</p>
|
||||
<ul>
|
||||
<li>nv50: handle NEG,ABS modifiers for short RCP encoding</li>
|
||||
</ul>
|
||||
|
||||
<p>Dylan Noblesmith (1):</p>
|
||||
<ul>
|
||||
<li>mesa: require GL_MAX_SAMPLES >= 4 for GL 3.0</li>
|
||||
</ul>
|
||||
|
||||
<p>Eric Anholt (1):</p>
|
||||
<ul>
|
||||
<li>i965/vs: Fix texelFetchOffset()</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (5):</p>
|
||||
<ul>
|
||||
<li>docs: Add 8.0.3 release md5sums</li>
|
||||
<li>glx/tests: Fix off-by-one error in allocating extension string buffer</li>
|
||||
<li>glsl: Remove spurious printf messages</li>
|
||||
<li>glsl: Fix pi/2 constant in acos built-in function</li>
|
||||
<li>mesa: Bump version number to 8.0.4</li>
|
||||
</ul>
|
||||
|
||||
<p>José Fonseca (2):</p>
|
||||
<ul>
|
||||
<li>mesa: Avoid void acinclude.m4 Android.common.mk Android.mk autogen.sh bin common.py configs configure.ac docs doxygen include Makefile scons SConstruct src tests arithmetic.</li>
|
||||
<li>draw: Ensure that prepare is always run after LLVM garbagge collection.</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (15):</p>
|
||||
<ul>
|
||||
<li>mesa: Check for a negative "size" parameter in glCopyBufferSubData().</li>
|
||||
<li>i965: Fix brw_swap_cmod() for LE/GE comparisons.</li>
|
||||
<li>glsl: Remove unused ir_loop_jump::loop pointer.</li>
|
||||
<li>ralloc: Fix ralloc_parent() of memory allocated out of the NULL context.</li>
|
||||
<li>mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).</li>
|
||||
<li>glsl/builtins: Fix textureGrad() for Array samplers.</li>
|
||||
<li>mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.</li>
|
||||
<li>mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.</li>
|
||||
<li>mesa: Unbind ARB_transform_feedback2 binding points on Delete too.</li>
|
||||
<li>meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().</li>
|
||||
<li>i965/fs: Fix texelFetchOffset() on pre-Gen7.</li>
|
||||
<li>i965/vs: Fix texelFetchOffset() on pre-Gen7.</li>
|
||||
<li>i965/fs: Fix user-defined FS outputs with less than four components.</li>
|
||||
<li>glsl: Hook up loop_variable_state destructor to plug a memory leak.</li>
|
||||
<li>glsl: Don't trust loop analysis in the presence of function calls.</li>
|
||||
</ul>
|
||||
|
||||
<p>Kurt Roeckx (1):</p>
|
||||
<ul>
|
||||
<li>i830: Fix crash for GL_STENCIL_TEST in i830Enable()</li>
|
||||
</ul>
|
||||
|
||||
<p>Lukas Rössler (1):</p>
|
||||
<ul>
|
||||
<li>glu: fix two Clang warnings</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (2):</p>
|
||||
<ul>
|
||||
<li>mesa: allow exposing GL3 without EXT_texture_integer</li>
|
||||
<li>st/mesa: don't do srgb->linear conversion in decompress_with_blit</li>
|
||||
</ul>
|
||||
|
||||
<p>Paul Seidler (1):</p>
|
||||
<ul>
|
||||
<li>tests: include mesa headers</li>
|
||||
</ul>
|
||||
|
||||
<p>Stéphane Marchesin (3):</p>
|
||||
<ul>
|
||||
<li>glx: Handle a null reply in QueryVersion.</li>
|
||||
<li>i915g: Don't invert signalled/unsignalled fences</li>
|
||||
<li>i915g: Don't avoid flushing when we have a pending fence.</li>
|
||||
</ul>
|
||||
|
||||
<p>Thomas Gstädtner (1):</p>
|
||||
<ul>
|
||||
<li>gallium/targets: pass ldflags parameter to MKLIB</li>
|
||||
</ul>
|
||||
|
||||
<p>Vadim Girlin (2):</p>
|
||||
<ul>
|
||||
<li>st/mesa: set stObj->lastLevel in guess_and_alloc_texture</li>
|
||||
<li>r600g: check gpr count limit</li>
|
||||
</ul>
|
||||
|
||||
<p>Vinson Lee (1):</p>
|
||||
<ul>
|
||||
<li>st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.</li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
56
docs/relnotes-8.1.html
Normal file
56
docs/relnotes-8.1.html
Normal file
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>Mesa 8.1 Release Notes / date TBD</h1>
|
||||
|
||||
<p>
|
||||
Mesa 8.1 is a new development release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 8.1 implements the OpenGL 3.0 API, but the version reported by
|
||||
glGetString(GL_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 3.0.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
tbd
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
|
||||
<p>
|
||||
Note: some of the new features are only available with certain drivers.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>GL_ARB_base_instance extension</li>
|
||||
<li>GL_NV_read_buffer extension for ES 2.0</li>
|
||||
<li>GL_ARB_shader_bit_encoding</li>
|
||||
<li>GL_EXT_unpack_subimage for ES 2.0</li>
|
||||
<li>GL_EXT_read_format_bgra for ES 1.1 and 2.0</li>
|
||||
<li>GL_ARB_debug_output</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<p>TBD -- This list is likely incomplete.</p>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>TBD</p>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -1,157 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>Mesa 9.0.1 Release Notes / November 14th, 2012</h1>
|
||||
|
||||
<p>
|
||||
Mesa 9.0.1 is a bug fix release which fixes bugs found since the 9.0 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 9.0 implements the OpenGL 3.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
|
||||
3.1 is <strong>only</strong> available if requested at context creation
|
||||
because GL_ARB_compatibility is not supported.
|
||||
</p>
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
TBD.
|
||||
</pre>
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None.</p>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<p>This list is likely incomplete.</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=44912">Bug 44912</a> - [bisected] WebGL conformance/textures/texture-mips tests fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55856">Bug 55856</a> - kwin with gles window content is not updating (gen4)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=56057">Bug 56057</a> - INTEL_swap_event not correctly listed</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=56211">Bug 56211</a> - src/mesa/state_tracker/st_cb_texture.c:1123:copy_image_data_to_texture: Assertion `u_minify(stImage->pt->height0, src_level) == stImage->base.Height' failed.</li>
|
||||
|
||||
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
<p>The full set of changes can be viewed by using the following GIT command:</p>
|
||||
|
||||
<pre>
|
||||
git log mesa-9.0..mesa-9.0.1
|
||||
</pre>
|
||||
|
||||
<p>Adam Jackson (1):</p>
|
||||
<ul>
|
||||
<li>glx: Add GLXBadProfileARB to the error string list</li>
|
||||
</ul>
|
||||
|
||||
<p>Andreas Boll (7):</p>
|
||||
<ul>
|
||||
<li>docs: add news item for 9.0 release</li>
|
||||
<li>mesa: add get-pick-list.sh script into bin/</li>
|
||||
<li>mesa: add initial .cherry-ignore file for the 9.0 branch</li>
|
||||
<li>mesa: use .cherry-ignore in the get-pick-list.sh script</li>
|
||||
<li>build: add config.sub and config.guess to tarballs target</li>
|
||||
<li>build: add missing Makefile.in files to tarballs target</li>
|
||||
<li>build: add missing files to tarballs target</li>
|
||||
</ul>
|
||||
|
||||
<p>Brian Paul (2):</p>
|
||||
<ul>
|
||||
<li>mesa: don't call TexImage driver hooks for zero-sized images</li>
|
||||
<li>mesa: fix error check for zero-sized compressed subtexture</li>
|
||||
</ul>
|
||||
|
||||
<p>Fredrik Höglund (1):</p>
|
||||
<ul>
|
||||
<li>egl_dri2/x11: Fix eglPostSubBufferNV()</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (5):</p>
|
||||
<ul>
|
||||
<li>docs: Add 9.0 release md5sums</li>
|
||||
<li>i965: Fix regression in depth texture rendering on pre-SNB</li>
|
||||
<li>glx: Set sRGBCapable to a default value</li>
|
||||
<li>docs: Add 9.0.1 release notes</li>
|
||||
<li>mesa: Bump version to 9.0.1</li>
|
||||
</ul>
|
||||
|
||||
<p>Imre Deak (7):</p>
|
||||
<ul>
|
||||
<li>mesa: glGet: fix indentation of _mesa_init_get_hash</li>
|
||||
<li>mesa: glGet: fix indentation of find_value</li>
|
||||
<li>mesa: glGet: fix indentation of print_table_stats</li>
|
||||
<li>mesa: glGet: fix API check for EGL_image_external enums</li>
|
||||
<li>glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension section</li>
|
||||
<li>mesa: glGet: fix parameter lookup for apps using multiple APIs</li>
|
||||
<li>glget: fix make check for glGet GL_POLYGON_OFFSET_BIAS</li>
|
||||
</ul>
|
||||
|
||||
<p>Jonas Ådahl (1):</p>
|
||||
<ul>
|
||||
<li>wayland: Destroy frame callback when destroying surface</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (1):</p>
|
||||
<ul>
|
||||
<li>glsl: Allow ir_if in the linker's move_non_declarations function.</li>
|
||||
</ul>
|
||||
|
||||
<p>Kristian Høgsberg (5):</p>
|
||||
<ul>
|
||||
<li>gbm: Reject buffers that are not wl_drm buffers in gbm_bo_import()</li>
|
||||
<li>gbm: Use the kms dumb ioctls for cursor instead of libkms</li>
|
||||
<li>egl/wayland: Update to Wayland 0.99 API</li>
|
||||
<li>wayland: Remove 0.85 compatibility #ifdefs</li>
|
||||
<li>wayland: Drop support for ill-defined, unused wl_egl_pixmap</li>
|
||||
</ul>
|
||||
|
||||
<p>Marcin Slusarz (1):</p>
|
||||
<ul>
|
||||
<li>nouveau: use pre-calculated stride for resource_get_handle</li>
|
||||
</ul>
|
||||
|
||||
<p>Matt Turner (4):</p>
|
||||
<ul>
|
||||
<li>egl: Return EGL_BAD_MATCH for invalid profile attributes</li>
|
||||
<li>Re-add HAVE_PTHREADS preprocessor macro</li>
|
||||
<li>build: Ship install-sh in the tarball</li>
|
||||
<li>ralloc: Annotate printf functions with PRINTFLIKE(...)</li>
|
||||
</ul>
|
||||
|
||||
<p>Michel Dänzer (2):</p>
|
||||
<ul>
|
||||
<li>st/mesa: Fix source miptree level for copying data to finalized miptree.</li>
|
||||
<li>st/mesa: Fix assertions for copying texture image to finalized miptree.</li>
|
||||
</ul>
|
||||
|
||||
<p>Owen W. Taylor (1):</p>
|
||||
<ul>
|
||||
<li>glx: Fix listing of INTEL_swap_event in glXQueryExtensionsString()</li>
|
||||
</ul>
|
||||
|
||||
<p>Quentin Glidic (1):</p>
|
||||
<ul>
|
||||
<li>intel: Add missing #include <time.h></li>
|
||||
</ul>
|
||||
|
||||
<p>Tomeu Vizoso (1):</p>
|
||||
<ul>
|
||||
<li>mesa/es: Define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT enum for all GLs</li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -1,92 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>Mesa 9.0 Release Notes / October 8th, 2012</h1>
|
||||
|
||||
<p>
|
||||
Mesa 9.0 is a new development release.
|
||||
People who are concerned with stability and reliability should stick
|
||||
with a previous release or wait for Mesa 9.0.1.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 9.0 implements the OpenGL 3.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
|
||||
3.1 is <strong>only</strong> available if requested at context creation
|
||||
because GL_ARB_compatibility is not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
be4cd34c6599a7cb9d254b05c48bdb1f MesaLib-9.0.tar.gz
|
||||
60e557ce407be3732711da484ab3db6c MesaLib-9.0.tar.bz2
|
||||
16b128544cd3f7e237927bb9f8aab7ce MesaLib-9.0.zip
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
|
||||
<p>
|
||||
Note: some of the new features are only available with certain drivers.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Added new Gallium3D - nv30 driver</li>
|
||||
<li>Added new Gallium3D - radeonsi driver</li>
|
||||
<li>Added OpenCL state tracker Clover</li>
|
||||
<li>Completed VDPAU state tracker (video decoding support is currently limited to MPEG1 and MPEG2)</li>
|
||||
<li>GL_ARB_base_instance</li>
|
||||
<li>GL_ARB_blend_func_extended</li>
|
||||
<li>GL_ARB_debug_output</li>
|
||||
<li>GL_ARB_invalidate_subdata - Currently a "no-op" implementation. This
|
||||
extension is always enabled in all drivers.</li>
|
||||
<li>GL_ARB_shader_bit_encoding</li>
|
||||
<li>GL_ARB_texture_buffer_object</li>
|
||||
<li>GL_ARB_timer_query</li>
|
||||
<li>GL_ARB_transform_feedback3</li>
|
||||
<li>GL_ARB_transform_feedback_instanced</li>
|
||||
<li>GL_ARB_uniform_buffer_object</li>
|
||||
<li>GL_EXT_unpack_subimage for ES 2.0</li>
|
||||
<li>GL_EXT_read_format_bgra for ES 1.1 and 2.0</li>
|
||||
<li>GL_EXT_texture_rg for ES 2.x</li>
|
||||
<li>GL_NV_read_buffer for ES 2.0</li>
|
||||
<li>GLX_ARB_create_context_robustness</li>
|
||||
<li>EGL_KHR_create_context</li>
|
||||
<li>EGL_KHR_surfaceless_context - This replaces the
|
||||
EGL_KHR_surfaceless_{gles1,gles2,opengl} extensions that were never approved
|
||||
by Khronos.</li>
|
||||
<li>EGL_EXT_create_context_robustness</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<p>TBD -- This list is likely incomplete.</p>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
The legacy/static Makefile system (ex: 'make linux-dri') has been removed.
|
||||
<br>
|
||||
The two supported build methods are now autoconf/automake and SCons.
|
||||
</li>
|
||||
<li>Removed support for GL_ARB_shadow_ambient extension</li>
|
||||
<li>Removed Gallium3D - nvfx driver (use nv30 instead)</li>
|
||||
<li>
|
||||
libGLU has been moved into its own repository, found at <a href="http://cgit.freedesktop.org/mesa/glu/">http://cgit.freedesktop.org/mesa/glu/</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -14,15 +14,11 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="relnotes-9.0.1.html">9.0.1 release notes</a>
|
||||
<li><a href="relnotes-9.0.html">9.0 release notes</a>
|
||||
<li><a href="relnotes-8.0.4.html">8.0.4 release notes</a>
|
||||
<li><a href="relnotes-8.1.html">8.1 release notes</a>
|
||||
<li><a href="relnotes-8.0.3.html">8.0.3 release notes</a>
|
||||
<li><a href="relnotes-8.0.2.html">8.0.2 release notes</a>
|
||||
<li><a href="relnotes-8.0.1.html">8.0.1 release notes</a>
|
||||
<li><a href="relnotes-8.0.html">8.0 release notes</a>
|
||||
<li><a href="relnotes-7.11.2.html">7.11.2 release notes</a>
|
||||
<li><a href="relnotes-7.11.1.html">7.11.1 release notes</a>
|
||||
<li><a href="relnotes-7.11.html">7.11 release notes</a>
|
||||
<li><a href="relnotes-7.10.3.html">7.10.3 release notes</a>
|
||||
<li><a href="relnotes-7.10.2.html">7.10.2 release notes</a>
|
||||
|
@@ -243,7 +243,7 @@ regressions.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <a href="http://piglit.freedesktop.org/" target="_parent">Piglit</a> project
|
||||
The <a href="http://people.freedesktop.org/~nh/piglit/" target="_parent">Piglit</a> project
|
||||
has many GLSL tests and the
|
||||
<a href="http://glean.sf.net" target="_parent">Glean</a> glsl1 test
|
||||
tests GLSL features.
|
||||
|
@@ -146,6 +146,11 @@ each directory.
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><b>glu</b> - The OpenGL Utility library
|
||||
<ul>
|
||||
<li><b>sgi</b> - GLU from SGI
|
||||
<li><b>mesa</b> - Mesa version of GLU (deprecated)
|
||||
</ul>
|
||||
<li><b>glx</b> - The GLX library code for building libGL. This is used for
|
||||
direct rendering drivers. It will dynamically load one of the
|
||||
xxx_dri.so drivers.
|
||||
|
@@ -9,25 +9,19 @@
|
||||
|
||||
<h1>Development Utilities</h1>
|
||||
|
||||
<dl>
|
||||
<dt><a href="http://cgit.freedesktop.org/mesa/demos"
|
||||
target="_parent">Mesa demos collection</a></dt>
|
||||
<dd>includes several utility routines in the <code>src/util/</code>
|
||||
directory.</dd>
|
||||
<ul>
|
||||
|
||||
<dt><a href="http://piglit.freedesktop.org"
|
||||
target="_parent">Piglit</a></dt>
|
||||
<dd>is an open-source test suite for OpenGL implementations.</dd>
|
||||
<li>The Mesa distribution includes several utility routines in the
|
||||
progs/util/ directory
|
||||
|
||||
<dt><a href="https://github.com/apitrace/apitrace"
|
||||
target="_parent">ApiTrace</a></dt>
|
||||
<dd>is a project to trace, analyze and debug graphics api's.</dd>
|
||||
<li>Allen Akin's <a href="http://glean.sourceforge.net/"
|
||||
target="_parent">glean</a> is a framework for OpenGL testing.
|
||||
|
||||
<dt><a href="http://www.valgrind.org"
|
||||
target="_parent">Valgrind</a></dt>
|
||||
<dd>is a very useful tool for tracking down
|
||||
memory-related problems in your code.</dd>
|
||||
</dl>
|
||||
<li><a href="http://www.valgrind.org"
|
||||
target="_parent">Valgrind</a> is a very useful tool for tracking down
|
||||
memory-related problems in your code.
|
||||
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -11,8 +11,9 @@ PROJECT_NAME = "Mesa GLSL module"
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = ../src/glsl/
|
||||
RECURSIVE = NO
|
||||
EXCLUDE = ../src/glsl/glsl_lexer.cc \
|
||||
../src/glsl/glsl_parser.cc \
|
||||
EXCLUDE = ../src/glsl/glsl_lexer.cpp \
|
||||
../src/glsl/glsl_lexer.h \
|
||||
../src/glsl/glsl_parser.cpp \
|
||||
../src/glsl/glsl_parser.h
|
||||
EXCLUDE_PATTERNS =
|
||||
#---------------------------------------------------------------------------
|
||||
|
@@ -6,7 +6,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2012 The Khronos Group Inc.
|
||||
** Copyright (c) 2007-2010 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
@@ -34,8 +34,8 @@ extern "C" {
|
||||
|
||||
/* Header file version number */
|
||||
/* Current version at http://www.khronos.org/registry/egl/ */
|
||||
/* $Revision: 18699 $ on $Date: 2012-07-31 03:04:59 -0700 (Tue, 31 Jul 2012) $ */
|
||||
#define EGL_EGLEXT_VERSION 14
|
||||
/* $Revision: 15052 $ on $Date: 2011-07-06 17:43:46 -0700 (Wed, 06 Jul 2011) $ */
|
||||
#define EGL_EGLEXT_VERSION 10
|
||||
|
||||
#ifndef EGL_KHR_config_attribs
|
||||
#define EGL_KHR_config_attribs 1
|
||||
@@ -178,15 +178,15 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EG
|
||||
|
||||
#ifndef EGL_NV_coverage_sample
|
||||
#define EGL_NV_coverage_sample 1
|
||||
#define EGL_COVERAGE_BUFFERS_NV 0x30E0
|
||||
#define EGL_COVERAGE_SAMPLES_NV 0x30E1
|
||||
#define EGL_COVERAGE_BUFFERS_NV 0x30E0
|
||||
#define EGL_COVERAGE_SAMPLES_NV 0x30E1
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_depth_nonlinear
|
||||
#define EGL_NV_depth_nonlinear 1
|
||||
#define EGL_DEPTH_ENCODING_NV 0x30E2
|
||||
#define EGL_DEPTH_ENCODING_NV 0x30E2
|
||||
#define EGL_DEPTH_ENCODING_NONE_NV 0
|
||||
#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
|
||||
#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLTimeNV requires 64-bit uint support */
|
||||
@@ -208,12 +208,12 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EG
|
||||
typedef void* EGLSyncNV;
|
||||
typedef khronos_utime_nanoseconds_t EGLTimeNV;
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync);
|
||||
EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
|
||||
EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
|
||||
EGLBoolean eglDestroySyncNV (EGLSyncNV sync);
|
||||
EGLBoolean eglFenceNV (EGLSyncNV sync);
|
||||
EGLint eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
|
||||
EGLBoolean eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
|
||||
EGLBoolean eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
|
||||
@@ -313,7 +313,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay
|
||||
#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLuint64NV requires 64-bit uint support */
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */
|
||||
#ifndef EGL_NV_system_time
|
||||
#define EGL_NV_system_time 1
|
||||
|
||||
@@ -328,134 +328,6 @@ typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLuint64KHR requires 64-bit uint support */
|
||||
#ifndef EGL_KHR_stream
|
||||
#define EGL_KHR_stream 1
|
||||
typedef void* EGLStreamKHR;
|
||||
typedef khronos_uint64_t EGLuint64KHR;
|
||||
#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0)
|
||||
#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210
|
||||
#define EGL_PRODUCER_FRAME_KHR 0x3212
|
||||
#define EGL_CONSUMER_FRAME_KHR 0x3213
|
||||
#define EGL_STREAM_STATE_KHR 0x3214
|
||||
#define EGL_STREAM_STATE_CREATED_KHR 0x3215
|
||||
#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216
|
||||
#define EGL_STREAM_STATE_EMPTY_KHR 0x3217
|
||||
#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218
|
||||
#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219
|
||||
#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A
|
||||
#define EGL_BAD_STREAM_KHR 0x321B
|
||||
#define EGL_BAD_STATE_KHR 0x321C
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_consumer_gltexture
|
||||
#define EGL_KHR_stream_consumer_gltexture 1
|
||||
#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_producer_eglsurface
|
||||
#define EGL_KHR_stream_producer_eglsurface 1
|
||||
#define EGL_STREAM_BIT_KHR 0x0800
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_producer_aldatalocator
|
||||
#define EGL_KHR_stream_producer_aldatalocator 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_fifo
|
||||
#define EGL_KHR_stream_fifo 1
|
||||
/* reuse EGLTimeKHR */
|
||||
#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC
|
||||
#define EGL_STREAM_TIME_NOW_KHR 0x31FD
|
||||
#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE
|
||||
#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EGL_EXT_create_context_robustness
|
||||
#define EGL_EXT_create_context_robustness 1
|
||||
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF
|
||||
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138
|
||||
#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE
|
||||
#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANGLE_d3d_share_handle_client_buffer
|
||||
#define EGL_ANGLE_d3d_share_handle_client_buffer 1
|
||||
/* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_create_context
|
||||
#define EGL_KHR_create_context 1
|
||||
#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION
|
||||
#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB
|
||||
#define EGL_CONTEXT_FLAGS_KHR 0x30FC
|
||||
#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD
|
||||
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD
|
||||
#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE
|
||||
#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF
|
||||
#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
|
||||
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
|
||||
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
|
||||
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
|
||||
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_surfaceless_context
|
||||
#define EGL_KHR_surfaceless_context 1
|
||||
/* No tokens/entry points, just relaxes an error condition */
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_cross_process_fd
|
||||
#define EGL_KHR_stream_cross_process_fd 1
|
||||
typedef int EGLNativeFileDescriptorKHR;
|
||||
#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1))
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <EGL/eglmesaext.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -112,24 +112,14 @@ typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDRMDISPLAYMESA) (int fd);
|
||||
#ifndef EGL_WL_bind_wayland_display
|
||||
#define EGL_WL_bind_wayland_display 1
|
||||
|
||||
#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
|
||||
#define EGL_WAYLAND_PLANE_WL 0x31D6 /* eglCreateImageKHR target */
|
||||
|
||||
#define EGL_TEXTURE_Y_U_V_WL 0x31D7
|
||||
#define EGL_TEXTURE_Y_UV_WL 0x31D8
|
||||
#define EGL_TEXTURE_Y_XUXV_WL 0x31D9
|
||||
|
||||
#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
|
||||
struct wl_display;
|
||||
struct wl_buffer;
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_buffer *buffer, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_buffer *buffer, EGLint attribute, EGLint *value);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NOK_swap_region
|
||||
|
1520
include/GL/glext.h
1520
include/GL/glext.h
File diff suppressed because it is too large
Load Diff
353
include/GL/glu.h
Normal file
353
include/GL/glu.h
Normal file
@@ -0,0 +1,353 @@
|
||||
/*
|
||||
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
|
||||
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
|
||||
*
|
||||
* 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 including the dates of first publication and
|
||||
* either this permission notice or a reference to
|
||||
* http://oss.sgi.com/projects/FreeB/
|
||||
* 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
|
||||
* SILICON GRAPHICS, INC. 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.
|
||||
*
|
||||
* Except as contained in this notice, the name of Silicon Graphics, Inc.
|
||||
* shall not be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in this Software without prior written authorization from
|
||||
* Silicon Graphics, Inc.
|
||||
*/
|
||||
|
||||
#ifndef __glu_h__
|
||||
#define __glu_h__
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#include "glu_mangle.h"
|
||||
#endif
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#ifndef GLAPIENTRY
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#define GLAPIENTRY __stdcall
|
||||
#else
|
||||
#define GLAPIENTRY
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef GLAPIENTRYP
|
||||
#define GLAPIENTRYP GLAPIENTRY *
|
||||
#endif
|
||||
|
||||
#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
|
||||
# undef GLAPI
|
||||
# define GLAPI __declspec(dllexport)
|
||||
#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL)
|
||||
/* tag specifying we're building for DLL runtime support */
|
||||
# undef GLAPI
|
||||
# define GLAPI __declspec(dllimport)
|
||||
#elif !defined(GLAPI)
|
||||
/* for use with static link lib build of Win32 edition only */
|
||||
# define GLAPI extern
|
||||
#endif /* _STATIC_MESA support */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Extensions */
|
||||
#define GLU_EXT_object_space_tess 1
|
||||
#define GLU_EXT_nurbs_tessellator 1
|
||||
|
||||
/* Boolean */
|
||||
#define GLU_FALSE 0
|
||||
#define GLU_TRUE 1
|
||||
|
||||
/* Version */
|
||||
#define GLU_VERSION_1_1 1
|
||||
#define GLU_VERSION_1_2 1
|
||||
#define GLU_VERSION_1_3 1
|
||||
|
||||
/* StringName */
|
||||
#define GLU_VERSION 100800
|
||||
#define GLU_EXTENSIONS 100801
|
||||
|
||||
/* ErrorCode */
|
||||
#define GLU_INVALID_ENUM 100900
|
||||
#define GLU_INVALID_VALUE 100901
|
||||
#define GLU_OUT_OF_MEMORY 100902
|
||||
#define GLU_INCOMPATIBLE_GL_VERSION 100903
|
||||
#define GLU_INVALID_OPERATION 100904
|
||||
|
||||
/* NurbsDisplay */
|
||||
/* GLU_FILL */
|
||||
#define GLU_OUTLINE_POLYGON 100240
|
||||
#define GLU_OUTLINE_PATCH 100241
|
||||
|
||||
/* NurbsCallback */
|
||||
#define GLU_NURBS_ERROR 100103
|
||||
#define GLU_ERROR 100103
|
||||
#define GLU_NURBS_BEGIN 100164
|
||||
#define GLU_NURBS_BEGIN_EXT 100164
|
||||
#define GLU_NURBS_VERTEX 100165
|
||||
#define GLU_NURBS_VERTEX_EXT 100165
|
||||
#define GLU_NURBS_NORMAL 100166
|
||||
#define GLU_NURBS_NORMAL_EXT 100166
|
||||
#define GLU_NURBS_COLOR 100167
|
||||
#define GLU_NURBS_COLOR_EXT 100167
|
||||
#define GLU_NURBS_TEXTURE_COORD 100168
|
||||
#define GLU_NURBS_TEX_COORD_EXT 100168
|
||||
#define GLU_NURBS_END 100169
|
||||
#define GLU_NURBS_END_EXT 100169
|
||||
#define GLU_NURBS_BEGIN_DATA 100170
|
||||
#define GLU_NURBS_BEGIN_DATA_EXT 100170
|
||||
#define GLU_NURBS_VERTEX_DATA 100171
|
||||
#define GLU_NURBS_VERTEX_DATA_EXT 100171
|
||||
#define GLU_NURBS_NORMAL_DATA 100172
|
||||
#define GLU_NURBS_NORMAL_DATA_EXT 100172
|
||||
#define GLU_NURBS_COLOR_DATA 100173
|
||||
#define GLU_NURBS_COLOR_DATA_EXT 100173
|
||||
#define GLU_NURBS_TEXTURE_COORD_DATA 100174
|
||||
#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
|
||||
#define GLU_NURBS_END_DATA 100175
|
||||
#define GLU_NURBS_END_DATA_EXT 100175
|
||||
|
||||
/* NurbsError */
|
||||
#define GLU_NURBS_ERROR1 100251
|
||||
#define GLU_NURBS_ERROR2 100252
|
||||
#define GLU_NURBS_ERROR3 100253
|
||||
#define GLU_NURBS_ERROR4 100254
|
||||
#define GLU_NURBS_ERROR5 100255
|
||||
#define GLU_NURBS_ERROR6 100256
|
||||
#define GLU_NURBS_ERROR7 100257
|
||||
#define GLU_NURBS_ERROR8 100258
|
||||
#define GLU_NURBS_ERROR9 100259
|
||||
#define GLU_NURBS_ERROR10 100260
|
||||
#define GLU_NURBS_ERROR11 100261
|
||||
#define GLU_NURBS_ERROR12 100262
|
||||
#define GLU_NURBS_ERROR13 100263
|
||||
#define GLU_NURBS_ERROR14 100264
|
||||
#define GLU_NURBS_ERROR15 100265
|
||||
#define GLU_NURBS_ERROR16 100266
|
||||
#define GLU_NURBS_ERROR17 100267
|
||||
#define GLU_NURBS_ERROR18 100268
|
||||
#define GLU_NURBS_ERROR19 100269
|
||||
#define GLU_NURBS_ERROR20 100270
|
||||
#define GLU_NURBS_ERROR21 100271
|
||||
#define GLU_NURBS_ERROR22 100272
|
||||
#define GLU_NURBS_ERROR23 100273
|
||||
#define GLU_NURBS_ERROR24 100274
|
||||
#define GLU_NURBS_ERROR25 100275
|
||||
#define GLU_NURBS_ERROR26 100276
|
||||
#define GLU_NURBS_ERROR27 100277
|
||||
#define GLU_NURBS_ERROR28 100278
|
||||
#define GLU_NURBS_ERROR29 100279
|
||||
#define GLU_NURBS_ERROR30 100280
|
||||
#define GLU_NURBS_ERROR31 100281
|
||||
#define GLU_NURBS_ERROR32 100282
|
||||
#define GLU_NURBS_ERROR33 100283
|
||||
#define GLU_NURBS_ERROR34 100284
|
||||
#define GLU_NURBS_ERROR35 100285
|
||||
#define GLU_NURBS_ERROR36 100286
|
||||
#define GLU_NURBS_ERROR37 100287
|
||||
|
||||
/* NurbsProperty */
|
||||
#define GLU_AUTO_LOAD_MATRIX 100200
|
||||
#define GLU_CULLING 100201
|
||||
#define GLU_SAMPLING_TOLERANCE 100203
|
||||
#define GLU_DISPLAY_MODE 100204
|
||||
#define GLU_PARAMETRIC_TOLERANCE 100202
|
||||
#define GLU_SAMPLING_METHOD 100205
|
||||
#define GLU_U_STEP 100206
|
||||
#define GLU_V_STEP 100207
|
||||
#define GLU_NURBS_MODE 100160
|
||||
#define GLU_NURBS_MODE_EXT 100160
|
||||
#define GLU_NURBS_TESSELLATOR 100161
|
||||
#define GLU_NURBS_TESSELLATOR_EXT 100161
|
||||
#define GLU_NURBS_RENDERER 100162
|
||||
#define GLU_NURBS_RENDERER_EXT 100162
|
||||
|
||||
/* NurbsSampling */
|
||||
#define GLU_OBJECT_PARAMETRIC_ERROR 100208
|
||||
#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
|
||||
#define GLU_OBJECT_PATH_LENGTH 100209
|
||||
#define GLU_OBJECT_PATH_LENGTH_EXT 100209
|
||||
#define GLU_PATH_LENGTH 100215
|
||||
#define GLU_PARAMETRIC_ERROR 100216
|
||||
#define GLU_DOMAIN_DISTANCE 100217
|
||||
|
||||
/* NurbsTrim */
|
||||
#define GLU_MAP1_TRIM_2 100210
|
||||
#define GLU_MAP1_TRIM_3 100211
|
||||
|
||||
/* QuadricDrawStyle */
|
||||
#define GLU_POINT 100010
|
||||
#define GLU_LINE 100011
|
||||
#define GLU_FILL 100012
|
||||
#define GLU_SILHOUETTE 100013
|
||||
|
||||
/* QuadricCallback */
|
||||
/* GLU_ERROR */
|
||||
|
||||
/* QuadricNormal */
|
||||
#define GLU_SMOOTH 100000
|
||||
#define GLU_FLAT 100001
|
||||
#define GLU_NONE 100002
|
||||
|
||||
/* QuadricOrientation */
|
||||
#define GLU_OUTSIDE 100020
|
||||
#define GLU_INSIDE 100021
|
||||
|
||||
/* TessCallback */
|
||||
#define GLU_TESS_BEGIN 100100
|
||||
#define GLU_BEGIN 100100
|
||||
#define GLU_TESS_VERTEX 100101
|
||||
#define GLU_VERTEX 100101
|
||||
#define GLU_TESS_END 100102
|
||||
#define GLU_END 100102
|
||||
#define GLU_TESS_ERROR 100103
|
||||
#define GLU_TESS_EDGE_FLAG 100104
|
||||
#define GLU_EDGE_FLAG 100104
|
||||
#define GLU_TESS_COMBINE 100105
|
||||
#define GLU_TESS_BEGIN_DATA 100106
|
||||
#define GLU_TESS_VERTEX_DATA 100107
|
||||
#define GLU_TESS_END_DATA 100108
|
||||
#define GLU_TESS_ERROR_DATA 100109
|
||||
#define GLU_TESS_EDGE_FLAG_DATA 100110
|
||||
#define GLU_TESS_COMBINE_DATA 100111
|
||||
|
||||
/* TessContour */
|
||||
#define GLU_CW 100120
|
||||
#define GLU_CCW 100121
|
||||
#define GLU_INTERIOR 100122
|
||||
#define GLU_EXTERIOR 100123
|
||||
#define GLU_UNKNOWN 100124
|
||||
|
||||
/* TessProperty */
|
||||
#define GLU_TESS_WINDING_RULE 100140
|
||||
#define GLU_TESS_BOUNDARY_ONLY 100141
|
||||
#define GLU_TESS_TOLERANCE 100142
|
||||
|
||||
/* TessError */
|
||||
#define GLU_TESS_ERROR1 100151
|
||||
#define GLU_TESS_ERROR2 100152
|
||||
#define GLU_TESS_ERROR3 100153
|
||||
#define GLU_TESS_ERROR4 100154
|
||||
#define GLU_TESS_ERROR5 100155
|
||||
#define GLU_TESS_ERROR6 100156
|
||||
#define GLU_TESS_ERROR7 100157
|
||||
#define GLU_TESS_ERROR8 100158
|
||||
#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
|
||||
#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
|
||||
#define GLU_TESS_MISSING_END_POLYGON 100153
|
||||
#define GLU_TESS_MISSING_END_CONTOUR 100154
|
||||
#define GLU_TESS_COORD_TOO_LARGE 100155
|
||||
#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
|
||||
|
||||
/* TessWinding */
|
||||
#define GLU_TESS_WINDING_ODD 100130
|
||||
#define GLU_TESS_WINDING_NONZERO 100131
|
||||
#define GLU_TESS_WINDING_POSITIVE 100132
|
||||
#define GLU_TESS_WINDING_NEGATIVE 100133
|
||||
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
class GLUnurbs;
|
||||
class GLUquadric;
|
||||
class GLUtesselator;
|
||||
#else
|
||||
typedef struct GLUnurbs GLUnurbs;
|
||||
typedef struct GLUquadric GLUquadric;
|
||||
typedef struct GLUtesselator GLUtesselator;
|
||||
#endif
|
||||
|
||||
typedef GLUnurbs GLUnurbsObj;
|
||||
typedef GLUquadric GLUquadricObj;
|
||||
typedef GLUtesselator GLUtesselatorObj;
|
||||
typedef GLUtesselator GLUtriangulatorObj;
|
||||
|
||||
#define GLU_TESS_MAX_COORD 1.0e150
|
||||
|
||||
/* Internal convenience typedefs */
|
||||
typedef void (GLAPIENTRYP _GLUfuncptr)(void);
|
||||
|
||||
GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb);
|
||||
GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
|
||||
GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
|
||||
GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
|
||||
GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad);
|
||||
GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
|
||||
GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb);
|
||||
GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
|
||||
GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
|
||||
GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
|
||||
GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
|
||||
GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
|
||||
GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
|
||||
GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void);
|
||||
GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void);
|
||||
GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
|
||||
GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
|
||||
GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
|
||||
GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
|
||||
GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
|
||||
GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
|
||||
GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
|
||||
GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
|
||||
GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
|
||||
GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
|
||||
GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
|
||||
GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
|
||||
GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
|
||||
GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
|
||||
GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);
|
||||
GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
|
||||
GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);
|
||||
GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
|
||||
GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
|
||||
GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
|
||||
GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
|
||||
GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
|
||||
GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
|
||||
GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
|
||||
GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __glu_h__ */
|
86
include/GL/glu_mangle.h
Normal file
86
include/GL/glu_mangle.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.0
|
||||
* Copyright (C) 1995-1998 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GLU_MANGLE_H
|
||||
#define GLU_MANGLE_H
|
||||
|
||||
|
||||
#define gluLookAt mgluLookAt
|
||||
#define gluOrtho2D mgluOrtho2D
|
||||
#define gluPerspective mgluPerspective
|
||||
#define gluPickMatrix mgluPickMatrix
|
||||
#define gluProject mgluProject
|
||||
#define gluUnProject mgluUnProject
|
||||
#define gluErrorString mgluErrorString
|
||||
#define gluScaleImage mgluScaleImage
|
||||
#define gluBuild1DMipmaps mgluBuild1DMipmaps
|
||||
#define gluBuild2DMipmaps mgluBuild2DMipmaps
|
||||
#define gluNewQuadric mgluNewQuadric
|
||||
#define gluDeleteQuadric mgluDeleteQuadric
|
||||
#define gluQuadricDrawStyle mgluQuadricDrawStyle
|
||||
#define gluQuadricOrientation mgluQuadricOrientation
|
||||
#define gluQuadricNormals mgluQuadricNormals
|
||||
#define gluQuadricTexture mgluQuadricTexture
|
||||
#define gluQuadricCallback mgluQuadricCallback
|
||||
#define gluCylinder mgluCylinder
|
||||
#define gluSphere mgluSphere
|
||||
#define gluDisk mgluDisk
|
||||
#define gluPartialDisk mgluPartialDisk
|
||||
#define gluNewNurbsRenderer mgluNewNurbsRenderer
|
||||
#define gluDeleteNurbsRenderer mgluDeleteNurbsRenderer
|
||||
#define gluLoadSamplingMatrices mgluLoadSamplingMatrices
|
||||
#define gluNurbsProperty mgluNurbsProperty
|
||||
#define gluGetNurbsProperty mgluGetNurbsProperty
|
||||
#define gluBeginCurve mgluBeginCurve
|
||||
#define gluEndCurve mgluEndCurve
|
||||
#define gluNurbsCurve mgluNurbsCurve
|
||||
#define gluBeginSurface mgluBeginSurface
|
||||
#define gluEndSurface mgluEndSurface
|
||||
#define gluNurbsSurface mgluNurbsSurface
|
||||
#define gluBeginTrim mgluBeginTrim
|
||||
#define gluEndTrim mgluEndTrim
|
||||
#define gluPwlCurve mgluPwlCurve
|
||||
#define gluNurbsCallback mgluNurbsCallback
|
||||
#define gluNewTess mgluNewTess
|
||||
#define gluDeleteTess mgluDeleteTess
|
||||
#define gluTessBeginPolygon mgluTessBeginPolygon
|
||||
#define gluTessBeginContour mgluTessBeginContour
|
||||
#define gluTessVertex mgluTessVertex
|
||||
#define gluTessEndPolygon mgluTessEndPolygon
|
||||
#define gluTessEndContour mgluTessEndContour
|
||||
#define gluTessProperty mgluTessProperty
|
||||
#define gluTessNormal mgluTessNormal
|
||||
#define gluTessCallback mgluTessCallback
|
||||
#define gluGetTessProperty mgluGetTessProperty
|
||||
#define gluBeginPolygon mgluBeginPolygon
|
||||
#define gluNextContour mgluNextContour
|
||||
#define gluEndPolygon mgluEndPolygon
|
||||
#define gluGetString mgluGetString
|
||||
#define gluBuild1DMipmapLevels mgluBuild1DMipmapLevels
|
||||
#define gluBuild2DMipmapLevels mgluBuild2DMipmapLevels
|
||||
#define gluBuild3DMipmapLevels mgluBuild3DMipmapLevels
|
||||
#define gluBuild3DMipmaps mgluBuild3DMipmaps
|
||||
#define gluCheckExtension mgluCheckExtension
|
||||
#define gluUnProject4 mgluUnProject4
|
||||
#define gluNurbsCallbackData mgluNurbsCallbackData
|
||||
#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT
|
||||
|
||||
#endif
|
@@ -6,7 +6,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2012 The Khronos Group Inc.
|
||||
** Copyright (c) 2007-2010 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
@@ -48,9 +48,9 @@ extern "C" {
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glxext.h last updated 2012/02/29 */
|
||||
/* glxext.h last updated 2010/08/06 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define GLX_GLXEXT_VERSION 33
|
||||
#define GLX_GLXEXT_VERSION 32
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
@@ -440,10 +440,6 @@ extern "C" {
|
||||
#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_swap_control_tear
|
||||
#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
@@ -968,9 +964,9 @@ typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoC
|
||||
#ifndef GLX_EXT_swap_control
|
||||
#define GLX_EXT_swap_control 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval);
|
||||
extern int glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
|
||||
typedef int ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_copy_image
|
||||
@@ -989,10 +985,6 @@ typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx,
|
||||
#define GLX_NV_multisample_coverage 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_swap_control_tear
|
||||
#define GLX_EXT_swap_control_tear 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -800,35 +800,17 @@ struct __DRIdri2LoaderExtensionRec {
|
||||
#define __DRI_DRI2_VERSION 3
|
||||
|
||||
#define __DRI_API_OPENGL 0 /**< OpenGL compatibility profile */
|
||||
#define __DRI_API_GLES 1 /**< OpenGL ES 1.x */
|
||||
#define __DRI_API_GLES2 2 /**< OpenGL ES 2.0 or 3.0 */
|
||||
#define __DRI_API_GLES 1
|
||||
#define __DRI_API_GLES2 2
|
||||
#define __DRI_API_OPENGL_CORE 3 /**< OpenGL 3.2+ core profile */
|
||||
|
||||
#define __DRI_CTX_ATTRIB_MAJOR_VERSION 0
|
||||
#define __DRI_CTX_ATTRIB_MINOR_VERSION 1
|
||||
#define __DRI_CTX_ATTRIB_FLAGS 2
|
||||
|
||||
/**
|
||||
* \requires __DRI2_ROBUSTNESS.
|
||||
*/
|
||||
#define __DRI_CTX_ATTRIB_RESET_STRATEGY 3
|
||||
|
||||
#define __DRI_CTX_FLAG_DEBUG 0x00000001
|
||||
#define __DRI_CTX_FLAG_FORWARD_COMPATIBLE 0x00000002
|
||||
|
||||
/**
|
||||
* \requires __DRI2_ROBUSTNESS.
|
||||
*/
|
||||
#define __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS 0x00000004
|
||||
|
||||
/**
|
||||
* \name Context reset strategies.
|
||||
*/
|
||||
/*@{*/
|
||||
#define __DRI_CTX_RESET_NO_NOTIFICATION 0
|
||||
#define __DRI_CTX_RESET_LOSE_CONTEXT 1
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* \name Reasons that __DRIdri2Extension::createContextAttribs might fail
|
||||
*/
|
||||
@@ -912,77 +894,24 @@ struct __DRIdri2ExtensionRec {
|
||||
* extensions.
|
||||
*/
|
||||
#define __DRI_IMAGE "DRI_IMAGE"
|
||||
#define __DRI_IMAGE_VERSION 5
|
||||
#define __DRI_IMAGE_VERSION 4
|
||||
|
||||
/**
|
||||
* These formats correspond to the similarly named MESA_FORMAT_*
|
||||
* tokens, except in the native endian of the CPU. For example, on
|
||||
* little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
|
||||
* MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian.
|
||||
*
|
||||
* __DRI_IMAGE_FORMAT_NONE is for images that aren't directly usable
|
||||
* by the driver (YUV planar formats) but serve as a base image for
|
||||
* creating sub-images for the different planes within the image.
|
||||
*
|
||||
* R8, GR88 and NONE should not be used with createImageFormName or
|
||||
* createImage, and are returned by query from sub images created with
|
||||
* createImageFromNames (NONE, see above) and fromPlane (R8 & GR88).
|
||||
*/
|
||||
#define __DRI_IMAGE_FORMAT_RGB565 0x1001
|
||||
#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
|
||||
#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
|
||||
#define __DRI_IMAGE_FORMAT_ABGR8888 0x1004
|
||||
#define __DRI_IMAGE_FORMAT_XBGR8888 0x1005
|
||||
#define __DRI_IMAGE_FORMAT_R8 0x1006 /* Since version 5 */
|
||||
#define __DRI_IMAGE_FORMAT_GR88 0x1007
|
||||
#define __DRI_IMAGE_FORMAT_NONE 0x1008
|
||||
|
||||
#define __DRI_IMAGE_USE_SHARE 0x0001
|
||||
#define __DRI_IMAGE_USE_SCANOUT 0x0002
|
||||
#define __DRI_IMAGE_USE_CURSOR 0x0004 /* Depricated */
|
||||
|
||||
|
||||
/**
|
||||
* Four CC formats that matches with WL_DRM_FORMAT_* from wayland_drm.h
|
||||
* and GBM_FORMAT_* from gbm.h, used with createImageFromNames.
|
||||
*
|
||||
* \since 5
|
||||
*/
|
||||
|
||||
#define __DRI_IMAGE_FOURCC_RGB565 0x36314752
|
||||
#define __DRI_IMAGE_FOURCC_ARGB8888 0x34325241
|
||||
#define __DRI_IMAGE_FOURCC_XRGB8888 0x34325258
|
||||
#define __DRI_IMAGE_FOURCC_ABGR8888 0x34324241
|
||||
#define __DRI_IMAGE_FOURCC_XBGR8888 0x34324258
|
||||
#define __DRI_IMAGE_FOURCC_YUV410 0x39565559
|
||||
#define __DRI_IMAGE_FOURCC_YUV411 0x31315559
|
||||
#define __DRI_IMAGE_FOURCC_YUV420 0x32315559
|
||||
#define __DRI_IMAGE_FOURCC_YUV422 0x36315559
|
||||
#define __DRI_IMAGE_FOURCC_YUV444 0x34325559
|
||||
#define __DRI_IMAGE_FOURCC_NV12 0x3231564e
|
||||
#define __DRI_IMAGE_FOURCC_NV16 0x3631564e
|
||||
#define __DRI_IMAGE_FOURCC_YUYV 0x56595559
|
||||
|
||||
|
||||
/**
|
||||
* Queryable on images created by createImageFromNames.
|
||||
*
|
||||
* RGB and RGBA are may be usable directly as images but its still
|
||||
* recommended to call fromPlanar with plane == 0.
|
||||
*
|
||||
* Y_U_V, Y_UV and Y_XUXV all requires call to fromPlanar to create
|
||||
* usable sub-images, sampling from images return raw YUV data and
|
||||
* color conversion needs to be done in the shader.
|
||||
*
|
||||
* \since 5
|
||||
*/
|
||||
|
||||
#define __DRI_IMAGE_COMPONENTS_RGB 0x3001
|
||||
#define __DRI_IMAGE_COMPONENTS_RGBA 0x3002
|
||||
#define __DRI_IMAGE_COMPONENTS_Y_U_V 0x3003
|
||||
#define __DRI_IMAGE_COMPONENTS_Y_UV 0x3004
|
||||
#define __DRI_IMAGE_COMPONENTS_Y_XUXV 0x3005
|
||||
|
||||
#define __DRI_IMAGE_USE_CURSOR 0x0004
|
||||
#define __DRI_IMAGE_USE_WRITE 0x0008
|
||||
|
||||
/**
|
||||
* queryImage attributes
|
||||
@@ -992,9 +921,6 @@ struct __DRIdri2ExtensionRec {
|
||||
#define __DRI_IMAGE_ATTRIB_HANDLE 0x2001
|
||||
#define __DRI_IMAGE_ATTRIB_NAME 0x2002
|
||||
#define __DRI_IMAGE_ATTRIB_FORMAT 0x2003 /* available in versions 3+ */
|
||||
#define __DRI_IMAGE_ATTRIB_WIDTH 0x2004 /* available in versions 4+ */
|
||||
#define __DRI_IMAGE_ATTRIB_HEIGHT 0x2005
|
||||
#define __DRI_IMAGE_ATTRIB_COMPONENTS 0x2006 /* available in versions 5+ */
|
||||
|
||||
typedef struct __DRIimageRec __DRIimage;
|
||||
typedef struct __DRIimageExtensionRec __DRIimageExtension;
|
||||
@@ -1032,35 +958,11 @@ struct __DRIimageExtensionRec {
|
||||
GLboolean (*validateUsage)(__DRIimage *image, unsigned int use);
|
||||
|
||||
/**
|
||||
* Unlike createImageFromName __DRI_IMAGE_FORMAT is not but instead
|
||||
* __DRI_IMAGE_FOURCC and strides are in bytes not pixels. Stride is
|
||||
* also per block and not per pixel (for non-RGB, see gallium blocks).
|
||||
* Write data into image.
|
||||
*
|
||||
* \since 5
|
||||
* \since 4
|
||||
*/
|
||||
__DRIimage *(*createImageFromNames)(__DRIscreen *screen,
|
||||
int width, int height, int fourcc,
|
||||
int *names, int num_names,
|
||||
int *strides, int *offsets,
|
||||
void *loaderPrivate);
|
||||
|
||||
/**
|
||||
* Create an image out of a sub-region of a parent image. This
|
||||
* entry point lets us create individual __DRIimages for different
|
||||
* planes in a planar buffer (typically yuv), for example. While a
|
||||
* sub-image shares the underlying buffer object with the parent
|
||||
* image and other sibling sub-images, the life times of parent and
|
||||
* sub-images are not dependent. Destroying the parent or a
|
||||
* sub-image doesn't affect other images. The underlying buffer
|
||||
* object is free when no __DRIimage remains that references it.
|
||||
*
|
||||
* Sub-images may overlap, but rendering to overlapping sub-images
|
||||
* is undefined.
|
||||
*
|
||||
* \since 5
|
||||
*/
|
||||
__DRIimage *(*fromPlanar)(__DRIimage *image, int plane,
|
||||
void *loaderPrivate);
|
||||
int (*write)(__DRIimage *image, const void *buf, size_t count);
|
||||
};
|
||||
|
||||
|
||||
@@ -1098,21 +1000,4 @@ struct __DRI2configQueryExtensionRec {
|
||||
int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
|
||||
int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
|
||||
};
|
||||
|
||||
/**
|
||||
* Robust context driver extension.
|
||||
*
|
||||
* Existence of this extension means the driver can accept the
|
||||
* \c __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag and the
|
||||
* \c __DRI_CTX_ATTRIB_RESET_STRATEGY attribute in
|
||||
* \c __DRIdri2ExtensionRec::createContextAttribs.
|
||||
*/
|
||||
#define __DRI2_ROBUSTNESS "DRI_Robustness"
|
||||
#define __DRI2_ROBUSTNESS_VERSION 1
|
||||
|
||||
typedef struct __DRIrobustnessExtensionRec __DRIrobustnessExtension;
|
||||
struct __DRIrobustnessExtensionRec {
|
||||
__DRIextension base;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#ifndef __gl2ext_h_
|
||||
#define __gl2ext_h_
|
||||
|
||||
/* $Revision: 18099 $ on $Date:: 2012-06-06 09:16:19 -0700 #$ */
|
||||
/* $Revision: 15049 $ on $Date:: 2011-07-06 17:28:16 -0700 #$ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -93,9 +93,6 @@ typedef void* GLeglImageOES;
|
||||
#define GL_DEPTH24_STENCIL8_OES 0x88F0
|
||||
#endif
|
||||
|
||||
/* GL_OES_required_internalformat */
|
||||
/* No new tokens introduced by this extension. */
|
||||
|
||||
/* GL_OES_rgb8_rgba8 */
|
||||
#ifndef GL_OES_rgb8_rgba8
|
||||
#define GL_RGB8_OES 0x8051
|
||||
@@ -210,37 +207,6 @@ typedef void* GLeglImageOES;
|
||||
#define GL_MAX_SAMPLES_ANGLE 0x8D57
|
||||
#endif
|
||||
|
||||
/* GL_ANGLE_instanced_arrays */
|
||||
#ifndef GL_ANGLE_instanced_arrays
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE
|
||||
#endif
|
||||
|
||||
/* GL_ANGLE_pack_reverse_row_order */
|
||||
#ifndef GL_ANGLE_pack_reverse_row_order
|
||||
#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4
|
||||
#endif
|
||||
|
||||
/* GL_ANGLE_texture_compression_dxt3 */
|
||||
#ifndef GL_ANGLE_texture_compression_dxt3
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2
|
||||
#endif
|
||||
|
||||
/* GL_ANGLE_texture_compression_dxt5 */
|
||||
#ifndef GL_ANGLE_texture_compression_dxt5
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3
|
||||
#endif
|
||||
|
||||
/* GL_ANGLE_texture_usage */
|
||||
#ifndef GL_ANGLE_texture_usage
|
||||
#define GL_TEXTURE_USAGE_ANGLE 0x93A2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3
|
||||
#endif
|
||||
|
||||
/* GL_ANGLE_translated_shader_source */
|
||||
#ifndef GL_ANGLE_translated_shader_source
|
||||
#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* APPLE extension tokens
|
||||
*------------------------------------------------------------------------*/
|
||||
@@ -295,29 +261,6 @@ typedef void* GLeglImageOES;
|
||||
#define GL_MAX_EXT 0x8008
|
||||
#endif
|
||||
|
||||
/* GL_EXT_color_buffer_half_float */
|
||||
#ifndef GL_EXT_color_buffer_half_float
|
||||
#define GL_RGBA16F_EXT 0x881A
|
||||
#define GL_RGB16F_EXT 0x881B
|
||||
#define GL_RG16F_EXT 0x822F
|
||||
#define GL_R16F_EXT 0x822D
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211
|
||||
#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17
|
||||
#endif
|
||||
|
||||
/* GL_EXT_debug_label */
|
||||
#ifndef GL_EXT_debug_label
|
||||
#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F
|
||||
#define GL_PROGRAM_OBJECT_EXT 0x8B40
|
||||
#define GL_SHADER_OBJECT_EXT 0x8B48
|
||||
#define GL_BUFFER_OBJECT_EXT 0x9151
|
||||
#define GL_QUERY_OBJECT_EXT 0x9153
|
||||
#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154
|
||||
#endif
|
||||
|
||||
/* GL_EXT_debug_marker */
|
||||
/* No new tokens introduced by this extension. */
|
||||
|
||||
/* GL_EXT_discard_framebuffer */
|
||||
#ifndef GL_EXT_discard_framebuffer
|
||||
#define GL_COLOR_EXT 0x1800
|
||||
@@ -325,26 +268,9 @@ typedef void* GLeglImageOES;
|
||||
#define GL_STENCIL_EXT 0x1802
|
||||
#endif
|
||||
|
||||
/* GL_EXT_multisampled_render_to_texture */
|
||||
#ifndef GL_EXT_multisampled_render_to_texture
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C
|
||||
#define GL_RENDERBUFFER_SAMPLES_EXT 0x9133
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x9134
|
||||
#define GL_MAX_SAMPLES_EXT 0x9135
|
||||
#endif
|
||||
|
||||
/* GL_EXT_multi_draw_arrays */
|
||||
/* No new tokens introduced by this extension. */
|
||||
|
||||
/* GL_EXT_occlusion_query_boolean */
|
||||
#ifndef GL_EXT_occlusion_query_boolean
|
||||
#define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F
|
||||
#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A
|
||||
#define GL_CURRENT_QUERY_EXT 0x8865
|
||||
#define GL_QUERY_RESULT_EXT 0x8866
|
||||
#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867
|
||||
#endif
|
||||
|
||||
/* GL_EXT_read_format_bgra */
|
||||
#ifndef GL_EXT_read_format_bgra
|
||||
#define GL_BGRA_EXT 0x80E1
|
||||
@@ -352,53 +278,9 @@ typedef void* GLeglImageOES;
|
||||
#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
|
||||
#endif
|
||||
|
||||
/* GL_EXT_robustness */
|
||||
#ifndef GL_EXT_robustness
|
||||
/* reuse GL_NO_ERROR */
|
||||
#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253
|
||||
#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254
|
||||
#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255
|
||||
#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3
|
||||
#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256
|
||||
#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252
|
||||
#define GL_NO_RESET_NOTIFICATION_EXT 0x8261
|
||||
#endif
|
||||
|
||||
/* GL_EXT_separate_shader_objects */
|
||||
#ifndef GL_EXT_separate_shader_objects
|
||||
#define GL_VERTEX_SHADER_BIT_EXT 0x00000001
|
||||
#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002
|
||||
#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF
|
||||
#define GL_PROGRAM_SEPARABLE_EXT 0x8258
|
||||
#define GL_ACTIVE_PROGRAM_EXT 0x8259
|
||||
#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A
|
||||
#endif
|
||||
|
||||
/* GL_EXT_shader_texture_lod */
|
||||
/* No new tokens introduced by this extension. */
|
||||
|
||||
/* GL_EXT_shadow_samplers */
|
||||
#ifndef GL_EXT_shadow_samplers
|
||||
#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C
|
||||
#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D
|
||||
#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E
|
||||
#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62
|
||||
#endif
|
||||
|
||||
/* GL_EXT_sRGB */
|
||||
#ifndef GL_EXT_sRGB
|
||||
#define GL_SRGB_EXT 0x8C40
|
||||
#define GL_SRGB_ALPHA_EXT 0x8C42
|
||||
#define GL_SRGB8_ALPHA8_EXT 0x8C43
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_compression_dxt1 */
|
||||
#ifndef GL_EXT_texture_compression_dxt1
|
||||
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_filter_anisotropic */
|
||||
#ifndef GL_EXT_texture_filter_anisotropic
|
||||
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
|
||||
@@ -410,46 +292,17 @@ typedef void* GLeglImageOES;
|
||||
#define GL_BGRA_EXT 0x80E1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_rg */
|
||||
#ifndef GL_EXT_texture_rg
|
||||
#define GL_RED_EXT 0x1903
|
||||
#define GL_RG_EXT 0x8227
|
||||
#define GL_R8_EXT 0x8229
|
||||
#define GL_RG8_EXT 0x822B
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_storage */
|
||||
#ifndef GL_EXT_texture_storage
|
||||
#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F
|
||||
#define GL_ALPHA8_EXT 0x803C
|
||||
#define GL_LUMINANCE8_EXT 0x8040
|
||||
#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
|
||||
#define GL_RGBA32F_EXT 0x8814
|
||||
#define GL_RGB32F_EXT 0x8815
|
||||
#define GL_ALPHA32F_EXT 0x8816
|
||||
#define GL_LUMINANCE32F_EXT 0x8818
|
||||
#define GL_LUMINANCE_ALPHA32F_EXT 0x8819
|
||||
/* reuse GL_RGBA16F_EXT */
|
||||
/* reuse GL_RGB16F_EXT */
|
||||
#define GL_ALPHA16F_EXT 0x881C
|
||||
#define GL_LUMINANCE16F_EXT 0x881E
|
||||
#define GL_LUMINANCE_ALPHA16F_EXT 0x881F
|
||||
#define GL_RGB10_A2_EXT 0x8059
|
||||
#define GL_RGB10_EXT 0x8052
|
||||
#define GL_BGRA8_EXT 0x93A1
|
||||
#define GL_R8_EXT 0x8229
|
||||
#define GL_RG8_EXT 0x822B
|
||||
#define GL_R32F_EXT 0x822E
|
||||
#define GL_RG32F_EXT 0x8230
|
||||
#define GL_R16F_EXT 0x822D
|
||||
#define GL_RG16F_EXT 0x822F
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_type_2_10_10_10_REV */
|
||||
#ifndef GL_EXT_texture_type_2_10_10_10_REV
|
||||
#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_compression_dxt1 */
|
||||
#ifndef GL_EXT_texture_compression_dxt1
|
||||
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_unpack_subimage */
|
||||
#ifndef GL_EXT_unpack_subimage
|
||||
#define GL_UNPACK_ROW_LENGTH 0x0CF2
|
||||
@@ -466,15 +319,6 @@ typedef void* GLeglImageOES;
|
||||
#define GL_SHADER_BINARY_DMP 0x9250
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* FJ extension tokens
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_FJ_shader_binary_GCCSO */
|
||||
#ifndef GL_FJ_shader_binary_GCCSO
|
||||
#define GCCSO_SHADER_BINARY_FJ 0x9260
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* IMG extension tokens
|
||||
*------------------------------------------------------------------------*/
|
||||
@@ -787,11 +631,6 @@ typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum
|
||||
#define GL_OES_packed_depth_stencil 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_required_internalformat */
|
||||
#ifndef GL_OES_required_internalformat
|
||||
#define GL_OES_required_internalformat 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_rgb8_rgba8 */
|
||||
#ifndef GL_OES_rgb8_rgba8
|
||||
#define GL_OES_rgb8_rgba8 1
|
||||
@@ -951,45 +790,6 @@ GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target
|
||||
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
#endif
|
||||
|
||||
#ifndef GL_ANGLE_instanced_arrays
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
|
||||
GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFLGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
|
||||
typedef void (GL_APIENTRYP PFLGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
|
||||
typedef void (GL_APIENTRYP PFLGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor);
|
||||
#endif
|
||||
|
||||
/* GL_ANGLE_pack_reverse_row_order */
|
||||
#ifndef GL_ANGLE_pack_reverse_row_order
|
||||
#define GL_ANGLE_pack_reverse_row_order 1
|
||||
#endif
|
||||
|
||||
/* GL_ANGLE_texture_compression_dxt3 */
|
||||
#ifndef GL_ANGLE_texture_compression_dxt3
|
||||
#define GL_ANGLE_texture_compression_dxt3 1
|
||||
#endif
|
||||
|
||||
/* GL_ANGLE_texture_compression_dxt5 */
|
||||
#ifndef GL_ANGLE_texture_compression_dxt5
|
||||
#define GL_ANGLE_texture_compression_dxt5 1
|
||||
#endif
|
||||
|
||||
/* GL_ANGLE_texture_usage */
|
||||
#ifndef GL_ANGLE_texture_usage
|
||||
#define GL_ANGLE_texture_usage 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ANGLE_translated_shader_source
|
||||
#define GL_ANGLE_translated_shader_source 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFLGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* APPLE extension functions
|
||||
*------------------------------------------------------------------------*/
|
||||
@@ -1043,35 +843,6 @@ typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
|
||||
#define GL_EXT_blend_minmax 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_color_buffer_half_float */
|
||||
#ifndef GL_EXT_color_buffer_half_float
|
||||
#define GL_EXT_color_buffer_half_float 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_debug_label */
|
||||
#ifndef GL_EXT_debug_label
|
||||
#define GL_EXT_debug_label 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label);
|
||||
GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label);
|
||||
typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
|
||||
#endif
|
||||
|
||||
/* GL_EXT_debug_marker */
|
||||
#ifndef GL_EXT_debug_marker
|
||||
#define GL_EXT_debug_marker 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);
|
||||
GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker);
|
||||
GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
|
||||
typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
|
||||
typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
|
||||
#endif
|
||||
|
||||
/* GL_EXT_discard_framebuffer */
|
||||
#ifndef GL_EXT_discard_framebuffer
|
||||
#define GL_EXT_discard_framebuffer 1
|
||||
@@ -1081,17 +852,6 @@ GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numA
|
||||
typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
|
||||
#endif
|
||||
|
||||
/* GL_EXT_multisampled_render_to_texture */
|
||||
#ifndef GL_EXT_multisampled_render_to_texture
|
||||
#define GL_EXT_multisampled_render_to_texture 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
|
||||
GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_multi_draw_arrays
|
||||
#define GL_EXT_multi_draw_arrays 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
@@ -1102,134 +862,16 @@ typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *fir
|
||||
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
|
||||
#endif
|
||||
|
||||
/* GL_EXT_occlusion_query_boolean */
|
||||
#ifndef GL_EXT_occlusion_query_boolean
|
||||
#define GL_EXT_occlusion_query_boolean 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids);
|
||||
GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id);
|
||||
GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id);
|
||||
GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target);
|
||||
GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id);
|
||||
typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id);
|
||||
typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target);
|
||||
typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params);
|
||||
#endif
|
||||
|
||||
/* GL_EXT_read_format_bgra */
|
||||
#ifndef GL_EXT_read_format_bgra
|
||||
#define GL_EXT_read_format_bgra 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_robustness */
|
||||
#ifndef GL_EXT_robustness
|
||||
#define GL_EXT_robustness 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
|
||||
GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
|
||||
GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, float *params);
|
||||
GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
|
||||
#endif
|
||||
typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
|
||||
typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
|
||||
typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, float *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
|
||||
#endif
|
||||
|
||||
/* GL_EXT_separate_shader_objects */
|
||||
#ifndef GL_EXT_separate_shader_objects
|
||||
#define GL_EXT_separate_shader_objects 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program);
|
||||
GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings);
|
||||
GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline);
|
||||
GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines);
|
||||
GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline);
|
||||
GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
|
||||
GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint x);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint x, GLint y);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat x);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat x, GLfloat y);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline);
|
||||
GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
|
||||
typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program);
|
||||
typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings);
|
||||
typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines);
|
||||
typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
|
||||
typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint x);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint x, GLint y);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat x);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
|
||||
typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||
#endif
|
||||
|
||||
/* GL_EXT_shader_texture_lod */
|
||||
#ifndef GL_EXT_shader_texture_lod
|
||||
#define GL_EXT_shader_texture_lod 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_shadow_samplers */
|
||||
#ifndef GL_EXT_shadow_samplers
|
||||
#define GL_EXT_shadow_samplers 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_sRGB */
|
||||
#ifndef GL_EXT_sRGB
|
||||
#define GL_EXT_sRGB 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_compression_dxt1 */
|
||||
#ifndef GL_EXT_texture_compression_dxt1
|
||||
#define GL_EXT_texture_compression_dxt1 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_filter_anisotropic */
|
||||
#ifndef GL_EXT_texture_filter_anisotropic
|
||||
#define GL_EXT_texture_filter_anisotropic 1
|
||||
@@ -1240,35 +882,16 @@ typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeli
|
||||
#define GL_EXT_texture_format_BGRA8888 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_rg */
|
||||
#ifndef GL_EXT_texture_rg
|
||||
#define GL_EXT_texture_rg 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_storage */
|
||||
#ifndef GL_EXT_texture_storage
|
||||
#define GL_EXT_texture_storage 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
|
||||
GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
|
||||
GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_type_2_10_10_10_REV */
|
||||
#ifndef GL_EXT_texture_type_2_10_10_10_REV
|
||||
#define GL_EXT_texture_type_2_10_10_10_REV 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_compression_dxt1 */
|
||||
#ifndef GL_EXT_texture_compression_dxt1
|
||||
#define GL_EXT_texture_compression_dxt1 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_unpack_subimage */
|
||||
#ifndef GL_EXT_unpack_subimage
|
||||
#define GL_EXT_unpack_subimage 1
|
||||
@@ -1283,15 +906,6 @@ typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum
|
||||
#define GL_DMP_shader_binary 1
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* FJ extension functions
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_FJ_shader_binary_GCCSO */
|
||||
#ifndef GL_FJ_shader_binary_GCCSO
|
||||
#define GL_FJ_shader_binary_GCCSO 1
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* IMG extension functions
|
||||
*------------------------------------------------------------------------*/
|
||||
|
@@ -28,37 +28,6 @@ CHIPSET(0x015a, IVYBRIDGE_S_GT1, ivb_gt1)
|
||||
CHIPSET(0x016a, IVYBRIDGE_S_GT2, ivb_gt2)
|
||||
CHIPSET(0x0402, HASWELL_GT1, hsw_gt1)
|
||||
CHIPSET(0x0412, HASWELL_GT2, hsw_gt2)
|
||||
CHIPSET(0x0422, HASWELL_GT2_PLUS, hsw_gt2)
|
||||
CHIPSET(0x0406, HASWELL_M_GT1, hsw_gt1)
|
||||
CHIPSET(0x0416, HASWELL_M_GT2, hsw_gt2)
|
||||
CHIPSET(0x0426, HASWELL_M_GT2_PLUS, hsw_gt2)
|
||||
CHIPSET(0x040A, HASWELL_S_GT1, hsw_gt1)
|
||||
CHIPSET(0x041A, HASWELL_S_GT2, hsw_gt2)
|
||||
CHIPSET(0x042A, HASWELL_S_GT2_PLUS, hsw_gt2)
|
||||
CHIPSET(0x0C02, HASWELL_SDV_GT1, hsw_gt1)
|
||||
CHIPSET(0x0C12, HASWELL_SDV_GT2, hsw_gt2)
|
||||
CHIPSET(0x0C22, HASWELL_SDV_GT2_PLUS, hsw_gt2)
|
||||
CHIPSET(0x0C06, HASWELL_SDV_M_GT1, hsw_gt1)
|
||||
CHIPSET(0x0C16, HASWELL_SDV_M_GT2, hsw_gt2)
|
||||
CHIPSET(0x0C26, HASWELL_SDV_M_GT2_PLUS, hsw_gt2)
|
||||
CHIPSET(0x0C0A, HASWELL_SDV_S_GT1, hsw_gt1)
|
||||
CHIPSET(0x0C1A, HASWELL_SDV_S_GT2, hsw_gt2)
|
||||
CHIPSET(0x0C2A, HASWELL_SDV_S_GT2_PLUS, hsw_gt2)
|
||||
CHIPSET(0x0A02, HASWELL_ULT_GT1, hsw_gt1)
|
||||
CHIPSET(0x0A12, HASWELL_ULT_GT2, hsw_gt2)
|
||||
CHIPSET(0x0A22, HASWELL_ULT_GT2_PLUS, hsw_gt2)
|
||||
CHIPSET(0x0A06, HASWELL_ULT_M_GT1, hsw_gt1)
|
||||
CHIPSET(0x0A16, HASWELL_ULT_M_GT2, hsw_gt2)
|
||||
CHIPSET(0x0A26, HASWELL_ULT_M_GT2_PLUS, hsw_gt2)
|
||||
CHIPSET(0x0A0A, HASWELL_ULT_S_GT1, hsw_gt1)
|
||||
CHIPSET(0x0A1A, HASWELL_ULT_S_GT2, hsw_gt2)
|
||||
CHIPSET(0x0A2A, HASWELL_ULT_S_GT2_PLUS, hsw_gt2)
|
||||
CHIPSET(0x0D12, HASWELL_CRW_GT1, hsw_gt1)
|
||||
CHIPSET(0x0D22, HASWELL_CRW_GT2, hsw_gt2)
|
||||
CHIPSET(0x0D32, HASWELL_CRW_GT2_PLUS, hsw_gt2)
|
||||
CHIPSET(0x0D16, HASWELL_CRW_M_GT1, hsw_gt1)
|
||||
CHIPSET(0x0D26, HASWELL_CRW_M_GT2, hsw_gt2)
|
||||
CHIPSET(0x0D36, HASWELL_CRW_M_GT2_PLUS, hsw_gt2)
|
||||
CHIPSET(0x0D1A, HASWELL_CRW_S_GT1, hsw_gt1)
|
||||
CHIPSET(0x0D2A, HASWELL_CRW_S_GT2, hsw_gt2)
|
||||
CHIPSET(0x0D3A, HASWELL_CRW_S_GT2_PLUS, hsw_gt2)
|
||||
CHIPSET(0x0A16, HASWELL_M_ULT_GT2, hsw_gt2)
|
||||
|
@@ -157,7 +157,6 @@ CHIPSET(0x68FE, CEDAR_68FE, CEDAR)
|
||||
|
||||
CHIPSET(0x68C0, REDWOOD_68C0, REDWOOD)
|
||||
CHIPSET(0x68C1, REDWOOD_68C1, REDWOOD)
|
||||
CHIPSET(0x68C7, REDWOOD_68C7, REDWOOD)
|
||||
CHIPSET(0x68C8, REDWOOD_68C8, REDWOOD)
|
||||
CHIPSET(0x68C9, REDWOOD_68C9, REDWOOD)
|
||||
CHIPSET(0x68D8, REDWOOD_68D8, REDWOOD)
|
||||
@@ -180,8 +179,6 @@ CHIPSET(0x6880, CYPRESS_6880, CYPRESS)
|
||||
CHIPSET(0x6888, CYPRESS_6888, CYPRESS)
|
||||
CHIPSET(0x6889, CYPRESS_6889, CYPRESS)
|
||||
CHIPSET(0x688A, CYPRESS_688A, CYPRESS)
|
||||
CHIPSET(0x688C, CYPRESS_688C, CYPRESS)
|
||||
CHIPSET(0x688D, CYPRESS_688D, CYPRESS)
|
||||
CHIPSET(0x6898, CYPRESS_6898, CYPRESS)
|
||||
CHIPSET(0x6899, CYPRESS_6899, CYPRESS)
|
||||
CHIPSET(0x689B, CYPRESS_689B, CYPRESS)
|
||||
|
@@ -12,12 +12,9 @@ CHIPSET(0x679F, TAHITI_679F, TAHITI)
|
||||
CHIPSET(0x6800, PITCAIRN_6800, PITCAIRN)
|
||||
CHIPSET(0x6801, PITCAIRN_6801, PITCAIRN)
|
||||
CHIPSET(0x6802, PITCAIRN_6802, PITCAIRN)
|
||||
CHIPSET(0x6806, PITCAIRN_6806, PITCAIRN)
|
||||
CHIPSET(0x6808, PITCAIRN_6808, PITCAIRN)
|
||||
CHIPSET(0x6809, PITCAIRN_6809, PITCAIRN)
|
||||
CHIPSET(0x6810, PITCAIRN_6810, PITCAIRN)
|
||||
CHIPSET(0x6816, PITCAIRN_6816, PITCAIRN)
|
||||
CHIPSET(0x6817, PITCAIRN_6817, PITCAIRN)
|
||||
CHIPSET(0x6818, PITCAIRN_6818, PITCAIRN)
|
||||
CHIPSET(0x6819, PITCAIRN_6819, PITCAIRN)
|
||||
CHIPSET(0x684C, PITCAIRN_684C, PITCAIRN)
|
||||
|
5
m4/.gitignore
vendored
5
m4/.gitignore
vendored
@@ -1,5 +0,0 @@
|
||||
libtool.m4
|
||||
ltoptions.m4
|
||||
ltsugar.m4
|
||||
ltversion.m4
|
||||
lt~obsolete.m4
|
309
m4/ax_pthread.m4
309
m4/ax_pthread.m4
@@ -1,309 +0,0 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro figures out how to build C programs using POSIX threads. It
|
||||
# sets the PTHREAD_LIBS output variable to the threads library and linker
|
||||
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
|
||||
# flags that are needed. (The user can also force certain compiler
|
||||
# flags/libs to be tested by setting these environment variables.)
|
||||
#
|
||||
# Also sets PTHREAD_CC to any special C compiler that is needed for
|
||||
# multi-threaded programs (defaults to the value of CC otherwise). (This
|
||||
# is necessary on AIX to use the special cc_r compiler alias.)
|
||||
#
|
||||
# NOTE: You are assumed to not only compile your program with these flags,
|
||||
# but also link it with them as well. e.g. you should link with
|
||||
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||
#
|
||||
# If you are only building threads programs, you may wish to use these
|
||||
# variables in your default LIBS, CFLAGS, and CC:
|
||||
#
|
||||
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
# CC="$PTHREAD_CC"
|
||||
#
|
||||
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
|
||||
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
|
||||
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
#
|
||||
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
|
||||
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
|
||||
# PTHREAD_CFLAGS.
|
||||
#
|
||||
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
|
||||
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
|
||||
# is not found. If ACTION-IF-FOUND is not specified, the default action
|
||||
# will define HAVE_PTHREAD.
|
||||
#
|
||||
# Please let the authors know if this macro fails on any platform, or if
|
||||
# you have any other suggestions or comments. This macro was based on work
|
||||
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
|
||||
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
|
||||
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
|
||||
# grateful for the helpful feedback of numerous users.
|
||||
#
|
||||
# Updated for Autoconf 2.68 by Daniel Richard G.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 18
|
||||
|
||||
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
|
||||
AC_DEFUN([AX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_PUSH([C])
|
||||
ax_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
# requires special compiler flags (e.g. on True64 or Sequent).
|
||||
# It gets checked for in the link test anyway.
|
||||
|
||||
# First of all, check if the user has set any of the PTHREAD_LIBS,
|
||||
# etcetera environment variables, and if threads linking works using
|
||||
# them:
|
||||
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
|
||||
AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
|
||||
AC_MSG_RESULT($ax_pthread_ok)
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
fi
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
fi
|
||||
|
||||
# We must check for the threads library under a number of different
|
||||
# names; the ordering is very important because some systems
|
||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||
# libraries is broken (non-POSIX).
|
||||
|
||||
# Create a list of thread flags to try. Items starting with a "-" are
|
||||
# C compiler flags, and other items are library names, except for "none"
|
||||
# which indicates that we try without any flags at all, and "pthread-config"
|
||||
# which is a program returning the flags for the Pth emulation library.
|
||||
|
||||
ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
|
||||
# The ordering *is* (sometimes) important. Some notes on the
|
||||
# individual items follow:
|
||||
|
||||
# pthreads: AIX (must check this before -lpthread)
|
||||
# none: in case threads are in libc; should be tried before -Kthread and
|
||||
# other compiler flags to prevent continual compiler warnings
|
||||
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
||||
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
|
||||
# -pthreads: Solaris/gcc
|
||||
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||
# doesn't hurt to check since this sometimes defines pthreads too;
|
||||
# also defines -D_REENTRANT)
|
||||
# ... -mt is also the pthreads flag for HP/aCC
|
||||
# pthread: Linux, etcetera
|
||||
# --thread-safe: KAI C++
|
||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||
|
||||
case ${host_os} in
|
||||
solaris*)
|
||||
|
||||
# On Solaris (at least, for some versions), libc contains stubbed
|
||||
# (non-functional) versions of the pthreads routines, so link-based
|
||||
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
|
||||
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
||||
# a function called by this macro, so we could check for that, but
|
||||
# who knows whether they'll stub that too in a future libc.) So,
|
||||
# we'll just look for -pthreads and -lpthread first:
|
||||
|
||||
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
|
||||
;;
|
||||
|
||||
darwin*)
|
||||
ax_pthread_flags="-pthread $ax_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
for flag in $ax_pthread_flags; do
|
||||
|
||||
case $flag in
|
||||
none)
|
||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||
;;
|
||||
|
||||
-*)
|
||||
AC_MSG_CHECKING([whether pthreads work with $flag])
|
||||
PTHREAD_CFLAGS="$flag"
|
||||
;;
|
||||
|
||||
pthread-config)
|
||||
AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
|
||||
if test x"$ax_pthread_config" = xno; then continue; fi
|
||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
||||
PTHREAD_LIBS="-l$flag"
|
||||
;;
|
||||
esac
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Check for various functions. We must include pthread.h,
|
||||
# since some functions may be macros. (On the Sequent, we
|
||||
# need a special flag -Kthread to make this header compile.)
|
||||
# We check for pthread_join because it is in -lpthread on IRIX
|
||||
# while pthread_create is in libc. We check for pthread_attr_init
|
||||
# due to DEC craziness with -lpthreads. We check for
|
||||
# pthread_cleanup_push because it is one of the few pthread
|
||||
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||
# We try pthread_create on general principles.
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
|
||||
static void routine(void *a) { a = 0; }
|
||||
static void *start_routine(void *a) { return a; }],
|
||||
[pthread_t th; pthread_attr_t attr;
|
||||
pthread_create(&th, 0, start_routine, 0);
|
||||
pthread_join(th, 0);
|
||||
pthread_attr_init(&attr);
|
||||
pthread_cleanup_push(routine, 0);
|
||||
pthread_cleanup_pop(0) /* ; */])],
|
||||
[ax_pthread_ok=yes],
|
||||
[])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
AC_MSG_RESULT($ax_pthread_ok)
|
||||
if test "x$ax_pthread_ok" = xyes; then
|
||||
break;
|
||||
fi
|
||||
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
done
|
||||
fi
|
||||
|
||||
# Various other checks:
|
||||
if test "x$ax_pthread_ok" = xyes; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||
AC_MSG_CHECKING([for joinable pthread attribute])
|
||||
attr_name=unknown
|
||||
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
|
||||
[int attr = $attr; return attr /* ; */])],
|
||||
[attr_name=$attr; break],
|
||||
[])
|
||||
done
|
||||
AC_MSG_RESULT($attr_name)
|
||||
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
||||
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
|
||||
[Define to necessary symbol if this constant
|
||||
uses a non-standard name on your system.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
||||
flag=no
|
||||
case ${host_os} in
|
||||
aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
|
||||
osf* | hpux*) flag="-D_REENTRANT";;
|
||||
solaris*)
|
||||
if test "$GCC" = "yes"; then
|
||||
flag="-D_REENTRANT"
|
||||
else
|
||||
flag="-mt -D_REENTRANT"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT(${flag})
|
||||
if test "x$flag" != xno; then
|
||||
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
|
||||
ax_cv_PTHREAD_PRIO_INHERIT, [
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=no])
|
||||
])
|
||||
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
|
||||
AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
# More AIX lossage: must compile with xlc_r or cc_r
|
||||
if test x"$GCC" != xyes; then
|
||||
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
|
||||
else
|
||||
PTHREAD_CC=$CC
|
||||
fi
|
||||
else
|
||||
PTHREAD_CC="$CC"
|
||||
fi
|
||||
|
||||
AC_SUBST(PTHREAD_LIBS)
|
||||
AC_SUBST(PTHREAD_CFLAGS)
|
||||
AC_SUBST(PTHREAD_CC)
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test x"$ax_pthread_ok" = xyes; then
|
||||
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
|
||||
:
|
||||
else
|
||||
ax_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])dnl AX_PTHREAD
|
@@ -235,15 +235,6 @@ def parse_source_list(env, filename, names=None):
|
||||
# parse the source list file
|
||||
parser = source_list.SourceListParser()
|
||||
src = env.File(filename).srcnode()
|
||||
|
||||
cur_srcdir = env.Dir('.').srcnode().abspath
|
||||
top_srcdir = env.Dir('#').abspath
|
||||
top_builddir = os.path.join(top_srcdir, env['build_dir'])
|
||||
|
||||
# Populate the symbol table of the Makefile parser.
|
||||
parser.add_symbol('top_srcdir', top_srcdir)
|
||||
parser.add_symbol('top_builddir', top_builddir)
|
||||
|
||||
sym_table = parser.parse(src.abspath)
|
||||
|
||||
if names:
|
||||
@@ -258,21 +249,7 @@ def parse_source_list(env, filename, names=None):
|
||||
src_lists = {}
|
||||
for sym in symbols:
|
||||
val = sym_table[sym]
|
||||
srcs = []
|
||||
for f in val.split():
|
||||
if f:
|
||||
# Process source paths
|
||||
if f.startswith(top_builddir + '/src'):
|
||||
# Automake puts build output on a `src` subdirectory, bue
|
||||
# SCons does no, so strip it here.
|
||||
f = top_builddir + f[len(top_builddir + '/src'):]
|
||||
if f.startswith(cur_srcdir + '/'):
|
||||
# Prefer relative source paths, as absolute files tend to
|
||||
# cause duplicate actions.
|
||||
f = f[len(cur_srcdir + '/'):]
|
||||
srcs.append(f)
|
||||
|
||||
src_lists[sym] = srcs
|
||||
src_lists[sym] = [f for f in val.split(' ') if f]
|
||||
|
||||
# if names are given, concatenate the lists
|
||||
if names:
|
||||
|
@@ -140,8 +140,6 @@ def generate(env):
|
||||
env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
|
||||
env['msvc'] = env['CC'] == 'cl'
|
||||
env['suncc'] = env['platform'] == 'sunos' and os.path.basename(env['CC']) == 'cc'
|
||||
env['clang'] = env['CC'] == 'clang'
|
||||
env['icc'] = 'icc' == os.path.basename(env['CC'])
|
||||
|
||||
if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64':
|
||||
# MSVC x64 support is broken in earlier versions of scons
|
||||
@@ -155,7 +153,6 @@ def generate(env):
|
||||
gcc = env['gcc']
|
||||
msvc = env['msvc']
|
||||
suncc = env['suncc']
|
||||
icc = env['icc']
|
||||
|
||||
# Determine whether we are cross compiling; in particular, whether we need
|
||||
# to compile code generators with a different compiler as the target code.
|
||||
@@ -251,7 +248,7 @@ def generate(env):
|
||||
'_SVID_SOURCE',
|
||||
'_BSD_SOURCE',
|
||||
'_GNU_SOURCE',
|
||||
'HAVE_PTHREAD',
|
||||
'PTHREADS',
|
||||
'HAVE_POSIX_MEMALIGN',
|
||||
]
|
||||
if env['platform'] == 'darwin':
|
||||
@@ -298,10 +295,6 @@ def generate(env):
|
||||
cppdefines += ['BEOS_THREADS']
|
||||
if env['embedded']:
|
||||
cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED']
|
||||
if env['texture_float']:
|
||||
print 'warning: Floating-point textures enabled.'
|
||||
print 'warning: Please consult docs/patents.txt with your lawyer before building Mesa.'
|
||||
cppdefines += ['TEXTURE_FLOAT_ENABLED']
|
||||
env.Append(CPPDEFINES = cppdefines)
|
||||
|
||||
# C compiler options
|
||||
@@ -375,6 +368,7 @@ def generate(env):
|
||||
ccflags += [
|
||||
'-Wall',
|
||||
'-Wno-long-long',
|
||||
'-ffast-math',
|
||||
'-fmessage-length=0', # be nice to Eclipse
|
||||
]
|
||||
cflags += [
|
||||
@@ -388,10 +382,6 @@ def generate(env):
|
||||
cflags += [
|
||||
'-Wdeclaration-after-statement',
|
||||
]
|
||||
if icc:
|
||||
cflags += [
|
||||
'-std=gnu99',
|
||||
]
|
||||
if msvc:
|
||||
# See also:
|
||||
# - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
|
||||
@@ -415,6 +405,7 @@ def generate(env):
|
||||
'/GL-', # disable whole program optimization
|
||||
]
|
||||
ccflags += [
|
||||
'/fp:fast', # fast floating point
|
||||
'/W3', # warning level
|
||||
#'/Wp64', # enable 64 bit porting warnings
|
||||
'/wd4996', # disable deprecated POSIX name warnings
|
||||
@@ -493,12 +484,12 @@ def generate(env):
|
||||
env.Append(SHLINKFLAGS = shlinkflags)
|
||||
|
||||
# We have C++ in several libraries, so always link with the C++ compiler
|
||||
if env['gcc'] or env['clang']:
|
||||
if env['gcc']:
|
||||
env['LINK'] = env['CXX']
|
||||
|
||||
# Default libs
|
||||
libs = []
|
||||
if env['platform'] in ('darwin', 'freebsd', 'linux', 'posix', 'sunos'):
|
||||
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
|
||||
libs += ['m', 'pthread', 'dl']
|
||||
env.Append(LIBS = libs)
|
||||
|
||||
@@ -525,7 +516,7 @@ def generate(env):
|
||||
createInstallMethods(env)
|
||||
|
||||
env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage', 'xfixes'])
|
||||
env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx >= 1.8.1'])
|
||||
env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx'])
|
||||
env.PkgCheckModules('XF86VIDMODE', ['xxf86vm'])
|
||||
env.PkgCheckModules('DRM', ['libdrm >= 2.4.24'])
|
||||
env.PkgCheckModules('DRM_INTEL', ['libdrm_intel >= 2.4.30'])
|
||||
|
@@ -178,12 +178,7 @@ def generate(env):
|
||||
pass
|
||||
env.MergeFlags(cppflags)
|
||||
|
||||
components = ['engine', 'bitwriter', 'x86asmprinter']
|
||||
|
||||
if llvm_version >= distutils.version.LooseVersion('3.1'):
|
||||
components.append('mcjit')
|
||||
|
||||
env.ParseConfig('llvm-config --libs ' + ' '.join(components))
|
||||
env.ParseConfig('llvm-config --libs engine bitwriter')
|
||||
env.ParseConfig('llvm-config --ldflags')
|
||||
except OSError:
|
||||
print 'scons: llvm-config version %s failed' % llvm_version
|
||||
|
@@ -13,7 +13,6 @@ The goal is to allow Makefile's and SConscript's to share source listing.
|
||||
|
||||
class SourceListParser(object):
|
||||
def __init__(self):
|
||||
self.symbol_table = {}
|
||||
self._reset()
|
||||
|
||||
def _reset(self, filename=None):
|
||||
@@ -21,6 +20,7 @@ class SourceListParser(object):
|
||||
|
||||
self.line_no = 1
|
||||
self.line_cont = ''
|
||||
self.symbol_table = {}
|
||||
|
||||
def _error(self, msg):
|
||||
raise RuntimeError('%s:%d: %s' % (self.filename, self.line_no, msg))
|
||||
@@ -125,6 +125,3 @@ class SourceListParser(object):
|
||||
raise
|
||||
|
||||
return self.symbol_table
|
||||
|
||||
def add_symbol(self, name, value):
|
||||
self.symbol_table[name] = value
|
||||
|
@@ -27,6 +27,8 @@ if not env['embedded']:
|
||||
SConscript('glx/SConscript')
|
||||
if env['platform'] not in ['darwin', 'haiku', 'sunos']:
|
||||
SConscript('egl/main/SConscript')
|
||||
if env['platform'] not in ['darwin']:
|
||||
SConscript('glu/sgi/SConscript')
|
||||
|
||||
if env['gles']:
|
||||
SConscript('mapi/shared-glapi/SConscript')
|
||||
|
@@ -30,7 +30,6 @@ AM_CFLAGS = \
|
||||
$(DEFINES) \
|
||||
$(LIBDRM_CFLAGS) \
|
||||
$(LIBUDEV_CFLAGS) \
|
||||
$(LIBKMS_CFLAGS) \
|
||||
-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\"
|
||||
|
||||
noinst_LTLIBRARIES = libegl_dri2.la
|
||||
|
@@ -308,7 +308,7 @@ struct dri2_extension_match {
|
||||
|
||||
static struct dri2_extension_match dri2_driver_extensions[] = {
|
||||
{ __DRI_CORE, 1, offsetof(struct dri2_egl_display, core) },
|
||||
{ __DRI_DRI2, 2, offsetof(struct dri2_egl_display, dri2) },
|
||||
{ __DRI_DRI2, 1, offsetof(struct dri2_egl_display, dri2) },
|
||||
{ NULL, 0, 0 }
|
||||
};
|
||||
|
||||
@@ -322,12 +322,12 @@ static struct dri2_extension_match dri2_core_extensions[] = {
|
||||
static struct dri2_extension_match swrast_driver_extensions[] = {
|
||||
{ __DRI_CORE, 1, offsetof(struct dri2_egl_display, core) },
|
||||
{ __DRI_SWRAST, 2, offsetof(struct dri2_egl_display, swrast) },
|
||||
{ NULL, 0, 0 }
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static struct dri2_extension_match swrast_core_extensions[] = {
|
||||
{ __DRI_TEX_BUFFER, 2, offsetof(struct dri2_egl_display, tex_buffer) },
|
||||
{ NULL, 0, 0 }
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static EGLBoolean
|
||||
@@ -464,10 +464,16 @@ dri2_setup_screen(_EGLDisplay *disp)
|
||||
unsigned int api_mask;
|
||||
|
||||
if (dri2_dpy->dri2) {
|
||||
api_mask = dri2_dpy->dri2->getAPIMask(dri2_dpy->dri_screen);
|
||||
if (dri2_dpy->dri2->base.version >= 2)
|
||||
api_mask = dri2_dpy->dri2->getAPIMask(dri2_dpy->dri_screen);
|
||||
else
|
||||
api_mask = 1 << __DRI_API_OPENGL;
|
||||
} else {
|
||||
assert(dri2_dpy->swrast);
|
||||
api_mask = 1 << __DRI_API_OPENGL | 1 << __DRI_API_GLES | 1 << __DRI_API_GLES2;
|
||||
if (dri2_dpy->swrast->base.version >= 2)
|
||||
api_mask = 1 << __DRI_API_OPENGL | 1 << __DRI_API_GLES | 1 << __DRI_API_GLES2;
|
||||
else
|
||||
api_mask = 1 << __DRI_API_OPENGL;
|
||||
}
|
||||
|
||||
disp->ClientAPIs = 0;
|
||||
@@ -478,14 +484,19 @@ dri2_setup_screen(_EGLDisplay *disp)
|
||||
if (api_mask & (1 << __DRI_API_GLES2))
|
||||
disp->ClientAPIs |= EGL_OPENGL_ES2_BIT;
|
||||
|
||||
assert(dri2_dpy->dri2 || dri2_dpy->swrast);
|
||||
disp->Extensions.KHR_surfaceless_context = EGL_TRUE;
|
||||
|
||||
if (dri2_dpy->dri2 && dri2_dpy->dri2->base.version >= 3) {
|
||||
disp->Extensions.KHR_create_context = EGL_TRUE;
|
||||
|
||||
if (dri2_dpy->robustness)
|
||||
disp->Extensions.EXT_create_context_robustness = EGL_TRUE;
|
||||
if (dri2_dpy->dri2) {
|
||||
if (dri2_dpy->dri2->base.version >= 2) {
|
||||
disp->Extensions.KHR_surfaceless_gles1 = EGL_TRUE;
|
||||
disp->Extensions.KHR_surfaceless_gles2 = EGL_TRUE;
|
||||
disp->Extensions.KHR_surfaceless_opengl = EGL_TRUE;
|
||||
}
|
||||
} else {
|
||||
assert(dri2_dpy->swrast);
|
||||
if (dri2_dpy->swrast->base.version >= 2) {
|
||||
disp->Extensions.KHR_surfaceless_gles1 = EGL_TRUE;
|
||||
disp->Extensions.KHR_surfaceless_gles2 = EGL_TRUE;
|
||||
disp->Extensions.KHR_surfaceless_opengl = EGL_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (dri2_dpy->image) {
|
||||
@@ -524,16 +535,8 @@ dri2_create_screen(_EGLDisplay *disp)
|
||||
extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
|
||||
|
||||
if (dri2_dpy->dri2) {
|
||||
unsigned i;
|
||||
|
||||
if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
|
||||
goto cleanup_dri_screen;
|
||||
|
||||
for (i = 0; extensions[i]; i++) {
|
||||
if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0) {
|
||||
dri2_dpy->robustness = (__DRIrobustnessExtension *) extensions[i];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
assert(dri2_dpy->swrast);
|
||||
if (!dri2_bind_extensions(dri2_dpy, swrast_core_extensions, extensions))
|
||||
@@ -650,8 +653,6 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
|
||||
struct dri2_egl_context *dri2_ctx;
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct dri2_egl_context *dri2_ctx_shared = dri2_egl_context(share_list);
|
||||
__DRIcontext *shared =
|
||||
dri2_ctx_shared ? dri2_ctx_shared->dri_context : NULL;
|
||||
struct dri2_egl_config *dri2_config = dri2_egl_config(conf);
|
||||
const __DRIconfig *dri_config;
|
||||
int api;
|
||||
@@ -669,12 +670,11 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
|
||||
|
||||
switch (dri2_ctx->base.ClientAPI) {
|
||||
case EGL_OPENGL_ES_API:
|
||||
switch (dri2_ctx->base.ClientMajorVersion) {
|
||||
switch (dri2_ctx->base.ClientVersion) {
|
||||
case 1:
|
||||
api = __DRI_API_GLES;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
api = __DRI_API_GLES2;
|
||||
break;
|
||||
default:
|
||||
@@ -683,13 +683,7 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
|
||||
}
|
||||
break;
|
||||
case EGL_OPENGL_API:
|
||||
if ((dri2_ctx->base.ClientMajorVersion >= 4
|
||||
|| (dri2_ctx->base.ClientMajorVersion == 3
|
||||
&& dri2_ctx->base.ClientMinorVersion >= 2))
|
||||
&& dri2_ctx->base.Profile == EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR)
|
||||
api = __DRI_API_OPENGL_CORE;
|
||||
else
|
||||
api = __DRI_API_OPENGL;
|
||||
api = __DRI_API_OPENGL;
|
||||
break;
|
||||
default:
|
||||
_eglError(EGL_BAD_PARAMETER, "eglCreateContext");
|
||||
@@ -719,72 +713,44 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
|
||||
dri_config = NULL;
|
||||
|
||||
if (dri2_dpy->dri2) {
|
||||
if (dri2_dpy->dri2->base.version >= 3) {
|
||||
unsigned error;
|
||||
unsigned num_attribs = 0;
|
||||
uint32_t ctx_attribs[8];
|
||||
|
||||
ctx_attribs[num_attribs++] = __DRI_CTX_ATTRIB_MAJOR_VERSION;
|
||||
ctx_attribs[num_attribs++] = dri2_ctx->base.ClientMajorVersion;
|
||||
ctx_attribs[num_attribs++] = __DRI_CTX_ATTRIB_MINOR_VERSION;
|
||||
ctx_attribs[num_attribs++] = dri2_ctx->base.ClientMinorVersion;
|
||||
|
||||
if (dri2_ctx->base.Flags != 0) {
|
||||
/* If the implementation doesn't support the __DRI2_ROBUSTNESS
|
||||
* extension, don't even try to send it the robust-access flag.
|
||||
* It may explode. Instead, generate the required EGL error here.
|
||||
*/
|
||||
if ((dri2_ctx->base.Flags & EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR) != 0
|
||||
&& !dri2_dpy->robustness) {
|
||||
_eglError(EGL_BAD_MATCH, "eglCreateContext");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ctx_attribs[num_attribs++] = __DRI_CTX_ATTRIB_FLAGS;
|
||||
ctx_attribs[num_attribs++] = dri2_ctx->base.Flags;
|
||||
}
|
||||
|
||||
if (dri2_ctx->base.ResetNotificationStrategy != EGL_NO_RESET_NOTIFICATION_KHR) {
|
||||
/* If the implementation doesn't support the __DRI2_ROBUSTNESS
|
||||
* extension, don't even try to send it a reset strategy. It may
|
||||
* explode. Instead, generate the required EGL error here.
|
||||
*/
|
||||
if (!dri2_dpy->robustness) {
|
||||
_eglError(EGL_BAD_CONFIG, "eglCreateContext");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ctx_attribs[num_attribs++] = __DRI_CTX_ATTRIB_RESET_STRATEGY;
|
||||
ctx_attribs[num_attribs++] = __DRI_CTX_RESET_LOSE_CONTEXT;
|
||||
}
|
||||
|
||||
assert(num_attribs <= ARRAY_SIZE(ctx_attribs));
|
||||
|
||||
dri2_ctx->dri_context =
|
||||
dri2_dpy->dri2->createContextAttribs(dri2_dpy->dri_screen,
|
||||
api,
|
||||
dri_config,
|
||||
shared,
|
||||
num_attribs / 2,
|
||||
ctx_attribs,
|
||||
& error,
|
||||
dri2_ctx);
|
||||
} else {
|
||||
if (dri2_dpy->dri2->base.version >= 2) {
|
||||
dri2_ctx->dri_context =
|
||||
dri2_dpy->dri2->createNewContextForAPI(dri2_dpy->dri_screen,
|
||||
api,
|
||||
dri_config,
|
||||
shared,
|
||||
dri2_ctx_shared ?
|
||||
dri2_ctx_shared->dri_context : NULL,
|
||||
dri2_ctx);
|
||||
} else if (api == __DRI_API_OPENGL) {
|
||||
dri2_ctx->dri_context =
|
||||
dri2_dpy->dri2->createNewContext(dri2_dpy->dri_screen,
|
||||
dri_config,
|
||||
dri2_ctx_shared ?
|
||||
dri2_ctx_shared->dri_context : NULL,
|
||||
dri2_ctx);
|
||||
} else {
|
||||
/* fail */
|
||||
}
|
||||
} else {
|
||||
assert(dri2_dpy->swrast);
|
||||
dri2_ctx->dri_context =
|
||||
dri2_dpy->swrast->createNewContextForAPI(dri2_dpy->dri_screen,
|
||||
api,
|
||||
dri_config,
|
||||
shared,
|
||||
dri2_ctx);
|
||||
if (dri2_dpy->swrast->base.version >= 2) {
|
||||
dri2_ctx->dri_context =
|
||||
dri2_dpy->swrast->createNewContextForAPI(dri2_dpy->dri_screen,
|
||||
api,
|
||||
dri_config,
|
||||
dri2_ctx_shared ?
|
||||
dri2_ctx_shared->dri_context : NULL,
|
||||
dri2_ctx);
|
||||
} else if (api == __DRI_API_OPENGL) {
|
||||
dri2_ctx->dri_context =
|
||||
dri2_dpy->core->createNewContext(dri2_dpy->dri_screen,
|
||||
dri_config,
|
||||
dri2_ctx_shared ?
|
||||
dri2_ctx_shared->dri_context : NULL,
|
||||
dri2_ctx);
|
||||
} else {
|
||||
/* fail */
|
||||
}
|
||||
}
|
||||
|
||||
if (!dri2_ctx->dri_context)
|
||||
@@ -993,18 +959,54 @@ dri2_release_tex_image(_EGLDriver *drv,
|
||||
}
|
||||
|
||||
static _EGLImage *
|
||||
dri2_create_image(_EGLDisplay *disp, __DRIimage *dri_image)
|
||||
dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, _EGLContext *ctx,
|
||||
EGLClientBuffer buffer,
|
||||
const EGLint *attr_list)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
|
||||
struct dri2_egl_image *dri2_img;
|
||||
GLuint renderbuffer = (GLuint) (uintptr_t) buffer;
|
||||
|
||||
if (dri_image == NULL) {
|
||||
_eglError(EGL_BAD_ALLOC, "dri2_create_image");
|
||||
return NULL;
|
||||
if (renderbuffer == 0) {
|
||||
_eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr");
|
||||
return EGL_NO_IMAGE_KHR;
|
||||
}
|
||||
|
||||
dri2_img = malloc(sizeof *dri2_img);
|
||||
if (!dri2_img) {
|
||||
_eglError(EGL_BAD_ALLOC, "dri2_create_image");
|
||||
_eglError(EGL_BAD_ALLOC, "dri2_create_image_khr");
|
||||
return EGL_NO_IMAGE_KHR;
|
||||
}
|
||||
|
||||
if (!_eglInitImage(&dri2_img->base, disp)) {
|
||||
free(dri2_img);
|
||||
return EGL_NO_IMAGE_KHR;
|
||||
}
|
||||
|
||||
dri2_img->dri_image =
|
||||
dri2_dpy->image->createImageFromRenderbuffer(dri2_ctx->dri_context,
|
||||
renderbuffer,
|
||||
dri2_img);
|
||||
|
||||
return &dri2_img->base;
|
||||
}
|
||||
|
||||
static _EGLImage *
|
||||
dri2_create_image_drm_name(_EGLDisplay *disp, _EGLContext *ctx,
|
||||
EGLint name,
|
||||
const _EGLImageAttribs *attrs,
|
||||
EGLint format,
|
||||
EGLint pitch)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct dri2_egl_image *dri2_img;
|
||||
|
||||
(void) ctx;
|
||||
|
||||
dri2_img = malloc(sizeof *dri2_img);
|
||||
if (!dri2_img) {
|
||||
_eglError(EGL_BAD_ALLOC, "dri2_create_image_mesa_drm");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1013,41 +1015,29 @@ dri2_create_image(_EGLDisplay *disp, __DRIimage *dri_image)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dri2_img->dri_image = dri_image;
|
||||
|
||||
return &dri2_img->base;
|
||||
}
|
||||
|
||||
static _EGLImage *
|
||||
dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, _EGLContext *ctx,
|
||||
EGLClientBuffer buffer,
|
||||
const EGLint *attr_list)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
|
||||
GLuint renderbuffer = (GLuint) (uintptr_t) buffer;
|
||||
__DRIimage *dri_image;
|
||||
|
||||
if (renderbuffer == 0) {
|
||||
_eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr");
|
||||
return EGL_NO_IMAGE_KHR;
|
||||
dri2_img->dri_image =
|
||||
dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
|
||||
attrs->Width,
|
||||
attrs->Height,
|
||||
format,
|
||||
name,
|
||||
pitch,
|
||||
dri2_img);
|
||||
if (dri2_img->dri_image == NULL) {
|
||||
free(dri2_img);
|
||||
_eglError(EGL_BAD_ALLOC, "dri2_create_image_mesa_drm");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dri_image =
|
||||
dri2_dpy->image->createImageFromRenderbuffer(dri2_ctx->dri_context,
|
||||
renderbuffer, NULL);
|
||||
|
||||
return dri2_create_image(disp, dri_image);
|
||||
return &dri2_img->base;
|
||||
}
|
||||
|
||||
static _EGLImage *
|
||||
dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
|
||||
EGLClientBuffer buffer, const EGLint *attr_list)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
EGLint format, name, pitch, err;
|
||||
_EGLImageAttribs attrs;
|
||||
__DRIimage *dri_image;
|
||||
|
||||
name = (EGLint) (uintptr_t) buffer;
|
||||
|
||||
@@ -1073,76 +1063,52 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dri_image =
|
||||
dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
|
||||
attrs.Width,
|
||||
attrs.Height,
|
||||
format,
|
||||
name,
|
||||
pitch,
|
||||
NULL);
|
||||
|
||||
return dri2_create_image(disp, dri_image);
|
||||
return dri2_create_image_drm_name (disp, ctx, name, &attrs, format, pitch);
|
||||
}
|
||||
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
|
||||
/* This structure describes how a wl_buffer maps to one or more
|
||||
* __DRIimages. A wl_drm_buffer stores the wl_drm format code and the
|
||||
* offsets and strides of the planes in the buffer. This table maps a
|
||||
* wl_drm format code to a description of the planes in the buffer
|
||||
* that lets us create a __DRIimage for each of the planes. */
|
||||
|
||||
static const struct wl_drm_components_descriptor {
|
||||
uint32_t dri_components;
|
||||
EGLint components;
|
||||
int nplanes;
|
||||
} wl_drm_components[] = {
|
||||
{ __DRI_IMAGE_COMPONENTS_RGB, EGL_TEXTURE_RGB, 1 },
|
||||
{ __DRI_IMAGE_COMPONENTS_RGBA, EGL_TEXTURE_RGBA, 1 },
|
||||
{ __DRI_IMAGE_COMPONENTS_Y_U_V, EGL_TEXTURE_Y_U_V_WL, 3 },
|
||||
{ __DRI_IMAGE_COMPONENTS_Y_UV, EGL_TEXTURE_Y_UV_WL, 2 },
|
||||
{ __DRI_IMAGE_COMPONENTS_Y_XUXV, EGL_TEXTURE_Y_XUXV_WL, 2 },
|
||||
};
|
||||
|
||||
static _EGLImage *
|
||||
dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,
|
||||
EGLClientBuffer _buffer,
|
||||
const EGLint *attr_list)
|
||||
{
|
||||
struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer;
|
||||
struct wl_buffer *buffer = (struct wl_buffer *) _buffer;
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
const struct wl_drm_components_descriptor *f;
|
||||
__DRIimage *dri_image;
|
||||
_EGLImageAttribs attrs;
|
||||
EGLint err;
|
||||
int32_t plane;
|
||||
EGLint format, name, stride, pitch, err;
|
||||
|
||||
if (!wayland_buffer_is_drm(&buffer->buffer))
|
||||
if (!wayland_buffer_is_drm(buffer))
|
||||
return NULL;
|
||||
|
||||
dri_image = wayland_drm_buffer_get_buffer(buffer);
|
||||
|
||||
dri2_dpy->image->queryImage(dri_image, __DRI_IMAGE_ATTRIB_NAME, &name);
|
||||
dri2_dpy->image->queryImage(dri_image, __DRI_IMAGE_ATTRIB_STRIDE, &stride);
|
||||
|
||||
err = _eglParseImageAttribList(&attrs, disp, attr_list);
|
||||
plane = attrs.PlaneWL;
|
||||
if (err != EGL_SUCCESS) {
|
||||
_eglError(EGL_BAD_PARAMETER, "dri2_create_image_wayland_wl_buffer");
|
||||
if (err != EGL_SUCCESS)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
f = buffer->driver_format;
|
||||
if (plane < 0 || plane >= f->nplanes) {
|
||||
attrs.Width = buffer->width;
|
||||
attrs.Height = buffer->height;
|
||||
|
||||
switch (wayland_drm_buffer_get_format(buffer)) {
|
||||
case WL_DRM_FORMAT_ARGB8888:
|
||||
format = __DRI_IMAGE_FORMAT_ARGB8888;
|
||||
break;
|
||||
case WL_DRM_FORMAT_XRGB8888:
|
||||
format = __DRI_IMAGE_FORMAT_XRGB8888;
|
||||
break;
|
||||
default:
|
||||
_eglError(EGL_BAD_PARAMETER,
|
||||
"dri2_create_image_wayland_wl_buffer (plane out of bounds)");
|
||||
"dri2_create_image_khr: unsupported wl_buffer format");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dri_image = dri2_dpy->image->fromPlanar(buffer->driver_buffer, plane, NULL);
|
||||
pitch = stride / 4;
|
||||
|
||||
if (dri_image == NULL) {
|
||||
_eglError(EGL_BAD_PARAMETER, "dri2_create_image_wayland_wl_buffer");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return dri2_create_image(disp, dri_image);
|
||||
return dri2_create_image_drm_name(disp, ctx, name, &attrs, format, pitch);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1295,46 +1261,43 @@ dri2_export_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img,
|
||||
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
|
||||
static void
|
||||
static void *
|
||||
dri2_wl_reference_buffer(void *user_data, uint32_t name,
|
||||
struct wl_drm_buffer *buffer)
|
||||
int32_t width, int32_t height,
|
||||
uint32_t stride, uint32_t format)
|
||||
{
|
||||
_EGLDisplay *disp = user_data;
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
__DRIimage *img;
|
||||
int i, dri_components = 0;
|
||||
__DRIimage *image;
|
||||
int dri_format;
|
||||
|
||||
img = dri2_dpy->image->createImageFromNames(dri2_dpy->dri_screen,
|
||||
buffer->buffer.width,
|
||||
buffer->buffer.height,
|
||||
buffer->format, (int*)&name, 1,
|
||||
buffer->stride,
|
||||
buffer->offset,
|
||||
NULL);
|
||||
switch (format) {
|
||||
case WL_DRM_FORMAT_ARGB8888:
|
||||
dri_format =__DRI_IMAGE_FORMAT_ARGB8888;
|
||||
break;
|
||||
case WL_DRM_FORMAT_XRGB8888:
|
||||
dri_format = __DRI_IMAGE_FORMAT_XRGB8888;
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (img == NULL)
|
||||
return;
|
||||
image = dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
|
||||
width, height,
|
||||
dri_format, name, stride / 4,
|
||||
NULL);
|
||||
|
||||
dri2_dpy->image->queryImage(img, __DRI_IMAGE_ATTRIB_COMPONENTS, &dri_components);
|
||||
|
||||
buffer->driver_format = NULL;
|
||||
for (i = 0; i < ARRAY_SIZE(wl_drm_components); i++)
|
||||
if (wl_drm_components[i].dri_components == dri_components)
|
||||
buffer->driver_format = &wl_drm_components[i];
|
||||
|
||||
if (buffer->driver_format == NULL)
|
||||
dri2_dpy->image->destroyImage(img);
|
||||
else
|
||||
buffer->driver_buffer = img;
|
||||
return image;
|
||||
}
|
||||
|
||||
static void
|
||||
dri2_wl_release_buffer(void *user_data, struct wl_drm_buffer *buffer)
|
||||
dri2_wl_release_buffer(void *user_data, void *buffer)
|
||||
{
|
||||
_EGLDisplay *disp = user_data;
|
||||
__DRIimage *image = buffer;
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
|
||||
dri2_dpy->image->destroyImage(buffer->driver_buffer);
|
||||
dri2_dpy->image->destroyImage(image);
|
||||
}
|
||||
|
||||
static struct wayland_drm_callbacks wl_drm_callbacks = {
|
||||
@@ -1383,33 +1346,6 @@ dri2_unbind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
dri2_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
struct wl_buffer *_buffer,
|
||||
EGLint attribute, EGLint *value)
|
||||
{
|
||||
struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer;
|
||||
const struct wl_drm_components_descriptor *format;
|
||||
|
||||
if (!wayland_buffer_is_drm(&buffer->buffer))
|
||||
return EGL_FALSE;
|
||||
|
||||
format = buffer->driver_format;
|
||||
switch (attribute) {
|
||||
case EGL_TEXTURE_FORMAT:
|
||||
*value = format->components;
|
||||
return EGL_TRUE;
|
||||
case EGL_WIDTH:
|
||||
*value = buffer->buffer.width;
|
||||
break;
|
||||
case EGL_HEIGHT:
|
||||
*value = buffer->buffer.height;
|
||||
break;
|
||||
}
|
||||
|
||||
return EGL_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
@@ -1507,7 +1443,6 @@ _eglBuiltInDriverDRI2(const char *args)
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
dri2_drv->base.API.BindWaylandDisplayWL = dri2_bind_wayland_display_wl;
|
||||
dri2_drv->base.API.UnbindWaylandDisplayWL = dri2_unbind_wayland_display_wl;
|
||||
dri2_drv->base.API.QueryWaylandBufferWL = dri2_query_wayland_buffer_wl;
|
||||
#endif
|
||||
|
||||
dri2_drv->base.Name = "DRI2";
|
||||
|
@@ -99,7 +99,6 @@ struct dri2_egl_display
|
||||
__DRI2flushExtension *flush;
|
||||
__DRItexBufferExtension *tex_buffer;
|
||||
__DRIimageExtension *image;
|
||||
__DRIrobustnessExtension *robustness;
|
||||
int fd;
|
||||
|
||||
int own_device;
|
||||
@@ -122,10 +121,8 @@ struct dri2_egl_display
|
||||
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
struct wl_display *wl_dpy;
|
||||
struct wl_registry *wl_registry;
|
||||
struct wl_drm *wl_server_drm;
|
||||
struct wl_drm *wl_drm;
|
||||
struct wl_event_queue *wl_queue;
|
||||
int authenticated;
|
||||
int formats;
|
||||
#endif
|
||||
@@ -176,7 +173,7 @@ struct dri2_egl_surface
|
||||
__DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT];
|
||||
__DRIbuffer *third_buffer;
|
||||
__DRIbuffer *pending_buffer;
|
||||
struct wl_callback *frame_callback;
|
||||
EGLBoolean block_swap_buffers;
|
||||
int format;
|
||||
#endif
|
||||
|
||||
|
@@ -500,14 +500,6 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
|
||||
for (j = 0; dri2_dpy->driver_configs[j]; j++) {
|
||||
const EGLint surface_type = EGL_WINDOW_BIT | EGL_PBUFFER_BIT;
|
||||
struct dri2_egl_config *dri2_conf;
|
||||
unsigned int double_buffered = 0;
|
||||
|
||||
dri2_dpy->core->getConfigAttrib(dri2_dpy->driver_configs[j],
|
||||
__DRI_ATTRIB_DOUBLE_BUFFER, &double_buffered);
|
||||
|
||||
/* support only double buffered configs */
|
||||
if (!double_buffered)
|
||||
continue;
|
||||
|
||||
dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],
|
||||
count + 1, visuals[i].size, surface_type, NULL,
|
||||
@@ -533,6 +525,17 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
|
||||
/* there is no front buffer so no OpenGL */
|
||||
dri2_conf->base.RenderableType &= ~EGL_OPENGL_BIT;
|
||||
dri2_conf->base.Conformant &= ~EGL_OPENGL_BIT;
|
||||
|
||||
/*
|
||||
* We want to make sure GL_DRAW_BUFFER for windows or pbuffers is always
|
||||
* GL_BACK. For EGL configs that do not have a double DRI config, clear
|
||||
* the surface type.
|
||||
*
|
||||
* This is just to be on the safe side. dri2_add_config never sets
|
||||
* EGL_WINDOW_BIT or EGL_PBUFFER_BIT for such configs.
|
||||
*/
|
||||
if (!dri2_conf->dri_double_config)
|
||||
dri2_conf->base.SurfaceType = 0;
|
||||
}
|
||||
|
||||
return (count != 0);
|
||||
@@ -657,29 +660,18 @@ droid_open_device(void)
|
||||
return (fd >= 0) ? dup(fd) : -1;
|
||||
}
|
||||
|
||||
/* support versions < JellyBean */
|
||||
#ifndef ALOGW
|
||||
#define ALOGW LOGW
|
||||
#endif
|
||||
#ifndef ALOGD
|
||||
#define ALOGD LOGD
|
||||
#endif
|
||||
#ifndef ALOGI
|
||||
#define ALOGI LOGI
|
||||
#endif
|
||||
|
||||
static void
|
||||
droid_log(EGLint level, const char *msg)
|
||||
{
|
||||
switch (level) {
|
||||
case _EGL_DEBUG:
|
||||
ALOGD("%s", msg);
|
||||
LOGD("%s", msg);
|
||||
break;
|
||||
case _EGL_INFO:
|
||||
ALOGI("%s", msg);
|
||||
LOGI("%s", msg);
|
||||
break;
|
||||
case _EGL_WARNING:
|
||||
ALOGW("%s", msg);
|
||||
LOGW("%s", msg);
|
||||
break;
|
||||
case _EGL_FATAL:
|
||||
LOG_FATAL("%s", msg);
|
||||
|
@@ -108,8 +108,6 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
|
||||
|
||||
switch (type) {
|
||||
case EGL_WINDOW_BIT:
|
||||
if (!window)
|
||||
return NULL;
|
||||
surf = gbm_dri_surface((struct gbm_surface *) window);
|
||||
dri2_surf->gbm_surf = surf;
|
||||
dri2_surf->base.Width = surf->base.width;
|
||||
|
@@ -45,34 +45,6 @@ enum wl_drm_format_flags {
|
||||
HAS_XRGB8888 = 2
|
||||
};
|
||||
|
||||
static void
|
||||
sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
|
||||
{
|
||||
int *done = data;
|
||||
|
||||
*done = 1;
|
||||
wl_callback_destroy(callback);
|
||||
}
|
||||
|
||||
static const struct wl_callback_listener sync_listener = {
|
||||
sync_callback
|
||||
};
|
||||
|
||||
static int
|
||||
roundtrip(struct dri2_egl_display *dri2_dpy)
|
||||
{
|
||||
struct wl_callback *callback;
|
||||
int done = 0, ret = 0;
|
||||
|
||||
callback = wl_display_sync(dri2_dpy->wl_dpy);
|
||||
wl_callback_add_listener(callback, &sync_listener, &done);
|
||||
wl_proxy_set_queue((struct wl_proxy *) callback, dri2_dpy->wl_queue);
|
||||
while (ret != -1 && !done)
|
||||
ret = wl_display_dispatch_queue(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
wl_buffer_release(void *data, struct wl_buffer *buffer)
|
||||
{
|
||||
@@ -108,6 +80,7 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
|
||||
struct dri2_egl_surface *dri2_surf;
|
||||
struct dri2_egl_buffer *dri2_buf;
|
||||
int i;
|
||||
|
||||
(void) drv;
|
||||
@@ -131,7 +104,7 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
|
||||
|
||||
dri2_surf->pending_buffer = NULL;
|
||||
dri2_surf->third_buffer = NULL;
|
||||
dri2_surf->frame_callback = NULL;
|
||||
dri2_surf->block_swap_buffers = EGL_FALSE;
|
||||
|
||||
if (conf->AlphaSize == 0)
|
||||
dri2_surf->format = WL_DRM_FORMAT_XRGB8888;
|
||||
@@ -145,6 +118,17 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
|
||||
dri2_surf->base.Width = -1;
|
||||
dri2_surf->base.Height = -1;
|
||||
break;
|
||||
case EGL_PIXMAP_BIT:
|
||||
dri2_surf->wl_pix = (struct wl_egl_pixmap *) window;
|
||||
|
||||
dri2_surf->base.Width = dri2_surf->wl_pix->width;
|
||||
dri2_surf->base.Height = dri2_surf->wl_pix->height;
|
||||
|
||||
if (dri2_surf->wl_pix->driver_private) {
|
||||
dri2_buf = dri2_surf->wl_pix->driver_private;
|
||||
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] = dri2_buf->dri_buffer;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
goto cleanup_surf;
|
||||
}
|
||||
@@ -182,6 +166,15 @@ dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
window, attrib_list);
|
||||
}
|
||||
|
||||
static _EGLSurface *
|
||||
dri2_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLConfig *conf, EGLNativePixmapType pixmap,
|
||||
const EGLint *attrib_list)
|
||||
{
|
||||
return dri2_create_surface(drv, disp, EGL_PIXMAP_BIT, conf,
|
||||
pixmap, attrib_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called via eglDestroySurface(), drv->API.DestroySurface().
|
||||
*/
|
||||
@@ -204,7 +197,8 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
|
||||
wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]);
|
||||
|
||||
for (i = 0; i < __DRI_BUFFER_COUNT; ++i)
|
||||
if (dri2_surf->dri_buffers[i])
|
||||
if (dri2_surf->dri_buffers[i] && !(i == __DRI_BUFFER_FRONT_LEFT &&
|
||||
dri2_surf->base.Type == EGL_PIXMAP_BIT))
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->dri_buffers[i]);
|
||||
|
||||
@@ -213,14 +207,27 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
|
||||
dri2_surf->third_buffer);
|
||||
}
|
||||
|
||||
if (dri2_surf->frame_callback)
|
||||
wl_callback_destroy(dri2_surf->frame_callback);
|
||||
|
||||
free(surf);
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
dri2_wl_egl_pixmap_destroy(struct wl_egl_pixmap *egl_pixmap)
|
||||
{
|
||||
struct dri2_egl_buffer *dri2_buf = egl_pixmap->driver_private;
|
||||
|
||||
assert(dri2_buf);
|
||||
|
||||
dri2_buf->dri2_dpy->dri2->releaseBuffer(dri2_buf->dri2_dpy->dri_screen,
|
||||
dri2_buf->dri_buffer);
|
||||
|
||||
free(dri2_buf);
|
||||
|
||||
egl_pixmap->driver_private = NULL;
|
||||
egl_pixmap->destroy = NULL;
|
||||
}
|
||||
|
||||
static struct wl_buffer *
|
||||
wayland_create_buffer(struct dri2_egl_surface *dri2_surf,
|
||||
__DRIbuffer *buffer)
|
||||
@@ -260,6 +267,30 @@ dri2_process_back_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dri2_process_front_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy =
|
||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||
struct dri2_egl_buffer *dri2_buf;
|
||||
|
||||
switch (dri2_surf->base.Type) {
|
||||
case EGL_PIXMAP_BIT:
|
||||
dri2_buf = malloc(sizeof *dri2_buf);
|
||||
if (!dri2_buf)
|
||||
return;
|
||||
|
||||
dri2_buf->dri_buffer = dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT];
|
||||
dri2_buf->dri2_dpy = dri2_dpy;
|
||||
|
||||
dri2_surf->wl_pix->driver_private = dri2_buf;
|
||||
dri2_surf->wl_pix->destroy = dri2_wl_egl_pixmap_destroy;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dri2_release_pending_buffer(void *data,
|
||||
struct wl_callback *callback, uint32_t time)
|
||||
@@ -302,13 +333,11 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
|
||||
switch (i) {
|
||||
case __DRI_BUFFER_FRONT_LEFT:
|
||||
if (dri2_surf->pending_buffer)
|
||||
roundtrip(dri2_dpy);
|
||||
wl_display_roundtrip(dri2_dpy->wl_dpy);
|
||||
dri2_surf->pending_buffer = dri2_surf->dri_buffers[i];
|
||||
callback = wl_display_sync(dri2_dpy->wl_dpy);
|
||||
wl_callback_add_listener(callback,
|
||||
&release_buffer_listener, dri2_surf);
|
||||
wl_proxy_set_queue((struct wl_proxy *) callback,
|
||||
dri2_dpy->wl_queue);
|
||||
break;
|
||||
default:
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
@@ -437,7 +466,9 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
|
||||
if (!dri2_surf->dri_buffers[attachments[i]])
|
||||
continue;
|
||||
|
||||
if (attachments[i] == __DRI_BUFFER_BACK_LEFT)
|
||||
if (attachments[i] == __DRI_BUFFER_FRONT_LEFT)
|
||||
dri2_process_front_buffer(dri2_surf, attachments[i+1]);
|
||||
else if (attachments[i] == __DRI_BUFFER_BACK_LEFT)
|
||||
dri2_process_back_buffer(dri2_surf, attachments[i+1]);
|
||||
}
|
||||
|
||||
@@ -448,7 +479,13 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
|
||||
dri2_surf->buffer_count++;
|
||||
}
|
||||
|
||||
assert(dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
|
||||
assert(dri2_surf->base.Type == EGL_PIXMAP_BIT ||
|
||||
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
|
||||
|
||||
if (dri2_surf->base.Type == EGL_PIXMAP_BIT && !dri2_surf->wl_pix->buffer)
|
||||
dri2_surf->wl_pix->buffer =
|
||||
wayland_create_buffer(dri2_surf,
|
||||
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]);
|
||||
|
||||
*out_count = dri2_surf->buffer_count;
|
||||
if (dri2_surf->buffer_count == 0)
|
||||
@@ -515,7 +552,7 @@ wayland_frame_callback(void *data, struct wl_callback *callback, uint32_t time)
|
||||
{
|
||||
struct dri2_egl_surface *dri2_surf = data;
|
||||
|
||||
dri2_surf->frame_callback = NULL;
|
||||
dri2_surf->block_swap_buffers = EGL_FALSE;
|
||||
wl_callback_destroy(callback);
|
||||
}
|
||||
|
||||
@@ -532,18 +569,17 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
|
||||
struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv);
|
||||
int ret = 0;
|
||||
struct wl_callback *callback;
|
||||
|
||||
while (dri2_surf->frame_callback && ret != -1)
|
||||
ret = wl_display_dispatch_queue(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
|
||||
if (ret < 0)
|
||||
return EGL_FALSE;
|
||||
if (dri2_surf->block_swap_buffers) {
|
||||
wl_display_flush(dri2_dpy->wl_dpy);
|
||||
while (dri2_surf->block_swap_buffers)
|
||||
wl_display_iterate(dri2_dpy->wl_dpy, WL_DISPLAY_READABLE);
|
||||
}
|
||||
|
||||
dri2_surf->frame_callback = wl_surface_frame(dri2_surf->wl_win->surface);
|
||||
wl_callback_add_listener(dri2_surf->frame_callback,
|
||||
&frame_listener, dri2_surf);
|
||||
wl_proxy_set_queue((struct wl_proxy *) dri2_surf->frame_callback,
|
||||
dri2_dpy->wl_queue);
|
||||
dri2_surf->block_swap_buffers = EGL_TRUE;
|
||||
callback = wl_surface_frame(dri2_surf->wl_win->surface);
|
||||
wl_callback_add_listener(callback, &frame_listener, dri2_surf);
|
||||
|
||||
if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
|
||||
pointer_swap(
|
||||
@@ -575,8 +611,6 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
|
||||
|
||||
wl_surface_damage(dri2_surf->wl_win->surface, 0, 0,
|
||||
dri2_surf->base.Width, dri2_surf->base.Height);
|
||||
|
||||
wl_surface_commit(dri2_surf->wl_win->surface);
|
||||
}
|
||||
|
||||
_EGLContext *ctx;
|
||||
@@ -592,6 +626,71 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called via eglCreateImageKHR(), drv->API.CreateImageKHR().
|
||||
*/
|
||||
static _EGLImage *
|
||||
dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
|
||||
EGLClientBuffer buffer, const EGLint *attr_list)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct wl_egl_pixmap *wl_egl_pixmap = (struct wl_egl_pixmap *) buffer;
|
||||
struct dri2_egl_buffer *dri2_buf;
|
||||
EGLint wl_attr_list[] = {
|
||||
EGL_WIDTH, 0,
|
||||
EGL_HEIGHT, 0,
|
||||
EGL_DRM_BUFFER_STRIDE_MESA, 0,
|
||||
EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_FORMAT_ARGB32_MESA,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
dri2_buf = malloc(sizeof *dri2_buf);
|
||||
if (!dri2_buf)
|
||||
return NULL;
|
||||
|
||||
dri2_buf->dri2_dpy = dri2_dpy;
|
||||
dri2_buf->dri_buffer =
|
||||
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
|
||||
__DRI_BUFFER_FRONT_LEFT, 32,
|
||||
wl_egl_pixmap->width,
|
||||
wl_egl_pixmap->height);
|
||||
|
||||
wl_egl_pixmap->destroy = dri2_wl_egl_pixmap_destroy;
|
||||
wl_egl_pixmap->driver_private = dri2_buf;
|
||||
|
||||
/* FIXME: Get buffer format from attr_list somehow... or from the
|
||||
wl_egl_piaxmap. */
|
||||
wl_egl_pixmap->buffer =
|
||||
wl_drm_create_buffer(dri2_dpy->wl_drm,
|
||||
dri2_buf->dri_buffer->name,
|
||||
wl_egl_pixmap->width,
|
||||
wl_egl_pixmap->height,
|
||||
dri2_buf->dri_buffer->pitch,
|
||||
WL_DRM_FORMAT_ARGB8888);
|
||||
|
||||
wl_attr_list[1] = wl_egl_pixmap->width;
|
||||
wl_attr_list[3] = wl_egl_pixmap->height;
|
||||
wl_attr_list[5] = dri2_buf->dri_buffer->pitch / 4;
|
||||
|
||||
return dri2_create_image_khr(disp->Driver, disp, ctx, EGL_DRM_BUFFER_MESA,
|
||||
(EGLClientBuffer)(intptr_t) dri2_buf->dri_buffer->name, wl_attr_list);
|
||||
}
|
||||
|
||||
static _EGLImage *
|
||||
dri2_wayland_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLContext *ctx, EGLenum target,
|
||||
EGLClientBuffer buffer, const EGLint *attr_list)
|
||||
{
|
||||
(void) drv;
|
||||
|
||||
switch (target) {
|
||||
case EGL_NATIVE_PIXMAP_KHR:
|
||||
return dri2_create_image_khr_pixmap(disp, ctx, buffer, attr_list);
|
||||
default:
|
||||
return dri2_create_image_khr(drv, disp, ctx, target, buffer, attr_list);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id)
|
||||
{
|
||||
@@ -601,8 +700,7 @@ dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id)
|
||||
dri2_dpy->authenticated = 0;
|
||||
|
||||
wl_drm_authenticate(dri2_dpy->wl_drm, id);
|
||||
if (roundtrip(dri2_dpy) < 0)
|
||||
ret = -1;
|
||||
wl_display_roundtrip(dri2_dpy->wl_dpy);
|
||||
|
||||
if (!dri2_dpy->authenticated)
|
||||
ret = -1;
|
||||
@@ -697,37 +795,22 @@ static const struct wl_drm_listener drm_listener = {
|
||||
drm_handle_authenticated
|
||||
};
|
||||
|
||||
static void
|
||||
registry_handle_global(void *data, struct wl_registry *registry, uint32_t name,
|
||||
const char *interface, uint32_t version)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = data;
|
||||
|
||||
if (strcmp(interface, "wl_drm") == 0) {
|
||||
dri2_dpy->wl_drm =
|
||||
wl_registry_bind(registry, name, &wl_drm_interface, 1);
|
||||
wl_drm_add_listener(dri2_dpy->wl_drm, &drm_listener, dri2_dpy);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct wl_registry_listener registry_listener = {
|
||||
registry_handle_global
|
||||
};
|
||||
|
||||
EGLBoolean
|
||||
dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy;
|
||||
const __DRIconfig *config;
|
||||
uint32_t types;
|
||||
uint32_t id, types;
|
||||
int i;
|
||||
static const unsigned int argb_masks[4] =
|
||||
{ 0xff0000, 0xff00, 0xff, 0xff000000 };
|
||||
static const unsigned int rgb_masks[4] = { 0xff0000, 0xff00, 0xff, 0 };
|
||||
|
||||
drv->API.CreateWindowSurface = dri2_create_window_surface;
|
||||
drv->API.CreatePixmapSurface = dri2_create_pixmap_surface;
|
||||
drv->API.DestroySurface = dri2_destroy_surface;
|
||||
drv->API.SwapBuffers = dri2_swap_buffers;
|
||||
drv->API.CreateImageKHR = dri2_wayland_create_image_khr;
|
||||
drv->API.Terminate = dri2_terminate;
|
||||
|
||||
dri2_dpy = malloc(sizeof *dri2_dpy);
|
||||
@@ -746,19 +829,22 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
dri2_dpy->wl_dpy = disp->PlatformDisplay;
|
||||
}
|
||||
|
||||
dri2_dpy->wl_queue = wl_display_create_queue(dri2_dpy->wl_dpy);
|
||||
dri2_dpy->wl_registry = wl_display_get_registry(dri2_dpy->wl_dpy);
|
||||
wl_proxy_set_queue((struct wl_proxy *) dri2_dpy->wl_registry,
|
||||
dri2_dpy->wl_queue);
|
||||
wl_registry_add_listener(dri2_dpy->wl_registry,
|
||||
®istry_listener, dri2_dpy);
|
||||
if (roundtrip(dri2_dpy) < 0 || dri2_dpy->wl_drm == NULL)
|
||||
id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
|
||||
if (id == 0)
|
||||
wl_display_roundtrip(dri2_dpy->wl_dpy);
|
||||
id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
|
||||
if (id == 0)
|
||||
goto cleanup_dpy;
|
||||
|
||||
if (roundtrip(dri2_dpy) < 0 || dri2_dpy->fd == -1)
|
||||
dri2_dpy->wl_drm = wl_display_bind(dri2_dpy->wl_dpy, id, &wl_drm_interface);
|
||||
if (!dri2_dpy->wl_drm)
|
||||
goto cleanup_dpy;
|
||||
wl_drm_add_listener(dri2_dpy->wl_drm, &drm_listener, dri2_dpy);
|
||||
wl_display_roundtrip(dri2_dpy->wl_dpy);
|
||||
if (dri2_dpy->fd == -1)
|
||||
goto cleanup_drm;
|
||||
|
||||
if (roundtrip(dri2_dpy) < 0 || !dri2_dpy->authenticated)
|
||||
wl_display_roundtrip(dri2_dpy->wl_dpy);
|
||||
if (!dri2_dpy->authenticated)
|
||||
goto cleanup_fd;
|
||||
|
||||
dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd);
|
||||
@@ -785,7 +871,7 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
if (!dri2_create_screen(disp))
|
||||
goto cleanup_driver;
|
||||
|
||||
types = EGL_WINDOW_BIT;
|
||||
types = EGL_WINDOW_BIT | EGL_PIXMAP_BIT;
|
||||
for (i = 0; dri2_dpy->driver_configs[i]; i++) {
|
||||
config = dri2_dpy->driver_configs[i];
|
||||
if (dri2_dpy->formats & HAS_XRGB8888)
|
||||
@@ -794,6 +880,8 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
dri2_add_config(disp, config, i + 1, 0, types, NULL, argb_masks);
|
||||
}
|
||||
|
||||
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
|
||||
|
||||
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
|
||||
dri2_dpy->authenticate = dri2_wayland_authenticate;
|
||||
|
||||
|
@@ -778,9 +778,10 @@ dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
|
||||
if (numRects > (int)ARRAY_SIZE(rectangles))
|
||||
return dri2_copy_region(drv, disp, draw, dri2_surf->region);
|
||||
|
||||
/* FIXME: Invert y here? */
|
||||
for (i = 0; i < numRects; i++) {
|
||||
rectangles[i].x = rects[i * 4];
|
||||
rectangles[i].y = dri2_surf->base.Height - rects[i * 4 + 1] - rects[i * 4 + 3];
|
||||
rectangles[i].y = rects[i * 4 + 1];
|
||||
rectangles[i].width = rects[i * 4 + 2];
|
||||
rectangles[i].height = rects[i * 4 + 3];
|
||||
}
|
||||
@@ -797,7 +798,7 @@ static EGLBoolean
|
||||
dri2_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
|
||||
EGLint x, EGLint y, EGLint width, EGLint height)
|
||||
{
|
||||
const EGLint rect[4] = { x, y, width, height };
|
||||
const EGLint rect[4] = { x, draw->Height - y - height, width, height };
|
||||
|
||||
if (x < 0 || y < 0 || width < 0 || height < 0)
|
||||
_eglError(EGL_BAD_PARAMETER, "eglPostSubBufferNV");
|
||||
|
@@ -19,7 +19,7 @@
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
|
||||
GLAPI_LIB = ../mapi/glapi/libglapi.la
|
||||
GLAPI_LIB = ../mapi/glapi/libglapi.a
|
||||
|
||||
if HAVE_XF86VIDMODE
|
||||
EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE
|
||||
|
@@ -427,7 +427,9 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list,
|
||||
|
||||
if (!config) {
|
||||
/* config may be NULL if surfaceless */
|
||||
if (!disp->Extensions.KHR_surfaceless_context)
|
||||
if (!disp->Extensions.KHR_surfaceless_gles1 &&
|
||||
!disp->Extensions.KHR_surfaceless_gles2 &&
|
||||
!disp->Extensions.KHR_surfaceless_opengl)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_CONFIG, EGL_NO_CONTEXT);
|
||||
}
|
||||
|
||||
@@ -485,7 +487,9 @@ eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read,
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE);
|
||||
if (!draw_surf || !read_surf) {
|
||||
/* surfaces may be NULL if surfaceless */
|
||||
if (!disp->Extensions.KHR_surfaceless_context)
|
||||
if (!disp->Extensions.KHR_surfaceless_gles1 &&
|
||||
!disp->Extensions.KHR_surfaceless_gles2 &&
|
||||
!disp->Extensions.KHR_surfaceless_opengl)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
|
||||
|
||||
if ((!draw_surf && draw != EGL_NO_SURFACE) ||
|
||||
@@ -936,7 +940,6 @@ eglGetProcAddress(const char *procname)
|
||||
#ifdef EGL_WL_bind_wayland_display
|
||||
{ "eglBindWaylandDisplayWL", (_EGLProc) eglBindWaylandDisplayWL },
|
||||
{ "eglUnbindWaylandDisplayWL", (_EGLProc) eglUnbindWaylandDisplayWL },
|
||||
{ "eglQueryWaylandBufferWL", (_EGLProc) eglQueryWaylandBufferWL },
|
||||
#endif
|
||||
{ "eglPostSubBufferNV", (_EGLProc) eglPostSubBufferNV },
|
||||
{ NULL, NULL }
|
||||
@@ -1537,25 +1540,6 @@ eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
|
||||
|
||||
RETURN_EGL_EVAL(disp, ret);
|
||||
}
|
||||
|
||||
EGLBoolean EGLAPIENTRY
|
||||
eglQueryWaylandBufferWL(EGLDisplay dpy,struct wl_buffer *buffer,
|
||||
EGLint attribute, EGLint *value)
|
||||
{
|
||||
_EGLDisplay *disp = _eglLockDisplay(dpy);
|
||||
_EGLDriver *drv;
|
||||
EGLBoolean ret;
|
||||
|
||||
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
|
||||
assert(disp->Extensions.WL_bind_wayland_display);
|
||||
|
||||
if (!buffer)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
|
||||
|
||||
ret = drv->API.QueryWaylandBufferWL(drv, disp, buffer, attribute, value);
|
||||
|
||||
RETURN_EGL_EVAL(disp, ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
@@ -123,7 +123,6 @@ typedef EGLBoolean (*ExportDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, _
|
||||
struct wl_display;
|
||||
typedef EGLBoolean (*BindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display);
|
||||
typedef EGLBoolean (*UnbindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display);
|
||||
typedef EGLBoolean (*QueryWaylandBufferWL_t)(_EGLDriver *drv, _EGLDisplay *displ, struct wl_buffer *buffer, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
|
||||
typedef EGLBoolean (*PostSubBufferNV_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface, EGLint x, EGLint y, EGLint width, EGLint height);
|
||||
@@ -200,7 +199,6 @@ struct _egl_api
|
||||
#ifdef EGL_WL_bind_wayland_display
|
||||
BindWaylandDisplayWL_t BindWaylandDisplayWL;
|
||||
UnbindWaylandDisplayWL_t UnbindWaylandDisplayWL;
|
||||
QueryWaylandBufferWL_t QueryWaylandBufferWL;
|
||||
#endif
|
||||
|
||||
PostSubBufferNV_t PostSubBufferNV;
|
||||
|
@@ -49,12 +49,11 @@ _eglGetContextAPIBit(_EGLContext *ctx)
|
||||
|
||||
switch (ctx->ClientAPI) {
|
||||
case EGL_OPENGL_ES_API:
|
||||
switch (ctx->ClientMajorVersion) {
|
||||
switch (ctx->ClientVersion) {
|
||||
case 1:
|
||||
bit = EGL_OPENGL_ES_BIT;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
bit = EGL_OPENGL_ES2_BIT;
|
||||
break;
|
||||
default:
|
||||
@@ -79,8 +78,7 @@ _eglGetContextAPIBit(_EGLContext *ctx)
|
||||
* Parse the list of context attributes and return the proper error code.
|
||||
*/
|
||||
static EGLint
|
||||
_eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
const EGLint *attrib_list)
|
||||
_eglParseContextAttribList(_EGLContext *ctx, const EGLint *attrib_list)
|
||||
{
|
||||
EGLenum api = ctx->ClientAPI;
|
||||
EGLint i, err = EGL_SUCCESS;
|
||||
@@ -88,113 +86,22 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
if (!attrib_list)
|
||||
return EGL_SUCCESS;
|
||||
|
||||
if (api == EGL_OPENVG_API && attrib_list[0] != EGL_NONE) {
|
||||
_eglLog(_EGL_DEBUG, "bad context attribute 0x%04x", attrib_list[0]);
|
||||
return EGL_BAD_ATTRIBUTE;
|
||||
}
|
||||
|
||||
for (i = 0; attrib_list[i] != EGL_NONE; i++) {
|
||||
EGLint attr = attrib_list[i++];
|
||||
EGLint val = attrib_list[i];
|
||||
|
||||
switch (attr) {
|
||||
case EGL_CONTEXT_CLIENT_VERSION:
|
||||
ctx->ClientMajorVersion = val;
|
||||
if (api != EGL_OPENGL_ES_API) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
if (val != 1 && val != 2) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
ctx->ClientVersion = val;
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_MINOR_VERSION_KHR:
|
||||
if (!dpy->Extensions.KHR_create_context) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
|
||||
ctx->ClientMinorVersion = val;
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_FLAGS_KHR:
|
||||
if (!dpy->Extensions.KHR_create_context) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* The EGL_KHR_create_context spec says:
|
||||
*
|
||||
* "Flags are only defined for OpenGL context creation, and
|
||||
* specifying a flags value other than zero for other types of
|
||||
* contexts, including OpenGL ES contexts, will generate an
|
||||
* error."
|
||||
*/
|
||||
if (api != EGL_OPENGL_API && val != 0) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
|
||||
ctx->Flags = val;
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR:
|
||||
if (!dpy->Extensions.KHR_create_context) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* The EGL_KHR_create_context spec says:
|
||||
*
|
||||
* "[EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR] is only meaningful for
|
||||
* OpenGL contexts, and specifying it for other types of
|
||||
* contexts, including OpenGL ES contexts, will generate an
|
||||
* error."
|
||||
*/
|
||||
if (api != EGL_OPENGL_API) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
|
||||
ctx->Profile = val;
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR:
|
||||
/* The EGL_KHR_create_context spec says:
|
||||
*
|
||||
* "[EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR] is only
|
||||
* meaningful for OpenGL contexts, and specifying it for other
|
||||
* types of contexts, including OpenGL ES contexts, will generate
|
||||
* an error."
|
||||
*/
|
||||
if (!dpy->Extensions.KHR_create_context
|
||||
|| api != EGL_OPENGL_API) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
|
||||
ctx->ResetNotificationStrategy = val;
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT:
|
||||
/* The EGL_EXT_create_context_robustness spec says:
|
||||
*
|
||||
* "[EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT] is only
|
||||
* meaningful for OpenGL ES contexts, and specifying it for other
|
||||
* types of contexts will generate an EGL_BAD_ATTRIBUTE error."
|
||||
*/
|
||||
if (!dpy->Extensions.EXT_create_context_robustness
|
||||
|| api != EGL_OPENGL_ES_API) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
|
||||
ctx->ResetNotificationStrategy = val;
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT:
|
||||
if (!dpy->Extensions.EXT_create_context_robustness) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
|
||||
ctx->Flags = EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR;
|
||||
break;
|
||||
|
||||
default:
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
@@ -206,144 +113,6 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
}
|
||||
}
|
||||
|
||||
if (api == EGL_OPENGL_API) {
|
||||
/* The EGL_KHR_create_context spec says:
|
||||
*
|
||||
* "If the requested OpenGL version is less than 3.2,
|
||||
* EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR is ignored and the
|
||||
* functionality of the context is determined solely by the
|
||||
* requested version."
|
||||
*
|
||||
* Since the value is ignored, only validate the setting if the version
|
||||
* is >= 3.2.
|
||||
*/
|
||||
if (ctx->ClientMajorVersion >= 4
|
||||
|| (ctx->ClientMajorVersion == 3 && ctx->ClientMinorVersion >= 2)) {
|
||||
switch (ctx->Profile) {
|
||||
case EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR:
|
||||
case EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR:
|
||||
break;
|
||||
|
||||
default:
|
||||
/* The EGL_KHR_create_context spec says:
|
||||
*
|
||||
* "* If an OpenGL context is requested, the requested version
|
||||
* is greater than 3.2, and the value for attribute
|
||||
* EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR has no bits set; has
|
||||
* any bits set other than EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR
|
||||
* and EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR; has
|
||||
* more than one of these bits set; or if the implementation does
|
||||
* not support the requested profile, then an EGL_BAD_MATCH error
|
||||
* is generated."
|
||||
*/
|
||||
err = EGL_BAD_MATCH;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* The EGL_KHR_create_context spec says:
|
||||
*
|
||||
* "* If an OpenGL context is requested and the values for
|
||||
* attributes EGL_CONTEXT_MAJOR_VERSION_KHR and
|
||||
* EGL_CONTEXT_MINOR_VERSION_KHR, when considered together with
|
||||
* the value for attribute
|
||||
* EGL_CONTEXT_FORWARD_COMPATIBLE_BIT_KHR, specify an OpenGL
|
||||
* version and feature set that are not defined, than an
|
||||
* EGL_BAD_MATCH error is generated.
|
||||
*
|
||||
* ... Thus, examples of invalid combinations of attributes
|
||||
* include:
|
||||
*
|
||||
* - Major version < 1 or > 4
|
||||
* - Major version == 1 and minor version < 0 or > 5
|
||||
* - Major version == 2 and minor version < 0 or > 1
|
||||
* - Major version == 3 and minor version < 0 or > 2
|
||||
* - Major version == 4 and minor version < 0 or > 2
|
||||
* - Forward-compatible flag set and major version < 3"
|
||||
*/
|
||||
if (ctx->ClientMajorVersion < 1 || ctx->ClientMinorVersion < 0)
|
||||
err = EGL_BAD_MATCH;
|
||||
|
||||
switch (ctx->ClientMajorVersion) {
|
||||
case 1:
|
||||
if (ctx->ClientMinorVersion > 5
|
||||
|| (ctx->Flags & EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR) != 0)
|
||||
err = EGL_BAD_MATCH;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (ctx->ClientMinorVersion > 1
|
||||
|| (ctx->Flags & EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR) != 0)
|
||||
err = EGL_BAD_MATCH;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
/* Note: The text above is incorrect. There *is* an OpenGL 3.3!
|
||||
*/
|
||||
if (ctx->ClientMinorVersion > 3)
|
||||
err = EGL_BAD_MATCH;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
default:
|
||||
/* Don't put additional version checks here. We don't know that
|
||||
* there won't be versions > 4.2.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
} else if (api == EGL_OPENGL_ES_API) {
|
||||
/* The EGL_KHR_create_context spec says:
|
||||
*
|
||||
* "* If an OpenGL ES context is requested and the values for
|
||||
* attributes EGL_CONTEXT_MAJOR_VERSION_KHR and
|
||||
* EGL_CONTEXT_MINOR_VERSION_KHR specify an OpenGL ES version that
|
||||
* is not defined, than an EGL_BAD_MATCH error is generated.
|
||||
*
|
||||
* ... Examples of invalid combinations of attributes include:
|
||||
*
|
||||
* - Major version < 1 or > 2
|
||||
* - Major version == 1 and minor version < 0 or > 1
|
||||
* - Major version == 2 and minor version != 0
|
||||
*/
|
||||
if (ctx->ClientMajorVersion < 1 || ctx->ClientMinorVersion < 0)
|
||||
err = EGL_BAD_MATCH;
|
||||
|
||||
switch (ctx->ClientMajorVersion) {
|
||||
case 1:
|
||||
if (ctx->ClientMinorVersion > 1)
|
||||
err = EGL_BAD_MATCH;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (ctx->ClientMinorVersion > 0)
|
||||
err = EGL_BAD_MATCH;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
default:
|
||||
/* Don't put additional version checks here. We don't know that
|
||||
* there won't be versions > 3.0.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (ctx->ResetNotificationStrategy) {
|
||||
case EGL_NO_RESET_NOTIFICATION_KHR:
|
||||
case EGL_LOSE_CONTEXT_ON_RESET_KHR:
|
||||
break;
|
||||
|
||||
default:
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((ctx->Flags & ~(EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR
|
||||
| EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR
|
||||
| EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR)) != 0) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -368,15 +137,10 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
|
||||
ctx->ClientAPI = api;
|
||||
ctx->Config = conf;
|
||||
ctx->WindowRenderBuffer = EGL_NONE;
|
||||
ctx->Profile = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
|
||||
|
||||
ctx->ClientMajorVersion = 1; /* the default, per EGL spec */
|
||||
ctx->ClientMinorVersion = 0;
|
||||
ctx->Flags = 0;
|
||||
ctx->Profile = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
|
||||
ctx->ResetNotificationStrategy = EGL_NO_RESET_NOTIFICATION_KHR;
|
||||
ctx->ClientVersion = 1; /* the default, per EGL spec */
|
||||
|
||||
err = _eglParseContextAttribList(ctx, dpy, attrib_list);
|
||||
err = _eglParseContextAttribList(ctx, attrib_list);
|
||||
if (err == EGL_SUCCESS && ctx->Config) {
|
||||
EGLint api_bit;
|
||||
|
||||
@@ -427,7 +191,7 @@ _eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *c,
|
||||
*value = c->Config->ConfigID;
|
||||
break;
|
||||
case EGL_CONTEXT_CLIENT_VERSION:
|
||||
*value = c->ClientMajorVersion;
|
||||
*value = c->ClientVersion;
|
||||
break;
|
||||
case EGL_CONTEXT_CLIENT_TYPE:
|
||||
*value = c->ClientAPI;
|
||||
@@ -480,6 +244,7 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
|
||||
_EGLThreadInfo *t = _eglGetCurrentThread();
|
||||
_EGLDisplay *dpy;
|
||||
EGLint conflict_api;
|
||||
EGLBoolean surfaceless;
|
||||
|
||||
if (_eglIsCurrentThreadDummy())
|
||||
return _eglError(EGL_BAD_ALLOC, "eglMakeCurrent");
|
||||
@@ -492,8 +257,22 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
|
||||
}
|
||||
|
||||
dpy = ctx->Resource.Display;
|
||||
if (!dpy->Extensions.KHR_surfaceless_context
|
||||
&& (draw == NULL || read == NULL))
|
||||
switch (_eglGetContextAPIBit(ctx)) {
|
||||
case EGL_OPENGL_ES_BIT:
|
||||
surfaceless = dpy->Extensions.KHR_surfaceless_gles1;
|
||||
break;
|
||||
case EGL_OPENGL_ES2_BIT:
|
||||
surfaceless = dpy->Extensions.KHR_surfaceless_gles2;
|
||||
break;
|
||||
case EGL_OPENGL_BIT:
|
||||
surfaceless = dpy->Extensions.KHR_surfaceless_opengl;
|
||||
break;
|
||||
default:
|
||||
surfaceless = EGL_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!surfaceless && (draw == NULL || read == NULL))
|
||||
return _eglError(EGL_BAD_MATCH, "eglMakeCurrent");
|
||||
|
||||
/*
|
||||
|
@@ -52,11 +52,7 @@ struct _egl_context
|
||||
_EGLConfig *Config;
|
||||
|
||||
EGLint ClientAPI; /**< EGL_OPENGL_ES_API, EGL_OPENGL_API, EGL_OPENVG_API */
|
||||
EGLint ClientMajorVersion;
|
||||
EGLint ClientMinorVersion;
|
||||
EGLint Flags;
|
||||
EGLint Profile;
|
||||
EGLint ResetNotificationStrategy;
|
||||
EGLint ClientVersion; /**< 1 = OpenGLES 1.x, 2 = OpenGLES 2.x */
|
||||
|
||||
/* The real render buffer when a window surface is bound */
|
||||
EGLint WindowRenderBuffer;
|
||||
|
@@ -42,7 +42,7 @@
|
||||
static _EGLThreadInfo dummy_thread = _EGL_THREAD_INFO_INITIALIZER;
|
||||
|
||||
|
||||
#if HAVE_PTHREAD
|
||||
#if PTHREADS
|
||||
#include <pthread.h>
|
||||
|
||||
static _EGL_DECLARE_MUTEX(_egl_TSDMutex);
|
||||
@@ -108,7 +108,7 @@ static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
#else /* HAVE_PTHREAD */
|
||||
#else /* PTHREADS */
|
||||
static const _EGLThreadInfo *_egl_TSD;
|
||||
static void (*_egl_FreeTSD)(_EGLThreadInfo *);
|
||||
|
||||
@@ -137,7 +137,7 @@ static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
#endif /* !HAVE_PTHREAD */
|
||||
#endif /* !PTHREADS */
|
||||
|
||||
|
||||
static void
|
||||
|
@@ -103,8 +103,9 @@ struct _egl_extensions
|
||||
EGLBoolean KHR_reusable_sync;
|
||||
EGLBoolean KHR_fence_sync;
|
||||
|
||||
EGLBoolean KHR_surfaceless_context;
|
||||
EGLBoolean KHR_create_context;
|
||||
EGLBoolean KHR_surfaceless_gles1;
|
||||
EGLBoolean KHR_surfaceless_gles2;
|
||||
EGLBoolean KHR_surfaceless_opengl;
|
||||
|
||||
EGLBoolean NOK_swap_region;
|
||||
EGLBoolean NOK_texture_from_pixmap;
|
||||
@@ -112,8 +113,6 @@ struct _egl_extensions
|
||||
EGLBoolean ANDROID_image_native_buffer;
|
||||
|
||||
EGLBoolean NV_post_sub_buffer;
|
||||
|
||||
EGLBoolean EXT_create_context_robustness;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -88,11 +88,6 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
attrs->DRMBufferStrideMESA = val;
|
||||
break;
|
||||
|
||||
/* EGL_WL_bind_wayland_display */
|
||||
case EGL_WAYLAND_PLANE_WL:
|
||||
attrs->PlaneWL = val;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* unknown attrs are ignored */
|
||||
break;
|
||||
|
@@ -50,9 +50,6 @@ struct _egl_image_attribs
|
||||
EGLint DRMBufferFormatMESA;
|
||||
EGLint DRMBufferUseMESA;
|
||||
EGLint DRMBufferStrideMESA;
|
||||
|
||||
/* EGL_WL_bind_wayland_display */
|
||||
EGLint PlaneWL;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -107,16 +107,15 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
|
||||
_EGL_CHECK_EXTENSION(KHR_reusable_sync);
|
||||
_EGL_CHECK_EXTENSION(KHR_fence_sync);
|
||||
|
||||
_EGL_CHECK_EXTENSION(KHR_surfaceless_context);
|
||||
_EGL_CHECK_EXTENSION(KHR_create_context);
|
||||
_EGL_CHECK_EXTENSION(KHR_surfaceless_gles1);
|
||||
_EGL_CHECK_EXTENSION(KHR_surfaceless_gles2);
|
||||
_EGL_CHECK_EXTENSION(KHR_surfaceless_opengl);
|
||||
|
||||
_EGL_CHECK_EXTENSION(NOK_swap_region);
|
||||
_EGL_CHECK_EXTENSION(NOK_texture_from_pixmap);
|
||||
|
||||
_EGL_CHECK_EXTENSION(ANDROID_image_native_buffer);
|
||||
|
||||
_EGL_CHECK_EXTENSION(EXT_create_context_robustness);
|
||||
|
||||
_EGL_CHECK_EXTENSION(NV_post_sub_buffer);
|
||||
#undef _EGL_CHECK_EXTENSION
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@
|
||||
|
||||
#include "eglcompiler.h"
|
||||
|
||||
#ifdef HAVE_PTHREAD
|
||||
#ifdef PTHREADS
|
||||
#include <pthread.h>
|
||||
|
||||
typedef pthread_mutex_t _EGLMutex;
|
||||
|
@@ -12,11 +12,4 @@ BUILT_SOURCES = wayland-drm-protocol.c \
|
||||
wayland-drm-server-protocol.h
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
%-protocol.c : %.xml
|
||||
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
|
||||
|
||||
%-server-protocol.h : %.xml
|
||||
$(AM_V_GEN)$(WAYLAND_SCANNER) server-header < $< > $@
|
||||
|
||||
%-client-protocol.h : %.xml
|
||||
$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
|
||||
@wayland_scanner_rules@
|
||||
|
@@ -119,22 +119,6 @@
|
||||
<arg name="format" type="uint"/>
|
||||
</request>
|
||||
|
||||
<!-- Create a wayland buffer for the named DRM buffer. The DRM
|
||||
surface must have a name using the flink ioctl -->
|
||||
<request name="create_planar_buffer">
|
||||
<arg name="id" type="new_id" interface="wl_buffer"/>
|
||||
<arg name="name" type="uint"/>
|
||||
<arg name="width" type="int"/>
|
||||
<arg name="height" type="int"/>
|
||||
<arg name="format" type="uint"/>
|
||||
<arg name="offset0" type="int"/>
|
||||
<arg name="stride0" type="int"/>
|
||||
<arg name="offset1" type="int"/>
|
||||
<arg name="stride1" type="int"/>
|
||||
<arg name="offset2" type="int"/>
|
||||
<arg name="stride2" type="int"/>
|
||||
</request>
|
||||
|
||||
<!-- Notification of the path of the drm device which is used by
|
||||
the server. The client should use this device for creating
|
||||
local buffers. Only buffers created from this device should
|
@@ -36,6 +36,17 @@
|
||||
#include "wayland-drm.h"
|
||||
#include "wayland-drm-server-protocol.h"
|
||||
|
||||
/* Git master of Wayland is moving towards a stable version of the
|
||||
* protocol, but breaking from 0.85 in the process. For the time
|
||||
* being, it's convenient to be able to build Mesa against both master
|
||||
* and 0.85.x of Wayland. To make this work we'll do a compile-time
|
||||
* version check and work around the difference in API and protocol */
|
||||
#if defined (WAYLAND_VERSION_MAJOR) && \
|
||||
WAYLAND_VERSION_MAJOR == 0 && \
|
||||
WAYLAND_VERSION_MINOR == 85
|
||||
#define HAS_WAYLAND_0_85
|
||||
#endif
|
||||
|
||||
struct wl_drm {
|
||||
struct wl_display *display;
|
||||
|
||||
@@ -45,37 +56,69 @@ struct wl_drm {
|
||||
struct wayland_drm_callbacks *callbacks;
|
||||
};
|
||||
|
||||
struct wl_drm_buffer {
|
||||
struct wl_buffer buffer;
|
||||
struct wl_drm *drm;
|
||||
uint32_t format;
|
||||
|
||||
void *driver_buffer;
|
||||
};
|
||||
|
||||
static void
|
||||
destroy_buffer(struct wl_resource *resource)
|
||||
{
|
||||
struct wl_drm_buffer *buffer = resource->data;
|
||||
struct wl_drm *drm = buffer->drm;
|
||||
|
||||
drm->callbacks->release_buffer(drm->user_data, buffer);
|
||||
drm->callbacks->release_buffer(drm->user_data,
|
||||
buffer->driver_buffer);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
static void
|
||||
buffer_destroy(struct wl_client *client, struct wl_resource *resource)
|
||||
{
|
||||
#ifdef HAS_WAYLAND_0_85
|
||||
wl_resource_destroy(resource, 0);
|
||||
#else
|
||||
wl_resource_destroy(resource);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAS_WAYLAND_0_85
|
||||
static void
|
||||
buffer_damage(struct wl_client *client, struct wl_resource *buffer,
|
||||
int32_t x, int32_t y, int32_t width, int32_t height)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
const static struct wl_buffer_interface drm_buffer_interface = {
|
||||
#ifdef HAS_WAYLAND_0_85
|
||||
buffer_damage,
|
||||
#endif
|
||||
buffer_destroy
|
||||
};
|
||||
|
||||
static void
|
||||
create_buffer(struct wl_client *client, struct wl_resource *resource,
|
||||
uint32_t id, uint32_t name, int32_t width, int32_t height,
|
||||
uint32_t format,
|
||||
int32_t offset0, int32_t stride0,
|
||||
int32_t offset1, int32_t stride1,
|
||||
int32_t offset2, int32_t stride2)
|
||||
drm_create_buffer(struct wl_client *client, struct wl_resource *resource,
|
||||
uint32_t id, uint32_t name, int32_t width, int32_t height,
|
||||
uint32_t stride, uint32_t format)
|
||||
{
|
||||
struct wl_drm *drm = resource->data;
|
||||
struct wl_drm_buffer *buffer;
|
||||
|
||||
switch (format) {
|
||||
case WL_DRM_FORMAT_ARGB8888:
|
||||
case WL_DRM_FORMAT_XRGB8888:
|
||||
break;
|
||||
default:
|
||||
wl_resource_post_error(resource,
|
||||
WL_DRM_ERROR_INVALID_FORMAT,
|
||||
"invalid format");
|
||||
return;
|
||||
}
|
||||
|
||||
buffer = calloc(1, sizeof *buffer);
|
||||
if (buffer == NULL) {
|
||||
wl_resource_post_no_memory(resource);
|
||||
@@ -86,14 +129,12 @@ create_buffer(struct wl_client *client, struct wl_resource *resource,
|
||||
buffer->buffer.width = width;
|
||||
buffer->buffer.height = height;
|
||||
buffer->format = format;
|
||||
buffer->offset[0] = offset0;
|
||||
buffer->stride[0] = stride0;
|
||||
buffer->offset[1] = offset1;
|
||||
buffer->stride[1] = stride1;
|
||||
buffer->offset[2] = offset2;
|
||||
buffer->stride[2] = stride2;
|
||||
|
||||
drm->callbacks->reference_buffer(drm->user_data, name, buffer);
|
||||
buffer->driver_buffer =
|
||||
drm->callbacks->reference_buffer(drm->user_data, name,
|
||||
width, height,
|
||||
stride, format);
|
||||
|
||||
if (buffer->driver_buffer == NULL) {
|
||||
wl_resource_post_error(resource,
|
||||
WL_DRM_ERROR_INVALID_NAME,
|
||||
@@ -113,56 +154,6 @@ create_buffer(struct wl_client *client, struct wl_resource *resource,
|
||||
wl_client_add_resource(resource->client, &buffer->buffer.resource);
|
||||
}
|
||||
|
||||
static void
|
||||
drm_create_buffer(struct wl_client *client, struct wl_resource *resource,
|
||||
uint32_t id, uint32_t name, int32_t width, int32_t height,
|
||||
uint32_t stride, uint32_t format)
|
||||
{
|
||||
switch (format) {
|
||||
case WL_DRM_FORMAT_ARGB8888:
|
||||
case WL_DRM_FORMAT_XRGB8888:
|
||||
case WL_DRM_FORMAT_YUYV:
|
||||
break;
|
||||
default:
|
||||
wl_resource_post_error(resource,
|
||||
WL_DRM_ERROR_INVALID_FORMAT,
|
||||
"invalid format");
|
||||
return;
|
||||
}
|
||||
|
||||
create_buffer(client, resource, id,
|
||||
name, width, height, format, 0, stride, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
drm_create_planar_buffer(struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
uint32_t id, uint32_t name,
|
||||
int32_t width, int32_t height, uint32_t format,
|
||||
int32_t offset0, int32_t stride0,
|
||||
int32_t offset1, int32_t stride1,
|
||||
int32_t offset2, int32_t stride2)
|
||||
{
|
||||
switch (format) {
|
||||
case WL_DRM_FORMAT_YUV410:
|
||||
case WL_DRM_FORMAT_YUV411:
|
||||
case WL_DRM_FORMAT_YUV420:
|
||||
case WL_DRM_FORMAT_YUV422:
|
||||
case WL_DRM_FORMAT_YUV444:
|
||||
case WL_DRM_FORMAT_NV12:
|
||||
case WL_DRM_FORMAT_NV16:
|
||||
break;
|
||||
default:
|
||||
wl_resource_post_error(resource,
|
||||
WL_DRM_ERROR_INVALID_FORMAT,
|
||||
"invalid format");
|
||||
return;
|
||||
}
|
||||
|
||||
create_buffer(client, resource, id, name, width, height, format,
|
||||
offset0, stride0, offset1, stride1, offset2, stride2);
|
||||
}
|
||||
|
||||
static void
|
||||
drm_authenticate(struct wl_client *client,
|
||||
struct wl_resource *resource, uint32_t id)
|
||||
@@ -179,8 +170,7 @@ drm_authenticate(struct wl_client *client,
|
||||
|
||||
const static struct wl_drm_interface drm_interface = {
|
||||
drm_authenticate,
|
||||
drm_create_buffer,
|
||||
drm_create_planar_buffer
|
||||
drm_create_buffer
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -196,14 +186,6 @@ bind_drm(struct wl_client *client, void *data, uint32_t version, uint32_t id)
|
||||
WL_DRM_FORMAT_ARGB8888);
|
||||
wl_resource_post_event(resource, WL_DRM_FORMAT,
|
||||
WL_DRM_FORMAT_XRGB8888);
|
||||
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUV410);
|
||||
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUV411);
|
||||
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUV420);
|
||||
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUV422);
|
||||
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUV444);
|
||||
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_NV12);
|
||||
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_NV16);
|
||||
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUYV);
|
||||
}
|
||||
|
||||
struct wl_drm *
|
||||
|
@@ -1,91 +1,22 @@
|
||||
#ifndef WAYLAND_DRM_H
|
||||
#define WAYLAND_DRM_H
|
||||
|
||||
#include <wayland-server.h>
|
||||
#include "egldisplay.h"
|
||||
#include "eglimage.h"
|
||||
|
||||
#ifndef WL_DRM_FORMAT_ENUM
|
||||
#define WL_DRM_FORMAT_ENUM
|
||||
enum wl_drm_format {
|
||||
WL_DRM_FORMAT_C8 = 0x20203843,
|
||||
WL_DRM_FORMAT_RGB332 = 0x38424752,
|
||||
WL_DRM_FORMAT_BGR233 = 0x38524742,
|
||||
WL_DRM_FORMAT_XRGB4444 = 0x32315258,
|
||||
WL_DRM_FORMAT_XBGR4444 = 0x32314258,
|
||||
WL_DRM_FORMAT_RGBX4444 = 0x32315852,
|
||||
WL_DRM_FORMAT_BGRX4444 = 0x32315842,
|
||||
WL_DRM_FORMAT_ARGB4444 = 0x32315241,
|
||||
WL_DRM_FORMAT_ABGR4444 = 0x32314241,
|
||||
WL_DRM_FORMAT_RGBA4444 = 0x32314152,
|
||||
WL_DRM_FORMAT_BGRA4444 = 0x32314142,
|
||||
WL_DRM_FORMAT_XRGB1555 = 0x35315258,
|
||||
WL_DRM_FORMAT_XBGR1555 = 0x35314258,
|
||||
WL_DRM_FORMAT_RGBX5551 = 0x35315852,
|
||||
WL_DRM_FORMAT_BGRX5551 = 0x35315842,
|
||||
WL_DRM_FORMAT_ARGB1555 = 0x35315241,
|
||||
WL_DRM_FORMAT_ABGR1555 = 0x35314241,
|
||||
WL_DRM_FORMAT_RGBA5551 = 0x35314152,
|
||||
WL_DRM_FORMAT_BGRA5551 = 0x35314142,
|
||||
WL_DRM_FORMAT_RGB565 = 0x36314752,
|
||||
WL_DRM_FORMAT_BGR565 = 0x36314742,
|
||||
WL_DRM_FORMAT_RGB888 = 0x34324752,
|
||||
WL_DRM_FORMAT_BGR888 = 0x34324742,
|
||||
WL_DRM_FORMAT_XRGB8888 = 0x34325258,
|
||||
WL_DRM_FORMAT_XBGR8888 = 0x34324258,
|
||||
WL_DRM_FORMAT_RGBX8888 = 0x34325852,
|
||||
WL_DRM_FORMAT_BGRX8888 = 0x34325842,
|
||||
WL_DRM_FORMAT_ARGB8888 = 0x34325241,
|
||||
WL_DRM_FORMAT_ABGR8888 = 0x34324241,
|
||||
WL_DRM_FORMAT_RGBA8888 = 0x34324152,
|
||||
WL_DRM_FORMAT_BGRA8888 = 0x34324142,
|
||||
WL_DRM_FORMAT_XRGB2101010 = 0x30335258,
|
||||
WL_DRM_FORMAT_XBGR2101010 = 0x30334258,
|
||||
WL_DRM_FORMAT_RGBX1010102 = 0x30335852,
|
||||
WL_DRM_FORMAT_BGRX1010102 = 0x30335842,
|
||||
WL_DRM_FORMAT_ARGB2101010 = 0x30335241,
|
||||
WL_DRM_FORMAT_ABGR2101010 = 0x30334241,
|
||||
WL_DRM_FORMAT_RGBA1010102 = 0x30334152,
|
||||
WL_DRM_FORMAT_BGRA1010102 = 0x30334142,
|
||||
WL_DRM_FORMAT_YUYV = 0x56595559,
|
||||
WL_DRM_FORMAT_YVYU = 0x55595659,
|
||||
WL_DRM_FORMAT_UYVY = 0x59565955,
|
||||
WL_DRM_FORMAT_VYUY = 0x59555956,
|
||||
WL_DRM_FORMAT_AYUV = 0x56555941,
|
||||
WL_DRM_FORMAT_NV12 = 0x3231564e,
|
||||
WL_DRM_FORMAT_NV21 = 0x3132564e,
|
||||
WL_DRM_FORMAT_NV16 = 0x3631564e,
|
||||
WL_DRM_FORMAT_NV61 = 0x3136564e,
|
||||
WL_DRM_FORMAT_YUV410 = 0x39565559,
|
||||
WL_DRM_FORMAT_YVU410 = 0x39555659,
|
||||
WL_DRM_FORMAT_YUV411 = 0x31315559,
|
||||
WL_DRM_FORMAT_YVU411 = 0x31315659,
|
||||
WL_DRM_FORMAT_YUV420 = 0x32315559,
|
||||
WL_DRM_FORMAT_YVU420 = 0x32315659,
|
||||
WL_DRM_FORMAT_YUV422 = 0x36315559,
|
||||
WL_DRM_FORMAT_YVU422 = 0x36315659,
|
||||
WL_DRM_FORMAT_YUV444 = 0x34325559,
|
||||
WL_DRM_FORMAT_YVU444 = 0x34325659,
|
||||
};
|
||||
#endif /* WL_DRM_FORMAT_ENUM */
|
||||
#include <wayland-server.h>
|
||||
#include "wayland-drm-server-protocol.h"
|
||||
|
||||
struct wl_drm;
|
||||
|
||||
struct wl_drm_buffer {
|
||||
struct wl_buffer buffer;
|
||||
struct wl_drm *drm;
|
||||
uint32_t format;
|
||||
const void *driver_format;
|
||||
int32_t offset[3];
|
||||
int32_t stride[3];
|
||||
void *driver_buffer;
|
||||
};
|
||||
|
||||
struct wayland_drm_callbacks {
|
||||
int (*authenticate)(void *user_data, uint32_t id);
|
||||
|
||||
void (*reference_buffer)(void *user_data, uint32_t name,
|
||||
struct wl_drm_buffer *buffer);
|
||||
void *(*reference_buffer)(void *user_data, uint32_t name,
|
||||
int32_t width, int32_t height,
|
||||
uint32_t stride, uint32_t format);
|
||||
|
||||
void (*release_buffer)(void *user_data, struct wl_drm_buffer *buffer);
|
||||
void (*release_buffer)(void *user_data, void *buffer);
|
||||
};
|
||||
|
||||
struct wl_drm *
|
||||
|
@@ -26,6 +26,17 @@ struct wl_egl_window {
|
||||
int attached_height;
|
||||
};
|
||||
|
||||
struct wl_egl_pixmap {
|
||||
struct wl_buffer *buffer;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
|
||||
void (*destroy) (struct wl_egl_pixmap *egl_pixmap);
|
||||
|
||||
void *driver_private;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -48,3 +48,36 @@ wl_egl_window_get_attached_size(struct wl_egl_window *egl_window,
|
||||
if (height)
|
||||
*height = egl_window->attached_height;
|
||||
}
|
||||
|
||||
WL_EGL_EXPORT struct wl_egl_pixmap *
|
||||
wl_egl_pixmap_create(int width, int height, uint32_t flags)
|
||||
{
|
||||
struct wl_egl_pixmap *egl_pixmap;
|
||||
|
||||
egl_pixmap = malloc(sizeof *egl_pixmap);
|
||||
if (egl_pixmap == NULL)
|
||||
return NULL;
|
||||
|
||||
egl_pixmap->width = width;
|
||||
egl_pixmap->height = height;
|
||||
|
||||
egl_pixmap->destroy = NULL;
|
||||
egl_pixmap->buffer = NULL;
|
||||
egl_pixmap->driver_private = NULL;
|
||||
|
||||
return egl_pixmap;
|
||||
}
|
||||
|
||||
WL_EGL_EXPORT void
|
||||
wl_egl_pixmap_destroy(struct wl_egl_pixmap *egl_pixmap)
|
||||
{
|
||||
if (egl_pixmap->destroy)
|
||||
egl_pixmap->destroy(egl_pixmap);
|
||||
free(egl_pixmap);
|
||||
}
|
||||
|
||||
WL_EGL_EXPORT struct wl_buffer *
|
||||
wl_egl_pixmap_create_buffer(struct wl_egl_pixmap *egl_pixmap)
|
||||
{
|
||||
return egl_pixmap->buffer;
|
||||
}
|
||||
|
@@ -44,7 +44,8 @@ $(LOCAL_GENERATED_SOURCES): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PYTHON) $^ > $@
|
||||
|
||||
$(intermediates)/indices/u_indices_gen.c \
|
||||
$(intermediates)/indices/u_unfilled_gen.c \
|
||||
$(intermediates)/util/u_format_srgb.c: $(intermediates)/%.c: $(LOCAL_PATH)/%.py
|
||||
$(intermediates)/util/u_format_srgb.c \
|
||||
$(intermediates)/util/u_half.c: $(intermediates)/%.c: $(LOCAL_PATH)/%.py
|
||||
$(transform-generated-source)
|
||||
|
||||
$(intermediates)/util/u_format_table.c: $(intermediates)/%.c: $(LOCAL_PATH)/%.py $(LOCAL_PATH)/util/u_format.csv
|
||||
|
@@ -39,4 +39,6 @@ util/u_format_srgb.c: util/u_format_srgb.py
|
||||
util/u_format_table.c: util/u_format_table.py util/u_format_pack.py util/u_format_parse.py util/u_format.csv
|
||||
$(PYTHON2) util/u_format_table.py util/u_format.csv > $@
|
||||
|
||||
util/u_half.c: util/u_half.py
|
||||
$(PYTHON2) util/u_half.py > $@
|
||||
# DO NOT DELETE
|
||||
|
@@ -155,7 +155,8 @@ GENERATED_SOURCES := \
|
||||
indices/u_indices_gen.c \
|
||||
indices/u_unfilled_gen.c \
|
||||
util/u_format_srgb.c \
|
||||
util/u_format_table.c
|
||||
util/u_format_table.c \
|
||||
util/u_half.c
|
||||
|
||||
GALLIVM_SOURCES := \
|
||||
gallivm/lp_bld_arit.c \
|
||||
@@ -165,7 +166,6 @@ GALLIVM_SOURCES := \
|
||||
gallivm/lp_bld_conv.c \
|
||||
gallivm/lp_bld_flow.c \
|
||||
gallivm/lp_bld_format_aos.c \
|
||||
gallivm/lp_bld_format_aos_array.c \
|
||||
gallivm/lp_bld_format_soa.c \
|
||||
gallivm/lp_bld_format_yuv.c \
|
||||
gallivm/lp_bld_gather.c \
|
||||
@@ -188,6 +188,7 @@ GALLIVM_SOURCES := \
|
||||
gallivm/lp_bld_type.c \
|
||||
draw/draw_llvm.c \
|
||||
draw/draw_llvm_sample.c \
|
||||
draw/draw_llvm_translate.c \
|
||||
draw/draw_vs_llvm.c \
|
||||
draw/draw_pt_fetch_shade_pipeline_llvm.c
|
||||
|
||||
|
@@ -35,6 +35,13 @@ env.CodeGenerate(
|
||||
command = python_cmd + ' $SCRIPT $SOURCE > $TARGET'
|
||||
)
|
||||
|
||||
env.CodeGenerate(
|
||||
target = 'util/u_half.c',
|
||||
script = 'util/u_half.py',
|
||||
source = [],
|
||||
command = python_cmd + ' $SCRIPT > $TARGET'
|
||||
)
|
||||
|
||||
env.Depends('util/u_format_table.c', [
|
||||
'#src/gallium/auxiliary/util/u_format_parse.py',
|
||||
'util/u_format_pack.py',
|
||||
|
@@ -27,7 +27,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
*
|
||||
* Wrap the cso cache & hash mechanisms in a simplified
|
||||
* pipe-driver-specific interface.
|
||||
*
|
||||
@@ -84,7 +84,8 @@ struct cso_context {
|
||||
boolean has_geometry_shader;
|
||||
boolean has_streamout;
|
||||
|
||||
struct sampler_info samplers[PIPE_SHADER_TYPES];
|
||||
struct sampler_info fragment_samplers;
|
||||
struct sampler_info vertex_samplers;
|
||||
|
||||
uint nr_vertex_buffers;
|
||||
struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS];
|
||||
@@ -104,9 +105,8 @@ struct cso_context {
|
||||
void *blend, *blend_saved;
|
||||
void *depth_stencil, *depth_stencil_saved;
|
||||
void *rasterizer, *rasterizer_saved;
|
||||
void *fragment_shader, *fragment_shader_saved;
|
||||
void *vertex_shader, *vertex_shader_saved;
|
||||
void *geometry_shader, *geometry_shader_saved;
|
||||
void *fragment_shader, *fragment_shader_saved, *geometry_shader;
|
||||
void *vertex_shader, *vertex_shader_saved, *geometry_shader_saved;
|
||||
void *velements, *velements_saved;
|
||||
|
||||
struct pipe_clip_state clip;
|
||||
@@ -115,7 +115,7 @@ struct cso_context {
|
||||
struct pipe_framebuffer_state fb, fb_saved;
|
||||
struct pipe_viewport_state vp, vp_saved;
|
||||
struct pipe_blend_color blend_color;
|
||||
unsigned sample_mask, sample_mask_saved;
|
||||
unsigned sample_mask;
|
||||
struct pipe_stencil_ref stencil_ref, stencil_ref_saved;
|
||||
};
|
||||
|
||||
@@ -135,8 +135,7 @@ static boolean delete_blend_state(struct cso_context *ctx, void *state)
|
||||
|
||||
static boolean delete_depth_stencil_state(struct cso_context *ctx, void *state)
|
||||
{
|
||||
struct cso_depth_stencil_alpha *cso =
|
||||
(struct cso_depth_stencil_alpha *)state;
|
||||
struct cso_depth_stencil_alpha *cso = (struct cso_depth_stencil_alpha *)state;
|
||||
|
||||
if (ctx->depth_stencil == cso->data)
|
||||
return FALSE;
|
||||
@@ -190,14 +189,19 @@ static INLINE boolean delete_cso(struct cso_context *ctx,
|
||||
switch (type) {
|
||||
case CSO_BLEND:
|
||||
return delete_blend_state(ctx, state);
|
||||
break;
|
||||
case CSO_SAMPLER:
|
||||
return delete_sampler_state(ctx, state);
|
||||
break;
|
||||
case CSO_DEPTH_STENCIL_ALPHA:
|
||||
return delete_depth_stencil_state(ctx, state);
|
||||
break;
|
||||
case CSO_RASTERIZER:
|
||||
return delete_rasterizer_state(ctx, state);
|
||||
break;
|
||||
case CSO_VELEMENTS:
|
||||
return delete_vertex_elements(ctx, state);
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
FREE(state);
|
||||
@@ -205,9 +209,8 @@ static INLINE boolean delete_cso(struct cso_context *ctx,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
sanitize_hash(struct cso_hash *hash, enum cso_cache_type type,
|
||||
int max_size, void *user_data)
|
||||
static INLINE void sanitize_hash(struct cso_hash *hash, enum cso_cache_type type,
|
||||
int max_size, void *user_data)
|
||||
{
|
||||
struct cso_context *ctx = (struct cso_context *)user_data;
|
||||
/* if we're approach the maximum size, remove fourth of the entries
|
||||
@@ -256,6 +259,8 @@ struct cso_context *cso_create_context( struct pipe_context *pipe )
|
||||
if (ctx == NULL)
|
||||
goto out;
|
||||
|
||||
assert(PIPE_MAX_SAMPLERS == PIPE_MAX_VERTEX_SAMPLERS);
|
||||
|
||||
ctx->cache = cso_cache_create();
|
||||
if (ctx->cache == NULL)
|
||||
goto out;
|
||||
@@ -264,7 +269,6 @@ struct cso_context *cso_create_context( struct pipe_context *pipe )
|
||||
ctx);
|
||||
|
||||
ctx->pipe = pipe;
|
||||
ctx->sample_mask_saved = ~0;
|
||||
|
||||
cso_init_vbuf(ctx);
|
||||
|
||||
@@ -283,7 +287,7 @@ struct cso_context *cso_create_context( struct pipe_context *pipe )
|
||||
return ctx;
|
||||
|
||||
out:
|
||||
cso_destroy_context( ctx );
|
||||
cso_destroy_context( ctx );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -292,7 +296,8 @@ out:
|
||||
*/
|
||||
void cso_release_all( struct cso_context *ctx )
|
||||
{
|
||||
unsigned i, shader;
|
||||
unsigned i;
|
||||
struct sampler_info *info;
|
||||
|
||||
if (ctx->pipe) {
|
||||
ctx->pipe->bind_blend_state( ctx->pipe, NULL );
|
||||
@@ -312,12 +317,17 @@ void cso_release_all( struct cso_context *ctx )
|
||||
}
|
||||
|
||||
/* free fragment samplers, views */
|
||||
for (shader = 0; shader < Elements(ctx->samplers); shader++) {
|
||||
struct sampler_info *info = &ctx->samplers[shader];
|
||||
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
|
||||
pipe_sampler_view_reference(&info->views[i], NULL);
|
||||
pipe_sampler_view_reference(&info->views_saved[i], NULL);
|
||||
}
|
||||
info = &ctx->fragment_samplers;
|
||||
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
|
||||
pipe_sampler_view_reference(&info->views[i], NULL);
|
||||
pipe_sampler_view_reference(&info->views_saved[i], NULL);
|
||||
}
|
||||
|
||||
/* free vertex samplers, views */
|
||||
info = &ctx->vertex_samplers;
|
||||
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
|
||||
pipe_sampler_view_reference(&info->views[i], NULL);
|
||||
pipe_sampler_view_reference(&info->views_saved[i], NULL);
|
||||
}
|
||||
|
||||
util_unreference_framebuffer_state(&ctx->fb);
|
||||
@@ -373,12 +383,10 @@ enum pipe_error cso_set_blend(struct cso_context *ctx,
|
||||
struct cso_hash_iter iter;
|
||||
void *handle;
|
||||
|
||||
key_size = templ->independent_blend_enable ?
|
||||
sizeof(struct pipe_blend_state) :
|
||||
(char *)&(templ->rt[1]) - (char *)templ;
|
||||
key_size = templ->independent_blend_enable ? sizeof(struct pipe_blend_state) :
|
||||
(char *)&(templ->rt[1]) - (char *)templ;
|
||||
hash_key = cso_construct_key((void*)templ, key_size);
|
||||
iter = cso_find_state_template(ctx->cache, hash_key, CSO_BLEND,
|
||||
(void*)templ, key_size);
|
||||
iter = cso_find_state_template(ctx->cache, hash_key, CSO_BLEND, (void*)templ, key_size);
|
||||
|
||||
if (cso_hash_iter_is_null(iter)) {
|
||||
struct cso_blend *cso = MALLOC(sizeof(struct cso_blend));
|
||||
@@ -427,33 +435,28 @@ void cso_restore_blend(struct cso_context *ctx)
|
||||
|
||||
|
||||
|
||||
enum pipe_error
|
||||
cso_set_depth_stencil_alpha(struct cso_context *ctx,
|
||||
const struct pipe_depth_stencil_alpha_state *templ)
|
||||
enum pipe_error cso_set_depth_stencil_alpha(struct cso_context *ctx,
|
||||
const struct pipe_depth_stencil_alpha_state *templ)
|
||||
{
|
||||
unsigned key_size = sizeof(struct pipe_depth_stencil_alpha_state);
|
||||
unsigned hash_key = cso_construct_key((void*)templ, key_size);
|
||||
struct cso_hash_iter iter = cso_find_state_template(ctx->cache,
|
||||
hash_key,
|
||||
hash_key,
|
||||
CSO_DEPTH_STENCIL_ALPHA,
|
||||
(void*)templ, key_size);
|
||||
void *handle;
|
||||
|
||||
if (cso_hash_iter_is_null(iter)) {
|
||||
struct cso_depth_stencil_alpha *cso =
|
||||
MALLOC(sizeof(struct cso_depth_stencil_alpha));
|
||||
struct cso_depth_stencil_alpha *cso = MALLOC(sizeof(struct cso_depth_stencil_alpha));
|
||||
if (!cso)
|
||||
return PIPE_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
memcpy(&cso->state, templ, sizeof(*templ));
|
||||
cso->data = ctx->pipe->create_depth_stencil_alpha_state(ctx->pipe,
|
||||
&cso->state);
|
||||
cso->delete_state =
|
||||
(cso_state_callback)ctx->pipe->delete_depth_stencil_alpha_state;
|
||||
cso->data = ctx->pipe->create_depth_stencil_alpha_state(ctx->pipe, &cso->state);
|
||||
cso->delete_state = (cso_state_callback)ctx->pipe->delete_depth_stencil_alpha_state;
|
||||
cso->context = ctx->pipe;
|
||||
|
||||
iter = cso_insert_state(ctx->cache, hash_key,
|
||||
CSO_DEPTH_STENCIL_ALPHA, cso);
|
||||
iter = cso_insert_state(ctx->cache, hash_key, CSO_DEPTH_STENCIL_ALPHA, cso);
|
||||
if (cso_hash_iter_is_null(iter)) {
|
||||
FREE(cso);
|
||||
return PIPE_ERROR_OUT_OF_MEMORY;
|
||||
@@ -462,8 +465,7 @@ cso_set_depth_stencil_alpha(struct cso_context *ctx,
|
||||
handle = cso->data;
|
||||
}
|
||||
else {
|
||||
handle = ((struct cso_depth_stencil_alpha *)
|
||||
cso_hash_iter_data(iter))->data;
|
||||
handle = ((struct cso_depth_stencil_alpha *)cso_hash_iter_data(iter))->data;
|
||||
}
|
||||
|
||||
if (ctx->depth_stencil != handle) {
|
||||
@@ -483,8 +485,7 @@ void cso_restore_depth_stencil_alpha(struct cso_context *ctx)
|
||||
{
|
||||
if (ctx->depth_stencil != ctx->depth_stencil_saved) {
|
||||
ctx->depth_stencil = ctx->depth_stencil_saved;
|
||||
ctx->pipe->bind_depth_stencil_alpha_state(ctx->pipe,
|
||||
ctx->depth_stencil_saved);
|
||||
ctx->pipe->bind_depth_stencil_alpha_state(ctx->pipe, ctx->depth_stencil_saved);
|
||||
}
|
||||
ctx->depth_stencil_saved = NULL;
|
||||
}
|
||||
@@ -497,8 +498,7 @@ enum pipe_error cso_set_rasterizer(struct cso_context *ctx,
|
||||
unsigned key_size = sizeof(struct pipe_rasterizer_state);
|
||||
unsigned hash_key = cso_construct_key((void*)templ, key_size);
|
||||
struct cso_hash_iter iter = cso_find_state_template(ctx->cache,
|
||||
hash_key,
|
||||
CSO_RASTERIZER,
|
||||
hash_key, CSO_RASTERIZER,
|
||||
(void*)templ, key_size);
|
||||
void *handle = NULL;
|
||||
|
||||
@@ -509,8 +509,7 @@ enum pipe_error cso_set_rasterizer(struct cso_context *ctx,
|
||||
|
||||
memcpy(&cso->state, templ, sizeof(*templ));
|
||||
cso->data = ctx->pipe->create_rasterizer_state(ctx->pipe, &cso->state);
|
||||
cso->delete_state =
|
||||
(cso_state_callback)ctx->pipe->delete_rasterizer_state;
|
||||
cso->delete_state = (cso_state_callback)ctx->pipe->delete_rasterizer_state;
|
||||
cso->context = ctx->pipe;
|
||||
|
||||
iter = cso_insert_state(ctx->cache, hash_key, CSO_RASTERIZER, cso);
|
||||
@@ -691,16 +690,6 @@ enum pipe_error cso_set_sample_mask(struct cso_context *ctx,
|
||||
return PIPE_OK;
|
||||
}
|
||||
|
||||
void cso_save_sample_mask(struct cso_context *ctx)
|
||||
{
|
||||
ctx->sample_mask_saved = ctx->sample_mask;
|
||||
}
|
||||
|
||||
void cso_restore_sample_mask(struct cso_context *ctx)
|
||||
{
|
||||
cso_set_sample_mask(ctx, ctx->sample_mask_saved);
|
||||
}
|
||||
|
||||
enum pipe_error cso_set_stencil_ref(struct cso_context *ctx,
|
||||
const struct pipe_stencil_ref *sr)
|
||||
{
|
||||
@@ -719,8 +708,7 @@ void cso_save_stencil_ref(struct cso_context *ctx)
|
||||
|
||||
void cso_restore_stencil_ref(struct cso_context *ctx)
|
||||
{
|
||||
if (memcmp(&ctx->stencil_ref, &ctx->stencil_ref_saved,
|
||||
sizeof(ctx->stencil_ref))) {
|
||||
if (memcmp(&ctx->stencil_ref, &ctx->stencil_ref_saved, sizeof(ctx->stencil_ref))) {
|
||||
ctx->stencil_ref = ctx->stencil_ref_saved;
|
||||
ctx->pipe->set_stencil_ref(ctx->pipe, &ctx->stencil_ref);
|
||||
}
|
||||
@@ -812,10 +800,9 @@ cso_restore_clip(struct cso_context *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
enum pipe_error
|
||||
cso_set_vertex_elements(struct cso_context *ctx,
|
||||
unsigned count,
|
||||
const struct pipe_vertex_element *states)
|
||||
enum pipe_error cso_set_vertex_elements(struct cso_context *ctx,
|
||||
unsigned count,
|
||||
const struct pipe_vertex_element *states)
|
||||
{
|
||||
struct u_vbuf *vbuf = ctx->vbuf;
|
||||
unsigned key_size, hash_key;
|
||||
@@ -828,18 +815,15 @@ cso_set_vertex_elements(struct cso_context *ctx,
|
||||
return PIPE_OK;
|
||||
}
|
||||
|
||||
/* Need to include the count into the stored state data too.
|
||||
* Otherwise first few count pipe_vertex_elements could be identical
|
||||
* even if count is different, and there's no guarantee the hash would
|
||||
* be different in that case neither.
|
||||
*/
|
||||
/* need to include the count into the stored state data too.
|
||||
Otherwise first few count pipe_vertex_elements could be identical even if count
|
||||
is different, and there's no guarantee the hash would be different in that
|
||||
case neither */
|
||||
key_size = sizeof(struct pipe_vertex_element) * count + sizeof(unsigned);
|
||||
velems_state.count = count;
|
||||
memcpy(velems_state.velems, states,
|
||||
sizeof(struct pipe_vertex_element) * count);
|
||||
memcpy(velems_state.velems, states, sizeof(struct pipe_vertex_element) * count);
|
||||
hash_key = cso_construct_key((void*)&velems_state, key_size);
|
||||
iter = cso_find_state_template(ctx->cache, hash_key, CSO_VELEMENTS,
|
||||
(void*)&velems_state, key_size);
|
||||
iter = cso_find_state_template(ctx->cache, hash_key, CSO_VELEMENTS, (void*)&velems_state, key_size);
|
||||
|
||||
if (cso_hash_iter_is_null(iter)) {
|
||||
struct cso_velements *cso = MALLOC(sizeof(struct cso_velements));
|
||||
@@ -847,10 +831,8 @@ cso_set_vertex_elements(struct cso_context *ctx,
|
||||
return PIPE_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
memcpy(&cso->state, &velems_state, key_size);
|
||||
cso->data = ctx->pipe->create_vertex_elements_state(ctx->pipe, count,
|
||||
&cso->state.velems[0]);
|
||||
cso->delete_state =
|
||||
(cso_state_callback) ctx->pipe->delete_vertex_elements_state;
|
||||
cso->data = ctx->pipe->create_vertex_elements_state(ctx->pipe, count, &cso->state.velems[0]);
|
||||
cso->delete_state = (cso_state_callback)ctx->pipe->delete_vertex_elements_state;
|
||||
cso->context = ctx->pipe;
|
||||
|
||||
iter = cso_insert_state(ctx->cache, hash_key, CSO_VELEMENTS, cso);
|
||||
@@ -988,8 +970,7 @@ single_sampler(struct cso_context *ctx,
|
||||
|
||||
memcpy(&cso->state, templ, sizeof(*templ));
|
||||
cso->data = ctx->pipe->create_sampler_state(ctx->pipe, &cso->state);
|
||||
cso->delete_state =
|
||||
(cso_state_callback) ctx->pipe->delete_sampler_state;
|
||||
cso->delete_state = (cso_state_callback)ctx->pipe->delete_sampler_state;
|
||||
cso->context = ctx->pipe;
|
||||
|
||||
iter = cso_insert_state(ctx->cache, hash_key, CSO_SAMPLER, cso);
|
||||
@@ -1012,19 +993,26 @@ single_sampler(struct cso_context *ctx,
|
||||
|
||||
enum pipe_error
|
||||
cso_single_sampler(struct cso_context *ctx,
|
||||
unsigned shader_stage,
|
||||
unsigned idx,
|
||||
const struct pipe_sampler_state *templ)
|
||||
{
|
||||
return single_sampler(ctx, &ctx->samplers[shader_stage], idx, templ);
|
||||
return single_sampler(ctx, &ctx->fragment_samplers, idx, templ);
|
||||
}
|
||||
|
||||
enum pipe_error
|
||||
cso_single_vertex_sampler(struct cso_context *ctx,
|
||||
unsigned idx,
|
||||
const struct pipe_sampler_state *templ)
|
||||
{
|
||||
return single_sampler(ctx, &ctx->vertex_samplers, idx, templ);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
|
||||
single_sampler_done(struct cso_context *ctx,
|
||||
struct sampler_info *info)
|
||||
{
|
||||
struct sampler_info *info = &ctx->samplers[shader_stage];
|
||||
unsigned i;
|
||||
|
||||
/* find highest non-null sampler */
|
||||
@@ -1038,39 +1026,39 @@ single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
|
||||
if (info->hw.nr_samplers != info->nr_samplers ||
|
||||
memcmp(info->hw.samplers,
|
||||
info->samplers,
|
||||
info->nr_samplers * sizeof(void *)) != 0)
|
||||
info->nr_samplers * sizeof(void *)) != 0)
|
||||
{
|
||||
memcpy(info->hw.samplers,
|
||||
info->samplers,
|
||||
info->nr_samplers * sizeof(void *));
|
||||
info->hw.nr_samplers = info->nr_samplers;
|
||||
|
||||
switch (shader_stage) {
|
||||
case PIPE_SHADER_FRAGMENT:
|
||||
if (info == &ctx->fragment_samplers) {
|
||||
ctx->pipe->bind_fragment_sampler_states(ctx->pipe,
|
||||
info->nr_samplers,
|
||||
info->samplers);
|
||||
break;
|
||||
case PIPE_SHADER_VERTEX:
|
||||
}
|
||||
else if (info == &ctx->vertex_samplers) {
|
||||
ctx->pipe->bind_vertex_sampler_states(ctx->pipe,
|
||||
info->nr_samplers,
|
||||
info->samplers);
|
||||
break;
|
||||
case PIPE_SHADER_GEOMETRY:
|
||||
ctx->pipe->bind_geometry_sampler_states(ctx->pipe,
|
||||
info->nr_samplers,
|
||||
info->samplers);
|
||||
break;
|
||||
default:
|
||||
assert(!"bad shader type in single_sampler_done()");
|
||||
}
|
||||
else {
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cso_single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
|
||||
cso_single_sampler_done( struct cso_context *ctx )
|
||||
{
|
||||
single_sampler_done(ctx, shader_stage);
|
||||
single_sampler_done(ctx, &ctx->fragment_samplers);
|
||||
}
|
||||
|
||||
void
|
||||
cso_single_vertex_sampler_done(struct cso_context *ctx)
|
||||
{
|
||||
single_sampler_done(ctx, &ctx->vertex_samplers);
|
||||
}
|
||||
|
||||
|
||||
@@ -1079,13 +1067,12 @@ cso_single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
|
||||
* last one. Done to always try to set as many samplers
|
||||
* as possible.
|
||||
*/
|
||||
enum pipe_error
|
||||
cso_set_samplers(struct cso_context *ctx,
|
||||
unsigned shader_stage,
|
||||
unsigned nr,
|
||||
const struct pipe_sampler_state **templates)
|
||||
static enum pipe_error
|
||||
set_samplers(struct cso_context *ctx,
|
||||
struct sampler_info *info,
|
||||
unsigned nr,
|
||||
const struct pipe_sampler_state **templates)
|
||||
{
|
||||
struct sampler_info *info = &ctx->samplers[shader_stage];
|
||||
unsigned i;
|
||||
enum pipe_error temp, error = PIPE_OK;
|
||||
|
||||
@@ -1104,38 +1091,82 @@ cso_set_samplers(struct cso_context *ctx,
|
||||
error = temp;
|
||||
}
|
||||
|
||||
single_sampler_done(ctx, shader_stage);
|
||||
single_sampler_done(ctx, info);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
void
|
||||
cso_save_samplers(struct cso_context *ctx, unsigned shader_stage)
|
||||
enum pipe_error
|
||||
cso_set_samplers(struct cso_context *ctx,
|
||||
unsigned nr,
|
||||
const struct pipe_sampler_state **templates)
|
||||
{
|
||||
return set_samplers(ctx, &ctx->fragment_samplers, nr, templates);
|
||||
}
|
||||
|
||||
enum pipe_error
|
||||
cso_set_vertex_samplers(struct cso_context *ctx,
|
||||
unsigned nr,
|
||||
const struct pipe_sampler_state **templates)
|
||||
{
|
||||
return set_samplers(ctx, &ctx->vertex_samplers, nr, templates);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
save_samplers(struct cso_context *ctx, struct sampler_info *info)
|
||||
{
|
||||
struct sampler_info *info = &ctx->samplers[shader_stage];
|
||||
info->nr_samplers_saved = info->nr_samplers;
|
||||
memcpy(info->samplers_saved, info->samplers, sizeof(info->samplers));
|
||||
}
|
||||
|
||||
void
|
||||
cso_save_samplers(struct cso_context *ctx)
|
||||
{
|
||||
save_samplers(ctx, &ctx->fragment_samplers);
|
||||
}
|
||||
|
||||
void
|
||||
cso_restore_samplers(struct cso_context *ctx, unsigned shader_stage)
|
||||
cso_save_vertex_samplers(struct cso_context *ctx)
|
||||
{
|
||||
struct sampler_info *info = &ctx->samplers[shader_stage];
|
||||
info->nr_samplers = info->nr_samplers_saved;
|
||||
memcpy(info->samplers, info->samplers_saved, sizeof(info->samplers));
|
||||
single_sampler_done(ctx, shader_stage);
|
||||
save_samplers(ctx, &ctx->vertex_samplers);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
cso_set_sampler_views(struct cso_context *ctx,
|
||||
unsigned shader_stage,
|
||||
unsigned count,
|
||||
struct pipe_sampler_view **views)
|
||||
|
||||
static void
|
||||
restore_samplers(struct cso_context *ctx, struct sampler_info *info)
|
||||
{
|
||||
struct sampler_info *info = &ctx->samplers[shader_stage];
|
||||
unsigned i;
|
||||
info->nr_samplers = info->nr_samplers_saved;
|
||||
memcpy(info->samplers, info->samplers_saved, sizeof(info->samplers));
|
||||
single_sampler_done(ctx, info);
|
||||
}
|
||||
|
||||
void
|
||||
cso_restore_samplers(struct cso_context *ctx)
|
||||
{
|
||||
restore_samplers(ctx, &ctx->fragment_samplers);
|
||||
}
|
||||
|
||||
void
|
||||
cso_restore_vertex_samplers(struct cso_context *ctx)
|
||||
{
|
||||
restore_samplers(ctx, &ctx->vertex_samplers);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
set_sampler_views(struct cso_context *ctx,
|
||||
struct sampler_info *info,
|
||||
void (*set_views)(struct pipe_context *,
|
||||
unsigned num_views,
|
||||
struct pipe_sampler_view **),
|
||||
uint count,
|
||||
struct pipe_sampler_view **views)
|
||||
{
|
||||
uint i;
|
||||
|
||||
/* reference new views */
|
||||
for (i = 0; i < count; i++) {
|
||||
@@ -1149,27 +1180,36 @@ cso_set_sampler_views(struct cso_context *ctx,
|
||||
info->nr_views = count;
|
||||
|
||||
/* bind the new sampler views */
|
||||
switch (shader_stage) {
|
||||
case PIPE_SHADER_FRAGMENT:
|
||||
ctx->pipe->set_fragment_sampler_views(ctx->pipe, count, info->views);
|
||||
break;
|
||||
case PIPE_SHADER_VERTEX:
|
||||
ctx->pipe->set_vertex_sampler_views(ctx->pipe, count, info->views);
|
||||
break;
|
||||
case PIPE_SHADER_GEOMETRY:
|
||||
ctx->pipe->set_geometry_sampler_views(ctx->pipe, count, info->views);
|
||||
break;
|
||||
default:
|
||||
assert(!"bad shader type in cso_set_sampler_views()");
|
||||
}
|
||||
set_views(ctx->pipe, count, info->views);
|
||||
}
|
||||
|
||||
void
|
||||
cso_set_fragment_sampler_views(struct cso_context *ctx,
|
||||
uint count,
|
||||
struct pipe_sampler_view **views)
|
||||
{
|
||||
set_sampler_views(ctx, &ctx->fragment_samplers,
|
||||
ctx->pipe->set_fragment_sampler_views,
|
||||
count, views);
|
||||
}
|
||||
|
||||
void
|
||||
cso_set_vertex_sampler_views(struct cso_context *ctx,
|
||||
uint count,
|
||||
struct pipe_sampler_view **views)
|
||||
{
|
||||
set_sampler_views(ctx, &ctx->vertex_samplers,
|
||||
ctx->pipe->set_vertex_sampler_views,
|
||||
count, views);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
cso_save_sampler_views(struct cso_context *ctx, unsigned shader_stage)
|
||||
|
||||
static void
|
||||
save_sampler_views(struct cso_context *ctx,
|
||||
struct sampler_info *info)
|
||||
{
|
||||
struct sampler_info *info = &ctx->samplers[shader_stage];
|
||||
unsigned i;
|
||||
uint i;
|
||||
|
||||
info->nr_views_saved = info->nr_views;
|
||||
|
||||
@@ -1179,14 +1219,29 @@ cso_save_sampler_views(struct cso_context *ctx, unsigned shader_stage)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cso_save_fragment_sampler_views(struct cso_context *ctx)
|
||||
{
|
||||
save_sampler_views(ctx, &ctx->fragment_samplers);
|
||||
}
|
||||
|
||||
void
|
||||
cso_restore_sampler_views(struct cso_context *ctx, unsigned shader_stage)
|
||||
cso_save_vertex_sampler_views(struct cso_context *ctx)
|
||||
{
|
||||
struct sampler_info *info = &ctx->samplers[shader_stage];
|
||||
unsigned i, nr_saved = info->nr_views_saved;
|
||||
save_sampler_views(ctx, &ctx->vertex_samplers);
|
||||
}
|
||||
|
||||
for (i = 0; i < nr_saved; i++) {
|
||||
|
||||
static void
|
||||
restore_sampler_views(struct cso_context *ctx,
|
||||
struct sampler_info *info,
|
||||
void (*set_views)(struct pipe_context *,
|
||||
unsigned num_views,
|
||||
struct pipe_sampler_view **))
|
||||
{
|
||||
uint i;
|
||||
|
||||
for (i = 0; i < info->nr_views_saved; i++) {
|
||||
pipe_sampler_view_reference(&info->views[i], NULL);
|
||||
/* move the reference from one pointer to another */
|
||||
info->views[i] = info->views_saved[i];
|
||||
@@ -1197,24 +1252,26 @@ cso_restore_sampler_views(struct cso_context *ctx, unsigned shader_stage)
|
||||
}
|
||||
|
||||
/* bind the old/saved sampler views */
|
||||
switch (shader_stage) {
|
||||
case PIPE_SHADER_FRAGMENT:
|
||||
ctx->pipe->set_fragment_sampler_views(ctx->pipe, nr_saved, info->views);
|
||||
break;
|
||||
case PIPE_SHADER_VERTEX:
|
||||
ctx->pipe->set_vertex_sampler_views(ctx->pipe, nr_saved, info->views);
|
||||
break;
|
||||
case PIPE_SHADER_GEOMETRY:
|
||||
ctx->pipe->set_geometry_sampler_views(ctx->pipe, nr_saved, info->views);
|
||||
break;
|
||||
default:
|
||||
assert(!"bad shader type in cso_restore_sampler_views()");
|
||||
}
|
||||
set_views(ctx->pipe, info->nr_views_saved, info->views);
|
||||
|
||||
info->nr_views = nr_saved;
|
||||
info->nr_views = info->nr_views_saved;
|
||||
info->nr_views_saved = 0;
|
||||
}
|
||||
|
||||
void
|
||||
cso_restore_fragment_sampler_views(struct cso_context *ctx)
|
||||
{
|
||||
restore_sampler_views(ctx, &ctx->fragment_samplers,
|
||||
ctx->pipe->set_fragment_sampler_views);
|
||||
}
|
||||
|
||||
void
|
||||
cso_restore_vertex_sampler_views(struct cso_context *ctx)
|
||||
{
|
||||
restore_sampler_views(ctx, &ctx->vertex_samplers,
|
||||
ctx->pipe->set_vertex_sampler_views);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
cso_set_stream_outputs(struct cso_context *ctx,
|
||||
|
@@ -69,29 +69,39 @@ void cso_save_rasterizer(struct cso_context *cso);
|
||||
void cso_restore_rasterizer(struct cso_context *cso);
|
||||
|
||||
|
||||
enum pipe_error
|
||||
cso_set_samplers(struct cso_context *cso,
|
||||
unsigned shader_stage,
|
||||
unsigned count,
|
||||
const struct pipe_sampler_state **states);
|
||||
|
||||
void
|
||||
cso_save_samplers(struct cso_context *cso, unsigned shader_stage);
|
||||
|
||||
void
|
||||
cso_restore_samplers(struct cso_context *cso, unsigned shader_stage);
|
||||
enum pipe_error cso_set_samplers( struct cso_context *cso,
|
||||
unsigned count,
|
||||
const struct pipe_sampler_state **states );
|
||||
void cso_save_samplers(struct cso_context *cso);
|
||||
void cso_restore_samplers(struct cso_context *cso);
|
||||
|
||||
/* Alternate interface to support state trackers that like to modify
|
||||
* samplers one at a time:
|
||||
*/
|
||||
enum pipe_error
|
||||
cso_single_sampler(struct cso_context *cso,
|
||||
unsigned shader_stage,
|
||||
unsigned count,
|
||||
const struct pipe_sampler_state *states);
|
||||
enum pipe_error cso_single_sampler( struct cso_context *cso,
|
||||
unsigned nr,
|
||||
const struct pipe_sampler_state *states );
|
||||
|
||||
void cso_single_sampler_done( struct cso_context *cso );
|
||||
|
||||
enum pipe_error cso_set_vertex_samplers(struct cso_context *cso,
|
||||
unsigned count,
|
||||
const struct pipe_sampler_state **states);
|
||||
|
||||
void
|
||||
cso_single_sampler_done(struct cso_context *cso, unsigned shader_stage);
|
||||
cso_save_vertex_samplers(struct cso_context *cso);
|
||||
|
||||
void
|
||||
cso_restore_vertex_samplers(struct cso_context *cso);
|
||||
|
||||
enum pipe_error
|
||||
cso_single_vertex_sampler(struct cso_context *cso,
|
||||
unsigned nr,
|
||||
const struct pipe_sampler_state *states);
|
||||
|
||||
void
|
||||
cso_single_vertex_sampler_done(struct cso_context *cso);
|
||||
|
||||
|
||||
enum pipe_error cso_set_vertex_elements(struct cso_context *ctx,
|
||||
@@ -116,13 +126,6 @@ void cso_save_stream_outputs(struct cso_context *ctx);
|
||||
void cso_restore_stream_outputs(struct cso_context *ctx);
|
||||
|
||||
|
||||
/*
|
||||
* We don't provide shader caching in CSO. Most of the time the api provides
|
||||
* object semantics for shaders anyway, and the cases where it doesn't
|
||||
* (eg mesa's internally-generated texenv programs), it will be up to
|
||||
* the state tracker to implement their own specialized caching.
|
||||
*/
|
||||
|
||||
enum pipe_error cso_set_fragment_shader_handle(struct cso_context *ctx,
|
||||
void *handle );
|
||||
void cso_delete_fragment_shader(struct cso_context *ctx, void *handle );
|
||||
@@ -161,8 +164,6 @@ enum pipe_error cso_set_blend_color(struct cso_context *cso,
|
||||
|
||||
enum pipe_error cso_set_sample_mask(struct cso_context *cso,
|
||||
unsigned stencil_mask);
|
||||
void cso_save_sample_mask(struct cso_context *ctx);
|
||||
void cso_restore_sample_mask(struct cso_context *ctx);
|
||||
|
||||
enum pipe_error cso_set_stencil_ref(struct cso_context *cso,
|
||||
const struct pipe_stencil_ref *sr);
|
||||
@@ -183,21 +184,39 @@ void
|
||||
cso_restore_clip(struct cso_context *cso);
|
||||
|
||||
|
||||
/* sampler view state */
|
||||
/* fragment sampler view state */
|
||||
|
||||
/*
|
||||
* We don't provide shader caching in CSO. Most of the time the api provides
|
||||
* object semantics for shaders anyway, and the cases where it doesn't
|
||||
* (eg mesa's internally-generated texenv programs), it will be up to
|
||||
* the state tracker to implement their own specialized caching.
|
||||
*/
|
||||
|
||||
void
|
||||
cso_set_sampler_views(struct cso_context *cso,
|
||||
unsigned shader_stage,
|
||||
unsigned count,
|
||||
struct pipe_sampler_view **views);
|
||||
cso_set_fragment_sampler_views(struct cso_context *cso,
|
||||
uint count,
|
||||
struct pipe_sampler_view **views);
|
||||
|
||||
void
|
||||
cso_save_sampler_views(struct cso_context *cso, unsigned shader_stage);
|
||||
cso_save_fragment_sampler_views(struct cso_context *cso);
|
||||
|
||||
void
|
||||
cso_restore_sampler_views(struct cso_context *cso, unsigned shader_stage);
|
||||
cso_restore_fragment_sampler_views(struct cso_context *cso);
|
||||
|
||||
|
||||
/* vertex sampler view state */
|
||||
|
||||
void
|
||||
cso_set_vertex_sampler_views(struct cso_context *cso,
|
||||
uint count,
|
||||
struct pipe_sampler_view **views);
|
||||
|
||||
void
|
||||
cso_save_vertex_sampler_views(struct cso_context *cso);
|
||||
|
||||
void
|
||||
cso_restore_vertex_sampler_views(struct cso_context *cso);
|
||||
|
||||
/* drawing */
|
||||
|
||||
|
@@ -42,7 +42,6 @@
|
||||
|
||||
#if HAVE_LLVM
|
||||
#include "gallivm/lp_bld_init.h"
|
||||
#include "gallivm/lp_bld_limits.h"
|
||||
#include "draw_llvm.h"
|
||||
|
||||
static boolean
|
||||
@@ -70,7 +69,8 @@ draw_get_option_use_llvm(void)
|
||||
* Create new draw module context with gallivm state for LLVM JIT.
|
||||
*/
|
||||
static struct draw_context *
|
||||
draw_create_context(struct pipe_context *pipe, boolean try_llvm)
|
||||
draw_create_context(struct pipe_context *pipe, boolean try_llvm,
|
||||
struct gallivm_state *gallivm)
|
||||
{
|
||||
struct draw_context *draw = CALLOC_STRUCT( draw_context );
|
||||
if (draw == NULL)
|
||||
@@ -78,7 +78,16 @@ draw_create_context(struct pipe_context *pipe, boolean try_llvm)
|
||||
|
||||
#if HAVE_LLVM
|
||||
if (try_llvm && draw_get_option_use_llvm()) {
|
||||
draw->llvm = draw_llvm_create(draw);
|
||||
if (!gallivm) {
|
||||
gallivm = gallivm_create();
|
||||
draw->own_gallivm = gallivm;
|
||||
}
|
||||
|
||||
if (!gallivm)
|
||||
goto err_destroy;
|
||||
|
||||
draw->llvm = draw_llvm_create(draw, gallivm);
|
||||
|
||||
if (!draw->llvm)
|
||||
goto err_destroy;
|
||||
}
|
||||
@@ -104,7 +113,7 @@ err_out:
|
||||
struct draw_context *
|
||||
draw_create(struct pipe_context *pipe)
|
||||
{
|
||||
return draw_create_context(pipe, TRUE);
|
||||
return draw_create_context(pipe, TRUE, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +123,17 @@ draw_create(struct pipe_context *pipe)
|
||||
struct draw_context *
|
||||
draw_create_no_llvm(struct pipe_context *pipe)
|
||||
{
|
||||
return draw_create_context(pipe, FALSE);
|
||||
return draw_create_context(pipe, FALSE, NULL);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create new draw module context with gallivm state for LLVM JIT.
|
||||
*/
|
||||
struct draw_context *
|
||||
draw_create_gallivm(struct pipe_context *pipe, struct gallivm_state *gallivm)
|
||||
{
|
||||
return draw_create_context(pipe, TRUE, gallivm);
|
||||
}
|
||||
|
||||
|
||||
@@ -193,6 +212,9 @@ void draw_destroy( struct draw_context *draw )
|
||||
#ifdef HAVE_LLVM
|
||||
if (draw->llvm)
|
||||
draw_llvm_destroy( draw->llvm );
|
||||
|
||||
if (draw->own_gallivm)
|
||||
gallivm_destroy(draw->own_gallivm);
|
||||
#endif
|
||||
|
||||
FREE( draw );
|
||||
@@ -576,7 +598,7 @@ draw_num_shader_outputs(const struct draw_context *draw)
|
||||
|
||||
/**
|
||||
* Provide TGSI sampler objects for vertex/geometry shaders that use
|
||||
* texture fetches. This state only needs to be set once per context.
|
||||
* texture fetches.
|
||||
* This might only be used by software drivers for the time being.
|
||||
*/
|
||||
void
|
||||
@@ -586,12 +608,12 @@ draw_texture_samplers(struct draw_context *draw,
|
||||
struct tgsi_sampler **samplers)
|
||||
{
|
||||
if (shader == PIPE_SHADER_VERTEX) {
|
||||
draw->vs.tgsi.num_samplers = num_samplers;
|
||||
draw->vs.tgsi.samplers = samplers;
|
||||
draw->vs.num_samplers = num_samplers;
|
||||
draw->vs.samplers = samplers;
|
||||
} else {
|
||||
debug_assert(shader == PIPE_SHADER_GEOMETRY);
|
||||
draw->gs.tgsi.num_samplers = num_samplers;
|
||||
draw->gs.tgsi.samplers = samplers;
|
||||
draw->gs.num_samplers = num_samplers;
|
||||
draw->gs.samplers = samplers;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -621,7 +643,7 @@ draw_set_indexes(struct draw_context *draw,
|
||||
elem_size == 2 ||
|
||||
elem_size == 4);
|
||||
draw->pt.user.elts = elements;
|
||||
draw->pt.user.eltSizeIB = elem_size;
|
||||
draw->pt.user.eltSize = elem_size;
|
||||
}
|
||||
|
||||
|
||||
@@ -754,50 +776,45 @@ draw_set_so_state(struct draw_context *draw,
|
||||
|
||||
void
|
||||
draw_set_sampler_views(struct draw_context *draw,
|
||||
unsigned shader_stage,
|
||||
struct pipe_sampler_view **views,
|
||||
unsigned num)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
debug_assert(shader_stage < PIPE_SHADER_TYPES);
|
||||
debug_assert(num <= PIPE_MAX_SAMPLERS);
|
||||
debug_assert(num <= PIPE_MAX_VERTEX_SAMPLERS);
|
||||
|
||||
for (i = 0; i < num; ++i)
|
||||
draw->sampler_views[shader_stage][i] = views[i];
|
||||
for (i = num; i < PIPE_MAX_SAMPLERS; ++i)
|
||||
draw->sampler_views[shader_stage][i] = NULL;
|
||||
draw->sampler_views[i] = views[i];
|
||||
for (i = num; i < PIPE_MAX_VERTEX_SAMPLERS; ++i)
|
||||
draw->sampler_views[i] = NULL;
|
||||
|
||||
draw->num_sampler_views[shader_stage] = num;
|
||||
draw->num_sampler_views = num;
|
||||
}
|
||||
|
||||
void
|
||||
draw_set_samplers(struct draw_context *draw,
|
||||
unsigned shader_stage,
|
||||
struct pipe_sampler_state **samplers,
|
||||
unsigned num)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
debug_assert(shader_stage < PIPE_SHADER_TYPES);
|
||||
debug_assert(num <= PIPE_MAX_SAMPLERS);
|
||||
debug_assert(num <= PIPE_MAX_VERTEX_SAMPLERS);
|
||||
|
||||
for (i = 0; i < num; ++i)
|
||||
draw->samplers[shader_stage][i] = samplers[i];
|
||||
for (i = num; i < PIPE_MAX_SAMPLERS; ++i)
|
||||
draw->samplers[shader_stage][i] = NULL;
|
||||
draw->samplers[i] = samplers[i];
|
||||
for (i = num; i < PIPE_MAX_VERTEX_SAMPLERS; ++i)
|
||||
draw->samplers[i] = NULL;
|
||||
|
||||
draw->num_samplers[shader_stage] = num;
|
||||
draw->num_samplers = num;
|
||||
|
||||
#ifdef HAVE_LLVM
|
||||
if (draw->llvm && shader_stage == PIPE_SHADER_VERTEX)
|
||||
if (draw->llvm)
|
||||
draw_llvm_set_sampler_state(draw);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
draw_set_mapped_texture(struct draw_context *draw,
|
||||
unsigned shader_stage,
|
||||
unsigned sampler_idx,
|
||||
uint32_t width, uint32_t height, uint32_t depth,
|
||||
uint32_t first_level, uint32_t last_level,
|
||||
@@ -805,53 +822,11 @@ draw_set_mapped_texture(struct draw_context *draw,
|
||||
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS],
|
||||
const void *data[PIPE_MAX_TEXTURE_LEVELS])
|
||||
{
|
||||
if (shader_stage == PIPE_SHADER_VERTEX) {
|
||||
#ifdef HAVE_LLVM
|
||||
if (draw->llvm)
|
||||
draw_llvm_set_mapped_texture(draw,
|
||||
sampler_idx,
|
||||
width, height, depth, first_level, last_level,
|
||||
row_stride, img_stride, data);
|
||||
if(draw->llvm)
|
||||
draw_llvm_set_mapped_texture(draw,
|
||||
sampler_idx,
|
||||
width, height, depth, first_level, last_level,
|
||||
row_stride, img_stride, data);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XXX: Results for PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS because there are two
|
||||
* different ways of setting textures, and drivers typically only support one.
|
||||
*/
|
||||
int
|
||||
draw_get_shader_param_no_llvm(unsigned shader, enum pipe_shader_cap param)
|
||||
{
|
||||
switch(shader) {
|
||||
case PIPE_SHADER_VERTEX:
|
||||
case PIPE_SHADER_GEOMETRY:
|
||||
return tgsi_exec_get_shader_param(param);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XXX: Results for PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS because there are two
|
||||
* different ways of setting textures, and drivers typically only support one.
|
||||
*/
|
||||
int
|
||||
draw_get_shader_param(unsigned shader, enum pipe_shader_cap param)
|
||||
{
|
||||
|
||||
#ifdef HAVE_LLVM
|
||||
if (draw_get_option_use_llvm()) {
|
||||
switch(shader) {
|
||||
case PIPE_SHADER_VERTEX:
|
||||
case PIPE_SHADER_GEOMETRY:
|
||||
return gallivm_get_shader_param(param);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return draw_get_shader_param_no_llvm(shader, param);
|
||||
}
|
||||
|
||||
|
@@ -48,6 +48,7 @@ struct draw_vertex_shader;
|
||||
struct draw_geometry_shader;
|
||||
struct draw_fragment_shader;
|
||||
struct tgsi_sampler;
|
||||
struct gallivm_state;
|
||||
|
||||
/*
|
||||
* structure to contain driver internal information
|
||||
@@ -66,6 +67,9 @@ struct draw_context *draw_create( struct pipe_context *pipe );
|
||||
|
||||
struct draw_context *draw_create_no_llvm(struct pipe_context *pipe);
|
||||
|
||||
struct draw_context *
|
||||
draw_create_gallivm(struct pipe_context *pipe, struct gallivm_state *gallivm);
|
||||
|
||||
void draw_destroy( struct draw_context *draw );
|
||||
|
||||
void draw_flush(struct draw_context *draw);
|
||||
@@ -139,18 +143,15 @@ draw_texture_samplers(struct draw_context *draw,
|
||||
|
||||
void
|
||||
draw_set_sampler_views(struct draw_context *draw,
|
||||
unsigned shader_stage,
|
||||
struct pipe_sampler_view **views,
|
||||
unsigned num);
|
||||
void
|
||||
draw_set_samplers(struct draw_context *draw,
|
||||
unsigned shader_stage,
|
||||
struct pipe_sampler_state **samplers,
|
||||
unsigned num);
|
||||
|
||||
void
|
||||
draw_set_mapped_texture(struct draw_context *draw,
|
||||
unsigned shader_stage,
|
||||
unsigned sampler_idx,
|
||||
uint32_t width, uint32_t height, uint32_t depth,
|
||||
uint32_t first_level, uint32_t last_level,
|
||||
@@ -276,10 +277,16 @@ boolean draw_need_pipeline(const struct draw_context *draw,
|
||||
const struct pipe_rasterizer_state *rasterizer,
|
||||
unsigned prim );
|
||||
|
||||
int
|
||||
draw_get_shader_param(unsigned shader, enum pipe_shader_cap param);
|
||||
|
||||
int
|
||||
draw_get_shader_param_no_llvm(unsigned shader, enum pipe_shader_cap param);
|
||||
static INLINE int
|
||||
draw_get_shader_param(unsigned shader, enum pipe_shader_cap param)
|
||||
{
|
||||
switch(shader) {
|
||||
case PIPE_SHADER_VERTEX:
|
||||
case PIPE_SHADER_GEOMETRY:
|
||||
return tgsi_exec_get_shader_param(param);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* DRAW_CONTEXT_H */
|
||||
|
@@ -45,15 +45,15 @@
|
||||
boolean
|
||||
draw_gs_init( struct draw_context *draw )
|
||||
{
|
||||
draw->gs.tgsi.machine = tgsi_exec_machine_create();
|
||||
if (!draw->gs.tgsi.machine)
|
||||
draw->gs.machine = tgsi_exec_machine_create();
|
||||
if (!draw->gs.machine)
|
||||
return FALSE;
|
||||
|
||||
draw->gs.tgsi.machine->Primitives = align_malloc(
|
||||
draw->gs.machine->Primitives = align_malloc(
|
||||
MAX_PRIMITIVES * sizeof(struct tgsi_exec_vector), 16);
|
||||
if (!draw->gs.tgsi.machine->Primitives)
|
||||
if (!draw->gs.machine->Primitives)
|
||||
return FALSE;
|
||||
memset(draw->gs.tgsi.machine->Primitives, 0,
|
||||
memset(draw->gs.machine->Primitives, 0,
|
||||
MAX_PRIMITIVES * sizeof(struct tgsi_exec_vector));
|
||||
|
||||
return TRUE;
|
||||
@@ -61,12 +61,12 @@ draw_gs_init( struct draw_context *draw )
|
||||
|
||||
void draw_gs_destroy( struct draw_context *draw )
|
||||
{
|
||||
if (!draw->gs.tgsi.machine)
|
||||
if (!draw->gs.machine)
|
||||
return;
|
||||
|
||||
align_free(draw->gs.tgsi.machine->Primitives);
|
||||
align_free(draw->gs.machine->Primitives);
|
||||
|
||||
tgsi_exec_machine_destroy(draw->gs.tgsi.machine);
|
||||
tgsi_exec_machine_destroy(draw->gs.machine);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -121,7 +121,7 @@ draw_create_geometry_shader(struct draw_context *draw,
|
||||
gs->max_output_vertices = gs->info.properties[i].data[0];
|
||||
}
|
||||
|
||||
gs->machine = draw->gs.tgsi.machine;
|
||||
gs->machine = draw->gs.machine;
|
||||
|
||||
if (gs)
|
||||
{
|
||||
@@ -483,7 +483,7 @@ void draw_geometry_shader_prepare(struct draw_geometry_shader *shader,
|
||||
if (shader && shader->machine->Tokens != shader->state.tokens) {
|
||||
tgsi_exec_machine_bind_shader(shader->machine,
|
||||
shader->state.tokens,
|
||||
draw->gs.tgsi.num_samplers,
|
||||
draw->gs.tgsi.samplers);
|
||||
draw->gs.num_samplers,
|
||||
draw->gs.samplers);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -36,6 +36,11 @@
|
||||
#include "pipe/p_context.h"
|
||||
#include "util/u_simple_list.h"
|
||||
|
||||
#include <llvm-c/Core.h>
|
||||
#include <llvm-c/Analysis.h>
|
||||
#include <llvm-c/Target.h>
|
||||
#include <llvm-c/ExecutionEngine.h>
|
||||
|
||||
|
||||
struct draw_llvm;
|
||||
struct llvm_vertex_shader;
|
||||
@@ -97,7 +102,7 @@ struct draw_jit_context
|
||||
float (*planes) [DRAW_TOTAL_CLIP_PLANES][4];
|
||||
float *viewport;
|
||||
|
||||
struct draw_jit_texture textures[PIPE_MAX_SAMPLERS];
|
||||
struct draw_jit_texture textures[PIPE_MAX_VERTEX_SAMPLERS];
|
||||
};
|
||||
|
||||
|
||||
@@ -184,7 +189,7 @@ struct draw_llvm_variant_key
|
||||
|
||||
#define DRAW_LLVM_MAX_VARIANT_KEY_SIZE \
|
||||
(sizeof(struct draw_llvm_variant_key) + \
|
||||
PIPE_MAX_SAMPLERS * sizeof(struct lp_sampler_static_state) + \
|
||||
PIPE_MAX_VERTEX_SAMPLERS * sizeof(struct lp_sampler_static_state) + \
|
||||
(PIPE_MAX_ATTRIBS-1) * sizeof(struct pipe_vertex_element))
|
||||
|
||||
|
||||
@@ -215,14 +220,6 @@ struct draw_llvm_variant_list_item
|
||||
|
||||
struct draw_llvm_variant
|
||||
{
|
||||
struct gallivm_state *gallivm;
|
||||
|
||||
/* LLVM JIT builder types */
|
||||
LLVMTypeRef context_ptr_type;
|
||||
LLVMTypeRef buffer_ptr_type;
|
||||
LLVMTypeRef vb_ptr_type;
|
||||
LLVMTypeRef vertex_header_ptr_type;
|
||||
|
||||
LLVMValueRef function;
|
||||
LLVMValueRef function_elts;
|
||||
draw_jit_vert_func jit_func;
|
||||
@@ -252,8 +249,16 @@ struct draw_llvm {
|
||||
|
||||
struct draw_jit_context jit_context;
|
||||
|
||||
struct gallivm_state *gallivm;
|
||||
|
||||
struct draw_llvm_variant_list_item vs_variants_list;
|
||||
int nr_variants;
|
||||
|
||||
/* LLVM JIT builder types */
|
||||
LLVMTypeRef context_ptr_type;
|
||||
LLVMTypeRef buffer_ptr_type;
|
||||
LLVMTypeRef vb_ptr_type;
|
||||
LLVMTypeRef vertex_header_ptr_type;
|
||||
};
|
||||
|
||||
|
||||
@@ -265,7 +270,7 @@ llvm_vertex_shader(struct draw_vertex_shader *vs)
|
||||
|
||||
|
||||
struct draw_llvm *
|
||||
draw_llvm_create(struct draw_context *draw);
|
||||
draw_llvm_create(struct draw_context *draw, struct gallivm_state *gallivm);
|
||||
|
||||
void
|
||||
draw_llvm_destroy(struct draw_llvm *llvm);
|
||||
@@ -281,6 +286,11 @@ draw_llvm_destroy_variant(struct draw_llvm_variant *variant);
|
||||
struct draw_llvm_variant_key *
|
||||
draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store);
|
||||
|
||||
LLVMValueRef
|
||||
draw_llvm_translate_from(struct gallivm_state *gallivm,
|
||||
LLVMValueRef vbuffer,
|
||||
enum pipe_format from_format);
|
||||
|
||||
struct lp_build_sampler_soa *
|
||||
draw_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state,
|
||||
LLVMValueRef context_ptr);
|
||||
|
@@ -98,7 +98,7 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
|
||||
LLVMValueRef ptr;
|
||||
LLVMValueRef res;
|
||||
|
||||
debug_assert(unit < PIPE_MAX_SAMPLERS);
|
||||
debug_assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
|
||||
|
||||
/* context[0] */
|
||||
indices[0] = lp_build_const_int32(gallivm, 0);
|
||||
@@ -173,14 +173,15 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
|
||||
unsigned unit,
|
||||
unsigned num_coords,
|
||||
const LLVMValueRef *coords,
|
||||
const struct lp_derivatives *derivs,
|
||||
const LLVMValueRef *ddx,
|
||||
const LLVMValueRef *ddy,
|
||||
LLVMValueRef lod_bias, /* optional */
|
||||
LLVMValueRef explicit_lod, /* optional */
|
||||
LLVMValueRef *texel)
|
||||
{
|
||||
struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
|
||||
|
||||
assert(unit < PIPE_MAX_SAMPLERS);
|
||||
assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
|
||||
|
||||
lp_build_sample_soa(gallivm,
|
||||
&sampler->dynamic_state.static_state[unit],
|
||||
@@ -188,7 +189,7 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
|
||||
type,
|
||||
unit,
|
||||
num_coords, coords,
|
||||
derivs,
|
||||
ddx, ddy,
|
||||
lod_bias, explicit_lod,
|
||||
texel);
|
||||
}
|
||||
@@ -200,19 +201,17 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
|
||||
static void
|
||||
draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
|
||||
struct gallivm_state *gallivm,
|
||||
struct lp_type type,
|
||||
unsigned unit,
|
||||
LLVMValueRef explicit_lod, /* optional */
|
||||
LLVMValueRef *sizes_out)
|
||||
{
|
||||
struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
|
||||
|
||||
assert(unit < PIPE_MAX_SAMPLERS);
|
||||
assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
|
||||
|
||||
lp_build_size_query_soa(gallivm,
|
||||
&sampler->dynamic_state.static_state[unit],
|
||||
&sampler->dynamic_state.base,
|
||||
type,
|
||||
unit,
|
||||
explicit_lod,
|
||||
sizes_out);
|
||||
|
506
src/gallium/auxiliary/draw/draw_llvm_translate.c
Normal file
506
src/gallium/auxiliary/draw/draw_llvm_translate.c
Normal file
@@ -0,0 +1,506 @@
|
||||
#include "draw_private.h"
|
||||
#include "draw_context.h"
|
||||
|
||||
#include "draw_llvm.h"
|
||||
|
||||
#include "gallivm/lp_bld_const.h"
|
||||
#include "gallivm/lp_bld_struct.h"
|
||||
#include "gallivm/lp_bld_format.h"
|
||||
#include "gallivm/lp_bld_debug.h"
|
||||
#include "gallivm/lp_bld_type.h"
|
||||
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_format.h"
|
||||
#include "pipe/p_state.h"
|
||||
|
||||
|
||||
#define DRAW_DBG 0
|
||||
|
||||
static LLVMValueRef
|
||||
from_64_float(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
|
||||
LLVMPointerType(LLVMDoubleTypeInContext(gallivm->context), 0) , "");
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
|
||||
return LLVMBuildFPTrunc(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
}
|
||||
|
||||
static LLVMValueRef
|
||||
from_32_float(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
|
||||
LLVMPointerType(LLVMFloatTypeInContext(gallivm->context), 0) , "");
|
||||
return LLVMBuildLoad(gallivm->builder, bc, "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
from_8_uscaled(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
|
||||
return LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
from_16_uscaled(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
|
||||
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 16), 0) , "");
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
|
||||
return LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
from_32_uscaled(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
|
||||
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
|
||||
return LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
from_8_sscaled(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
|
||||
return LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
from_16_sscaled(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
|
||||
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 16), 0) , "");
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
|
||||
return LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
from_32_sscaled(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
|
||||
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
|
||||
return LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
}
|
||||
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
from_8_unorm(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
|
||||
LLVMValueRef uscaled = LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
return LLVMBuildFDiv(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 255.), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
from_16_unorm(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
|
||||
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 16), 0) , "");
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
|
||||
LLVMValueRef uscaled = LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
return LLVMBuildFDiv(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 65535.), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
from_32_unorm(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
|
||||
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
|
||||
LLVMValueRef uscaled = LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
|
||||
return LLVMBuildFDiv(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 4294967295.), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
from_8_snorm(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
|
||||
LLVMValueRef uscaled = LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
return LLVMBuildFDiv(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 127.0), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
from_16_snorm(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
|
||||
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 16), 0) , "");
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
|
||||
LLVMValueRef uscaled = LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
return LLVMBuildFDiv(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 32767.0f), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
from_32_snorm(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
|
||||
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
|
||||
LLVMValueRef uscaled = LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
|
||||
return LLVMBuildFDiv(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 2147483647.0), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
from_32_fixed(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
|
||||
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
|
||||
LLVMValueRef uscaled = LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
|
||||
|
||||
return LLVMBuildFDiv(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 65536.0), "");
|
||||
}
|
||||
|
||||
static LLVMValueRef
|
||||
to_64_float(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
return LLVMBuildFPExt(gallivm->builder, l, LLVMDoubleTypeInContext(gallivm->context), "");
|
||||
}
|
||||
|
||||
static LLVMValueRef
|
||||
to_32_float(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
return LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
to_8_uscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
return LLVMBuildFPToUI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 8), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
to_16_uscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
return LLVMBuildFPToUI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 16), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
to_32_uscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
return LLVMBuildFPToUI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 32), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
to_8_sscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
return LLVMBuildFPToSI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 8), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
to_16_sscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
return LLVMBuildFPToSI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 16), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
to_32_sscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
return LLVMBuildFPToSI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 32), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
to_8_unorm(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
LLVMValueRef uscaled = LLVMBuildFPToUI(gallivm->builder, l,
|
||||
LLVMIntTypeInContext(gallivm->context, 8), "");
|
||||
return LLVMBuildFMul(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 255.), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
to_16_unorm(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
LLVMValueRef uscaled = LLVMBuildFPToUI(gallivm->builder, l,
|
||||
LLVMIntTypeInContext(gallivm->context, 32), "");
|
||||
return LLVMBuildFMul(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 65535.), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
to_32_unorm(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
LLVMValueRef uscaled = LLVMBuildFPToUI(gallivm->builder, l,
|
||||
LLVMIntTypeInContext(gallivm->context, 32), "");
|
||||
|
||||
return LLVMBuildFMul(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 4294967295.), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
to_8_snorm(struct gallivm_state *gallivm, LLVMValueRef val)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
|
||||
LLVMValueRef uscaled = LLVMBuildFPToSI(gallivm->builder, l,
|
||||
LLVMIntTypeInContext(gallivm->context, 8), "");
|
||||
return LLVMBuildFMul(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 127.0), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
to_16_snorm(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
LLVMValueRef uscaled = LLVMBuildFPToSI(gallivm->builder, l,
|
||||
LLVMIntTypeInContext(gallivm->context, 16), "");
|
||||
return LLVMBuildFMul(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 32767.0f), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
to_32_snorm(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
LLVMValueRef uscaled = LLVMBuildFPToSI(gallivm->builder, l,
|
||||
LLVMIntTypeInContext(gallivm->context, 32), "");
|
||||
|
||||
return LLVMBuildFMul(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 2147483647.0), "");
|
||||
}
|
||||
|
||||
static INLINE LLVMValueRef
|
||||
to_32_fixed(struct gallivm_state *gallivm, LLVMValueRef fp)
|
||||
{
|
||||
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
|
||||
LLVMValueRef uscaled = LLVMBuildFPToSI(gallivm->builder, l,
|
||||
LLVMIntTypeInContext(gallivm->context, 32), "");
|
||||
|
||||
return LLVMBuildFMul(gallivm->builder, uscaled,
|
||||
lp_build_const_float(gallivm, 65536.0), "");
|
||||
}
|
||||
|
||||
typedef LLVMValueRef (*from_func)(struct gallivm_state *, LLVMValueRef);
|
||||
typedef LLVMValueRef (*to_func)(struct gallivm_state *, LLVMValueRef);
|
||||
|
||||
/* so that underneath can avoid function calls which are prohibited
|
||||
* for static initialization we need this conversion */
|
||||
enum ll_type {
|
||||
LL_Double,
|
||||
LL_Float,
|
||||
LL_Int32,
|
||||
LL_Int16,
|
||||
LL_Int8
|
||||
};
|
||||
|
||||
static INLINE LLVMTypeRef
|
||||
ll_type_to_llvm(struct gallivm_state *gallivm, enum ll_type type)
|
||||
{
|
||||
switch (type) {
|
||||
case LL_Double:
|
||||
return LLVMDoubleTypeInContext(gallivm->context);
|
||||
case LL_Float:
|
||||
return LLVMFloatTypeInContext(gallivm->context);
|
||||
case LL_Int32:
|
||||
return LLVMInt32TypeInContext(gallivm->context);
|
||||
case LL_Int16:
|
||||
return LLVMIntTypeInContext(gallivm->context, 16);
|
||||
case LL_Int8:
|
||||
return LLVMIntTypeInContext(gallivm->context, 8);
|
||||
}
|
||||
return LLVMIntTypeInContext(gallivm->context, 8);
|
||||
}
|
||||
|
||||
static INLINE int
|
||||
ll_type_size(enum ll_type type)
|
||||
{
|
||||
switch (type) {
|
||||
case LL_Double:
|
||||
return 8;
|
||||
case LL_Float:
|
||||
return 4;
|
||||
case LL_Int32:
|
||||
return 4;
|
||||
case LL_Int16:
|
||||
return 2;
|
||||
case LL_Int8:
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct draw_llvm_translate {
|
||||
int format;
|
||||
from_func from;
|
||||
to_func to;
|
||||
enum ll_type type;
|
||||
int num_components;
|
||||
} translates[] =
|
||||
{
|
||||
{PIPE_FORMAT_R64_FLOAT, from_64_float, to_64_float, LL_Double, 1},
|
||||
{PIPE_FORMAT_R64G64_FLOAT, from_64_float, to_64_float, LL_Double, 2},
|
||||
{PIPE_FORMAT_R64G64B64_FLOAT, from_64_float, to_64_float, LL_Double, 3},
|
||||
{PIPE_FORMAT_R64G64B64A64_FLOAT, from_64_float, to_64_float, LL_Double, 4},
|
||||
{PIPE_FORMAT_R32_FLOAT, from_32_float, to_32_float, LL_Float, 1},
|
||||
{PIPE_FORMAT_R32G32_FLOAT, from_32_float, to_32_float, LL_Float, 2},
|
||||
{PIPE_FORMAT_R32G32B32_FLOAT, from_32_float, to_32_float, LL_Float, 3},
|
||||
{PIPE_FORMAT_R32G32B32A32_FLOAT, from_32_float, to_32_float, LL_Float, 4},
|
||||
|
||||
{PIPE_FORMAT_R32_UNORM, from_32_unorm, to_32_unorm, LL_Int32, 1},
|
||||
{PIPE_FORMAT_R32G32_UNORM, from_32_unorm, to_32_unorm, LL_Int32, 2},
|
||||
{PIPE_FORMAT_R32G32B32_UNORM, from_32_unorm, to_32_unorm, LL_Int32, 3},
|
||||
{PIPE_FORMAT_R32G32B32A32_UNORM, from_32_unorm, to_32_unorm, LL_Int32, 4},
|
||||
|
||||
{PIPE_FORMAT_R32_USCALED, from_32_uscaled, to_32_uscaled, LL_Int32, 1},
|
||||
{PIPE_FORMAT_R32G32_USCALED, from_32_uscaled, to_32_uscaled, LL_Int32, 2},
|
||||
{PIPE_FORMAT_R32G32B32_USCALED, from_32_uscaled, to_32_uscaled, LL_Int32, 3},
|
||||
{PIPE_FORMAT_R32G32B32A32_USCALED, from_32_uscaled, to_32_uscaled, LL_Int32, 4},
|
||||
|
||||
{PIPE_FORMAT_R32_SNORM, from_32_snorm, to_32_snorm, LL_Int32, 1},
|
||||
{PIPE_FORMAT_R32G32_SNORM, from_32_snorm, to_32_snorm, LL_Int32, 2},
|
||||
{PIPE_FORMAT_R32G32B32_SNORM, from_32_snorm, to_32_snorm, LL_Int32, 3},
|
||||
{PIPE_FORMAT_R32G32B32A32_SNORM, from_32_snorm, to_32_snorm, LL_Int32, 4},
|
||||
|
||||
{PIPE_FORMAT_R32_SSCALED, from_32_sscaled, to_32_sscaled, LL_Int32, 1},
|
||||
{PIPE_FORMAT_R32G32_SSCALED, from_32_sscaled, to_32_sscaled, LL_Int32, 2},
|
||||
{PIPE_FORMAT_R32G32B32_SSCALED, from_32_sscaled, to_32_sscaled, LL_Int32, 3},
|
||||
{PIPE_FORMAT_R32G32B32A32_SSCALED, from_32_sscaled, to_32_sscaled, LL_Int32, 4},
|
||||
|
||||
{PIPE_FORMAT_R16_UNORM, from_16_unorm, to_16_unorm, LL_Int16, 1},
|
||||
{PIPE_FORMAT_R16G16_UNORM, from_16_unorm, to_16_unorm, LL_Int16, 2},
|
||||
{PIPE_FORMAT_R16G16B16_UNORM, from_16_unorm, to_16_unorm, LL_Int16, 3},
|
||||
{PIPE_FORMAT_R16G16B16A16_UNORM, from_16_unorm, to_16_unorm, LL_Int16, 4},
|
||||
|
||||
{PIPE_FORMAT_R16_USCALED, from_16_uscaled, to_16_uscaled, LL_Int16, 1},
|
||||
{PIPE_FORMAT_R16G16_USCALED, from_16_uscaled, to_16_uscaled, LL_Int16, 2},
|
||||
{PIPE_FORMAT_R16G16B16_USCALED, from_16_uscaled, to_16_uscaled, LL_Int16, 3},
|
||||
{PIPE_FORMAT_R16G16B16A16_USCALED, from_16_uscaled, to_16_uscaled, LL_Int16, 4},
|
||||
|
||||
{PIPE_FORMAT_R16_SNORM, from_16_snorm, to_16_snorm, LL_Int16, 1},
|
||||
{PIPE_FORMAT_R16G16_SNORM, from_16_snorm, to_16_snorm, LL_Int16, 2},
|
||||
{PIPE_FORMAT_R16G16B16_SNORM, from_16_snorm, to_16_snorm, LL_Int16, 3},
|
||||
{PIPE_FORMAT_R16G16B16A16_SNORM, from_16_snorm, to_16_snorm, LL_Int16, 4},
|
||||
|
||||
{PIPE_FORMAT_R16_SSCALED, from_16_sscaled, to_16_sscaled, LL_Int16, 1},
|
||||
{PIPE_FORMAT_R16G16_SSCALED, from_16_sscaled, to_16_sscaled, LL_Int16, 2},
|
||||
{PIPE_FORMAT_R16G16B16_SSCALED, from_16_sscaled, to_16_sscaled, LL_Int16, 3},
|
||||
{PIPE_FORMAT_R16G16B16A16_SSCALED, from_16_sscaled, to_16_sscaled, LL_Int16, 4},
|
||||
|
||||
{PIPE_FORMAT_R8_UNORM, from_8_unorm, to_8_unorm, LL_Int8, 1},
|
||||
{PIPE_FORMAT_R8G8_UNORM, from_8_unorm, to_8_unorm, LL_Int8, 2},
|
||||
{PIPE_FORMAT_R8G8B8_UNORM, from_8_unorm, to_8_unorm, LL_Int8, 3},
|
||||
{PIPE_FORMAT_R8G8B8A8_UNORM, from_8_unorm, to_8_unorm, LL_Int8, 4},
|
||||
|
||||
{PIPE_FORMAT_R8_USCALED, from_8_uscaled, to_8_uscaled, LL_Int8, 1},
|
||||
{PIPE_FORMAT_R8G8_USCALED, from_8_uscaled, to_8_uscaled, LL_Int8, 2},
|
||||
{PIPE_FORMAT_R8G8B8_USCALED, from_8_uscaled, to_8_uscaled, LL_Int8, 3},
|
||||
{PIPE_FORMAT_R8G8B8A8_USCALED, from_8_uscaled, to_8_uscaled, LL_Int8, 4},
|
||||
|
||||
{PIPE_FORMAT_R8_SNORM, from_8_snorm, to_8_snorm, LL_Int8, 1},
|
||||
{PIPE_FORMAT_R8G8_SNORM, from_8_snorm, to_8_snorm, LL_Int8, 2},
|
||||
{PIPE_FORMAT_R8G8B8_SNORM, from_8_snorm, to_8_snorm, LL_Int8, 3},
|
||||
{PIPE_FORMAT_R8G8B8A8_SNORM, from_8_snorm, to_8_snorm, LL_Int8, 4},
|
||||
|
||||
{PIPE_FORMAT_R8_SSCALED, from_8_sscaled, to_8_sscaled, LL_Int8, 1},
|
||||
{PIPE_FORMAT_R8G8_SSCALED, from_8_sscaled, to_8_sscaled, LL_Int8, 2},
|
||||
{PIPE_FORMAT_R8G8B8_SSCALED, from_8_sscaled, to_8_sscaled, LL_Int8, 3},
|
||||
{PIPE_FORMAT_R8G8B8A8_SSCALED, from_8_sscaled, to_8_sscaled, LL_Int8, 4},
|
||||
|
||||
{PIPE_FORMAT_R32_FIXED, from_32_fixed, to_32_fixed, LL_Int32, 1},
|
||||
{PIPE_FORMAT_R32G32_FIXED, from_32_fixed, to_32_fixed, LL_Int32, 2},
|
||||
{PIPE_FORMAT_R32G32B32_FIXED, from_32_fixed, to_32_fixed, LL_Int32, 3},
|
||||
{PIPE_FORMAT_R32G32B32A32_FIXED, from_32_fixed, to_32_fixed, LL_Int32, 4},
|
||||
};
|
||||
|
||||
|
||||
static LLVMValueRef
|
||||
fetch(struct gallivm_state *gallivm,
|
||||
LLVMValueRef ptr, int val_size, int nr_components,
|
||||
from_func func)
|
||||
{
|
||||
int i;
|
||||
int offset = 0;
|
||||
LLVMValueRef res =
|
||||
LLVMConstNull(LLVMVectorType(LLVMFloatTypeInContext(gallivm->context), 4));
|
||||
LLVMValueRef defaults[4];
|
||||
|
||||
defaults[0] =
|
||||
defaults[1] =
|
||||
defaults[2] = lp_build_const_float(gallivm, 0.0);
|
||||
defaults[3] = lp_build_const_float(gallivm, 1.0);
|
||||
|
||||
for (i = 0; i < nr_components; ++i) {
|
||||
LLVMValueRef src_index = lp_build_const_int32(gallivm, offset);
|
||||
LLVMValueRef dst_index = lp_build_const_int32(gallivm, i);
|
||||
LLVMValueRef src_tmp;
|
||||
LLVMValueRef component;
|
||||
|
||||
src_tmp = LLVMBuildGEP(gallivm->builder, ptr, &src_index, 1, "src_tmp");
|
||||
|
||||
/* convert src_tmp to float */
|
||||
component = func(gallivm, src_tmp);
|
||||
|
||||
/* vec.comp = component */
|
||||
res = LLVMBuildInsertElement(gallivm->builder,
|
||||
res,
|
||||
component,
|
||||
dst_index, "");
|
||||
offset += val_size;
|
||||
}
|
||||
for (; i < 4; ++i) {
|
||||
LLVMValueRef dst_index = lp_build_const_int32(gallivm, i);
|
||||
res = LLVMBuildInsertElement(gallivm->builder,
|
||||
res,
|
||||
defaults[i],
|
||||
dst_index, "");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
LLVMValueRef
|
||||
draw_llvm_translate_from(struct gallivm_state *gallivm,
|
||||
LLVMValueRef vbuffer,
|
||||
enum pipe_format from_format)
|
||||
{
|
||||
const struct util_format_description *format_desc;
|
||||
LLVMValueRef zero;
|
||||
int i;
|
||||
struct lp_type type = lp_float32_vec4_type();
|
||||
|
||||
/*
|
||||
* The above can only cope with straight arrays: no bitfields,
|
||||
* swizzles, or half floats.
|
||||
*/
|
||||
|
||||
for (i = 0; i < Elements(translates); ++i) {
|
||||
if (translates[i].format == from_format) {
|
||||
/*LLVMTypeRef type = ll_type_to_llvm(translates[i].type);*/
|
||||
return fetch(gallivm,
|
||||
vbuffer,
|
||||
ll_type_size(translates[i].type),
|
||||
translates[i].num_components,
|
||||
translates[i].from);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This doesn't handle anything bigger than 32bits, or half floats
|
||||
* yet.
|
||||
*
|
||||
* TODO: unify all this code into lp_build_fetch_rgba_aos().
|
||||
*/
|
||||
|
||||
format_desc = util_format_description(from_format);
|
||||
zero = LLVMConstNull(LLVMInt32TypeInContext(gallivm->context));
|
||||
return lp_build_fetch_rgba_aos(gallivm, format_desc, type, vbuffer, zero, zero, zero);
|
||||
}
|
@@ -47,8 +47,8 @@
|
||||
#include "tgsi/tgsi_scan.h"
|
||||
|
||||
#ifdef HAVE_LLVM
|
||||
#include <llvm-c/ExecutionEngine.h>
|
||||
struct draw_llvm;
|
||||
struct gallivm_state;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -174,7 +174,6 @@ struct draw_context
|
||||
/** vertex element/index buffer (ex: glDrawElements) */
|
||||
const void *elts;
|
||||
/** bytes per index (0, 1, 2 or 4) */
|
||||
unsigned eltSizeIB;
|
||||
unsigned eltSize;
|
||||
int eltBias;
|
||||
unsigned min_index;
|
||||
@@ -241,14 +240,12 @@ struct draw_context
|
||||
uint edgeflag_output;
|
||||
uint clipvertex_output;
|
||||
uint clipdistance_output[2];
|
||||
/** TGSI program interpreter runtime state */
|
||||
struct tgsi_exec_machine *machine;
|
||||
|
||||
/** Fields for TGSI interpreter / execution */
|
||||
struct {
|
||||
struct tgsi_exec_machine *machine;
|
||||
uint num_samplers;
|
||||
struct tgsi_sampler **samplers;
|
||||
|
||||
struct tgsi_sampler **samplers;
|
||||
uint num_samplers;
|
||||
} tgsi;
|
||||
|
||||
const void *aligned_constants[PIPE_MAX_CONSTANT_BUFFERS];
|
||||
|
||||
@@ -268,14 +265,11 @@ struct draw_context
|
||||
uint num_gs_outputs; /**< convenience, from geometry_shader */
|
||||
uint position_output;
|
||||
|
||||
/** Fields for TGSI interpreter / execution */
|
||||
struct {
|
||||
struct tgsi_exec_machine *machine;
|
||||
|
||||
struct tgsi_sampler **samplers;
|
||||
uint num_samplers;
|
||||
} tgsi;
|
||||
/** TGSI program interpreter runtime state */
|
||||
struct tgsi_exec_machine *machine;
|
||||
|
||||
uint num_samplers;
|
||||
struct tgsi_sampler **samplers;
|
||||
} gs;
|
||||
|
||||
/** Fragment shader state */
|
||||
@@ -307,17 +301,13 @@ struct draw_context
|
||||
|
||||
#ifdef HAVE_LLVM
|
||||
struct draw_llvm *llvm;
|
||||
struct gallivm_state *own_gallivm;
|
||||
#endif
|
||||
|
||||
/** Texture sampler and sampler view state.
|
||||
* Note that we have arrays indexed by shader type. At this time
|
||||
* we only handle vertex and geometry shaders in the draw module, but
|
||||
* there may be more in the future (ex: hull and tessellation).
|
||||
*/
|
||||
struct pipe_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
|
||||
unsigned num_sampler_views[PIPE_SHADER_TYPES];
|
||||
const struct pipe_sampler_state *samplers[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
|
||||
unsigned num_samplers[PIPE_SHADER_TYPES];
|
||||
struct pipe_sampler_view *sampler_views[PIPE_MAX_VERTEX_SAMPLERS];
|
||||
unsigned num_sampler_views;
|
||||
const struct pipe_sampler_state *samplers[PIPE_MAX_VERTEX_SAMPLERS];
|
||||
unsigned num_samplers;
|
||||
|
||||
void *driver_private;
|
||||
};
|
||||
|
@@ -362,7 +362,7 @@ draw_pt_arrays_restart(struct draw_context *draw,
|
||||
|
||||
assert(info->primitive_restart);
|
||||
|
||||
if (draw->pt.user.eltSize) {
|
||||
if (draw->pt.user.elts) {
|
||||
/* indexed prims (draw_elements) */
|
||||
cur_start = start;
|
||||
cur_count = 0;
|
||||
@@ -433,8 +433,12 @@ draw_arrays_instanced(struct draw_context *draw,
|
||||
info.count = count;
|
||||
info.start_instance = startInstance;
|
||||
info.instance_count = instanceCount;
|
||||
info.min_index = start;
|
||||
info.max_index = start + count - 1;
|
||||
|
||||
info.indexed = (draw->pt.user.elts != NULL);
|
||||
if (!info.indexed) {
|
||||
info.min_index = start;
|
||||
info.max_index = start + count - 1;
|
||||
}
|
||||
|
||||
draw_vbo(draw, &info);
|
||||
}
|
||||
@@ -461,7 +465,6 @@ draw_vbo(struct draw_context *draw,
|
||||
draw->pt.user.eltBias = info->index_bias;
|
||||
draw->pt.user.min_index = info->min_index;
|
||||
draw->pt.user.max_index = info->max_index;
|
||||
draw->pt.user.eltSize = info->indexed ? draw->pt.user.eltSizeIB : 0;
|
||||
|
||||
if (0)
|
||||
debug_printf("draw_vbo(mode=%u start=%u count=%u):\n",
|
||||
|
@@ -230,7 +230,7 @@ llvm_pipeline_generic( struct draw_pt_middle_end *middle,
|
||||
llvm_vert_info.stride = fpme->vertex_size;
|
||||
llvm_vert_info.verts =
|
||||
(struct vertex_header *)MALLOC(fpme->vertex_size *
|
||||
align(fetch_info->count, lp_native_vector_width / 32));
|
||||
align(fetch_info->count, 4));
|
||||
if (!llvm_vert_info.verts) {
|
||||
assert(0);
|
||||
return;
|
||||
@@ -423,7 +423,7 @@ draw_pt_fetch_pipeline_or_emit_llvm(struct draw_context *draw)
|
||||
{
|
||||
struct llvm_middle_end *fpme = 0;
|
||||
|
||||
if (!draw->llvm)
|
||||
if (!draw->llvm || !draw->llvm->gallivm->engine)
|
||||
return NULL;
|
||||
|
||||
fpme = CALLOC_STRUCT( llvm_middle_end );
|
||||
|
@@ -193,8 +193,8 @@ draw_vs_init( struct draw_context *draw )
|
||||
{
|
||||
draw->dump_vs = debug_get_option_gallium_dump_vs();
|
||||
|
||||
draw->vs.tgsi.machine = tgsi_exec_machine_create();
|
||||
if (!draw->vs.tgsi.machine)
|
||||
draw->vs.machine = tgsi_exec_machine_create();
|
||||
if (!draw->vs.machine)
|
||||
return FALSE;
|
||||
|
||||
draw->vs.emit_cache = translate_cache_create();
|
||||
@@ -225,7 +225,7 @@ draw_vs_destroy( struct draw_context *draw )
|
||||
}
|
||||
}
|
||||
|
||||
tgsi_exec_machine_destroy(draw->vs.tgsi.machine);
|
||||
tgsi_exec_machine_destroy(draw->vs.machine);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -69,8 +69,8 @@ vs_exec_prepare( struct draw_vertex_shader *shader,
|
||||
if (evs->machine->Tokens != shader->state.tokens) {
|
||||
tgsi_exec_machine_bind_shader(evs->machine,
|
||||
shader->state.tokens,
|
||||
draw->vs.tgsi.num_samplers,
|
||||
draw->vs.tgsi.samplers);
|
||||
draw->vs.num_samplers,
|
||||
draw->vs.samplers);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ draw_create_vs_exec(struct draw_context *draw,
|
||||
vs->base.run_linear = vs_exec_run_linear;
|
||||
vs->base.delete = vs_exec_delete;
|
||||
vs->base.create_variant = draw_vs_create_variant_generic;
|
||||
vs->machine = draw->vs.tgsi.machine;
|
||||
vs->machine = draw->vs.machine;
|
||||
|
||||
return &vs->base;
|
||||
}
|
||||
|
@@ -75,9 +75,9 @@ lp_build_min_simple(struct lp_build_context *bld,
|
||||
LLVMValueRef a,
|
||||
LLVMValueRef b)
|
||||
{
|
||||
LLVMBuilderRef builder = bld->gallivm->builder;
|
||||
const struct lp_type type = bld->type;
|
||||
const char *intrinsic = NULL;
|
||||
unsigned intr_size = 0;
|
||||
LLVMValueRef cond;
|
||||
|
||||
assert(lp_check_value(type, a));
|
||||
@@ -85,71 +85,31 @@ lp_build_min_simple(struct lp_build_context *bld,
|
||||
|
||||
/* TODO: optimize the constant case */
|
||||
|
||||
if (type.floating && util_cpu_caps.has_sse) {
|
||||
if (type.width == 32) {
|
||||
if (type.length == 1) {
|
||||
intrinsic = "llvm.x86.sse.min.ss";
|
||||
intr_size = 128;
|
||||
}
|
||||
else if (type.length <= 4 || !util_cpu_caps.has_avx) {
|
||||
if(type.width * type.length == 128) {
|
||||
if(type.floating) {
|
||||
if(type.width == 32 && util_cpu_caps.has_sse)
|
||||
intrinsic = "llvm.x86.sse.min.ps";
|
||||
intr_size = 128;
|
||||
}
|
||||
else {
|
||||
intrinsic = "llvm.x86.avx.min.ps.256";
|
||||
intr_size = 256;
|
||||
}
|
||||
}
|
||||
if (type.width == 64 && util_cpu_caps.has_sse2) {
|
||||
if (type.length == 1) {
|
||||
intrinsic = "llvm.x86.sse2.min.sd";
|
||||
intr_size = 128;
|
||||
}
|
||||
else if (type.length == 2 || !util_cpu_caps.has_avx) {
|
||||
if(type.width == 64 && util_cpu_caps.has_sse2)
|
||||
intrinsic = "llvm.x86.sse2.min.pd";
|
||||
intr_size = 128;
|
||||
}
|
||||
else {
|
||||
intrinsic = "llvm.x86.avx.min.pd.256";
|
||||
intr_size = 256;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (util_cpu_caps.has_sse2 && type.length >= 2) {
|
||||
intr_size = 128;
|
||||
if ((type.width == 8 || type.width == 16) &&
|
||||
(type.width * type.length <= 64) &&
|
||||
(gallivm_debug & GALLIVM_DEBUG_PERF)) {
|
||||
debug_printf("%s: inefficient code, bogus shuffle due to packing\n",
|
||||
__FUNCTION__);
|
||||
}
|
||||
if (type.width == 8 && !type.sign) {
|
||||
intrinsic = "llvm.x86.sse2.pminu.b";
|
||||
}
|
||||
else if (type.width == 16 && type.sign) {
|
||||
intrinsic = "llvm.x86.sse2.pmins.w";
|
||||
}
|
||||
if (util_cpu_caps.has_sse4_1) {
|
||||
if (type.width == 8 && type.sign) {
|
||||
else {
|
||||
if(type.width == 8 && !type.sign && util_cpu_caps.has_sse2)
|
||||
intrinsic = "llvm.x86.sse2.pminu.b";
|
||||
if(type.width == 8 && type.sign && util_cpu_caps.has_sse4_1)
|
||||
intrinsic = "llvm.x86.sse41.pminsb";
|
||||
}
|
||||
if (type.width == 16 && !type.sign) {
|
||||
if(type.width == 16 && !type.sign && util_cpu_caps.has_sse4_1)
|
||||
intrinsic = "llvm.x86.sse41.pminuw";
|
||||
}
|
||||
if (type.width == 32 && !type.sign) {
|
||||
if(type.width == 16 && type.sign && util_cpu_caps.has_sse2)
|
||||
intrinsic = "llvm.x86.sse2.pmins.w";
|
||||
if(type.width == 32 && !type.sign && util_cpu_caps.has_sse4_1)
|
||||
intrinsic = "llvm.x86.sse41.pminud";
|
||||
}
|
||||
if (type.width == 32 && type.sign) {
|
||||
if(type.width == 32 && type.sign && util_cpu_caps.has_sse4_1)
|
||||
intrinsic = "llvm.x86.sse41.pminsd";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(intrinsic) {
|
||||
return lp_build_intrinsic_binary_anylength(bld->gallivm, intrinsic,
|
||||
type,
|
||||
intr_size, a, b);
|
||||
}
|
||||
if(intrinsic)
|
||||
return lp_build_intrinsic_binary(builder, intrinsic, lp_build_vec_type(bld->gallivm, bld->type), a, b);
|
||||
|
||||
cond = lp_build_cmp(bld, PIPE_FUNC_LESS, a, b);
|
||||
return lp_build_select(bld, cond, a, b);
|
||||
@@ -165,9 +125,9 @@ lp_build_max_simple(struct lp_build_context *bld,
|
||||
LLVMValueRef a,
|
||||
LLVMValueRef b)
|
||||
{
|
||||
LLVMBuilderRef builder = bld->gallivm->builder;
|
||||
const struct lp_type type = bld->type;
|
||||
const char *intrinsic = NULL;
|
||||
unsigned intr_size = 0;
|
||||
LLVMValueRef cond;
|
||||
|
||||
assert(lp_check_value(type, a));
|
||||
@@ -175,72 +135,31 @@ lp_build_max_simple(struct lp_build_context *bld,
|
||||
|
||||
/* TODO: optimize the constant case */
|
||||
|
||||
if (type.floating && util_cpu_caps.has_sse) {
|
||||
if (type.width == 32) {
|
||||
if (type.length == 1) {
|
||||
intrinsic = "llvm.x86.sse.max.ss";
|
||||
intr_size = 128;
|
||||
}
|
||||
else if (type.length <= 4 || !util_cpu_caps.has_avx) {
|
||||
if(type.width * type.length == 128) {
|
||||
if(type.floating) {
|
||||
if(type.width == 32 && util_cpu_caps.has_sse)
|
||||
intrinsic = "llvm.x86.sse.max.ps";
|
||||
intr_size = 128;
|
||||
}
|
||||
else {
|
||||
intrinsic = "llvm.x86.avx.max.ps.256";
|
||||
intr_size = 256;
|
||||
}
|
||||
}
|
||||
if (type.width == 64 && util_cpu_caps.has_sse2) {
|
||||
if (type.length == 1) {
|
||||
intrinsic = "llvm.x86.sse2.max.sd";
|
||||
intr_size = 128;
|
||||
}
|
||||
else if (type.length == 2 || !util_cpu_caps.has_avx) {
|
||||
if(type.width == 64 && util_cpu_caps.has_sse2)
|
||||
intrinsic = "llvm.x86.sse2.max.pd";
|
||||
intr_size = 128;
|
||||
}
|
||||
else {
|
||||
intrinsic = "llvm.x86.avx.max.pd.256";
|
||||
intr_size = 256;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (util_cpu_caps.has_sse2 && type.length >= 2) {
|
||||
intr_size = 128;
|
||||
if ((type.width == 8 || type.width == 16) &&
|
||||
(type.width * type.length <= 64) &&
|
||||
(gallivm_debug & GALLIVM_DEBUG_PERF)) {
|
||||
debug_printf("%s: inefficient code, bogus shuffle due to packing\n",
|
||||
__FUNCTION__);
|
||||
}
|
||||
if (type.width == 8 && !type.sign) {
|
||||
intrinsic = "llvm.x86.sse2.pmaxu.b";
|
||||
intr_size = 128;
|
||||
}
|
||||
else if (type.width == 16 && type.sign) {
|
||||
intrinsic = "llvm.x86.sse2.pmaxs.w";
|
||||
}
|
||||
if (util_cpu_caps.has_sse4_1) {
|
||||
if (type.width == 8 && type.sign) {
|
||||
else {
|
||||
if(type.width == 8 && !type.sign && util_cpu_caps.has_sse2)
|
||||
intrinsic = "llvm.x86.sse2.pmaxu.b";
|
||||
if(type.width == 8 && type.sign && util_cpu_caps.has_sse4_1)
|
||||
intrinsic = "llvm.x86.sse41.pmaxsb";
|
||||
}
|
||||
if (type.width == 16 && !type.sign) {
|
||||
if(type.width == 16 && !type.sign && util_cpu_caps.has_sse4_1)
|
||||
intrinsic = "llvm.x86.sse41.pmaxuw";
|
||||
}
|
||||
if (type.width == 32 && !type.sign) {
|
||||
if(type.width == 16 && type.sign && util_cpu_caps.has_sse2)
|
||||
intrinsic = "llvm.x86.sse2.pmaxs.w";
|
||||
if(type.width == 32 && !type.sign && util_cpu_caps.has_sse4_1)
|
||||
intrinsic = "llvm.x86.sse41.pmaxud";
|
||||
}
|
||||
if (type.width == 32 && type.sign) {
|
||||
if(type.width == 32 && type.sign && util_cpu_caps.has_sse4_1)
|
||||
intrinsic = "llvm.x86.sse41.pmaxsd";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(intrinsic) {
|
||||
return lp_build_intrinsic_binary_anylength(bld->gallivm, intrinsic,
|
||||
type,
|
||||
intr_size, a, b);
|
||||
}
|
||||
if(intrinsic)
|
||||
return lp_build_intrinsic_binary(builder, intrinsic, lp_build_vec_type(bld->gallivm, bld->type), a, b);
|
||||
|
||||
cond = lp_build_cmp(bld, PIPE_FUNC_GREATER, a, b);
|
||||
return lp_build_select(bld, cond, a, b);
|
||||
@@ -346,20 +265,15 @@ lp_build_add(struct lp_build_context *bld,
|
||||
}
|
||||
|
||||
|
||||
/** Return the scalar sum of the elements of a.
|
||||
* Should avoid this operation whenever possible.
|
||||
*/
|
||||
/** Return the scalar sum of the elements of a */
|
||||
LLVMValueRef
|
||||
lp_build_horizontal_add(struct lp_build_context *bld,
|
||||
LLVMValueRef a)
|
||||
lp_build_sum_vector(struct lp_build_context *bld,
|
||||
LLVMValueRef a)
|
||||
{
|
||||
LLVMBuilderRef builder = bld->gallivm->builder;
|
||||
const struct lp_type type = bld->type;
|
||||
LLVMValueRef index, res;
|
||||
unsigned i, length;
|
||||
LLVMValueRef shuffles1[LP_MAX_VECTOR_LENGTH / 2];
|
||||
LLVMValueRef shuffles2[LP_MAX_VECTOR_LENGTH / 2];
|
||||
LLVMValueRef vecres, elem2;
|
||||
unsigned i;
|
||||
|
||||
assert(lp_check_value(type, a));
|
||||
|
||||
@@ -369,191 +283,26 @@ lp_build_horizontal_add(struct lp_build_context *bld,
|
||||
|
||||
assert(!bld->type.norm);
|
||||
|
||||
/*
|
||||
* for byte vectors can do much better with psadbw.
|
||||
* Using repeated shuffle/adds here. Note with multiple vectors
|
||||
* this can be done more efficiently as outlined in the intel
|
||||
* optimization manual.
|
||||
* Note: could cause data rearrangement if used with smaller element
|
||||
* sizes.
|
||||
*/
|
||||
|
||||
vecres = a;
|
||||
length = type.length / 2;
|
||||
while (length > 1) {
|
||||
LLVMValueRef vec1, vec2;
|
||||
for (i = 0; i < length; i++) {
|
||||
shuffles1[i] = lp_build_const_int32(bld->gallivm, i);
|
||||
shuffles2[i] = lp_build_const_int32(bld->gallivm, i + length);
|
||||
}
|
||||
vec1 = LLVMBuildShuffleVector(builder, vecres, vecres,
|
||||
LLVMConstVector(shuffles1, length), "");
|
||||
vec2 = LLVMBuildShuffleVector(builder, vecres, vecres,
|
||||
LLVMConstVector(shuffles2, length), "");
|
||||
if (type.floating) {
|
||||
vecres = LLVMBuildFAdd(builder, vec1, vec2, "");
|
||||
}
|
||||
else {
|
||||
vecres = LLVMBuildAdd(builder, vec1, vec2, "");
|
||||
}
|
||||
length = length >> 1;
|
||||
}
|
||||
|
||||
/* always have vector of size 2 here */
|
||||
assert(length == 1);
|
||||
|
||||
index = lp_build_const_int32(bld->gallivm, 0);
|
||||
res = LLVMBuildExtractElement(builder, vecres, index, "");
|
||||
index = lp_build_const_int32(bld->gallivm, 1);
|
||||
elem2 = LLVMBuildExtractElement(builder, vecres, index, "");
|
||||
res = LLVMBuildExtractElement(builder, a, index, "");
|
||||
|
||||
if (type.floating)
|
||||
res = LLVMBuildFAdd(builder, res, elem2, "");
|
||||
else
|
||||
res = LLVMBuildAdd(builder, res, elem2, "");
|
||||
for (i = 1; i < type.length; i++) {
|
||||
index = lp_build_const_int32(bld->gallivm, i);
|
||||
if (type.floating)
|
||||
res = LLVMBuildFAdd(builder, res,
|
||||
LLVMBuildExtractElement(builder,
|
||||
a, index, ""),
|
||||
"");
|
||||
else
|
||||
res = LLVMBuildAdd(builder, res,
|
||||
LLVMBuildExtractElement(builder,
|
||||
a, index, ""),
|
||||
"");
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the horizontal sums of 4 float vectors as a float4 vector.
|
||||
* This uses the technique as outlined in Intel Optimization Manual.
|
||||
*/
|
||||
static LLVMValueRef
|
||||
lp_build_horizontal_add4x4f(struct lp_build_context *bld,
|
||||
LLVMValueRef src[4])
|
||||
{
|
||||
struct gallivm_state *gallivm = bld->gallivm;
|
||||
LLVMBuilderRef builder = gallivm->builder;
|
||||
LLVMValueRef shuffles[4];
|
||||
LLVMValueRef tmp[4];
|
||||
LLVMValueRef sumtmp[2], shuftmp[2];
|
||||
|
||||
/* lower half of regs */
|
||||
shuffles[0] = lp_build_const_int32(gallivm, 0);
|
||||
shuffles[1] = lp_build_const_int32(gallivm, 1);
|
||||
shuffles[2] = lp_build_const_int32(gallivm, 4);
|
||||
shuffles[3] = lp_build_const_int32(gallivm, 5);
|
||||
tmp[0] = LLVMBuildShuffleVector(builder, src[0], src[1],
|
||||
LLVMConstVector(shuffles, 4), "");
|
||||
tmp[2] = LLVMBuildShuffleVector(builder, src[2], src[3],
|
||||
LLVMConstVector(shuffles, 4), "");
|
||||
|
||||
/* upper half of regs */
|
||||
shuffles[0] = lp_build_const_int32(gallivm, 2);
|
||||
shuffles[1] = lp_build_const_int32(gallivm, 3);
|
||||
shuffles[2] = lp_build_const_int32(gallivm, 6);
|
||||
shuffles[3] = lp_build_const_int32(gallivm, 7);
|
||||
tmp[1] = LLVMBuildShuffleVector(builder, src[0], src[1],
|
||||
LLVMConstVector(shuffles, 4), "");
|
||||
tmp[3] = LLVMBuildShuffleVector(builder, src[2], src[3],
|
||||
LLVMConstVector(shuffles, 4), "");
|
||||
|
||||
sumtmp[0] = LLVMBuildFAdd(builder, tmp[0], tmp[1], "");
|
||||
sumtmp[1] = LLVMBuildFAdd(builder, tmp[2], tmp[3], "");
|
||||
|
||||
shuffles[0] = lp_build_const_int32(gallivm, 0);
|
||||
shuffles[1] = lp_build_const_int32(gallivm, 2);
|
||||
shuffles[2] = lp_build_const_int32(gallivm, 4);
|
||||
shuffles[3] = lp_build_const_int32(gallivm, 6);
|
||||
shuftmp[0] = LLVMBuildShuffleVector(builder, sumtmp[0], sumtmp[1],
|
||||
LLVMConstVector(shuffles, 4), "");
|
||||
|
||||
shuffles[0] = lp_build_const_int32(gallivm, 1);
|
||||
shuffles[1] = lp_build_const_int32(gallivm, 3);
|
||||
shuffles[2] = lp_build_const_int32(gallivm, 5);
|
||||
shuffles[3] = lp_build_const_int32(gallivm, 7);
|
||||
shuftmp[1] = LLVMBuildShuffleVector(builder, sumtmp[0], sumtmp[1],
|
||||
LLVMConstVector(shuffles, 4), "");
|
||||
|
||||
return LLVMBuildFAdd(builder, shuftmp[0], shuftmp[1], "");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* partially horizontally add 2-4 float vectors with length nx4,
|
||||
* i.e. only four adjacent values in each vector will be added,
|
||||
* assuming values are really grouped in 4 which also determines
|
||||
* output order.
|
||||
*
|
||||
* Return a vector of the same length as the initial vectors,
|
||||
* with the excess elements (if any) being undefined.
|
||||
* The element order is independent of number of input vectors.
|
||||
* For 3 vectors x0x1x2x3x4x5x6x7, y0y1y2y3y4y5y6y7, z0z1z2z3z4z5z6z7
|
||||
* the output order thus will be
|
||||
* sumx0-x3,sumy0-y3,sumz0-z3,undef,sumx4-x7,sumy4-y7,sumz4z7,undef
|
||||
*/
|
||||
LLVMValueRef
|
||||
lp_build_hadd_partial4(struct lp_build_context *bld,
|
||||
LLVMValueRef vectors[],
|
||||
unsigned num_vecs)
|
||||
{
|
||||
struct gallivm_state *gallivm = bld->gallivm;
|
||||
LLVMBuilderRef builder = gallivm->builder;
|
||||
LLVMValueRef ret_vec;
|
||||
LLVMValueRef tmp[4];
|
||||
const char *intrinsic = NULL;
|
||||
|
||||
assert(num_vecs >= 2 && num_vecs <= 4);
|
||||
assert(bld->type.floating);
|
||||
|
||||
/* only use this with at least 2 vectors, as it is sort of expensive
|
||||
* (depending on cpu) and we always need two horizontal adds anyway,
|
||||
* so a shuffle/add approach might be better.
|
||||
*/
|
||||
|
||||
tmp[0] = vectors[0];
|
||||
tmp[1] = vectors[1];
|
||||
|
||||
tmp[2] = num_vecs > 2 ? vectors[2] : vectors[0];
|
||||
tmp[3] = num_vecs > 3 ? vectors[3] : vectors[0];
|
||||
|
||||
if (util_cpu_caps.has_sse3 && bld->type.width == 32 &&
|
||||
bld->type.length == 4) {
|
||||
intrinsic = "llvm.x86.sse3.hadd.ps";
|
||||
}
|
||||
else if (util_cpu_caps.has_avx && bld->type.width == 32 &&
|
||||
bld->type.length == 8) {
|
||||
intrinsic = "llvm.x86.avx.hadd.ps.256";
|
||||
}
|
||||
if (intrinsic) {
|
||||
tmp[0] = lp_build_intrinsic_binary(builder, intrinsic,
|
||||
lp_build_vec_type(gallivm, bld->type),
|
||||
tmp[0], tmp[1]);
|
||||
if (num_vecs > 2) {
|
||||
tmp[1] = lp_build_intrinsic_binary(builder, intrinsic,
|
||||
lp_build_vec_type(gallivm, bld->type),
|
||||
tmp[2], tmp[3]);
|
||||
}
|
||||
else {
|
||||
tmp[1] = tmp[0];
|
||||
}
|
||||
return lp_build_intrinsic_binary(builder, intrinsic,
|
||||
lp_build_vec_type(gallivm, bld->type),
|
||||
tmp[0], tmp[1]);
|
||||
}
|
||||
|
||||
if (bld->type.length == 4) {
|
||||
ret_vec = lp_build_horizontal_add4x4f(bld, tmp);
|
||||
}
|
||||
else {
|
||||
LLVMValueRef partres[LP_MAX_VECTOR_LENGTH/4];
|
||||
unsigned j;
|
||||
unsigned num_iter = bld->type.length / 4;
|
||||
struct lp_type parttype = bld->type;
|
||||
parttype.length = 4;
|
||||
for (j = 0; j < num_iter; j++) {
|
||||
LLVMValueRef partsrc[4];
|
||||
unsigned i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
partsrc[i] = lp_build_extract_range(gallivm, tmp[i], j*4, 4);
|
||||
}
|
||||
partres[j] = lp_build_horizontal_add4x4f(bld, partsrc);
|
||||
}
|
||||
ret_vec = lp_build_concat(gallivm, partres, parttype, num_iter);
|
||||
}
|
||||
return ret_vec;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a - b
|
||||
@@ -804,7 +553,7 @@ lp_build_mul_imm(struct lp_build_context *bld,
|
||||
if(bld->type.floating) {
|
||||
#if 0
|
||||
/*
|
||||
* Power of two multiplication by directly manipulating the exponent.
|
||||
* Power of two multiplication by directly manipulating the mantissa.
|
||||
*
|
||||
* XXX: This might not be always faster, it will introduce a small error
|
||||
* for multiplication by zero, and it will produce wrong results
|
||||
@@ -863,8 +612,7 @@ lp_build_div(struct lp_build_context *bld,
|
||||
return LLVMConstUDiv(a, b);
|
||||
}
|
||||
|
||||
if(((util_cpu_caps.has_sse && type.width == 32 && type.length == 4) ||
|
||||
(util_cpu_caps.has_avx && type.width == 32 && type.length == 8)) &&
|
||||
if(util_cpu_caps.has_sse && type.width == 32 && type.length == 4 &&
|
||||
type.floating)
|
||||
return lp_build_mul(bld, a, lp_build_rcp(bld, b));
|
||||
|
||||
@@ -1123,12 +871,6 @@ lp_build_abs(struct lp_build_context *bld,
|
||||
return lp_build_intrinsic_unary(builder, "llvm.x86.ssse3.pabs.d.128", vec_type, a);
|
||||
}
|
||||
}
|
||||
else if (type.width*type.length == 256 && util_cpu_caps.has_ssse3 &&
|
||||
(gallivm_debug & GALLIVM_DEBUG_PERF) &&
|
||||
(type.width == 8 || type.width == 16 || type.width == 32)) {
|
||||
debug_printf("%s: inefficient code, should split vectors manually\n",
|
||||
__FUNCTION__);
|
||||
}
|
||||
|
||||
return lp_build_max(bld, a, LLVMBuildNeg(builder, a, ""));
|
||||
}
|
||||
@@ -1192,7 +934,6 @@ lp_build_sgn(struct lp_build_context *bld,
|
||||
else
|
||||
{
|
||||
/* signed int/norm/fixed point */
|
||||
/* could use psign with sse3 and appropriate vectors here */
|
||||
LLVMValueRef minus_one = lp_build_const_vec(bld->gallivm, type, -1.0);
|
||||
cond = lp_build_cmp(bld, PIPE_FUNC_GREATER, a, bld->zero);
|
||||
res = lp_build_select(bld, cond, bld->one, minus_one);
|
||||
@@ -1259,16 +1000,7 @@ lp_build_int_to_float(struct lp_build_context *bld,
|
||||
return LLVMBuildSIToFP(builder, a, vec_type, "");
|
||||
}
|
||||
|
||||
static boolean
|
||||
sse41_rounding_available(const struct lp_type type)
|
||||
{
|
||||
if ((util_cpu_caps.has_sse4_1 &&
|
||||
(type.length == 1 || type.width*type.length == 128)) ||
|
||||
(util_cpu_caps.has_avx && type.width*type.length == 256))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
enum lp_build_round_sse41_mode
|
||||
{
|
||||
@@ -1333,34 +1065,18 @@ lp_build_round_sse41(struct lp_build_context *bld,
|
||||
res = LLVMBuildExtractElement(builder, res, index0, "");
|
||||
}
|
||||
else {
|
||||
if (type.width * type.length == 128) {
|
||||
switch(type.width) {
|
||||
case 32:
|
||||
intrinsic = "llvm.x86.sse41.round.ps";
|
||||
break;
|
||||
case 64:
|
||||
intrinsic = "llvm.x86.sse41.round.pd";
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
return bld->undef;
|
||||
}
|
||||
}
|
||||
else {
|
||||
assert(type.width * type.length == 256);
|
||||
assert(util_cpu_caps.has_avx);
|
||||
assert(type.width*type.length == 128);
|
||||
|
||||
switch(type.width) {
|
||||
case 32:
|
||||
intrinsic = "llvm.x86.avx.round.ps.256";
|
||||
break;
|
||||
case 64:
|
||||
intrinsic = "llvm.x86.avx.round.pd.256";
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
return bld->undef;
|
||||
}
|
||||
switch(type.width) {
|
||||
case 32:
|
||||
intrinsic = "llvm.x86.sse41.round.ps";
|
||||
break;
|
||||
case 64:
|
||||
intrinsic = "llvm.x86.sse41.round.pd";
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
return bld->undef;
|
||||
}
|
||||
|
||||
res = lp_build_intrinsic_binary(builder, intrinsic,
|
||||
@@ -1409,15 +1125,10 @@ lp_build_iround_nearest_sse2(struct lp_build_context *bld,
|
||||
ret_type, arg);
|
||||
}
|
||||
else {
|
||||
if (type.width* type.length == 128) {
|
||||
intrinsic = "llvm.x86.sse2.cvtps2dq";
|
||||
}
|
||||
else {
|
||||
assert(type.width*type.length == 256);
|
||||
assert(util_cpu_caps.has_avx);
|
||||
assert(type.width*type.length == 128);
|
||||
|
||||
intrinsic = "llvm.x86.sse2.cvtps2dq";
|
||||
|
||||
intrinsic = "llvm.x86.avx.cvt.ps2dq.256";
|
||||
}
|
||||
res = lp_build_intrinsic_unary(builder, intrinsic,
|
||||
ret_type, a);
|
||||
}
|
||||
@@ -1441,7 +1152,8 @@ lp_build_trunc(struct lp_build_context *bld,
|
||||
assert(type.floating);
|
||||
assert(lp_check_value(type, a));
|
||||
|
||||
if (sse41_rounding_available(type)) {
|
||||
if (util_cpu_caps.has_sse4_1 &&
|
||||
(type.length == 1 || type.width*type.length == 128)) {
|
||||
return lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_TRUNCATE);
|
||||
}
|
||||
else {
|
||||
@@ -1471,7 +1183,8 @@ lp_build_round(struct lp_build_context *bld,
|
||||
assert(type.floating);
|
||||
assert(lp_check_value(type, a));
|
||||
|
||||
if (sse41_rounding_available(type)) {
|
||||
if (util_cpu_caps.has_sse4_1 &&
|
||||
(type.length == 1 || type.width*type.length == 128)) {
|
||||
return lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_NEAREST);
|
||||
}
|
||||
else {
|
||||
@@ -1499,7 +1212,8 @@ lp_build_floor(struct lp_build_context *bld,
|
||||
assert(type.floating);
|
||||
assert(lp_check_value(type, a));
|
||||
|
||||
if (sse41_rounding_available(type)) {
|
||||
if (util_cpu_caps.has_sse4_1 &&
|
||||
(type.length == 1 || type.width*type.length == 128)) {
|
||||
return lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_FLOOR);
|
||||
}
|
||||
else {
|
||||
@@ -1527,7 +1241,8 @@ lp_build_ceil(struct lp_build_context *bld,
|
||||
assert(type.floating);
|
||||
assert(lp_check_value(type, a));
|
||||
|
||||
if (sse41_rounding_available(type)) {
|
||||
if (util_cpu_caps.has_sse4_1 &&
|
||||
(type.length == 1 || type.width*type.length == 128)) {
|
||||
return lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_CEIL);
|
||||
}
|
||||
else {
|
||||
@@ -1553,34 +1268,6 @@ lp_build_fract(struct lp_build_context *bld,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prevent returning a fractional part of 1.0 for very small negative values of
|
||||
* 'a' by clamping against 0.99999(9).
|
||||
*/
|
||||
static inline LLVMValueRef
|
||||
clamp_fract(struct lp_build_context *bld, LLVMValueRef fract)
|
||||
{
|
||||
LLVMValueRef max;
|
||||
|
||||
/* this is the largest number smaller than 1.0 representable as float */
|
||||
max = lp_build_const_vec(bld->gallivm, bld->type,
|
||||
1.0 - 1.0/(1LL << (lp_mantissa(bld->type) + 1)));
|
||||
return lp_build_min(bld, fract, max);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Same as lp_build_fract, but guarantees that the result is always smaller
|
||||
* than one.
|
||||
*/
|
||||
LLVMValueRef
|
||||
lp_build_fract_safe(struct lp_build_context *bld,
|
||||
LLVMValueRef a)
|
||||
{
|
||||
return clamp_fract(bld, lp_build_fract(bld, a));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the integer part of a float (vector) value (== round toward zero).
|
||||
* The returned value is an integer (vector).
|
||||
@@ -1620,12 +1307,12 @@ lp_build_iround(struct lp_build_context *bld,
|
||||
|
||||
assert(lp_check_value(type, a));
|
||||
|
||||
if ((util_cpu_caps.has_sse2 &&
|
||||
((type.width == 32) && (type.length == 1 || type.length == 4))) ||
|
||||
(util_cpu_caps.has_avx && type.width == 32 && type.length == 8)) {
|
||||
if (util_cpu_caps.has_sse2 &&
|
||||
((type.width == 32) && (type.length == 1 || type.length == 4))) {
|
||||
return lp_build_iround_nearest_sse2(bld, a);
|
||||
}
|
||||
if (sse41_rounding_available(type)) {
|
||||
else if (util_cpu_caps.has_sse4_1 &&
|
||||
(type.length == 1 || type.width*type.length == 128)) {
|
||||
res = lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_NEAREST);
|
||||
}
|
||||
else {
|
||||
@@ -1675,12 +1362,14 @@ lp_build_ifloor(struct lp_build_context *bld,
|
||||
assert(type.floating);
|
||||
assert(lp_check_value(type, a));
|
||||
|
||||
res = a;
|
||||
if (type.sign) {
|
||||
if (sse41_rounding_available(type)) {
|
||||
res = lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_FLOOR);
|
||||
}
|
||||
else {
|
||||
if (util_cpu_caps.has_sse4_1 &&
|
||||
(type.length == 1 || type.width*type.length == 128)) {
|
||||
res = lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_FLOOR);
|
||||
}
|
||||
else {
|
||||
res = a;
|
||||
|
||||
if (type.sign) {
|
||||
/* Take the sign bit and add it to 1 constant */
|
||||
LLVMTypeRef vec_type = bld->vec_type;
|
||||
unsigned mantissa = lp_mantissa(type);
|
||||
@@ -1734,7 +1423,8 @@ lp_build_iceil(struct lp_build_context *bld,
|
||||
assert(type.floating);
|
||||
assert(lp_check_value(type, a));
|
||||
|
||||
if (sse41_rounding_available(type)) {
|
||||
if (util_cpu_caps.has_sse4_1 &&
|
||||
(type.length == 1 || type.width*type.length == 128)) {
|
||||
res = lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_CEIL);
|
||||
}
|
||||
else {
|
||||
@@ -1780,7 +1470,7 @@ lp_build_iceil(struct lp_build_context *bld,
|
||||
* Combined ifloor() & fract().
|
||||
*
|
||||
* Preferred to calling the functions separately, as it will ensure that the
|
||||
* strategy (floor() vs ifloor()) that results in less redundant work is used.
|
||||
* stratergy (floor() vs ifloor()) that results in less redundant work is used.
|
||||
*/
|
||||
void
|
||||
lp_build_ifloor_fract(struct lp_build_context *bld,
|
||||
@@ -1795,7 +1485,8 @@ lp_build_ifloor_fract(struct lp_build_context *bld,
|
||||
assert(type.floating);
|
||||
assert(lp_check_value(type, a));
|
||||
|
||||
if (sse41_rounding_available(type)) {
|
||||
if (util_cpu_caps.has_sse4_1 &&
|
||||
(type.length == 1 || type.width*type.length == 128)) {
|
||||
/*
|
||||
* floor() is easier.
|
||||
*/
|
||||
@@ -1816,21 +1507,6 @@ lp_build_ifloor_fract(struct lp_build_context *bld,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Same as lp_build_ifloor_fract, but guarantees that the fractional part is
|
||||
* always smaller than one.
|
||||
*/
|
||||
void
|
||||
lp_build_ifloor_fract_safe(struct lp_build_context *bld,
|
||||
LLVMValueRef a,
|
||||
LLVMValueRef *out_ipart,
|
||||
LLVMValueRef *out_fpart)
|
||||
{
|
||||
lp_build_ifloor_fract(bld, a, out_ipart, out_fpart);
|
||||
*out_fpart = clamp_fract(bld, *out_fpart);
|
||||
}
|
||||
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_sqrt(struct lp_build_context *bld,
|
||||
LLVMValueRef a)
|
||||
@@ -1842,15 +1518,11 @@ lp_build_sqrt(struct lp_build_context *bld,
|
||||
|
||||
assert(lp_check_value(type, a));
|
||||
|
||||
/* TODO: optimize the constant case */
|
||||
/* TODO: optimize the constant case */
|
||||
|
||||
assert(type.floating);
|
||||
if (type.length == 1) {
|
||||
util_snprintf(intrinsic, sizeof intrinsic, "llvm.sqrt.f%u", type.width);
|
||||
}
|
||||
else {
|
||||
util_snprintf(intrinsic, sizeof intrinsic, "llvm.sqrt.v%uf%u", type.length, type.width);
|
||||
}
|
||||
util_snprintf(intrinsic, sizeof intrinsic, "llvm.sqrt.v%uf%u", type.length, type.width);
|
||||
|
||||
return lp_build_intrinsic_unary(builder, intrinsic, vec_type, a);
|
||||
}
|
||||
@@ -1914,28 +1586,19 @@ lp_build_rcp(struct lp_build_context *bld,
|
||||
* - it doesn't even get the reciprocate of 1.0 exactly
|
||||
* - doing Newton-Rapshon steps yields wrong (NaN) values for 0.0 or Inf
|
||||
* - for recent processors the benefit over DIVPS is marginal, a case
|
||||
* dependent
|
||||
* depedent
|
||||
*
|
||||
* We could still use it on certain processors if benchmarks show that the
|
||||
* RCPPS plus necessary workarounds are still preferrable to DIVPS; or for
|
||||
* particular uses that require less workarounds.
|
||||
*/
|
||||
|
||||
if (FALSE && ((util_cpu_caps.has_sse && type.width == 32 && type.length == 4) ||
|
||||
(util_cpu_caps.has_avx && type.width == 32 && type.length == 8))){
|
||||
if (FALSE && util_cpu_caps.has_sse && type.width == 32 && type.length == 4) {
|
||||
const unsigned num_iterations = 0;
|
||||
LLVMValueRef res;
|
||||
unsigned i;
|
||||
const char *intrinsic = NULL;
|
||||
|
||||
if (type.length == 4) {
|
||||
intrinsic = "llvm.x86.sse.rcp.ps";
|
||||
}
|
||||
else {
|
||||
intrinsic = "llvm.x86.avx.rcp.ps.256";
|
||||
}
|
||||
|
||||
res = lp_build_intrinsic_unary(builder, intrinsic, bld->vec_type, a);
|
||||
res = lp_build_intrinsic_unary(builder, "llvm.x86.sse.rcp.ps", bld->vec_type, a);
|
||||
|
||||
for (i = 0; i < num_iterations; ++i) {
|
||||
res = lp_build_rcp_refine(bld, a, res);
|
||||
@@ -1990,22 +1653,12 @@ lp_build_rsqrt(struct lp_build_context *bld,
|
||||
|
||||
assert(type.floating);
|
||||
|
||||
if ((util_cpu_caps.has_sse && type.width == 32 && type.length == 4) ||
|
||||
(util_cpu_caps.has_avx && type.width == 32 && type.length == 8)) {
|
||||
if (util_cpu_caps.has_sse && type.width == 32 && type.length == 4) {
|
||||
const unsigned num_iterations = 1;
|
||||
LLVMValueRef res;
|
||||
unsigned i;
|
||||
const char *intrinsic = NULL;
|
||||
|
||||
if (type.length == 4) {
|
||||
intrinsic = "llvm.x86.sse.rsqrt.ps";
|
||||
}
|
||||
else {
|
||||
intrinsic = "llvm.x86.avx.rsqrt.ps.256";
|
||||
}
|
||||
|
||||
res = lp_build_intrinsic_unary(builder, intrinsic, bld->vec_type, a);
|
||||
|
||||
res = lp_build_intrinsic_unary(builder, "llvm.x86.sse.rsqrt.ps", bld->vec_type, a);
|
||||
|
||||
for (i = 0; i < num_iterations; ++i) {
|
||||
res = lp_build_rsqrt_refine(bld, a, res);
|
||||
|
@@ -57,13 +57,8 @@ lp_build_add(struct lp_build_context *bld,
|
||||
LLVMValueRef b);
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_horizontal_add(struct lp_build_context *bld,
|
||||
LLVMValueRef a);
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_hadd_partial4(struct lp_build_context *bld,
|
||||
LLVMValueRef vectors[],
|
||||
unsigned num_vecs);
|
||||
lp_build_sum_vector(struct lp_build_context *bld,
|
||||
LLVMValueRef a);
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_sub(struct lp_build_context *bld,
|
||||
@@ -161,10 +156,6 @@ LLVMValueRef
|
||||
lp_build_fract(struct lp_build_context *bld,
|
||||
LLVMValueRef a);
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_fract_safe(struct lp_build_context *bld,
|
||||
LLVMValueRef a);
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_ifloor(struct lp_build_context *bld,
|
||||
LLVMValueRef a);
|
||||
@@ -186,12 +177,6 @@ lp_build_ifloor_fract(struct lp_build_context *bld,
|
||||
LLVMValueRef *out_ipart,
|
||||
LLVMValueRef *out_fpart);
|
||||
|
||||
void
|
||||
lp_build_ifloor_fract_safe(struct lp_build_context *bld,
|
||||
LLVMValueRef a,
|
||||
LLVMValueRef *out_ipart,
|
||||
LLVMValueRef *out_fpart);
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_sqrt(struct lp_build_context *bld,
|
||||
LLVMValueRef a);
|
||||
|
@@ -37,7 +37,6 @@
|
||||
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_math.h"
|
||||
#include "util/u_half.h"
|
||||
|
||||
#include "lp_bld_type.h"
|
||||
#include "lp_bld_const.h"
|
||||
@@ -51,12 +50,10 @@ lp_mantissa(struct lp_type type)
|
||||
|
||||
if(type.floating) {
|
||||
switch(type.width) {
|
||||
case 16:
|
||||
return 10;
|
||||
case 32:
|
||||
return 23;
|
||||
case 64:
|
||||
return 52;
|
||||
return 53;
|
||||
default:
|
||||
assert(0);
|
||||
return 0;
|
||||
@@ -139,8 +136,6 @@ lp_const_min(struct lp_type type)
|
||||
|
||||
if (type.floating) {
|
||||
switch(type.width) {
|
||||
case 16:
|
||||
return -65504;
|
||||
case 32:
|
||||
return -FLT_MAX;
|
||||
case 64:
|
||||
@@ -174,8 +169,6 @@ lp_const_max(struct lp_type type)
|
||||
|
||||
if (type.floating) {
|
||||
switch(type.width) {
|
||||
case 16:
|
||||
return 65504;
|
||||
case 32:
|
||||
return FLT_MAX;
|
||||
case 64:
|
||||
@@ -203,8 +196,6 @@ lp_const_eps(struct lp_type type)
|
||||
{
|
||||
if (type.floating) {
|
||||
switch(type.width) {
|
||||
case 16:
|
||||
return 2E-10;
|
||||
case 32:
|
||||
return FLT_EPSILON;
|
||||
case 64:
|
||||
@@ -256,9 +247,7 @@ lp_build_one(struct gallivm_state *gallivm, struct lp_type type)
|
||||
|
||||
elem_type = lp_build_elem_type(gallivm, type);
|
||||
|
||||
if(type.floating && type.width == 16)
|
||||
elems[0] = LLVMConstInt(elem_type, util_float_to_half(1.0f), 0);
|
||||
else if(type.floating)
|
||||
if(type.floating)
|
||||
elems[0] = LLVMConstReal(elem_type, 1.0);
|
||||
else if(type.fixed)
|
||||
elems[0] = LLVMConstInt(elem_type, 1LL << (type.width/2), 0);
|
||||
@@ -303,9 +292,7 @@ lp_build_const_elem(struct gallivm_state *gallivm,
|
||||
LLVMTypeRef elem_type = lp_build_elem_type(gallivm, type);
|
||||
LLVMValueRef elem;
|
||||
|
||||
if(type.floating && type.width == 16) {
|
||||
elem = LLVMConstInt(elem_type, util_float_to_half((float)val), 0);
|
||||
} else if(type.floating) {
|
||||
if(type.floating) {
|
||||
elem = LLVMConstReal(elem_type, val);
|
||||
}
|
||||
else {
|
||||
@@ -377,10 +364,20 @@ lp_build_const_aos(struct gallivm_state *gallivm,
|
||||
if(swizzle == NULL)
|
||||
swizzle = default_swizzle;
|
||||
|
||||
elems[swizzle[0]] = lp_build_const_elem(gallivm, type, r);
|
||||
elems[swizzle[1]] = lp_build_const_elem(gallivm, type, g);
|
||||
elems[swizzle[2]] = lp_build_const_elem(gallivm, type, b);
|
||||
elems[swizzle[3]] = lp_build_const_elem(gallivm, type, a);
|
||||
if(type.floating) {
|
||||
elems[swizzle[0]] = LLVMConstReal(elem_type, r);
|
||||
elems[swizzle[1]] = LLVMConstReal(elem_type, g);
|
||||
elems[swizzle[2]] = LLVMConstReal(elem_type, b);
|
||||
elems[swizzle[3]] = LLVMConstReal(elem_type, a);
|
||||
}
|
||||
else {
|
||||
double dscale = lp_const_scale(type);
|
||||
|
||||
elems[swizzle[0]] = LLVMConstInt(elem_type, round(r*dscale), 0);
|
||||
elems[swizzle[1]] = LLVMConstInt(elem_type, round(g*dscale), 0);
|
||||
elems[swizzle[2]] = LLVMConstInt(elem_type, round(b*dscale), 0);
|
||||
elems[swizzle[3]] = LLVMConstInt(elem_type, round(a*dscale), 0);
|
||||
}
|
||||
|
||||
for(i = 4; i < type.length; ++i)
|
||||
elems[i] = elems[i % 4];
|
||||
@@ -455,7 +452,7 @@ lp_build_const_string(struct gallivm_state *gallivm,
|
||||
/**
|
||||
* Build a callable function pointer.
|
||||
*
|
||||
* We use function pointer constants instead of LLVMAddGlobalMapping()
|
||||
* We this casts instead of LLVMAddGlobalMapping()
|
||||
* to work around a bug in LLVM 2.6, and for efficiency/simplicity.
|
||||
*/
|
||||
LLVMValueRef
|
||||
|
@@ -70,66 +70,6 @@
|
||||
#include "lp_bld_arit.h"
|
||||
#include "lp_bld_pack.h"
|
||||
#include "lp_bld_conv.h"
|
||||
#include "lp_bld_logic.h"
|
||||
|
||||
|
||||
/**
|
||||
* Converts int16 half-float to float32
|
||||
* Note this can be performed in 1 instruction if vcvtph2ps exists (sse5 i think?)
|
||||
* [llvm.x86.vcvtph2ps / _mm_cvtph_ps]
|
||||
*
|
||||
* @param src_type <vector> type of int16
|
||||
* @param src value to convert
|
||||
*
|
||||
* ref http://fgiesen.wordpress.com/2012/03/28/half-to-float-done-quic/
|
||||
*/
|
||||
LLVMValueRef
|
||||
lp_build_half_to_float(struct gallivm_state *gallivm,
|
||||
struct lp_type src_type,
|
||||
LLVMValueRef src)
|
||||
{
|
||||
struct lp_type f32_type = lp_type_float_vec(32, 32 * src_type.length);
|
||||
struct lp_type i32_type = lp_type_int_vec(32, 32 * src_type.length);
|
||||
|
||||
LLVMBuilderRef builder = gallivm->builder;
|
||||
LLVMTypeRef int_vec_type = lp_build_vec_type(gallivm, i32_type);
|
||||
LLVMTypeRef float_vec_type = lp_build_vec_type(gallivm, f32_type);
|
||||
|
||||
/* Constants */
|
||||
LLVMValueRef i32_13 = lp_build_const_int_vec(gallivm, i32_type, 13);
|
||||
LLVMValueRef i32_16 = lp_build_const_int_vec(gallivm, i32_type, 16);
|
||||
LLVMValueRef i32_mask_nosign = lp_build_const_int_vec(gallivm, i32_type, 0x7fff);
|
||||
LLVMValueRef i32_was_infnan = lp_build_const_int_vec(gallivm, i32_type, 0x7bff);
|
||||
LLVMValueRef i32_exp_infnan = lp_build_const_int_vec(gallivm, i32_type, 0xff << 23);
|
||||
LLVMValueRef f32_magic = LLVMBuildBitCast(builder,
|
||||
lp_build_const_int_vec(gallivm, i32_type, (254 - 15) << 23),
|
||||
float_vec_type, "");
|
||||
|
||||
/* Convert int16 vector to int32 vector by zero ext */
|
||||
LLVMValueRef h = LLVMBuildZExt(builder, src, int_vec_type, "");
|
||||
|
||||
/* Exponent / mantissa bits */
|
||||
LLVMValueRef expmant = LLVMBuildAnd(builder, i32_mask_nosign, h, "");
|
||||
LLVMValueRef shifted = LLVMBuildBitCast(builder, LLVMBuildShl(builder, expmant, i32_13, ""), float_vec_type, "");
|
||||
|
||||
/* Exponent adjust */
|
||||
LLVMValueRef scaled = LLVMBuildBitCast(builder, LLVMBuildFMul(builder, shifted, f32_magic, ""), int_vec_type, "");
|
||||
|
||||
/* Make sure Inf/NaN survive */
|
||||
LLVMValueRef b_wasinfnan = lp_build_compare(gallivm, i32_type, PIPE_FUNC_GREATER, expmant, i32_was_infnan);
|
||||
LLVMValueRef infnanexp = LLVMBuildAnd(builder, b_wasinfnan, i32_exp_infnan, "");
|
||||
|
||||
/* Sign bit */
|
||||
LLVMValueRef justsign = LLVMBuildXor(builder, h, expmant, "");
|
||||
LLVMValueRef sign = LLVMBuildShl(builder, justsign, i32_16, "");
|
||||
|
||||
/* Combine result */
|
||||
LLVMValueRef sign_inf = LLVMBuildOr(builder, sign, infnanexp, "");
|
||||
LLVMValueRef final = LLVMBuildOr(builder, scaled, sign_inf, "");
|
||||
|
||||
/* Cast from int32 vector to float32 vector */
|
||||
return LLVMBuildBitCast(builder, final, float_vec_type, "");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -394,113 +334,64 @@ lp_build_conv(struct gallivm_state *gallivm,
|
||||
dst_type.width == 8 &&
|
||||
dst_type.length == 16 &&
|
||||
|
||||
4 * num_dsts == num_srcs &&
|
||||
|
||||
util_cpu_caps.has_sse2)
|
||||
{
|
||||
struct lp_build_context bld;
|
||||
struct lp_type int16_type = dst_type;
|
||||
struct lp_type int32_type = dst_type;
|
||||
LLVMValueRef const_255f;
|
||||
unsigned i, j;
|
||||
int i;
|
||||
|
||||
lp_build_context_init(&bld, gallivm, src_type);
|
||||
|
||||
int16_type.width *= 2;
|
||||
int16_type.length /= 2;
|
||||
int16_type.sign = 1;
|
||||
|
||||
int32_type.width *= 4;
|
||||
int32_type.length /= 4;
|
||||
int32_type.sign = 1;
|
||||
|
||||
const_255f = lp_build_const_vec(gallivm, src_type, 255.0f);
|
||||
|
||||
for (i = 0; i < num_dsts; ++i, src += 4) {
|
||||
for (i = 0; i < num_dsts; i++, src += 4) {
|
||||
struct lp_type int16_type = dst_type;
|
||||
struct lp_type int32_type = dst_type;
|
||||
LLVMValueRef lo, hi;
|
||||
LLVMValueRef src_int0;
|
||||
LLVMValueRef src_int1;
|
||||
LLVMValueRef src_int2;
|
||||
LLVMValueRef src_int3;
|
||||
LLVMTypeRef int32_vec_type;
|
||||
LLVMTypeRef src_vec_type;
|
||||
LLVMValueRef const_255f;
|
||||
LLVMValueRef a, b, c, d;
|
||||
|
||||
for (j = 0; j < 4; ++j) {
|
||||
tmp[j] = LLVMBuildFMul(builder, src[j], const_255f, "");
|
||||
tmp[j] = lp_build_iround(&bld, tmp[j]);
|
||||
}
|
||||
int16_type.width *= 2;
|
||||
int16_type.length /= 2;
|
||||
int16_type.sign = 1;
|
||||
|
||||
/* relying on clamping behavior of sse2 intrinsics here */
|
||||
lo = lp_build_pack2(gallivm, int32_type, int16_type, tmp[0], tmp[1]);
|
||||
hi = lp_build_pack2(gallivm, int32_type, int16_type, tmp[2], tmp[3]);
|
||||
dst[i] = lp_build_pack2(gallivm, int16_type, dst_type, lo, hi);
|
||||
}
|
||||
int32_type.width *= 4;
|
||||
int32_type.length /= 4;
|
||||
int32_type.sign = 1;
|
||||
|
||||
return;
|
||||
}
|
||||
src_vec_type = lp_build_vec_type(gallivm, src_type);
|
||||
int32_vec_type = lp_build_vec_type(gallivm, int32_type);
|
||||
|
||||
/* Special case 2x8f --> 1x16ub
|
||||
*/
|
||||
else if (src_type.floating == 1 &&
|
||||
src_type.fixed == 0 &&
|
||||
src_type.sign == 1 &&
|
||||
src_type.norm == 0 &&
|
||||
src_type.width == 32 &&
|
||||
src_type.length == 8 &&
|
||||
|
||||
dst_type.floating == 0 &&
|
||||
dst_type.fixed == 0 &&
|
||||
dst_type.sign == 0 &&
|
||||
dst_type.norm == 1 &&
|
||||
dst_type.width == 8 &&
|
||||
dst_type.length == 16 &&
|
||||
|
||||
2 * num_dsts == num_srcs &&
|
||||
|
||||
util_cpu_caps.has_avx) {
|
||||
|
||||
struct lp_build_context bld;
|
||||
struct lp_type int16_type = dst_type;
|
||||
struct lp_type int32_type = dst_type;
|
||||
LLVMValueRef const_255f;
|
||||
unsigned i;
|
||||
|
||||
lp_build_context_init(&bld, gallivm, src_type);
|
||||
|
||||
int16_type.width *= 2;
|
||||
int16_type.length /= 2;
|
||||
int16_type.sign = 1;
|
||||
|
||||
int32_type.width *= 4;
|
||||
int32_type.length /= 4;
|
||||
int32_type.sign = 1;
|
||||
|
||||
const_255f = lp_build_const_vec(gallivm, src_type, 255.0f);
|
||||
|
||||
for (i = 0; i < num_dsts; ++i, src += 2) {
|
||||
LLVMValueRef lo, hi, a, b;
|
||||
const_255f = lp_build_const_vec(gallivm, src_type, 255.0f);
|
||||
|
||||
a = LLVMBuildFMul(builder, src[0], const_255f, "");
|
||||
b = LLVMBuildFMul(builder, src[1], const_255f, "");
|
||||
c = LLVMBuildFMul(builder, src[2], const_255f, "");
|
||||
d = LLVMBuildFMul(builder, src[3], const_255f, "");
|
||||
|
||||
a = lp_build_iround(&bld, a);
|
||||
b = lp_build_iround(&bld, b);
|
||||
{
|
||||
struct lp_build_context bld;
|
||||
|
||||
tmp[0] = lp_build_extract_range(gallivm, a, 0, 4);
|
||||
tmp[1] = lp_build_extract_range(gallivm, a, 4, 4);
|
||||
tmp[2] = lp_build_extract_range(gallivm, b, 0, 4);
|
||||
tmp[3] = lp_build_extract_range(gallivm, b, 4, 4);
|
||||
bld.gallivm = gallivm;
|
||||
bld.type = src_type;
|
||||
bld.vec_type = src_vec_type;
|
||||
bld.int_elem_type = lp_build_elem_type(gallivm, int32_type);
|
||||
bld.int_vec_type = int32_vec_type;
|
||||
bld.undef = lp_build_undef(gallivm, src_type);
|
||||
bld.zero = lp_build_zero(gallivm, src_type);
|
||||
bld.one = lp_build_one(gallivm, src_type);
|
||||
|
||||
src_int0 = lp_build_iround(&bld, a);
|
||||
src_int1 = lp_build_iround(&bld, b);
|
||||
src_int2 = lp_build_iround(&bld, c);
|
||||
src_int3 = lp_build_iround(&bld, d);
|
||||
}
|
||||
/* relying on clamping behavior of sse2 intrinsics here */
|
||||
lo = lp_build_pack2(gallivm, int32_type, int16_type, tmp[0], tmp[1]);
|
||||
hi = lp_build_pack2(gallivm, int32_type, int16_type, tmp[2], tmp[3]);
|
||||
lo = lp_build_pack2(gallivm, int32_type, int16_type, src_int0, src_int1);
|
||||
hi = lp_build_pack2(gallivm, int32_type, int16_type, src_int2, src_int3);
|
||||
dst[i] = lp_build_pack2(gallivm, int16_type, dst_type, lo, hi);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Pre convert half-floats to floats
|
||||
*/
|
||||
else if (src_type.floating && src_type.width == 16)
|
||||
{
|
||||
for(i = 0; i < num_tmps; ++i)
|
||||
tmp[i] = lp_build_half_to_float(gallivm, src_type, tmp[i]);
|
||||
|
||||
tmp_type.width = 32;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -712,7 +603,7 @@ lp_build_conv(struct gallivm_state *gallivm,
|
||||
* This will convert the integer masks that match the given types.
|
||||
*
|
||||
* The mask values should 0 or -1, i.e., all bits either set to zero or one.
|
||||
* Any other value will likely cause unpredictable results.
|
||||
* Any other value will likely cause in unpredictable results.
|
||||
*
|
||||
* This is basically a very trimmed down version of lp_build_conv.
|
||||
*/
|
||||
@@ -723,6 +614,8 @@ lp_build_conv_mask(struct gallivm_state *gallivm,
|
||||
const LLVMValueRef *src, unsigned num_srcs,
|
||||
LLVMValueRef *dst, unsigned num_dsts)
|
||||
{
|
||||
/* Register width must remain constant */
|
||||
assert(src_type.width * src_type.length == dst_type.width * dst_type.length);
|
||||
|
||||
/* We must not loose or gain channels. Only precision */
|
||||
assert(src_type.length * num_srcs == dst_type.length * num_dsts);
|
||||
@@ -747,5 +640,16 @@ lp_build_conv_mask(struct gallivm_state *gallivm,
|
||||
* Truncate or expand bit width
|
||||
*/
|
||||
|
||||
lp_build_resize(gallivm, src_type, dst_type, src, num_srcs, dst, num_dsts);
|
||||
if(src_type.width > dst_type.width) {
|
||||
assert(num_dsts == 1);
|
||||
dst[0] = lp_build_pack(gallivm, src_type, dst_type, TRUE, src, num_srcs);
|
||||
}
|
||||
else if(src_type.width < dst_type.width) {
|
||||
assert(num_srcs == 1);
|
||||
lp_build_unpack(gallivm, src_type, dst_type, src[0], dst, num_dsts);
|
||||
}
|
||||
else {
|
||||
assert(num_srcs == num_dsts);
|
||||
memcpy(dst, src, num_dsts * sizeof *dst);
|
||||
}
|
||||
}
|
||||
|
@@ -42,10 +42,6 @@
|
||||
|
||||
struct lp_type;
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_half_to_float(struct gallivm_state *gallivm,
|
||||
struct lp_type src_type,
|
||||
LLVMValueRef src);
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_clamped_float_to_unsigned_norm(struct gallivm_state *gallivm,
|
||||
|
@@ -35,8 +35,10 @@
|
||||
|
||||
#if HAVE_LLVM >= 0x0300
|
||||
#include <llvm/Support/TargetRegistry.h>
|
||||
#include <llvm/Support/TargetSelect.h>
|
||||
#else /* HAVE_LLVM < 0x0300 */
|
||||
#include <llvm/Target/TargetRegistry.h>
|
||||
#include <llvm/Target/TargetSelect.h>
|
||||
#endif /* HAVE_LLVM < 0x0300 */
|
||||
|
||||
#if HAVE_LLVM >= 0x0209
|
||||
@@ -81,12 +83,8 @@ lp_check_alignment(const void *ptr, unsigned alignment)
|
||||
class raw_debug_ostream :
|
||||
public llvm::raw_ostream
|
||||
{
|
||||
private:
|
||||
uint64_t pos;
|
||||
|
||||
public:
|
||||
raw_debug_ostream() : pos(0) { }
|
||||
|
||||
void write_impl(const char *Ptr, size_t Size);
|
||||
|
||||
#if HAVE_LLVM >= 0x207
|
||||
@@ -185,7 +183,7 @@ lp_disassemble(const void* func)
|
||||
/*
|
||||
* Limit disassembly to this extent
|
||||
*/
|
||||
const uint64_t extent = 96 * 1024;
|
||||
const uint64_t extent = 0x10000;
|
||||
|
||||
uint64_t max_pc = 0;
|
||||
|
||||
@@ -202,6 +200,24 @@ lp_disassemble(const void* func)
|
||||
std::string Error;
|
||||
const Target *T = TargetRegistry::lookupTarget(Triple, Error);
|
||||
|
||||
#if HAVE_LLVM >= 0x0208
|
||||
InitializeNativeTargetAsmPrinter();
|
||||
#elif defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
|
||||
LLVMInitializeX86AsmPrinter();
|
||||
#elif defined(PIPE_ARCH_ARM)
|
||||
LLVMInitializeARMAsmPrinter();
|
||||
#elif defined(PIPE_ARCH_PPC)
|
||||
LLVMInitializePowerPCAsmPrinter();
|
||||
#endif
|
||||
|
||||
#if HAVE_LLVM >= 0x0301
|
||||
InitializeNativeTargetDisassembler();
|
||||
#elif defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
|
||||
LLVMInitializeX86Disassembler();
|
||||
#elif defined(PIPE_ARCH_ARM)
|
||||
LLVMInitializeARMDisassembler();
|
||||
#endif
|
||||
|
||||
#if HAVE_LLVM >= 0x0300
|
||||
OwningPtr<const MCAsmInfo> AsmInfo(T->createMCAsmInfo(Triple));
|
||||
#else
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user