Compare commits
67 Commits
mesa-9.1
...
gles3-fmt-
Author | SHA1 | Date | |
---|---|---|---|
|
ae0120f247 | ||
|
787bbe65ff | ||
|
5f96348c60 | ||
|
fe23a2c5e1 | ||
|
54d744bfc4 | ||
|
b1c62e9533 | ||
|
0faa38ccc6 | ||
|
ed9f608070 | ||
|
b68dc0c5ee | ||
|
add9b77cbd | ||
|
64e0be7d0b | ||
|
166c4d211d | ||
|
fef9526cb6 | ||
|
a33dc45d2f | ||
|
95da613011 | ||
|
9824382dbd | ||
|
067e9170ef | ||
|
28236b2f28 | ||
|
a1ef7b34ce | ||
|
8d99b25045 | ||
|
3613e67b4a | ||
|
566ce73fab | ||
|
4fd482b841 | ||
|
555245eeb7 | ||
|
e76ddbf0f8 | ||
|
8b89a5bbf5 | ||
|
56e2a876e4 | ||
|
acac9cdde0 | ||
|
8a88168a90 | ||
|
18aca7ac5a | ||
|
4dd38352e5 | ||
|
a0333d34a7 | ||
|
5d1c69be02 | ||
|
e68b841b3c | ||
|
3b495d815f | ||
|
0538b36bac | ||
|
d3d6e05349 | ||
|
4014ee4567 | ||
|
b83a83dcdf | ||
|
19864a4b1c | ||
|
24d89bc7ea | ||
|
84b2017c30 | ||
|
a9c1fa067c | ||
|
d9228105e1 | ||
|
4b7bea48ee | ||
|
b1a21a9f7c | ||
|
f7a82c00cd | ||
|
d053e8e85b | ||
|
0f16eafa17 | ||
|
43413b3fdd | ||
|
974d48a061 | ||
|
173e4f7a42 | ||
|
026099f93a | ||
|
feba88049f | ||
|
cf6ddcecda | ||
|
244d6eb094 | ||
|
7a4eca8280 | ||
|
3d0890d39d | ||
|
2a18d71dbe | ||
|
13fa793585 | ||
|
fca1ec5bfa | ||
|
5b9df1c245 | ||
|
bdea9b9460 | ||
|
e1ccb71996 | ||
|
db902c4948 | ||
|
a40737f505 | ||
|
dbee8d3ea2 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -4,7 +4,6 @@
|
||||
*.ilk
|
||||
*.la
|
||||
*.lo
|
||||
*.log
|
||||
*.o
|
||||
*.obj
|
||||
*.os
|
||||
@@ -18,7 +17,6 @@
|
||||
*.tar
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
*.trs
|
||||
*.zip
|
||||
*~
|
||||
depend
|
||||
@@ -38,9 +36,9 @@ config.py
|
||||
build
|
||||
libtool
|
||||
manifest.txt
|
||||
Makefile.in
|
||||
.dir-locals.el
|
||||
.deps/
|
||||
.dirstamp
|
||||
.libs/
|
||||
Makefile
|
||||
Makefile.in
|
||||
/Makefile
|
||||
|
28
Makefile.am
28
Makefile.am
@@ -30,13 +30,31 @@ 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
|
||||
|
||||
clean-local:
|
||||
-@touch $(top_builddir)/configs/current
|
||||
-@for dir in $(SUBDIRS) ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
(cd $$dir && $(MAKE) clean) ; \
|
||||
fi \
|
||||
done
|
||||
-@test -s $(top_builddir)/configs/current || rm -f $(top_builddir)/configs/current
|
||||
|
||||
|
||||
|
||||
distclean-local:
|
||||
-rm -rf lib*
|
||||
-rm -f $(top_builddir)/configs/current
|
||||
-find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
|
||||
-name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
|
||||
|
||||
.PHONY: doxygen
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
PACKAGE_VERSION=9.1
|
||||
PACKAGE_VERSION=9.1-devel
|
||||
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
|
||||
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
|
||||
|
||||
@@ -52,9 +70,9 @@ EXTRA_FILES = \
|
||||
bin/ltmain.sh \
|
||||
bin/missing \
|
||||
bin/ylwrap \
|
||||
src/glsl/glsl_parser.cpp \
|
||||
src/glsl/glsl_parser.cc \
|
||||
src/glsl/glsl_parser.h \
|
||||
src/glsl/glsl_lexer.cpp \
|
||||
src/glsl/glsl_lexer.cc \
|
||||
src/glsl/glcpp/glcpp-lex.c \
|
||||
src/glsl/glcpp/glcpp-parse.c \
|
||||
src/glsl/glcpp/glcpp-parse.h \
|
||||
@@ -75,7 +93,9 @@ IGNORE_FILES = \
|
||||
|
||||
|
||||
parsers: configure
|
||||
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp glcpp/glcpp-lex.c glcpp/glcpp-parse.c glcpp/glcpp-parse.h
|
||||
-@touch $(top_builddir)/configs/current
|
||||
$(MAKE) -C src/glsl glsl_parser.cc glsl_parser.h glsl_lexer.cc
|
||||
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
|
||||
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
|
||||
|
||||
# Everything for new a Mesa release:
|
||||
|
119
acinclude.m4
Normal file
119
acinclude.m4
Normal file
@@ -0,0 +1,119 @@
|
||||
# A few convenience macros for Mesa, mostly to keep all the platform
|
||||
# specifics out of configure.ac.
|
||||
|
||||
# MESA_PIC_FLAGS()
|
||||
#
|
||||
# Find out whether to build PIC code using the option --enable-pic and
|
||||
# the configure enable_static/enable_shared settings. If PIC is needed,
|
||||
# figure out the necessary flags for the platform and compiler.
|
||||
#
|
||||
# The platform checks have been shamelessly taken from libtool and
|
||||
# stripped down to just what's needed for Mesa. See _LT_COMPILER_PIC in
|
||||
# /usr/share/aclocal/libtool.m4 or
|
||||
# http://git.savannah.gnu.org/gitweb/?p=libtool.git;a=blob;f=libltdl/m4/libtool.m4;hb=HEAD
|
||||
#
|
||||
AC_DEFUN([MESA_PIC_FLAGS],
|
||||
[AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_ARG_VAR([PIC_FLAGS], [compiler flags for PIC code])
|
||||
AC_ARG_ENABLE([pic],
|
||||
[AS_HELP_STRING([--disable-pic],
|
||||
[don't compile PIC objects @<:@default=enabled for shared builds
|
||||
on supported platforms@:>@])],
|
||||
[enable_pic="$enableval"
|
||||
test "x$enable_pic" = x && enable_pic=auto],
|
||||
[enable_pic=auto])
|
||||
# disable PIC by default for static builds
|
||||
if test "$enable_pic" = auto && test "$enable_static" = yes; then
|
||||
enable_pic=no
|
||||
fi
|
||||
# if PIC hasn't been explicitly disabled, try to figure out the flags
|
||||
if test "$enable_pic" != no; then
|
||||
AC_MSG_CHECKING([for $CC option to produce PIC])
|
||||
# allow the user's flags to override
|
||||
if test "x$PIC_FLAGS" = x; then
|
||||
# see if we're using GCC
|
||||
if test "x$GCC" = xyes; then
|
||||
case "$host_os" in
|
||||
aix*|beos*|cygwin*|irix5*|irix6*|osf3*|osf4*|osf5*)
|
||||
# PIC is the default for these OSes.
|
||||
;;
|
||||
mingw*|os2*|pw32*)
|
||||
# This hack is so that the source file can tell whether
|
||||
# it is being built for inclusion in a dll (and should
|
||||
# export symbols for example).
|
||||
PIC_FLAGS="-DDLL_EXPORT"
|
||||
;;
|
||||
darwin*|rhapsody*)
|
||||
# PIC is the default on this platform
|
||||
# Common symbols not allowed in MH_DYLIB files
|
||||
PIC_FLAGS="-fno-common"
|
||||
;;
|
||||
hpux*)
|
||||
# PIC is the default for IA64 HP-UX and 64-bit HP-UX,
|
||||
# but not for PA HP-UX.
|
||||
case $host_cpu in
|
||||
hppa*64*|ia64*)
|
||||
;;
|
||||
*)
|
||||
PIC_FLAGS="-fPIC"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Everyone else on GCC uses -fPIC
|
||||
PIC_FLAGS="-fPIC"
|
||||
;;
|
||||
esac
|
||||
else # !GCC
|
||||
case "$host_os" in
|
||||
hpux9*|hpux10*|hpux11*)
|
||||
# PIC is the default for IA64 HP-UX and 64-bit HP-UX,
|
||||
# but not for PA HP-UX.
|
||||
case "$host_cpu" in
|
||||
hppa*64*|ia64*)
|
||||
# +Z the default
|
||||
;;
|
||||
*)
|
||||
PIC_FLAGS="+Z"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
linux*|k*bsd*-gnu)
|
||||
case `basename "$CC"` in
|
||||
icc*|ecc*|ifort*)
|
||||
PIC_FLAGS="-KPIC"
|
||||
;;
|
||||
pgcc*|pgf77*|pgf90*|pgf95*)
|
||||
# Portland Group compilers (*not* the Pentium gcc
|
||||
# compiler, which looks to be a dead project)
|
||||
PIC_FLAGS="-fpic"
|
||||
;;
|
||||
ccc*)
|
||||
# All Alpha code is PIC.
|
||||
;;
|
||||
xl*)
|
||||
# IBM XL C 8.0/Fortran 10.1 on PPC
|
||||
PIC_FLAGS="-qpic"
|
||||
;;
|
||||
*)
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
*Sun\ C*|*Sun\ F*)
|
||||
# Sun C 5.9 or Sun Fortran
|
||||
PIC_FLAGS="-KPIC"
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
;;
|
||||
solaris*)
|
||||
PIC_FLAGS="-KPIC"
|
||||
;;
|
||||
sunos4*)
|
||||
PIC_FLAGS="-PIC"
|
||||
;;
|
||||
esac
|
||||
fi # GCC
|
||||
fi # PIC_FLAGS
|
||||
AC_MSG_RESULT([$PIC_FLAGS])
|
||||
fi
|
||||
AC_SUBST([PIC_FLAGS])
|
||||
])# MESA_PIC_FLAGS
|
@@ -1,3 +0,0 @@
|
||||
d60da27273d2cdb68bc32cae2ca66718dab15f27 st/mesa: set ctx->Const.MaxSamples = 0, not 1
|
||||
5c86a728d4f688c0fe7fbf9f4b8f88060b65c4ee r600g: fix htile buffer leak
|
||||
496928a442cec980b534bc5da2523b3632b21b61 CopyTexImage: Don't check sRGB vs LINEAR for desktop GL
|
74
bin/installmesa
Executable file
74
bin/installmesa
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Simple shell script for installing Mesa's header and library files.
|
||||
# If the copy commands below don't work on a particular system (i.e. the
|
||||
# -f or -d flags), we may need to branch on `uname` to do the right thing.
|
||||
#
|
||||
|
||||
|
||||
TOP=.
|
||||
|
||||
INCLUDE_DIR="/usr/local/include"
|
||||
LIB_DIR="/usr/local/lib"
|
||||
|
||||
if [ "x$#" = "x0" ] ; then
|
||||
echo
|
||||
echo "***** Mesa installation - You may need root privileges to do this *****"
|
||||
echo
|
||||
echo "Default directory for header files is:" ${INCLUDE_DIR}
|
||||
echo "Enter new directory or press <Enter> to accept this default."
|
||||
|
||||
read INPUT
|
||||
if [ "x${INPUT}" != "x" ] ; then
|
||||
INCLUDE_DIR=${INPUT}
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Default directory for library files is:" ${LIB_DIR}
|
||||
echo "Enter new directory or press <Enter> to accept this default."
|
||||
|
||||
read INPUT
|
||||
if [ "x${INPUT}" != "x" ] ; then
|
||||
LIB_DIR=${INPUT}
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "About to install Mesa header files (GL/*.h) in: " ${INCLUDE_DIR}/GL
|
||||
echo "and Mesa library files (libGL.*, etc) in: " ${LIB_DIR}
|
||||
echo "Press <Enter> to continue, or <ctrl>-C to abort."
|
||||
|
||||
read INPUT
|
||||
|
||||
else
|
||||
INCLUDE_DIR=$1/include
|
||||
LIB_DIR=$1/lib
|
||||
fi
|
||||
|
||||
# flags:
|
||||
# -f = force
|
||||
# -d = preserve symlinks (does not work on BSD)
|
||||
|
||||
if [ `uname` = "FreeBSD" ] ; then
|
||||
CP_FLAGS="-f"
|
||||
elif [ `uname` = "Darwin" ] ; then
|
||||
CP_FLAGS="-f"
|
||||
elif [ `uname` = "AIX" ] ; then
|
||||
CP_FLAGS="-fh"
|
||||
else
|
||||
CP_FLAGS="-fd"
|
||||
fi
|
||||
|
||||
|
||||
set -v
|
||||
|
||||
mkdir -p ${INCLUDE_DIR}
|
||||
mkdir -p ${INCLUDE_DIR}/GL
|
||||
# NOT YET: mkdir -p ${INCLUDE_DIR}/GLES
|
||||
mkdir -p ${LIB_DIR}
|
||||
cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL
|
||||
cp -f ${TOP}/src/glw/*.h ${INCLUDE_DIR}/GL
|
||||
# NOT YET: cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES
|
||||
cp ${CP_FLAGS} ${TOP}/lib*/lib* ${LIB_DIR}
|
||||
|
||||
echo "Done."
|
112
bin/minstall
Executable file
112
bin/minstall
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
# A minimal replacement for 'install' that supports installing symbolic links.
|
||||
# Only a limited number of options are supported:
|
||||
# -d dir Create a directory
|
||||
# -m mode Sets a file's mode when installing
|
||||
|
||||
|
||||
# If these commands aren't portable, we'll need some "if (arch)" type stuff
|
||||
SYMLINK="ln -s"
|
||||
MKDIR="mkdir -p"
|
||||
RM="rm -f"
|
||||
|
||||
MODE=""
|
||||
|
||||
if [ "$1" = "-d" ] ; then
|
||||
# make a directory path
|
||||
$MKDIR "$2"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "-m" ] ; then
|
||||
# set file mode
|
||||
MODE=$2
|
||||
shift 2
|
||||
fi
|
||||
|
||||
# install file(s) into destination
|
||||
if [ $# -ge 2 ] ; then
|
||||
|
||||
# Last cmd line arg is the dest dir
|
||||
for FILE in $@ ; do
|
||||
DESTDIR="$FILE"
|
||||
done
|
||||
|
||||
# Loop over args, moving them to DEST directory
|
||||
I=1
|
||||
for FILE in $@ ; do
|
||||
if [ $I = $# ] ; then
|
||||
# stop, don't want to install $DEST into $DEST
|
||||
exit 0
|
||||
fi
|
||||
|
||||
DEST=$DESTDIR
|
||||
|
||||
# On CYGWIN, because DLLs are loaded by the native Win32 loader,
|
||||
# they are installed in the executable path. Stub libraries used
|
||||
# only for linking are installed in the library path
|
||||
case `uname` in
|
||||
CYGWIN*)
|
||||
case $FILE in
|
||||
*.dll)
|
||||
DEST="$DEST/../bin"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
PWDSAVE=`pwd`
|
||||
|
||||
# determine file's type
|
||||
if [ -h "$FILE" ] ; then
|
||||
#echo $FILE is a symlink
|
||||
# Unfortunately, cp -d isn't universal so we have to
|
||||
# use a work-around.
|
||||
|
||||
# Use ls -l to find the target that the link points to
|
||||
LL=`ls -l "$FILE"`
|
||||
for L in $LL ; do
|
||||
TARGET=$L
|
||||
done
|
||||
#echo $FILE is a symlink pointing to $TARGET
|
||||
|
||||
FILE=`basename "$FILE"`
|
||||
# Go to $DEST and make the link
|
||||
cd "$DEST" # pushd
|
||||
$RM "$FILE"
|
||||
$SYMLINK "$TARGET" "$FILE"
|
||||
cd "$PWDSAVE" # popd
|
||||
|
||||
elif [ -f "$FILE" ] ; then
|
||||
#echo "$FILE" is a regular file
|
||||
# Only copy if the files differ
|
||||
if ! cmp -s $FILE $DEST/`basename $FILE`; then
|
||||
$RM "$DEST/`basename $FILE`"
|
||||
cp "$FILE" "$DEST"
|
||||
fi
|
||||
if [ $MODE ] ; then
|
||||
FILE=`basename "$FILE"`
|
||||
chmod $MODE "$DEST/$FILE"
|
||||
fi
|
||||
else
|
||||
echo "Unknown type of argument: " "$FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
I=`expr $I + 1`
|
||||
done
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# If we get here, we didn't find anything to do
|
||||
echo "Usage:"
|
||||
echo " install -d dir Create named directory"
|
||||
echo " install [-m mode] file [...] dest Install files in destination"
|
||||
|
2
configs/.gitignore
vendored
Normal file
2
configs/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
current
|
||||
autoconf
|
222
configs/current.in
Normal file
222
configs/current.in
Normal file
@@ -0,0 +1,222 @@
|
||||
# Autoconf configuration
|
||||
|
||||
# Pull in the defaults
|
||||
include $(TOP)/configs/default
|
||||
|
||||
# This is generated by configure
|
||||
CONFIG_NAME = autoconf
|
||||
|
||||
# Compiler and flags
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
PIC_FLAGS = @PIC_FLAGS@
|
||||
DEFINES = @DEFINES@
|
||||
API_DEFINES = @API_DEFINES@
|
||||
SHARED_GLAPI = @SHARED_GLAPI@
|
||||
CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \
|
||||
$(PIC_FLAGS) $(DEFINES)
|
||||
CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
|
||||
$(PIC_FLAGS) $(DEFINES)
|
||||
CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@
|
||||
CXXFLAGS = $(CXXFLAGS_NOVISIBILITY) @VISIBILITY_CXXFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
RADEON_CFLAGS = @RADEON_CFLAGS@
|
||||
RADEON_LIBS = @RADEON_LIBS@
|
||||
NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@
|
||||
NOUVEAU_LIBS = @NOUVEAU_LIBS@
|
||||
INTEL_LIBS = @INTEL_LIBS@
|
||||
INTEL_CFLAGS = @INTEL_CFLAGS@
|
||||
X11_LIBS = @X11_LIBS@
|
||||
X11_CFLAGS = @X11_CFLAGS@
|
||||
LLVM_BINDIR = @LLVM_BINDIR@
|
||||
LLVM_CFLAGS = @LLVM_CFLAGS@
|
||||
LLVM_CPPFLAGS = @LLVM_CPPFLAGS@
|
||||
LLVM_CXXFLAGS = @LLVM_CXXFLAGS@
|
||||
LLVM_LDFLAGS = @LLVM_LDFLAGS@
|
||||
LLVM_LIBDIR = @LLVM_LIBDIR@
|
||||
LLVM_LIBS = @LLVM_LIBS@
|
||||
LLVM_INCLUDEDIR = @LLVM_INCLUDEDIR@
|
||||
GLW_CFLAGS = @GLW_CFLAGS@
|
||||
GLX_TLS = @GLX_TLS@
|
||||
|
||||
# dlopen
|
||||
DLOPEN_LIBS = @DLOPEN_LIBS@
|
||||
CLOCK_LIB = @CLOCK_LIB@
|
||||
|
||||
# Source selection
|
||||
MESA_ASM_FILES = @MESA_ASM_FILES@
|
||||
|
||||
# Misc tools and flags
|
||||
MAKE = @MAKE@
|
||||
SHELL = @SHELL@
|
||||
MKLIB_OPTIONS = @MKLIB_OPTIONS@
|
||||
MKDEP = @MKDEP@
|
||||
MKDEP_OPTIONS = @MKDEP_OPTIONS@
|
||||
INSTALL = @INSTALL@
|
||||
AWK = @AWK@
|
||||
GREP = @GREP@
|
||||
NM = @NM@
|
||||
|
||||
# Perl
|
||||
PERL = @PERL@
|
||||
|
||||
# Indent (used for generating dispatch tables)
|
||||
INDENT = @INDENT@
|
||||
INDENT_FLAGS = @INDENT_FLAGS@
|
||||
|
||||
# Python and flags (generally only needed by the developers)
|
||||
PYTHON2 = @PYTHON2@
|
||||
PYTHON_FLAGS = -t -O -O
|
||||
|
||||
# Flex and Bison for GLSL compiler
|
||||
FLEX = @LEX@
|
||||
BISON = @YACC@
|
||||
|
||||
# Library names (base name)
|
||||
GL_LIB = @GL_LIB@
|
||||
GLU_LIB = @GLU_LIB@
|
||||
GLW_LIB = GLw
|
||||
OSMESA_LIB = @OSMESA_LIB@
|
||||
GLESv1_CM_LIB = GLESv1_CM
|
||||
GLESv2_LIB = GLESv2
|
||||
VG_LIB = OpenVG
|
||||
GLAPI_LIB = glapi
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = @GL_LIB_NAME@
|
||||
GLU_LIB_NAME = @GLU_LIB_NAME@
|
||||
GLW_LIB_NAME = @GLW_LIB_NAME@
|
||||
OSMESA_LIB_NAME = @OSMESA_LIB_NAME@
|
||||
EGL_LIB_NAME = @EGL_LIB_NAME@
|
||||
GLESv1_CM_LIB_NAME = @GLESv1_CM_LIB_NAME@
|
||||
GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
|
||||
VG_LIB_NAME = @VG_LIB_NAME@
|
||||
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
|
||||
|
||||
# Globs used to install the lib and all symlinks
|
||||
GL_LIB_GLOB = @GL_LIB_GLOB@
|
||||
GLU_LIB_GLOB = @GLU_LIB_GLOB@
|
||||
GLW_LIB_GLOB = @GLW_LIB_GLOB@
|
||||
EGL_LIB_GLOB = @EGL_LIB_GLOB@
|
||||
GLESv1_CM_LIB_GLOB = @GLESv1_CM_LIB_GLOB@
|
||||
GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
|
||||
VG_LIB_GLOB = @VG_LIB_GLOB@
|
||||
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
|
||||
|
||||
# Directories to build
|
||||
LIB_DIR = @LIB_DIR@
|
||||
SRC_DIRS = @SRC_DIRS@
|
||||
DRIVER_DIRS = @DRIVER_DIRS@
|
||||
GALLIUM_DIRS = @GALLIUM_DIRS@
|
||||
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
|
||||
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
|
||||
GALLIUM_TARGET_DIRS = @GALLIUM_TARGET_DIRS@
|
||||
GALLIUM_STATE_TRACKERS_DIRS = @GALLIUM_STATE_TRACKERS_DIRS@
|
||||
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
|
||||
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
|
||||
|
||||
# Driver specific build vars
|
||||
DRI_DIRS = @DRI_DIRS@
|
||||
EGL_PLATFORMS = @EGL_PLATFORMS@
|
||||
EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
|
||||
|
||||
# Dependencies
|
||||
X11_INCLUDES = @X11_INCLUDES@
|
||||
|
||||
# GLw motif setup
|
||||
GLW_SOURCES = @GLW_SOURCES@
|
||||
MOTIF_CFLAGS = @MOTIF_CFLAGS@
|
||||
|
||||
# Library/program dependencies
|
||||
GL_LIB_DEPS = @GL_LIB_DEPS@
|
||||
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \
|
||||
@OSMESA_LIB_DEPS@
|
||||
EGL_LIB_DEPS = @EGL_LIB_DEPS@
|
||||
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLU_MESA_DEPS@ \
|
||||
@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@
|
||||
|
||||
# DRI dependencies
|
||||
DRI_LIB_DEPS = @DRI_LIB_DEPS@
|
||||
GALLIUM_DRI_LIB_DEPS = @GALLIUM_DRI_LIB_DEPS@
|
||||
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
|
||||
LIBDRM_LIBS = @LIBDRM_LIBS@
|
||||
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
|
||||
GLPROTO_CFLAGS = @GLPROTO_CFLAGS@
|
||||
EXPAT_INCLUDES = @EXPAT_INCLUDES@
|
||||
|
||||
# Autoconf directories
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
libdir = @libdir@
|
||||
includedir = @includedir@
|
||||
|
||||
# Installation directories (for make install)
|
||||
INSTALL_DIR = $(prefix)
|
||||
INSTALL_LIB_DIR = $(libdir)
|
||||
INSTALL_INC_DIR = $(includedir)
|
||||
|
||||
# DRI installation directories
|
||||
DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@
|
||||
|
||||
# Where libGL will look for DRI hardware drivers
|
||||
DRI_DRIVER_SEARCH_DIR = @DRI_DRIVER_SEARCH_DIR@
|
||||
|
||||
# EGL driver install directory
|
||||
EGL_DRIVER_INSTALL_DIR = @EGL_DRIVER_INSTALL_DIR@
|
||||
|
||||
# XVMC library install directory
|
||||
XVMC_LIB_INSTALL_DIR=@XVMC_LIB_INSTALL_DIR@
|
||||
|
||||
# VDPAU library install directory
|
||||
VDPAU_LIB_INSTALL_DIR=@VDPAU_LIB_INSTALL_DIR@
|
||||
|
||||
# VA library install directory
|
||||
VA_LIB_INSTALL_DIR=@VA_LIB_INSTALL_DIR@
|
||||
|
||||
# Xorg driver install directory (for xorg state-tracker)
|
||||
XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@
|
||||
|
||||
# Path to OpenCL C library libclc
|
||||
LIBCLC_PATH = @LIBCLC_PATH@
|
||||
|
||||
# pkg-config substitutions
|
||||
GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
|
||||
GL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
|
||||
GL_PC_CFLAGS = @GL_PC_CFLAGS@
|
||||
DRI_PC_REQ_PRIV = @DRI_PC_REQ_PRIV@
|
||||
GLU_PC_REQ = @GLU_PC_REQ@
|
||||
GLU_PC_REQ_PRIV = @GLU_PC_REQ_PRIV@
|
||||
GLU_PC_LIB_PRIV = @GLU_PC_LIB_PRIV@
|
||||
GLU_PC_CFLAGS = @GLU_PC_CFLAGS@
|
||||
GLW_PC_REQ_PRIV = @GLW_PC_REQ_PRIV@
|
||||
GLW_PC_LIB_PRIV = @GLW_PC_LIB_PRIV@
|
||||
GLW_PC_CFLAGS = @GLW_PC_CFLAGS@
|
||||
OSMESA_PC_REQ = @OSMESA_PC_REQ@
|
||||
OSMESA_PC_LIB_PRIV = @OSMESA_PC_LIB_PRIV@
|
||||
GLESv1_CM_PC_LIB_PRIV = @GLESv1_CM_PC_LIB_PRIV@
|
||||
GLESv2_PC_LIB_PRIV = @GLESv2_PC_LIB_PRIV@
|
||||
EGL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
|
||||
EGL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
|
||||
EGL_PC_CFLAGS = @GL_PC_CFLAGS@
|
||||
|
||||
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
|
||||
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
|
||||
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
|
||||
LIBUDEV_LIBS = @LIBUDEV_LIBS@
|
||||
WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
|
||||
WAYLAND_LIBS = @WAYLAND_LIBS@
|
||||
|
||||
MESA_LLVM = @MESA_LLVM@
|
||||
|
||||
LLVM_VERSION = @LLVM_VERSION@
|
||||
|
||||
HAVE_XF86VIDMODE = @HAVE_XF86VIDMODE@
|
||||
|
||||
GALLIUM_PIPE_LOADER_DEFINES = @GALLIUM_PIPE_LOADER_DEFINES@
|
||||
GALLIUM_PIPE_LOADER_LIBS = @GALLIUM_PIPE_LOADER_LIBS@
|
180
configs/default
Normal file
180
configs/default
Normal file
@@ -0,0 +1,180 @@
|
||||
# Default/template configuration
|
||||
|
||||
# This is included by other config files which may override some
|
||||
# of these variables.
|
||||
# Think of this as a base class from which configs are derived.
|
||||
|
||||
|
||||
CONFIG_NAME = default
|
||||
|
||||
# Version info
|
||||
MESA_MAJOR=9
|
||||
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.
|
||||
DRM_SOURCE_PATH=$(TOP)/../drm
|
||||
|
||||
# Compiler and flags
|
||||
CC = cc
|
||||
CXX = CC
|
||||
CFLAGS = -O
|
||||
CXXFLAGS = -O
|
||||
LDFLAGS =
|
||||
GLU_CFLAGS =
|
||||
GLX_TLS = no
|
||||
|
||||
# Compiler for building demos/tests/etc
|
||||
APP_CC = $(CC)
|
||||
APP_CXX = $(CXX)
|
||||
|
||||
# Misc tools and flags
|
||||
SHELL = /bin/sh
|
||||
MKLIB = $(SHELL) $(TOP)/bin/mklib
|
||||
MKLIB_OPTIONS =
|
||||
MKDEP = makedepend
|
||||
MKDEP_OPTIONS = -fdepend
|
||||
MAKE = make
|
||||
FLEX = flex
|
||||
BISON = bison
|
||||
PKG_CONFIG = pkg-config
|
||||
|
||||
# Use MINSTALL for installing libraries, INSTALL for everything else
|
||||
MINSTALL = $(SHELL) $(TOP)/bin/minstall
|
||||
INSTALL = $(MINSTALL)
|
||||
|
||||
# Tools for regenerating glapi (generally only needed by the developers)
|
||||
PYTHON2 = python
|
||||
PYTHON_FLAGS = -t -O -O
|
||||
INDENT = indent
|
||||
INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool
|
||||
|
||||
# Library names (base name)
|
||||
GL_LIB = GL
|
||||
GLU_LIB = GLU
|
||||
GLW_LIB = GLw
|
||||
OSMESA_LIB = OSMesa
|
||||
EGL_LIB = EGL
|
||||
GLESv1_CM_LIB = GLESv1_CM
|
||||
GLESv2_LIB = GLESv2
|
||||
VG_LIB = OpenVG
|
||||
GLAPI_LIB = glapi
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = lib$(GL_LIB).so
|
||||
GLU_LIB_NAME = lib$(GLU_LIB).so
|
||||
GLW_LIB_NAME = lib$(GLW_LIB).so
|
||||
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
|
||||
EGL_LIB_NAME = lib$(EGL_LIB).so
|
||||
GLESv1_CM_LIB_NAME = lib$(GLESv1_CM_LIB).so
|
||||
GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
|
||||
VG_LIB_NAME = lib$(VG_LIB).so
|
||||
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
|
||||
|
||||
# globs used to install the lib and all symlinks
|
||||
GL_LIB_GLOB = $(GL_LIB_NAME)*
|
||||
GLU_LIB_GLOB = $(GLU_LIB_NAME)*
|
||||
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
|
||||
EGL_LIB_GLOB = $(EGL_LIB_NAME)*
|
||||
GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
|
||||
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
|
||||
VG_LIB_GLOB = $(VG_LIB_NAME)*
|
||||
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
|
||||
|
||||
# Optional assembly language optimization files for libGL
|
||||
MESA_ASM_FILES =
|
||||
|
||||
# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in
|
||||
# order to build the Motif widget too)
|
||||
GLW_SOURCES = GLwDrawA.c
|
||||
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
|
||||
DRIVER_DIRS = x11 osmesa
|
||||
|
||||
# Gallium directories and
|
||||
GALLIUM_DIRS = auxiliary drivers state_trackers
|
||||
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
|
||||
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad i915 svga r300 nvfx nv50
|
||||
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
|
||||
GALLIUM_WINSYS_DIRS = sw sw/xlib
|
||||
GALLIUM_TARGET_DIRS = libgl-xlib
|
||||
GALLIUM_STATE_TRACKERS_DIRS = glx vega
|
||||
|
||||
# native platforms EGL should support
|
||||
EGL_PLATFORMS = x11
|
||||
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
|
||||
|
||||
# Program dependencies - specific GL libraries added in Makefiles
|
||||
X11_LIBS = -lX11
|
||||
|
||||
DLOPEN_LIBS = -ldl
|
||||
|
||||
# Installation directories (for make install)
|
||||
INSTALL_DIR = /usr/local
|
||||
INSTALL_LIB_DIR = $(INSTALL_DIR)/$(LIB_DIR)
|
||||
INSTALL_INC_DIR = $(INSTALL_DIR)/include
|
||||
DRI_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/dri
|
||||
|
||||
# Where libGL will look for DRI hardware drivers
|
||||
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
|
||||
|
||||
# EGL driver install directory
|
||||
EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl
|
||||
|
||||
# Xorg driver install directory (for xorg state-tracker)
|
||||
XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
|
||||
|
||||
# pkg-config substitutions
|
||||
GL_PC_REQ_PRIV =
|
||||
GL_PC_LIB_PRIV =
|
||||
GL_PC_CFLAGS =
|
||||
DRI_PC_REQ_PRIV =
|
||||
GLU_PC_REQ = gl
|
||||
GLU_PC_REQ_PRIV =
|
||||
GLU_PC_LIB_PRIV =
|
||||
GLU_PC_CFLAGS =
|
||||
GLW_PC_REQ_PRIV =
|
||||
GLW_PC_LIB_PRIV =
|
||||
GLW_PC_CFLAGS =
|
||||
OSMESA_PC_REQ =
|
||||
OSMESA_PC_LIB_PRIV =
|
||||
GLESv1_CM_PC_REQ_PRIV =
|
||||
GLESv1_CM_PC_LIB_PRIV =
|
||||
GLESv1_CM_PC_CFLAGS =
|
||||
GLESv2_PC_REQ_PRIV =
|
||||
GLESv2_PC_LIB_PRIV =
|
||||
GLESv2_PC_CFLAGS =
|
||||
VG_PC_REQ_PRIV =
|
||||
VG_PC_LIB_PRIV =
|
||||
VG_PC_CFLAGS =
|
||||
|
||||
# default targets
|
||||
# this helps reduce the mismatch between our automake Makefiles and the old
|
||||
# custom Makefiles while we transition.
|
||||
|
||||
all: default
|
||||
|
||||
am--refresh:
|
||||
|
||||
distclean: clean
|
||||
|
||||
check:
|
||||
test:
|
323
configure.ac
323
configure.ac
@@ -20,8 +20,7 @@ echo \#buildapi-variable-no-builddir >/dev/null
|
||||
# Support silent build rules, requires at least automake-1.11. Disable
|
||||
# by either passing --disable-silent-rules to configure or passing V=1
|
||||
# to make
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
|
||||
[AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
|
||||
|
||||
@@ -31,10 +30,10 @@ AC_SUBST([OSMESA_VERSION])
|
||||
|
||||
dnl Versions for external dependencies
|
||||
LIBDRM_REQUIRED=2.4.24
|
||||
LIBDRM_RADEON_REQUIRED=2.4.42
|
||||
LIBDRM_RADEON_REQUIRED=2.4.40
|
||||
LIBDRM_INTEL_REQUIRED=2.4.38
|
||||
LIBDRM_NVVIEUX_REQUIRED=2.4.33
|
||||
LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
|
||||
LIBDRM_NOUVEAU_REQUIRED=2.4.33
|
||||
DRI2PROTO_REQUIRED=2.6
|
||||
GLPROTO_REQUIRED=1.4.14
|
||||
LIBDRM_XORG_REQUIRED=2.4.24
|
||||
@@ -50,28 +49,37 @@ AM_PROG_CC_C_O
|
||||
AM_PROG_AS
|
||||
AC_CHECK_PROGS([MAKE], [gmake make])
|
||||
AC_CHECK_PROGS([PYTHON2], [python2 python])
|
||||
AX_PYTHON_MODULE([libxml2], [needed])
|
||||
AC_PROG_SED
|
||||
AC_PROG_MKDIR_P
|
||||
AC_PATH_PROG([MKDEP], [makedepend])
|
||||
|
||||
LT_PREREQ([2.2])
|
||||
LT_INIT([disable-static])
|
||||
|
||||
AX_PROG_BISON([],
|
||||
AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"],
|
||||
[AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])]))
|
||||
AX_PROG_FLEX([],
|
||||
AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-lex.c"],
|
||||
[AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])]))
|
||||
if test "x$MKDEP" = "x"; then
|
||||
AC_MSG_ERROR([makedepend is required to build Mesa])
|
||||
fi
|
||||
|
||||
AC_PROG_YACC
|
||||
AC_PATH_PROG([YACC_INST], $YACC)
|
||||
if test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"; then
|
||||
if test -z "$YACC_INST"; then
|
||||
AC_MSG_ERROR([yacc not found - unable to compile glcpp-parse.y])
|
||||
fi
|
||||
fi
|
||||
AC_PROG_LEX
|
||||
|
||||
AC_PATH_PROG([PERL], [perl])
|
||||
|
||||
AC_CHECK_PROG(INDENT, indent, indent, cat)
|
||||
if test "x$INDENT" != "xcat"; then
|
||||
AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -TGLubyte -TGLbyte -TBool')
|
||||
AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool')
|
||||
fi
|
||||
|
||||
dnl Our fallback install-sh is a symlink to minstall. Use the existing
|
||||
dnl configuration in that case.
|
||||
AC_PROG_INSTALL
|
||||
test "x$INSTALL" = "x$ac_install_sh" && INSTALL='$(MINSTALL)'
|
||||
|
||||
dnl We need a POSIX shell for parts of the build. Assume we have one
|
||||
dnl in most cases.
|
||||
@@ -118,6 +126,21 @@ if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
MKDEP_OPTIONS=-fdepend
|
||||
dnl Ask gcc where it's keeping its secret headers
|
||||
if test "x$GCC" = xyes; then
|
||||
for dir in include include-fixed; do
|
||||
GCC_INCLUDES=`$CC -print-file-name=$dir`
|
||||
if test "x$GCC_INCLUDES" != x && \
|
||||
test "$GCC_INCLUDES" != "$dir" && \
|
||||
test -d "$GCC_INCLUDES"; then
|
||||
MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
AC_SUBST([MKDEP_OPTIONS])
|
||||
|
||||
dnl Make sure the pkg-config macros are defined
|
||||
m4_ifndef([PKG_PROG_PKG_CONFIG],
|
||||
[m4_fatal([Could not locate the pkg-config autoconf macros.
|
||||
@@ -297,6 +320,15 @@ esac
|
||||
|
||||
AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
|
||||
|
||||
dnl
|
||||
dnl mklib options
|
||||
dnl
|
||||
AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
|
||||
if test "$enable_static" = yes; then
|
||||
MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
|
||||
fi
|
||||
AC_SUBST([MKLIB_OPTIONS])
|
||||
|
||||
dnl
|
||||
dnl other compiler options
|
||||
dnl
|
||||
@@ -493,6 +525,9 @@ if test "x$enable_asm" = xyes; then
|
||||
fi
|
||||
AC_SUBST([MESA_ASM_FILES])
|
||||
|
||||
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"],
|
||||
@@ -609,10 +644,8 @@ AC_ARG_ENABLE([vdpau],
|
||||
[enable_vdpau=auto])
|
||||
AC_ARG_ENABLE([opencl],
|
||||
[AS_HELP_STRING([--enable-opencl],
|
||||
[enable OpenCL library NOTE: Enabling this option will also enable
|
||||
--with-llvm-shared-libs
|
||||
@<:@default=no@:>@])],
|
||||
[],
|
||||
[enable OpenCL library @<:@default=no@:>@])],
|
||||
[enable_opencl="$enableval"],
|
||||
[enable_opencl=no])
|
||||
AC_ARG_ENABLE([xlib_glx],
|
||||
[AS_HELP_STRING([--enable-xlib-glx],
|
||||
@@ -647,15 +680,13 @@ AC_ARG_ENABLE([gallium_tests],
|
||||
[enable_gallium_tests=no])
|
||||
|
||||
# Option for Gallium drivers
|
||||
|
||||
# Keep this in sync with the --with-gallium-drivers help string default value
|
||||
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"
|
||||
@<:@default=r300,r600,svga,swrast@:>@])],
|
||||
@<:@default=r300,r600,swrast@:>@])],
|
||||
[with_gallium_drivers="$withval"],
|
||||
[with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
|
||||
|
||||
@@ -702,16 +733,6 @@ if test "x$enable_dri$enable_xlib_glx" = xyesyes; then
|
||||
AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together])
|
||||
fi
|
||||
|
||||
if test "x$enable_opengl$enable_xlib_glx" = xnoyes; then
|
||||
AC_MSG_ERROR([Xlib-GLX cannot be built without OpenGL])
|
||||
fi
|
||||
|
||||
# Disable GLX if OpenGL is not enabled
|
||||
if test "x$enable_glx$enable_opengl" = xyesno; then
|
||||
AC_MSG_WARN([OpenGL not enabled, disabling GLX])
|
||||
enable_glx=no
|
||||
fi
|
||||
|
||||
# Disable GLX if DRI and Xlib-GLX are not enabled
|
||||
if test "x$enable_glx" = xyes -a \
|
||||
"x$enable_dri" = xno -a \
|
||||
@@ -736,17 +757,22 @@ if test "x$enable_dri" = xno; then
|
||||
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"
|
||||
fi
|
||||
AC_SUBST([SHARED_GLAPI])
|
||||
AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
|
||||
|
||||
dnl
|
||||
dnl Driver specific build directories
|
||||
dnl
|
||||
SRC_DIRS="gtest"
|
||||
GALLIUM_DIRS="auxiliary drivers state_trackers"
|
||||
GALLIUM_TARGET_DIRS=""
|
||||
GALLIUM_WINSYS_DIRS="sw"
|
||||
@@ -771,7 +797,7 @@ fi
|
||||
# build glsl and mesa if OpenGL or OpenGL ES is enabled
|
||||
case "x$enable_opengl$enable_gles1$enable_gles2" in
|
||||
x*yes*)
|
||||
CORE_DIRS="mapi/glapi/gen $CORE_DIRS gtest glsl mesa"
|
||||
CORE_DIRS="mapi/glapi/gen $CORE_DIRS glsl mesa"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1088,8 +1114,8 @@ if test "x$enable_dri" = xyes; then
|
||||
LIBS="$save_LIBS"
|
||||
fi
|
||||
|
||||
# if we are building any dri driver other than swrast or using the dri state tracker ...
|
||||
if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast || test "x$enable_dri" = xyes; then
|
||||
# if we are building any dri driver other than swrast ...
|
||||
if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then
|
||||
# ... libdrm is required
|
||||
if test "x$have_libdrm" != xyes; then
|
||||
AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
|
||||
@@ -1372,7 +1398,6 @@ if test "x$enable_openvg" = xyes; then
|
||||
VG_PC_LIB_PRIV="-lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
|
||||
AC_SUBST([VG_PC_LIB_PRIV])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_OPENVG, test "x$enable_openvg" = xyes)
|
||||
|
||||
dnl
|
||||
dnl D3D1X configuration
|
||||
@@ -1427,27 +1452,17 @@ dnl
|
||||
|
||||
AC_ARG_WITH([libclc-path],
|
||||
[AS_HELP_STRING([--with-libclc-path],
|
||||
[DEPRECATED: See http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install])],
|
||||
[Path to libclc builtins library. Example: --with-libclc-path=\$HOME/libclc/])],
|
||||
[LIBCLC_PATH="$withval"],
|
||||
[LIBCLC_PATH=""])
|
||||
|
||||
if test "x$LIBCLC_PATH" != x; then
|
||||
AC_MSG_ERROR([The --with-libclc-path option has been deprecated.
|
||||
Please review the updated build instructions for clover:
|
||||
http://dri.freedesktop.org/wiki/GalliumCompute])
|
||||
fi
|
||||
|
||||
|
||||
AC_ARG_WITH([clang-libdir],
|
||||
[AS_HELP_STRING([--with-clang-libdir],
|
||||
[Path to Clang libraries @<:@default=llvm-config --libdir@:>@])],
|
||||
[CLANG_LIBDIR="$withval"],
|
||||
[CLANG_LIBDIR=""])
|
||||
|
||||
LIBCLC_INCLUDEDIR=`pkg-config --variable=includedir libclc`
|
||||
LIBCLC_LIBEXECDIR=`pkg-config --variable=libexecdir libclc`
|
||||
AC_SUBST([LIBCLC_INCLUDEDIR])
|
||||
AC_SUBST([LIBCLC_LIBEXECDIR])
|
||||
AC_SUBST([LIBCLC_PATH])
|
||||
|
||||
if test "x$enable_opencl" = xyes; then
|
||||
if test "x$with_gallium_drivers" = x; then
|
||||
@@ -1458,19 +1473,11 @@ if test "x$enable_opencl" = xyes; then
|
||||
AC_MSG_ERROR([gcc >= 4.6 is required to build clover])
|
||||
fi
|
||||
|
||||
if test "x$LIBCLC_INCLUDEDIR" == x || test "x$LIBCLC_LIBEXECDIR" == x; then
|
||||
AC_MSG_ERROR([pkg-config cannot use libclc.pc which is required to build clover])
|
||||
fi
|
||||
|
||||
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover"
|
||||
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
|
||||
enable_gallium_loader=yes
|
||||
fi
|
||||
|
||||
if test "x$enable_gallium_gbm" = xyes || test "x$enable_opencl" = xyes; then
|
||||
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS pipe-loader"
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl Gallium configuration
|
||||
dnl
|
||||
@@ -1493,10 +1500,8 @@ AC_SUBST([CLANG_RESOURCE_DIR])
|
||||
case "x$enable_opengl$enable_gles1$enable_gles2" in
|
||||
x*yes*)
|
||||
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
|
||||
HAVE_OPENGL=yes
|
||||
;;
|
||||
esac
|
||||
AM_CONDITIONAL(HAVE_OPENGL, test "x$HAVE_OPENGL" = xyes)
|
||||
|
||||
AC_SUBST([VG_LIB_DEPS])
|
||||
AC_SUBST([EGL_CLIENT_APIS])
|
||||
@@ -1630,13 +1635,8 @@ AC_ARG_ENABLE([gallium-llvm],
|
||||
AC_ARG_WITH([llvm-shared-libs],
|
||||
[AS_HELP_STRING([--with-llvm-shared-libs],
|
||||
[link with LLVM shared libraries @<:@default=disabled@:>@])],
|
||||
[],
|
||||
[with_llvm_shared_libs=yes],
|
||||
[with_llvm_shared_libs=no])
|
||||
AS_IF([test x$enable_opencl = xyes],
|
||||
[
|
||||
AC_MSG_WARN([OpenCL required, forcing LLVM shared libraries])
|
||||
with_llvm_shared_libs=yes
|
||||
])
|
||||
|
||||
AC_ARG_WITH([llvm-prefix],
|
||||
[AS_HELP_STRING([--with-llvm-prefix],
|
||||
@@ -1678,14 +1678,20 @@ if test "x$enable_gallium_llvm" = xyes; then
|
||||
if test "x$LLVM_CONFIG" != xno; then
|
||||
LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
|
||||
LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
|
||||
LLVM_COMPONENTS="engine bitwriter"
|
||||
if $LLVM_CONFIG --components | grep -q '\<mcjit\>'; then
|
||||
LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
|
||||
fi
|
||||
if test "x$with_llvm_shared_libs" = 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
|
||||
|
||||
if test "x$enable_opencl" = xyes; then
|
||||
LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
|
||||
fi
|
||||
if test "x$enable_opencl" = xyes; then
|
||||
LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
|
||||
fi
|
||||
LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
|
||||
fi
|
||||
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
|
||||
LLVM_BINDIR=`$LLVM_CONFIG --bindir`
|
||||
LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
|
||||
@@ -1693,7 +1699,7 @@ if test "x$enable_gallium_llvm" = xyes; then
|
||||
LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"`
|
||||
LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
|
||||
LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
|
||||
DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT"
|
||||
DEFINES="${DEFINES} -DHAVE_LLVM=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/0x0\10\2/g'`"
|
||||
MESA_LLVM=1
|
||||
|
||||
dnl Check for Clang interanl headers
|
||||
@@ -1707,11 +1713,9 @@ if test "x$enable_gallium_llvm" = xyes; then
|
||||
fi
|
||||
else
|
||||
MESA_LLVM=0
|
||||
LLVM_VERSION_INT=0
|
||||
fi
|
||||
else
|
||||
MESA_LLVM=0
|
||||
LLVM_VERSION_INT=0
|
||||
fi
|
||||
|
||||
dnl Directory for XVMC libs
|
||||
@@ -1726,7 +1730,7 @@ dnl
|
||||
dnl Gallium Tests
|
||||
dnl
|
||||
if test "x$enable_gallium_tests" = xyes; then
|
||||
SRC_DIRS="$SRC_DIRS gallium/tests/trivial gallium/tests/unit"
|
||||
SRC_DIRS="$SRC_DIRS gallium/tests/trivial"
|
||||
enable_gallium_loader=yes
|
||||
fi
|
||||
|
||||
@@ -1786,7 +1790,7 @@ gallium_require_llvm() {
|
||||
gallium_require_drm_loader() {
|
||||
if test "x$enable_gallium_loader" = xyes; then
|
||||
PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
|
||||
AC_MSG_ERROR([Gallium drm loader requires libudev]))
|
||||
AC_MSG_ERROR([Gallium drm loader requrires libudev]))
|
||||
if test "x$have_libdrm" != xyes; then
|
||||
AC_MSG_ERROR([Gallium drm loader requires libdrm >= $LIBDRM_REQUIRED])
|
||||
fi
|
||||
@@ -1809,7 +1813,7 @@ radeon_llvm_check() {
|
||||
configure flag])
|
||||
fi
|
||||
AC_MSG_WARN([Please ensure you use the latest llvm tree from git://people.freedesktop.org/~tstellar/llvm master before submitting a bug])
|
||||
LLVM_COMPONENTS="${LLVM_COMPONENTS} r600"
|
||||
LLVM_LIBS="$LLVM_LIBS `$LLVM_CONFIG --libs r600`"
|
||||
}
|
||||
|
||||
dnl Gallium drivers
|
||||
@@ -1819,12 +1823,10 @@ if test "x$with_gallium_drivers" != x; then
|
||||
for driver in $gallium_drivers; do
|
||||
case "x$driver" in
|
||||
xsvga)
|
||||
HAVE_GALLIUM_SVGA=yes
|
||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
|
||||
gallium_check_st "svga/drm" "dri-vmwgfx" "" "xa-vmwgfx"
|
||||
;;
|
||||
xi915)
|
||||
HAVE_GALLIUM_I915=yes
|
||||
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
|
||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 softpipe"
|
||||
if test "x$MESA_LLVM" = x1; then
|
||||
@@ -1834,33 +1836,28 @@ if test "x$with_gallium_drivers" != x; then
|
||||
gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
|
||||
;;
|
||||
xr300)
|
||||
HAVE_GALLIUM_R300=yes
|
||||
PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
|
||||
gallium_require_llvm "Gallium R300"
|
||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
|
||||
gallium_check_st "radeon/drm" "dri-r300" "" "" "xvmc-r300" "vdpau-r300"
|
||||
gallium_check_st "radeon/drm" "dri-r300" "xorg-r300" "" "xvmc-r300" "vdpau-r300"
|
||||
;;
|
||||
xr600)
|
||||
HAVE_GALLIUM_R600=yes
|
||||
PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
|
||||
gallium_require_drm_loader
|
||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
|
||||
if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
|
||||
radeon_llvm_check
|
||||
NEED_RADEON_GALLIUM=yes;
|
||||
R600_NEED_RADEON_GALLIUM=yes;
|
||||
LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo bitreader asmparser"
|
||||
fi
|
||||
if test "x$enable_r600_llvm" = xyes; then
|
||||
USE_R600_LLVM_COMPILER=yes;
|
||||
fi
|
||||
if test "x$enable_opencl" = xyes; then
|
||||
LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
|
||||
if test "x$enable_opencl" = xyes -a "x$with_llvm_shared_libs" = xno; then
|
||||
LLVM_LIBS="${LLVM_LIBS} `$LLVM_CONFIG --libs bitreader asmparser`"
|
||||
fi
|
||||
gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600"
|
||||
;;
|
||||
xradeonsi)
|
||||
HAVE_GALLIUM_RADEONSI=yes
|
||||
PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
|
||||
gallium_require_drm_loader
|
||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi"
|
||||
@@ -1869,17 +1866,14 @@ if test "x$with_gallium_drivers" != x; then
|
||||
gallium_check_st "radeon/drm" "dri-radeonsi" "xorg-radeonsi" "" "" "vdpau-radeonsi" ""
|
||||
;;
|
||||
xnouveau)
|
||||
HAVE_GALLIUM_NOUVEAU=yes
|
||||
PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
|
||||
gallium_require_drm_loader
|
||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nv30 nv50 nvc0"
|
||||
gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "" "xvmc-nouveau" "vdpau-nouveau"
|
||||
;;
|
||||
xswrast)
|
||||
HAVE_GALLIUM_SOFTPIPE=yes
|
||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe"
|
||||
if test "x$MESA_LLVM" = x1; then
|
||||
HAVE_GALLIUM_LLVMPIPE=yes
|
||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
|
||||
fi
|
||||
|
||||
@@ -1906,67 +1900,15 @@ if test "x$with_gallium_drivers" != x; then
|
||||
done
|
||||
fi
|
||||
|
||||
dnl Set LLVM_LIBS - This is done after the driver configuration so
|
||||
dnl that drivers can add additonal components to LLVM_COMPONENTS.
|
||||
dnl Previously, gallium drivers were updating LLVM_LIBS directly
|
||||
dnl by calling llvm-config --libs ${DRIVER_LLVM_COMPONENTS}, but
|
||||
dnl this was causing the same libraries to be appear multiple times
|
||||
dnl in LLVM_LIBS.
|
||||
|
||||
if test "x$MESA_LLVM" != x0; then
|
||||
|
||||
LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
|
||||
|
||||
if test "x$with_llvm_shared_libs" = xyes; then
|
||||
dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
|
||||
LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
|
||||
AC_CHECK_FILE("$LLVM_LIBDIR/lib$LLVM_SO_NAME.so", llvm_have_one_so=yes,)
|
||||
|
||||
if test "x$llvm_have_one_so" = xyes; then
|
||||
dnl LLVM was built using auto*, so there is only one shared object.
|
||||
LLVM_LIBS="-l$LLVM_SO_NAME"
|
||||
else
|
||||
dnl If LLVM was built with CMake, there will be one shared object per
|
||||
dnl component.
|
||||
AC_CHECK_FILE("$LLVM_LIBDIR/libLLVMTarget.so",,
|
||||
AC_MSG_ERROR([Could not find llvm shared libraries:
|
||||
Please make sure you have built llvm with the --enable-shared option
|
||||
and that your llvm libraries are installed in $LLVM_LIBDIR
|
||||
If you have installed your llvm libraries to a different directory you
|
||||
can use the --with-llvm-prefix= configure flag to specify this directory.
|
||||
NOTE: Mesa is attempting to use llvm shared libraries because you have
|
||||
passed one of the following options to configure:
|
||||
--with-llvm-shared-libs
|
||||
--enable-opencl
|
||||
If you do not want to build with llvm shared libraries and instead want to
|
||||
use llvm static libraries then remove these options from your configure
|
||||
invocation and reconfigure.]))
|
||||
|
||||
dnl We don't need to update LLVM_LIBS in this case because the LLVM
|
||||
dnl install uses a shared object for each compoenent and we have
|
||||
dnl already added all of these objects to LLVM_LIBS.
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
|
||||
|
||||
if test "x$enable_gallium_loader" = xyes; then
|
||||
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
|
||||
GALLIUM_PIPE_LOADER_DEFINES="-DHAVE_PIPE_LOADER_SW"
|
||||
GALLIUM_PIPE_LOADER_LIBS="\$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la"
|
||||
GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS \$(top_builddir)/src/gallium/winsys/sw/null/libws_null.la"
|
||||
GALLIUM_PIPE_LOADER_LIBS="\$(TOP)/src/gallium/auxiliary/pipe-loader/libpipe_loader.a"
|
||||
GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS \$(TOP)/src/gallium/winsys/sw/null/libws_null.a"
|
||||
|
||||
if test "x$HAVE_WINSYS_XLIB" = xyes; then
|
||||
GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XLIB"
|
||||
GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS \$(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la"
|
||||
GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS \$(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a"
|
||||
fi
|
||||
|
||||
if test "x$enable_gallium_drm_loader" = xyes; then
|
||||
@@ -2005,38 +1947,18 @@ AM_CONDITIONAL(HAVE_GALAHAD_GALLIUM, test x$HAVE_GALAHAD_GALLIUM = xyes)
|
||||
AM_CONDITIONAL(HAVE_IDENTITY_GALLIUM, test x$HAVE_IDENTITY_GALLIUM = xyes)
|
||||
AM_CONDITIONAL(HAVE_NOOP_GALLIUM, test x$HAVE_NOOP_GALLIUM = xyes)
|
||||
AM_CONDITIONAL(NEED_RADEON_GALLIUM, test x$NEED_RADEON_GALLIUM = xyes)
|
||||
AM_CONDITIONAL(R600_NEED_RADEON_GALLIUM, test x$R600_NEED_RADEON_GALLIUM = xyes)
|
||||
AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
|
||||
AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
|
||||
AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
|
||||
AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
|
||||
AM_CONDITIONAL(LLVM_NEEDS_FNORTTI, test $LLVM_VERSION_INT -ge 302)
|
||||
|
||||
AC_SUBST([GALLIUM_MAKE_DIRS])
|
||||
|
||||
AM_CONDITIONAL(NEED_LIBPROGRAM, test "x$with_gallium_drivers" != x -o \
|
||||
"x$enable_xlib_glx" = xyes -o \
|
||||
"x$enable_osmesa" = xyes)
|
||||
AM_CONDITIONAL(HAVE_X11_DRIVER, echo "$DRIVER_DIRS" | grep 'x11' >/dev/null 2>&1)
|
||||
|
||||
AM_CONDITIONAL(HAVE_X86_ASM, echo "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1)
|
||||
AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1)
|
||||
AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$DEFINES" | grep 'SPARC_ASM' >/dev/null 2>&1)
|
||||
|
||||
AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
|
||||
|
||||
AC_SUBST([VDPAU_MAJOR], 1)
|
||||
AC_SUBST([VDPAU_MINOR], 0)
|
||||
|
||||
AC_SUBST([XVMC_MAJOR], 1)
|
||||
AC_SUBST([XVMC_MINOR], 0)
|
||||
|
||||
AC_SUBST([XA_MAJOR], 1)
|
||||
AC_SUBST([XA_MINOR], 0)
|
||||
AC_SUBST([XA_TINY], 0)
|
||||
AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
|
||||
|
||||
dnl prepend CORE_DIRS to SRC_DIRS
|
||||
SRC_DIRS="$CORE_DIRS $SRC_DIRS"
|
||||
|
||||
@@ -2049,7 +1971,8 @@ CFLAGS="$CFLAGS $USER_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
|
||||
|
||||
dnl Substitute the config
|
||||
AC_CONFIG_FILES([Makefile
|
||||
AC_CONFIG_FILES([configs/current
|
||||
Makefile
|
||||
src/Makefile
|
||||
src/egl/Makefile
|
||||
src/egl/drivers/Makefile
|
||||
@@ -2062,83 +1985,18 @@ AC_CONFIG_FILES([Makefile
|
||||
src/egl/wayland/wayland-egl/Makefile
|
||||
src/egl/wayland/wayland-egl/wayland-egl.pc
|
||||
src/gallium/Makefile
|
||||
src/gallium/auxiliary/Makefile
|
||||
src/gallium/auxiliary/pipe-loader/Makefile
|
||||
src/gallium/drivers/Makefile
|
||||
src/gallium/drivers/i915/Makefile
|
||||
src/gallium/drivers/llvmpipe/Makefile
|
||||
src/gallium/drivers/nouveau/Makefile
|
||||
src/gallium/drivers/nv30/Makefile
|
||||
src/gallium/drivers/nv50/Makefile
|
||||
src/gallium/drivers/nvc0/Makefile
|
||||
src/gallium/drivers/r300/Makefile
|
||||
src/gallium/drivers/r600/Makefile
|
||||
src/gallium/drivers/radeon/Makefile
|
||||
src/gallium/drivers/radeonsi/Makefile
|
||||
src/gallium/drivers/rbug/Makefile
|
||||
src/gallium/drivers/softpipe/Makefile
|
||||
src/gallium/drivers/svga/Makefile
|
||||
src/gallium/drivers/trace/Makefile
|
||||
src/gallium/state_trackers/Makefile
|
||||
src/gallium/state_trackers/clover/Makefile
|
||||
src/gallium/state_trackers/dri/Makefile
|
||||
src/gallium/state_trackers/dri/drm/Makefile
|
||||
src/gallium/state_trackers/dri/sw/Makefile
|
||||
src/gallium/state_trackers/egl/Makefile
|
||||
src/gallium/state_trackers/gbm/Makefile
|
||||
src/gallium/state_trackers/glx/Makefile
|
||||
src/gallium/state_trackers/vdpau/Makefile
|
||||
src/gallium/state_trackers/vega/Makefile
|
||||
src/gallium/state_trackers/xa/Makefile
|
||||
src/gallium/state_trackers/xorg/Makefile
|
||||
src/gallium/state_trackers/xvmc/Makefile
|
||||
src/gallium/targets/Makefile
|
||||
src/gallium/targets/dri-i915/Makefile
|
||||
src/gallium/targets/dri-nouveau/Makefile
|
||||
src/gallium/targets/dri-r300/Makefile
|
||||
src/gallium/targets/dri-r600/Makefile
|
||||
src/gallium/targets/dri-radeonsi/Makefile
|
||||
src/gallium/targets/dri-swrast/Makefile
|
||||
src/gallium/targets/dri-vmwgfx/Makefile
|
||||
src/gallium/targets/egl-static/Makefile
|
||||
src/gallium/targets/gbm/Makefile
|
||||
src/gallium/targets/opencl/Makefile
|
||||
src/gallium/targets/pipe-loader/Makefile
|
||||
src/gallium/targets/libgl-xlib/Makefile
|
||||
src/gallium/targets/vdpau-nouveau/Makefile
|
||||
src/gallium/targets/vdpau-r300/Makefile
|
||||
src/gallium/targets/vdpau-r600/Makefile
|
||||
src/gallium/targets/vdpau-radeonsi/Makefile
|
||||
src/gallium/targets/vdpau-softpipe/Makefile
|
||||
src/gallium/targets/xa-vmwgfx/Makefile
|
||||
src/gallium/targets/xa-vmwgfx/xatracker.pc
|
||||
src/gallium/targets/xorg-i915/Makefile
|
||||
src/gallium/targets/xorg-nouveau/Makefile
|
||||
src/gallium/targets/xorg-r600/Makefile
|
||||
src/gallium/targets/xorg-radeonsi/Makefile
|
||||
src/gallium/targets/xvmc-nouveau/Makefile
|
||||
src/gallium/targets/xvmc-r300/Makefile
|
||||
src/gallium/targets/xvmc-r600/Makefile
|
||||
src/gallium/targets/xvmc-softpipe/Makefile
|
||||
src/gallium/tests/trivial/Makefile
|
||||
src/gallium/tests/unit/Makefile
|
||||
src/gallium/winsys/Makefile
|
||||
src/gallium/winsys/i915/drm/Makefile
|
||||
src/gallium/winsys/i915/sw/Makefile
|
||||
src/gallium/winsys/nouveau/drm/Makefile
|
||||
src/gallium/winsys/radeon/drm/Makefile
|
||||
src/gallium/winsys/svga/drm/Makefile
|
||||
src/gallium/winsys/sw/Makefile
|
||||
src/gallium/winsys/sw/dri/Makefile
|
||||
src/gallium/winsys/sw/fbdev/Makefile
|
||||
src/gallium/winsys/sw/null/Makefile
|
||||
src/gallium/winsys/sw/wayland/Makefile
|
||||
src/gallium/winsys/sw/wrapper/Makefile
|
||||
src/gallium/winsys/sw/xlib/Makefile
|
||||
src/gbm/Makefile
|
||||
src/gbm/main/gbm.pc
|
||||
src/glsl/Makefile
|
||||
src/glsl/builtin_compiler/Makefile
|
||||
src/glsl/glcpp/Makefile
|
||||
src/glsl/tests/Makefile
|
||||
src/glx/Makefile
|
||||
src/glx/tests/Makefile
|
||||
src/gtest/Makefile
|
||||
@@ -2158,7 +2016,6 @@ AC_CONFIG_FILES([Makefile
|
||||
src/mesa/drivers/Makefile
|
||||
src/mesa/drivers/dri/dri.pc
|
||||
src/mesa/drivers/dri/common/Makefile
|
||||
src/mesa/drivers/dri/common/xmlpool/Makefile
|
||||
src/mesa/drivers/dri/i915/Makefile
|
||||
src/mesa/drivers/dri/i965/Makefile
|
||||
src/mesa/drivers/dri/Makefile
|
||||
@@ -2282,9 +2139,9 @@ echo " Shared-glapi: $enable_shared_glapi"
|
||||
|
||||
dnl Compiler options
|
||||
# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
|
||||
cflags=`echo $CFLAGS | \
|
||||
cflags=`echo $CFLAGS $PIC_FLAGS | \
|
||||
$SED 's/^ *//;s/ */ /;s/ *$//'`
|
||||
cxxflags=`echo $CXXFLAGS | \
|
||||
cxxflags=`echo $CXXFLAGS $PIC_FLAGS | \
|
||||
$SED 's/^ *//;s/ */ /;s/ *$//'`
|
||||
defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'`
|
||||
echo ""
|
||||
|
12
docs/GL3.txt
12
docs/GL3.txt
@@ -41,15 +41,15 @@ GLX_ARB_create_context (GLX 1.4 is required) DONE
|
||||
|
||||
GL 3.1:
|
||||
|
||||
GLSL 1.40 DONE (i965, r600)
|
||||
Forward compatibile context support/deprecations DONE (i965, r600)
|
||||
GLSL 1.40 DONE (i965)
|
||||
Forward compatibile context support/deprecations DONE (i965)
|
||||
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, r600)
|
||||
Texture buffer objs (GL_ARB_texture_buffer_object) DONE for OpenGL 3.1 contexts (i965)
|
||||
Rectangular textures (GL_ARB_texture_rectangle) DONE (i965, r300, r600, swrast)
|
||||
Uniform buffer objs (GL_ARB_uniform_buffer_object) DONE (i965, r600, swrast)
|
||||
Uniform buffer objs (GL_ARB_uniform_buffer_object) DONE (i965)
|
||||
Signed normalized textures (GL_EXT_texture_snorm) DONE (i965, r300, r600)
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ GL_ARB_gpu_shader_fp64 not started
|
||||
GL_ARB_sample_shading not started
|
||||
GL_ARB_shader_subroutine not started
|
||||
GL_ARB_tessellation_shader not started
|
||||
GL_ARB_texture_buffer_object_rgb32 DONE (i965, softpipe)
|
||||
GL_ARB_texture_buffer_object_rgb32 DONE (softpipe)
|
||||
GL_ARB_texture_cube_map_array DONE (i965, softpipe)
|
||||
GL_ARB_texture_gather not started
|
||||
GL_ARB_transform_feedback2 DONE
|
||||
@@ -121,7 +121,7 @@ GL_ARB_compressed_texture_pixel_storage not started
|
||||
GL_ARB_shader_atomic_counters not started
|
||||
GL_ARB_texture_storage DONE (r300, r600, swrast, gallium)
|
||||
GL_ARB_transform_feedback_instanced DONE
|
||||
GL_ARB_base_instance DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_base_instance DONE (nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_shader_image_load_store not started
|
||||
GL_ARB_conservative_depth DONE (softpipe)
|
||||
GL_ARB_shading_language_420pack not started
|
||||
|
@@ -196,6 +196,8 @@ branch is relevant.
|
||||
<h3>Verify and update version info</h3>
|
||||
|
||||
<dl>
|
||||
<dt>configs/default</dt>
|
||||
<dd>MESA_MAJOR, MESA_MINOR and MESA_TINY</dd>
|
||||
<dt>Makefile.am</dt>
|
||||
<dd>PACKAGE_VERSION</dd>
|
||||
<dt>configure.ac</dt>
|
||||
|
@@ -16,14 +16,6 @@
|
||||
|
||||
<h1>News</h1>
|
||||
|
||||
<h2>January 22, 2013</h2>
|
||||
|
||||
<p>
|
||||
<a href="relnotes-9.0.2.html">Mesa 9.0.2</a> is released.
|
||||
This is a bug fix release.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>November 16, 2012</h2>
|
||||
|
||||
<p>
|
||||
|
@@ -1,290 +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>
|
||||
|
||||
<div class="header">
|
||||
<h1>The Mesa 3D Graphics Library</h1>
|
||||
</div>
|
||||
|
||||
<iframe src="contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 9.0.2 Release Notes / January 22th, 2013</h1>
|
||||
|
||||
<p>
|
||||
Mesa 9.0.2 is a bug fix release which fixes bugs found since the 9.0.1 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>
|
||||
5ae216ca9fecfa349f14ecb83aa3f124 MesaLib-9.0.2.tar.gz
|
||||
dc45d1192203e418163e0017640e1cfc MesaLib-9.0.2.tar.bz2
|
||||
93d40ec77d656dd04b561ba203ffbb91 MesaLib-9.0.2.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=22576">Bug 22576</a> - [KMS] mesa demo spectex broken on rv280</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26809">Bug 26809</a> - KMS/R200: Bad shading in NWN since Mesa rewrite</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45877">Bug 45877</a> - [bisected regression] Oglc fbo(negative.invalidParams3) Segmentation fault</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=54402">Bug 54402</a> - st_glsl_to_tgsi.cpp:4006:dst_register: Assertion `index < VERT_RESULT_MAX' failed</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55175">Bug 55175</a> - Memoryleak with glPopAttrib only on Intel GM45</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=56442">Bug 56442</a> - glcpp accepts junk after #else/#elif/#endif tokens</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=56706">Bug 56706</a> - EGL sets error to EGL_SUCCESS when DRI driver fails to create context</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=57622">Bug 57622</a> - Webgl conformance shader-with-non-reserved-words crash.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=57842">Bug 57842</a> - r200: Culling is broken when rendering to an FBO</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=57984">Bug 57984</a> - r300g: blend sfactor=GL_DST_COLOR fails with FBOs</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=58545">Bug 58545</a> - [llvmpipe] src/gallium/auxiliary/gallivm/lp_bld_tgsi_info.c:75:analyse_src: Assertion `src->Index < (sizeof(ctx->imm)/sizeof((ctx->imm)[0]))' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59383">Bug 59383</a> - src/glsl/tests/Makefile.am missing $(top_srcdir)/include</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.1..mesa-9.0.2
|
||||
</pre>
|
||||
|
||||
<p>Abdiel Janulgue (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Fix a crash in update_texture_state() for external texture type</li>
|
||||
</ul>
|
||||
|
||||
<p>Adam Jackson (4):</p>
|
||||
<ul>
|
||||
<li>glcpp: Fix visibility CFLAGS in automake</li>
|
||||
<li>glcpp: Typo fix.</li>
|
||||
<li>galahad, noop: Fix visibility CFLAGS in automake</li>
|
||||
<li>r300g: Fix visibility CFLAGS in automake</li>
|
||||
</ul>
|
||||
|
||||
<p>Alex Deucher (2):</p>
|
||||
<ul>
|
||||
<li>radeonsi: add some new SI pci ids</li>
|
||||
<li>radeonsi: add a new SI pci id</li>
|
||||
</ul>
|
||||
|
||||
<p>Ander Conselvan de Oliveira (2):</p>
|
||||
<ul>
|
||||
<li>egl/wayland: Don't invalidate drawable on swap buffers</li>
|
||||
<li>egl/wayland: Dispatch the event queue before get_buffers</li>
|
||||
<li>egl/wayland: Destroy the pending buffer callback with the egl surface</li>
|
||||
</ul>
|
||||
|
||||
<p>Andreas Boll (9):</p>
|
||||
<ul>
|
||||
<li>docs: fix release date of 9.0.1</li>
|
||||
<li>docs: add news item for 9.0.1 release</li>
|
||||
<li>Add .dirstamp to toplevel .gitignore</li>
|
||||
<li>build: use git ls-files for adding all Makefile.in into the release tarball</li>
|
||||
<li>build: Fix GLES linkage without libglapi</li>
|
||||
<li>Revert "r600g: try to fix streamout for the cases where BURST_COUNT > 0"</li>
|
||||
<li>mesa: update .cherry-ignore list</li>
|
||||
<li>mesa: Bump version to 9.0.2</li>
|
||||
<li>docs: Add 9.0.2 release notes</li>
|
||||
</ul>
|
||||
|
||||
<p>Anuj Phogat (2):</p>
|
||||
<ul>
|
||||
<li>mesa: Generate invalid operation in glGenerateMipMap for integer textures</li>
|
||||
<li>meta: Remove redundant code in _mesa_meta_GenerateMipmap</li>
|
||||
</ul>
|
||||
|
||||
<p>Ben Skeggs (3):</p>
|
||||
<ul>
|
||||
<li>nvc0: fix missing permanent bo reference on poly cache</li>
|
||||
<li>nvc0: point vertex runout at a valid address</li>
|
||||
<li>nv50: point vertex runout at a valid address</li>
|
||||
</ul>
|
||||
|
||||
<p>Brian Paul (5):</p>
|
||||
<ul>
|
||||
<li>svga: don't use uninitialized framebuffer state</li>
|
||||
<li>st/mesa: replace REALLOC() with realloc()</li>
|
||||
<li>st/mesa: free TGSI tokens with ureg_free_tokens()</li>
|
||||
<li>util: added pipe_surface_release() function</li>
|
||||
<li>gallivm: support more immediates in lp_build_tgsi_info()</li>
|
||||
</ul>
|
||||
|
||||
<p>Bryan Cain (1):</p>
|
||||
<ul>
|
||||
<li>glsl_to_tgsi: set correct register type for array and structure elements</li>
|
||||
</ul>
|
||||
|
||||
<p>Chad Versace (2):</p>
|
||||
<ul>
|
||||
<li>i965: Validate requested GLES context version in brwCreateContext</li>
|
||||
<li>egl/dri2: Set error code when dri2CreateContextAttribs fails</li>
|
||||
</ul>
|
||||
|
||||
<p>Chris Fester (1):</p>
|
||||
<ul>
|
||||
<li>util: null-out the node's prev/next pointers in list_del()</li>
|
||||
</ul>
|
||||
|
||||
<p>Christoph Bumiller (5):</p>
|
||||
<ul>
|
||||
<li>nv50/ir/tgsi: fix srcMask for TXP with SHADOW1D</li>
|
||||
<li>nvc0: add missing call to map edge flag in push_vbo</li>
|
||||
<li>nv50/ir: wrap assertion using typeid in #ifndef NDEBUG</li>
|
||||
<li>nouveau: fix undefined behaviour when testing sample_count</li>
|
||||
<li>nv50/ir: restore use of long immediate encodings</li>
|
||||
</ul>
|
||||
|
||||
<p>Dave Airlie (5):</p>
|
||||
<ul>
|
||||
<li>r600g: fix lod bias/explicit lod with cube maps.</li>
|
||||
<li>glsl_to_tgsi: fix dst register for texturing fetches.</li>
|
||||
<li>glsl: fix cut-n-paste error in error handling. (v2)</li>
|
||||
<li>glsl: initialise killed_all field.</li>
|
||||
<li>glsl: fix uninitialised variable from constructor</li>
|
||||
</ul>
|
||||
|
||||
<p>Eric Anholt (4):</p>
|
||||
<ul>
|
||||
<li>mesa: Fix the core GL genned-name handling for glBindBufferBase()/Range().</li>
|
||||
<li>mesa: Fix core GL genned-name handling for glBeginQuery().</li>
|
||||
<li>mesa: Fix segfault on reading from a missing color read buffer.</li>
|
||||
<li>i965/gen4: Fix memory leak each time compile_gs_prog() is called.</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (2):</p>
|
||||
<ul>
|
||||
<li>docs: Add 9.0.1 release md5sums</li>
|
||||
<li>glsl: Don't add structure fields to the symbol table</li>
|
||||
</ul>
|
||||
|
||||
<p>Johannes Obermayr (4):</p>
|
||||
<ul>
|
||||
<li>clover: Install CL headers.</li>
|
||||
<li>gallium/auxiliary: Add -fno-rtti to CXXFLAGS on LLVM >= 3.2.</li>
|
||||
<li>clover: Adapt libclc's INCLUDEDIR and LIBEXECDIR to make use of the new introduced libclc.pc.</li>
|
||||
<li>tests: AM_CPPFLAGS must include $(top_srcdir) instead of $(top_builddir).</li>
|
||||
</ul>
|
||||
|
||||
<p>Jonas Ådahl (1):</p>
|
||||
<ul>
|
||||
<li>wayland: Don't cancel a roundtrip when any event is received</li>
|
||||
</ul>
|
||||
|
||||
<p>José Fonseca (1):</p>
|
||||
<ul>
|
||||
<li>llvmpipe: Obey back writemask.</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (8):</p>
|
||||
<ul>
|
||||
<li>i965/vs: Fix unit mismatch in scratch base_offset parameter.</li>
|
||||
<li>i965/vs: Implement register spilling.</li>
|
||||
<li>mesa: Don't flatten IF statements by default.</li>
|
||||
<li>glcpp: Don't use infinite lookhead for #define differentiation.</li>
|
||||
<li>i965/vs: Don't lose the MRF writemask when doing compute-to-MRF.</li>
|
||||
<li>i965/vs: Preserve the type when copy propagating into an instruction.</li>
|
||||
<li>mesa: Fix glGetVertexAttribI[u]iv now that we have real integer attribs.</li>
|
||||
<li>i965: Fix AA Line Distance Mode in 3DSTATE_SF on Ivybridge.</li>
|
||||
</ul>
|
||||
|
||||
<p>Kristian Høgsberg (1):</p>
|
||||
<ul>
|
||||
<li>egl/wayland: Add invalidate back in eglSwapBuffers()</li>
|
||||
</ul>
|
||||
|
||||
<p>Maarten Lankhorst (2):</p>
|
||||
<ul>
|
||||
<li>makefiles: use configured name for -ldrm* where possible</li>
|
||||
<li>automake: strip LLVM_CXXFLAGS and LLVM_CPPFLAGS too</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (17):</p>
|
||||
<ul>
|
||||
<li>st/mesa: fix integer texture border color for some formats (v2)</li>
|
||||
<li>r300g: fix texture border color for sRGB formats</li>
|
||||
<li>mesa: bump MAX_VARYING to 32</li>
|
||||
<li>draw: fix assertion failure in draw_emit_vertex_attr</li>
|
||||
<li>vbo: fix glVertexAttribI* functions</li>
|
||||
<li>mesa: add MaxNumLevels to gl_texture_image, remove MaxLog2</li>
|
||||
<li>mesa: fix error checking of TexStorage(levels) for array and rect textures</li>
|
||||
<li>st/mesa: fix guessing the base level size</li>
|
||||
<li>st/mesa: fix computation of last_level during texture creation</li>
|
||||
<li>st/mesa: fix computation of last_level in GenerateMipmap</li>
|
||||
<li>r600g: fix streamout on RS780 and RS880</li>
|
||||
<li>r600g: advertise 32 streamout vec4 outputs</li>
|
||||
<li>r600g: fix broken streamout if streamout_begin caused a context flush</li>
|
||||
<li>mesa: fix BlitFramebuffer between linear and sRGB formats</li>
|
||||
<li>r600g: try to fix streamout for the cases where BURST_COUNT > 0</li>
|
||||
<li>r600g: always use a tiled resource as the destination of MSAA resolve</li>
|
||||
<li>mesa: add MaxNumLevels to gl_texture_image, remove MaxLog2</li>
|
||||
</ul>
|
||||
|
||||
<p>Mario Kleiner (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Don't glPopAttrib() GL_POINT_SPRITE_COORD_ORIGIN on < OpenGL-2.0</li>
|
||||
</ul>
|
||||
|
||||
<p>Matt Turner (1):</p>
|
||||
<ul>
|
||||
<li>glcpp: Reject garbage after #else and #endif tokens</li>
|
||||
</ul>
|
||||
|
||||
<p>Stefan Dösinger (1):</p>
|
||||
<ul>
|
||||
<li>r300: Don't disable destination read if the src blend factor needs it</li>
|
||||
</ul>
|
||||
|
||||
<p>Tapani Pälli (1):</p>
|
||||
<ul>
|
||||
<li>android: generate matching remap_helper to dispatch table</li>
|
||||
</ul>
|
||||
|
||||
<p>Tom Stellard (1):</p>
|
||||
<ul>
|
||||
<li>r600g: Use LOOP_START_DX10 for loops</li>
|
||||
</ul>
|
||||
|
||||
<p>Vinson Lee (1):</p>
|
||||
<ul>
|
||||
<li>i915: Fix wrong sizeof argument in i915_update_tex_unit.</li>
|
||||
</ul>
|
||||
|
||||
<p>smoki (2):</p>
|
||||
<ul>
|
||||
<li>r200: fix broken tcl lighting</li>
|
||||
<li>radeon/r200: Fix tcl culling</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -14,7 +14,7 @@
|
||||
<iframe src="contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 9.1 Release Notes / date February 22, 2013</h1>
|
||||
<h1>Mesa 9.1 Release Notes / date TBD</h1>
|
||||
|
||||
<p>
|
||||
Mesa 9.1 is a new development release.
|
||||
@@ -44,19 +44,9 @@ Note: some of the new features are only available with certain drivers.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>GL_ANGLE_texture_compression_dxt3</li>
|
||||
<li>GL_ANGLE_texture_compression_dxt5</li>
|
||||
<li>GL_ARB_ES3_compatibility</li>
|
||||
<li>GL_ARB_internalformat_query</li>
|
||||
<li>GL_ARB_map_buffer_alignment</li>
|
||||
<li>GL_ARB_shading_language_packing</li>
|
||||
<li>GL_ARB_texture_buffer_object_rgb32</li>
|
||||
<li>GL_ARB_texture_cube_map_array</li>
|
||||
<li>GL_EXT_color_buffer_float</li>
|
||||
<li>GL_OES_depth_texture_cube_map</li>
|
||||
<li>OpenGL 3.1 core profile support on Radeon HD2000 up to HD6000 series </li>
|
||||
<li>Multisample anti-aliasing support on Radeon X1000 series</li>
|
||||
<li>OpenGL ES 3.0 support on Intel HD Graphics 2000, 2500, 3000, and 4000</li>
|
||||
<li>GL_ARB_texture_buffer_object_rgb32</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -73,7 +63,6 @@ Note: some of the new features are only available with certain drivers.
|
||||
<li>Removed swrast support for GL_NV_vertex_program</li>
|
||||
<li>Removed swrast support for GL_NV_fragment_program</li>
|
||||
<li>Removed OpenVMS support (unmaintained and broken)</li>
|
||||
<li>Removed makedepend build dependency</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
@@ -22,7 +22,6 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
|
||||
<ul>
|
||||
<li><a href="relnotes-9.1.html">9.1 release notes</a>
|
||||
<li><a href="relnotes-9.0.2.html">9.0.2 release notes</a>
|
||||
<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.5.html">8.0.5 release notes</a>
|
||||
|
@@ -98,9 +98,8 @@ Begin by saving your current directory location:
|
||||
<pre>
|
||||
git clone git://anongit.freedesktop.org/git/mesa/vmwgfx
|
||||
</pre>
|
||||
<li>libdrm, a user-space library that interfaces with drm.
|
||||
Most distros ship with this but it's safest to install a newer version.
|
||||
To get the latest code from git:
|
||||
|
||||
<li>libdrm, A user-space library that interfaces with drm. Most distros ship with this driver. Safest bet is really to replace the system one. Optionally you can point LIBDRM_CFLAGS and LIBDRM_LIBS to the libdrm-2.4.22 package in toolchain. But here, we replace:
|
||||
<pre>
|
||||
git clone git://anongit.freedesktop.org/git/mesa/drm
|
||||
</pre>
|
||||
@@ -117,7 +116,7 @@ To get the latest code from git:
|
||||
<li>Build libdrm: If you're on a 32-bit system, you should skip the --libdir configure option. Note also the comment about toolchain libdrm above.
|
||||
<pre>
|
||||
cd $TOP/drm
|
||||
./autogen.sh --prefix=/usr --libdir=/usr/lib64
|
||||
./autogen.sh --prefix=/usr --enable-vmwgfx-experimental-api --libdir=/usr/lib64
|
||||
make
|
||||
sudo make install
|
||||
</pre>
|
||||
|
@@ -11,8 +11,8 @@ PROJECT_NAME = "Mesa GLSL module"
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = ../src/glsl/
|
||||
RECURSIVE = NO
|
||||
EXCLUDE = ../src/glsl/glsl_lexer.cpp \
|
||||
../src/glsl/glsl_parser.cpp \
|
||||
EXCLUDE = ../src/glsl/glsl_lexer.cc \
|
||||
../src/glsl/glsl_parser.cc \
|
||||
../src/glsl/glsl_parser.h
|
||||
EXCLUDE_PATTERNS =
|
||||
#---------------------------------------------------------------------------
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#define __gl3_h_
|
||||
|
||||
/*
|
||||
* gl3.h last updated on $Date: 2012-10-03 07:52:40 -0700 (Wed, 03 Oct 2012) $
|
||||
* gl3.h last updated on $Date: 2012-09-12 10:13:02 -0700 (Wed, 12 Sep 2012) $
|
||||
*/
|
||||
|
||||
#include <GLES3/gl3platform.h>
|
||||
@@ -796,7 +796,7 @@ typedef struct __GLsync *GLsync;
|
||||
#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
|
||||
#define GL_MAX_ELEMENT_INDEX 0x8D6B
|
||||
#define GL_NUM_SAMPLE_COUNTS 0x9380
|
||||
#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
|
||||
#define GL_TEXTURE_IMMUTABLE_LEVELS 0x8D63
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Entrypoint definitions
|
||||
|
@@ -46,17 +46,3 @@ CHIPSET(0x6839, VERDE_6839, VERDE)
|
||||
CHIPSET(0x683B, VERDE_683B, VERDE)
|
||||
CHIPSET(0x683D, VERDE_683D, VERDE)
|
||||
CHIPSET(0x683F, VERDE_683F, VERDE)
|
||||
|
||||
CHIPSET(0x6600, OLAND_6600, OLAND)
|
||||
CHIPSET(0x6601, OLAND_6601, OLAND)
|
||||
CHIPSET(0x6602, OLAND_6602, OLAND)
|
||||
CHIPSET(0x6603, OLAND_6603, OLAND)
|
||||
CHIPSET(0x6606, OLAND_6606, OLAND)
|
||||
CHIPSET(0x6607, OLAND_6607, OLAND)
|
||||
CHIPSET(0x6610, OLAND_6610, OLAND)
|
||||
CHIPSET(0x6611, OLAND_6611, OLAND)
|
||||
CHIPSET(0x6613, OLAND_6613, OLAND)
|
||||
CHIPSET(0x6620, OLAND_6620, OLAND)
|
||||
CHIPSET(0x6621, OLAND_6621, OLAND)
|
||||
CHIPSET(0x6623, OLAND_6623, OLAND)
|
||||
CHIPSET(0x6631, OLAND_6631, OLAND)
|
||||
|
@@ -1,71 +0,0 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_prog_bison.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PROG_BISON(ACTION-IF-TRUE,ACTION-IF-FALSE)
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check whether bison is the parser generator. Run ACTION-IF-TRUE if
|
||||
# successful, ACTION-IF-FALSE otherwise
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
|
||||
# Copyright (c) 2010 Diego Elio Petteno` <flameeyes@gmail.com>
|
||||
#
|
||||
# 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 2 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 9
|
||||
|
||||
# mattst88:
|
||||
# Modified YACC assignment to remove -o y.tab.c since we're writing
|
||||
# our own .y/.yy rules.
|
||||
#
|
||||
# Replaced m4_ifnblank(...) with m4_ifval(m4_normalize(...), ...)
|
||||
# since m4_ifnblank requires autoconf-2.64.
|
||||
|
||||
AC_DEFUN([AX_PROG_BISON], [
|
||||
AC_REQUIRE([AC_PROG_YACC])
|
||||
AC_REQUIRE([AC_PROG_EGREP])
|
||||
|
||||
AC_CACHE_CHECK([if bison is the parser generator],[ax_cv_prog_bison],[
|
||||
AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
|
||||
[ax_cv_prog_bison=yes], [ax_cv_prog_bison=no])
|
||||
])
|
||||
AS_IF([test "$ax_cv_prog_bison" = "yes"], [
|
||||
dnl replace the yacc-compatible compiler with the real bison, as
|
||||
dnl otherwise autoconf limits us to the POSIX yacc.
|
||||
dnl We also change the generated filename to the old one, so that
|
||||
dnl automake's ylwrap can deal with it.
|
||||
YACC="${YACC% -y}"
|
||||
] m4_ifval(m4_normalize([$1]), [[$1]]),
|
||||
m4_ifval(m4_normalize([$2]), [[$2]])
|
||||
)
|
||||
])
|
@@ -1,63 +0,0 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_prog_flex.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PROG_FLEX(ACTION-IF-TRUE,ACTION-IF-FALSE)
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check whether flex is the scanner generator. Run ACTION-IF-TRUE if
|
||||
# successful, ACTION-IF-FALSE otherwise
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
|
||||
# Copyright (c) 2010 Diego Elio Petteno` <flameeyes@gmail.com>
|
||||
#
|
||||
# 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 2 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 9
|
||||
|
||||
# mattst88:
|
||||
# Replaced m4_ifnblank(...) with m4_ifval(m4_normalize(...), ...)
|
||||
# since m4_ifnblank requires autoconf-2.64.
|
||||
|
||||
AC_DEFUN([AX_PROG_FLEX], [
|
||||
AC_REQUIRE([AM_PROG_LEX])
|
||||
AC_REQUIRE([AC_PROG_EGREP])
|
||||
|
||||
AC_CACHE_CHECK([if flex is the lexer generator],[ax_cv_prog_flex],[
|
||||
AS_IF([$LEX --version 2>/dev/null | $EGREP -q '^flex '],
|
||||
[ax_cv_prog_flex=yes], [ax_cv_prog_flex=no])
|
||||
])
|
||||
AS_IF([test "$ax_cv_prog_flex" = "yes"],
|
||||
m4_ifval(m4_normalize([$1]), [[$1]]),
|
||||
m4_ifval(m4_normalize([$2]), [[$2]])
|
||||
)
|
||||
])
|
@@ -1,49 +0,0 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_python_module.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PYTHON_MODULE(modname[, fatal])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Checks for Python module.
|
||||
#
|
||||
# If fatal is non-empty then absence of a module will trigger an error.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Andrew Collier
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 6
|
||||
|
||||
AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
|
||||
AC_DEFUN([AX_PYTHON_MODULE],[
|
||||
if test -z $PYTHON2;
|
||||
then
|
||||
PYTHON2="python"
|
||||
fi
|
||||
PYTHON_NAME=`basename $PYTHON2`
|
||||
AC_MSG_CHECKING($PYTHON_NAME module: $1)
|
||||
$PYTHON2 -c "import $1" 2>/dev/null
|
||||
if test $? -eq 0;
|
||||
then
|
||||
AC_MSG_RESULT(yes)
|
||||
eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
eval AS_TR_CPP(HAVE_PYMOD_$1)=no
|
||||
#
|
||||
if test -n "$2"
|
||||
then
|
||||
AC_MSG_ERROR(failed to find required module $1)
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
])
|
@@ -240,11 +240,6 @@ def parse_source_list(env, filename, names=None):
|
||||
top_srcdir = env.Dir('#').abspath
|
||||
top_builddir = os.path.join(top_srcdir, env['build_dir'])
|
||||
|
||||
# Normalize everything to / slashes
|
||||
cur_srcdir = cur_srcdir.replace('\\', '/')
|
||||
top_srcdir = top_srcdir.replace('\\', '/')
|
||||
top_builddir = top_builddir.replace('\\', '/')
|
||||
|
||||
# Populate the symbol table of the Makefile parser.
|
||||
parser.add_symbol('top_srcdir', top_srcdir)
|
||||
parser.add_symbol('top_builddir', top_builddir)
|
||||
@@ -268,8 +263,8 @@ def parse_source_list(env, filename, names=None):
|
||||
if f:
|
||||
# Process source paths
|
||||
if f.startswith(top_builddir + '/src'):
|
||||
# Automake puts build output on a `src` subdirectory, but
|
||||
# SCons does not, so strip it here.
|
||||
# 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
|
||||
|
@@ -361,7 +361,8 @@ def generate(env):
|
||||
ccflags += [
|
||||
'-mstackrealign', # ensure stack is aligned
|
||||
'-march=i586', # Haiku target is Pentium
|
||||
'-mtune=i686' # use i686 where we can
|
||||
'-mtune=i686', # use i686 where we can
|
||||
'-mmmx' # use mmx math where we can
|
||||
]
|
||||
if env['machine'] == 'x86_64':
|
||||
ccflags += ['-m64']
|
||||
@@ -399,6 +400,7 @@ def generate(env):
|
||||
ccflags += [
|
||||
'/Od', # disable optimizations
|
||||
'/Oi', # enable intrinsic functions
|
||||
'/Oy-', # disable frame pointer omission
|
||||
]
|
||||
else:
|
||||
ccflags += [
|
||||
@@ -410,7 +412,6 @@ def generate(env):
|
||||
]
|
||||
else:
|
||||
ccflags += [
|
||||
'/Oy-', # disable frame pointer omission
|
||||
'/GL-', # disable whole program optimization
|
||||
]
|
||||
ccflags += [
|
||||
@@ -530,7 +531,7 @@ def generate(env):
|
||||
env.PkgCheckModules('XF86VIDMODE', ['xxf86vm'])
|
||||
env.PkgCheckModules('DRM', ['libdrm >= 2.4.24'])
|
||||
env.PkgCheckModules('DRM_INTEL', ['libdrm_intel >= 2.4.30'])
|
||||
env.PkgCheckModules('DRM_RADEON', ['libdrm_radeon >= 2.4.42'])
|
||||
env.PkgCheckModules('DRM_RADEON', ['libdrm_radeon >= 2.4.40'])
|
||||
env.PkgCheckModules('XORG', ['xorg-server >= 1.6.0'])
|
||||
env.PkgCheckModules('KMS', ['libkms >= 2.4.24'])
|
||||
env.PkgCheckModules('UDEV', ['libudev > 150'])
|
||||
|
3
src/.gitignore
vendored
Normal file
3
src/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/Makefile
|
||||
*.trs
|
||||
*.log
|
1
src/egl/.gitignore
vendored
Normal file
1
src/egl/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/Makefile
|
1
src/egl/drivers/.gitignore
vendored
Normal file
1
src/egl/drivers/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Makefile
|
@@ -742,7 +742,7 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
|
||||
api = __DRI_API_GLES;
|
||||
break;
|
||||
case 2:
|
||||
api = __DRI_API_GLES2;
|
||||
api = __DRI_API_GLES3;
|
||||
break;
|
||||
case 3:
|
||||
api = __DRI_API_GLES3;
|
||||
|
@@ -172,29 +172,27 @@ struct dri2_egl_surface
|
||||
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
struct wl_egl_window *wl_win;
|
||||
struct wl_egl_pixmap *wl_pix;
|
||||
struct wl_buffer *wl_drm_buffer[WL_BUFFER_COUNT];
|
||||
int wl_buffer_lock[WL_BUFFER_COUNT];
|
||||
int dx;
|
||||
int dy;
|
||||
__DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT];
|
||||
__DRIbuffer *third_buffer;
|
||||
__DRIbuffer *pending_buffer;
|
||||
struct wl_callback *frame_callback;
|
||||
int format;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
struct gbm_dri_surface *gbm_surf;
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_WAYLAND_PLATFORM) || defined(HAVE_DRM_PLATFORM)
|
||||
__DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT];
|
||||
struct {
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
struct wl_buffer *wl_buffer;
|
||||
__DRIbuffer *dri_buffer;
|
||||
#endif
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
struct gbm_bo *bo;
|
||||
#endif
|
||||
int locked;
|
||||
int age;
|
||||
int locked;
|
||||
} color_buffers[3], *back, *current;
|
||||
#ifndef HAVE_WAYLAND_PLATFORM
|
||||
__DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ANDROID_PLATFORM
|
||||
|
@@ -324,16 +324,11 @@ 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);
|
||||
int i;
|
||||
|
||||
if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
|
||||
if (dri2_surf->current)
|
||||
_eglError(EGL_BAD_SURFACE, "dri2_swap_buffers");
|
||||
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++)
|
||||
if (dri2_surf->color_buffers[i].age > 0)
|
||||
dri2_surf->color_buffers[i].age++;
|
||||
dri2_surf->current = dri2_surf->back;
|
||||
dri2_surf->current->age = 1;
|
||||
dri2_surf->back = NULL;
|
||||
}
|
||||
|
||||
@@ -343,21 +338,6 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static EGLint
|
||||
dri2_query_buffer_age(_EGLDriver *drv,
|
||||
_EGLDisplay *disp, _EGLSurface *surface)
|
||||
{
|
||||
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
|
||||
__DRIbuffer buffer;
|
||||
|
||||
if (get_back_bo(dri2_surf, &buffer) < 0) {
|
||||
_eglError(EGL_BAD_ALLOC, "dri2_query_buffer_age");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return dri2_surf->back->age;
|
||||
}
|
||||
|
||||
static _EGLImage *
|
||||
dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
|
||||
EGLClientBuffer buffer, const EGLint *attr_list)
|
||||
@@ -484,9 +464,6 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
drv->API.DestroySurface = dri2_destroy_surface;
|
||||
drv->API.SwapBuffers = dri2_swap_buffers;
|
||||
drv->API.CreateImageKHR = dri2_drm_create_image_khr;
|
||||
drv->API.QueryBufferAge = dri2_query_buffer_age;
|
||||
|
||||
disp->Extensions.EXT_buffer_age = EGL_TRUE;
|
||||
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2011-2012 Intel Corporation
|
||||
* Copyright © 2011 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -82,16 +82,18 @@ wl_buffer_release(void *data, struct wl_buffer *buffer)
|
||||
struct dri2_egl_surface *dri2_surf = data;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); ++i)
|
||||
if (dri2_surf->color_buffers[i].wl_buffer == buffer)
|
||||
for (i = 0; i < WL_BUFFER_COUNT; ++i)
|
||||
if (dri2_surf->wl_drm_buffer[i] == buffer)
|
||||
break;
|
||||
|
||||
if (i == ARRAY_SIZE(dri2_surf->color_buffers)) {
|
||||
wl_buffer_destroy(buffer);
|
||||
return;
|
||||
}
|
||||
assert(i <= WL_BUFFER_COUNT);
|
||||
|
||||
/* not found? */
|
||||
if (i == WL_BUFFER_COUNT)
|
||||
return;
|
||||
|
||||
dri2_surf->wl_buffer_lock[i] = 0;
|
||||
|
||||
dri2_surf->color_buffers[i].locked = 0;
|
||||
}
|
||||
|
||||
static struct wl_buffer_listener wl_buffer_listener = {
|
||||
@@ -119,6 +121,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;
|
||||
int i;
|
||||
|
||||
(void) drv;
|
||||
|
||||
@@ -128,10 +131,21 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(dri2_surf, 0, sizeof *dri2_surf);
|
||||
if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
|
||||
goto cleanup_surf;
|
||||
|
||||
for (i = 0; i < WL_BUFFER_COUNT; ++i) {
|
||||
dri2_surf->wl_drm_buffer[i] = NULL;
|
||||
dri2_surf->wl_buffer_lock[i] = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < __DRI_BUFFER_COUNT; ++i)
|
||||
dri2_surf->dri_buffers[i] = NULL;
|
||||
|
||||
dri2_surf->pending_buffer = NULL;
|
||||
dri2_surf->third_buffer = NULL;
|
||||
dri2_surf->frame_callback = NULL;
|
||||
|
||||
if (conf->AlphaSize == 0)
|
||||
dri2_surf->format = WL_DRM_FORMAT_XRGB8888;
|
||||
else
|
||||
@@ -201,23 +215,24 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
|
||||
|
||||
(*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
|
||||
if (dri2_surf->color_buffers[i].wl_buffer)
|
||||
wl_buffer_destroy(dri2_surf->color_buffers[i].wl_buffer);
|
||||
if (dri2_surf->color_buffers[i].dri_buffer)
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->color_buffers[i].dri_buffer);
|
||||
}
|
||||
for (i = 0; i < WL_BUFFER_COUNT; ++i)
|
||||
if (dri2_surf->wl_drm_buffer[i])
|
||||
wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]);
|
||||
|
||||
for (i = 0; i < __DRI_BUFFER_COUNT; i++)
|
||||
if (dri2_surf->dri_buffers[i] &&
|
||||
dri2_surf->dri_buffers[i]->attachment != __DRI_BUFFER_BACK_LEFT)
|
||||
for (i = 0; i < __DRI_BUFFER_COUNT; ++i)
|
||||
if (dri2_surf->dri_buffers[i])
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->dri_buffers[i]);
|
||||
|
||||
if (dri2_surf->third_buffer) {
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->third_buffer);
|
||||
}
|
||||
|
||||
if (dri2_surf->frame_callback)
|
||||
wl_callback_destroy(dri2_surf->frame_callback);
|
||||
|
||||
|
||||
if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
|
||||
dri2_surf->wl_win->private = NULL;
|
||||
dri2_surf->wl_win->resize_callback = NULL;
|
||||
@@ -228,96 +243,173 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static struct wl_buffer *
|
||||
wayland_create_buffer(struct dri2_egl_surface *dri2_surf,
|
||||
__DRIbuffer *buffer)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy =
|
||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||
struct wl_buffer *buf;
|
||||
|
||||
buf = wl_drm_create_buffer(dri2_dpy->wl_drm, buffer->name,
|
||||
dri2_surf->base.Width, dri2_surf->base.Height,
|
||||
buffer->pitch, dri2_surf->format);
|
||||
wl_buffer_add_listener(buf, &wl_buffer_listener, dri2_surf);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
static void
|
||||
dri2_process_back_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy =
|
||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||
|
||||
(void) format;
|
||||
|
||||
switch (dri2_surf->base.Type) {
|
||||
case EGL_WINDOW_BIT:
|
||||
/* allocate a front buffer for our double-buffered window*/
|
||||
if (dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] != NULL)
|
||||
break;
|
||||
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] =
|
||||
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
|
||||
__DRI_BUFFER_FRONT_LEFT, format,
|
||||
dri2_surf->base.Width, dri2_surf->base.Height);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dri2_release_pending_buffer(void *data,
|
||||
struct wl_callback *callback, uint32_t time)
|
||||
{
|
||||
struct dri2_egl_surface *dri2_surf = data;
|
||||
struct dri2_egl_display *dri2_dpy =
|
||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||
|
||||
/* FIXME: print internal error */
|
||||
if (!dri2_surf->pending_buffer)
|
||||
return;
|
||||
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->pending_buffer);
|
||||
dri2_surf->pending_buffer = NULL;
|
||||
|
||||
wl_callback_destroy(callback);
|
||||
}
|
||||
|
||||
static const struct wl_callback_listener release_buffer_listener = {
|
||||
dri2_release_pending_buffer
|
||||
};
|
||||
|
||||
static void
|
||||
dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy =
|
||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||
struct wl_callback *callback;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
|
||||
if (dri2_surf->color_buffers[i].wl_buffer &&
|
||||
!dri2_surf->color_buffers[i].locked)
|
||||
wl_buffer_destroy(dri2_surf->color_buffers[i].wl_buffer);
|
||||
if (dri2_surf->color_buffers[i].dri_buffer)
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->color_buffers[i].dri_buffer);
|
||||
|
||||
dri2_surf->color_buffers[i].wl_buffer = NULL;
|
||||
dri2_surf->color_buffers[i].dri_buffer = NULL;
|
||||
dri2_surf->color_buffers[i].locked = 0;
|
||||
if (dri2_surf->third_buffer) {
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->third_buffer);
|
||||
dri2_surf->third_buffer = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < __DRI_BUFFER_COUNT; i++)
|
||||
if (dri2_surf->dri_buffers[i] &&
|
||||
dri2_surf->dri_buffers[i]->attachment != __DRI_BUFFER_BACK_LEFT)
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->dri_buffers[i]);
|
||||
}
|
||||
|
||||
static int
|
||||
get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy =
|
||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||
int i;
|
||||
|
||||
/* There might be a buffer release already queued that wasn't processed */
|
||||
wl_display_dispatch_queue_pending(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
|
||||
|
||||
if (dri2_surf->back == NULL) {
|
||||
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
|
||||
/* Get an unlocked buffer, preferrably one with a dri_buffer already
|
||||
* allocated. */
|
||||
if (dri2_surf->color_buffers[i].locked)
|
||||
continue;
|
||||
if (dri2_surf->back == NULL)
|
||||
dri2_surf->back = &dri2_surf->color_buffers[i];
|
||||
else if (dri2_surf->back->dri_buffer == NULL)
|
||||
dri2_surf->back = &dri2_surf->color_buffers[i];
|
||||
for (i = 0; i < __DRI_BUFFER_COUNT; ++i) {
|
||||
if (dri2_surf->dri_buffers[i]) {
|
||||
switch (i) {
|
||||
case __DRI_BUFFER_FRONT_LEFT:
|
||||
if (dri2_surf->pending_buffer)
|
||||
roundtrip(dri2_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,
|
||||
dri2_surf->dri_buffers[i]);
|
||||
break;
|
||||
}
|
||||
dri2_surf->dri_buffers[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (dri2_surf->back == NULL)
|
||||
return -1;
|
||||
if (dri2_surf->back->dri_buffer == NULL) {
|
||||
dri2_surf->back->dri_buffer =
|
||||
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
|
||||
__DRI_BUFFER_BACK_LEFT, 32,
|
||||
dri2_surf->base.Width,
|
||||
dri2_surf->base.Height);
|
||||
dri2_surf->back->age = 0;
|
||||
}
|
||||
if (dri2_surf->back->dri_buffer == NULL)
|
||||
return -1;
|
||||
|
||||
dri2_surf->back->locked = 1;
|
||||
memcpy(buffer, dri2_surf->back->dri_buffer, sizeof *buffer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
get_aux_bo(struct dri2_egl_surface *dri2_surf,
|
||||
unsigned int attachment, unsigned int format, __DRIbuffer *buffer)
|
||||
static inline void
|
||||
pointer_swap(const void **p1, const void **p2)
|
||||
{
|
||||
const void *tmp = *p1;
|
||||
*p1 = *p2;
|
||||
*p2 = tmp;
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_third_buffer(struct dri2_egl_surface *dri2_surf)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy =
|
||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||
__DRIbuffer *b = dri2_surf->dri_buffers[attachment];
|
||||
|
||||
if (b == NULL) {
|
||||
b = dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
|
||||
attachment, format,
|
||||
dri2_surf->base.Width,
|
||||
dri2_surf->base.Height);
|
||||
dri2_surf->dri_buffers[attachment] = b;
|
||||
if (dri2_surf->third_buffer == NULL)
|
||||
return;
|
||||
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->third_buffer);
|
||||
dri2_surf->third_buffer = NULL;
|
||||
|
||||
if (dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD])
|
||||
wl_buffer_destroy(dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD]);
|
||||
dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD] = NULL;
|
||||
dri2_surf->wl_buffer_lock[WL_BUFFER_THIRD] = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
swap_wl_buffers(struct dri2_egl_surface *dri2_surf,
|
||||
enum wayland_buffer_type a, enum wayland_buffer_type b)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
tmp = dri2_surf->wl_buffer_lock[a];
|
||||
dri2_surf->wl_buffer_lock[a] = dri2_surf->wl_buffer_lock[b];
|
||||
dri2_surf->wl_buffer_lock[b] = tmp;
|
||||
|
||||
pointer_swap((const void **) &dri2_surf->wl_drm_buffer[a],
|
||||
(const void **) &dri2_surf->wl_drm_buffer[b]);
|
||||
}
|
||||
|
||||
static void
|
||||
swap_back_and_third(struct dri2_egl_surface *dri2_surf)
|
||||
{
|
||||
if (dri2_surf->wl_buffer_lock[WL_BUFFER_THIRD])
|
||||
destroy_third_buffer(dri2_surf);
|
||||
|
||||
pointer_swap((const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT],
|
||||
(const void **) &dri2_surf->third_buffer);
|
||||
|
||||
swap_wl_buffers(dri2_surf, WL_BUFFER_BACK, WL_BUFFER_THIRD);
|
||||
}
|
||||
|
||||
static void
|
||||
dri2_prior_buffer_creation(struct dri2_egl_surface *dri2_surf,
|
||||
unsigned int type)
|
||||
{
|
||||
switch (type) {
|
||||
case __DRI_BUFFER_BACK_LEFT:
|
||||
if (dri2_surf->wl_buffer_lock[WL_BUFFER_BACK])
|
||||
swap_back_and_third(dri2_surf);
|
||||
else if (dri2_surf->third_buffer)
|
||||
destroy_third_buffer(dri2_surf);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
if (b == NULL)
|
||||
return -1;
|
||||
|
||||
memcpy(buffer, b, sizeof *buffer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __DRIbuffer *
|
||||
@@ -329,7 +421,10 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
|
||||
struct dri2_egl_surface *dri2_surf = loaderPrivate;
|
||||
struct dri2_egl_display *dri2_dpy =
|
||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||
int i, j;
|
||||
int i;
|
||||
|
||||
/* There might be a buffer release already queued that wasn't processed */
|
||||
wl_display_dispatch_queue_pending(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
|
||||
|
||||
if (dri2_surf->base.Type == EGL_WINDOW_BIT &&
|
||||
(dri2_surf->base.Width != dri2_surf->wl_win->width ||
|
||||
@@ -341,42 +436,47 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
|
||||
dri2_surf->base.Height = dri2_surf->wl_win->height;
|
||||
dri2_surf->dx = dri2_surf->wl_win->dx;
|
||||
dri2_surf->dy = dri2_surf->wl_win->dy;
|
||||
}
|
||||
|
||||
for (i = 0, j = 0; i < 2 * count; i += 2, j++) {
|
||||
switch (attachments[i]) {
|
||||
case __DRI_BUFFER_BACK_LEFT:
|
||||
if (get_back_bo(dri2_surf, &dri2_surf->buffers[j]) < 0) {
|
||||
_eglError(EGL_BAD_ALLOC, "failed to allocate color buffer");
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (get_aux_bo(dri2_surf, attachments[i], attachments[i + 1],
|
||||
&dri2_surf->buffers[j]) < 0) {
|
||||
_eglError(EGL_BAD_ALLOC, "failed to allocate aux buffer");
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
for (i = 0; i < WL_BUFFER_COUNT; ++i) {
|
||||
if (dri2_surf->wl_drm_buffer[i])
|
||||
wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]);
|
||||
dri2_surf->wl_drm_buffer[i] = NULL;
|
||||
dri2_surf->wl_buffer_lock[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we have an extra unlocked buffer at this point, we had to do triple
|
||||
* buffering for a while, but now can go back to just double buffering.
|
||||
* That means we can free any unlocked buffer now. */
|
||||
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
|
||||
if (!dri2_surf->color_buffers[i].locked &&
|
||||
dri2_surf->color_buffers[i].wl_buffer) {
|
||||
wl_buffer_destroy(dri2_surf->color_buffers[i].wl_buffer);
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->color_buffers[i].dri_buffer);
|
||||
dri2_surf->color_buffers[i].wl_buffer = NULL;
|
||||
dri2_surf->color_buffers[i].dri_buffer = NULL;
|
||||
dri2_surf->buffer_count = 0;
|
||||
for (i = 0; i < 2*count; i+=2) {
|
||||
assert(attachments[i] < __DRI_BUFFER_COUNT);
|
||||
assert(dri2_surf->buffer_count < 5);
|
||||
|
||||
dri2_prior_buffer_creation(dri2_surf, attachments[i]);
|
||||
|
||||
if (dri2_surf->dri_buffers[attachments[i]] == NULL) {
|
||||
|
||||
dri2_surf->dri_buffers[attachments[i]] =
|
||||
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
|
||||
attachments[i], attachments[i+1],
|
||||
dri2_surf->base.Width, dri2_surf->base.Height);
|
||||
|
||||
if (!dri2_surf->dri_buffers[attachments[i]])
|
||||
continue;
|
||||
|
||||
if (attachments[i] == __DRI_BUFFER_BACK_LEFT)
|
||||
dri2_process_back_buffer(dri2_surf, attachments[i+1]);
|
||||
}
|
||||
|
||||
memcpy(&dri2_surf->buffers[dri2_surf->buffer_count],
|
||||
dri2_surf->dri_buffers[attachments[i]],
|
||||
sizeof(__DRIbuffer));
|
||||
|
||||
dri2_surf->buffer_count++;
|
||||
}
|
||||
|
||||
*out_count = j;
|
||||
if (j == 0)
|
||||
assert(dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
|
||||
|
||||
*out_count = dri2_surf->buffer_count;
|
||||
if (dri2_surf->buffer_count == 0)
|
||||
return NULL;
|
||||
|
||||
*width = dri2_surf->base.Width;
|
||||
@@ -446,8 +546,7 @@ 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);
|
||||
__DRIbuffer buffer;
|
||||
int i, ret = 0;
|
||||
int ret = 0;
|
||||
|
||||
while (dri2_surf->frame_callback && ret != -1)
|
||||
ret = wl_display_dispatch_queue(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
|
||||
@@ -460,71 +559,46 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
|
||||
wl_proxy_set_queue((struct wl_proxy *) dri2_surf->frame_callback,
|
||||
dri2_dpy->wl_queue);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++)
|
||||
if (dri2_surf->color_buffers[i].age > 0)
|
||||
dri2_surf->color_buffers[i].age++;
|
||||
if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
|
||||
pointer_swap(
|
||||
(const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT],
|
||||
(const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
|
||||
|
||||
/* Make sure we have a back buffer in case we're swapping without ever
|
||||
* rendering. */
|
||||
if (get_back_bo(dri2_surf, &buffer) < 0) {
|
||||
_eglError(EGL_BAD_ALLOC, "dri2_swap_buffers");
|
||||
return EGL_FALSE;
|
||||
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]->attachment =
|
||||
__DRI_BUFFER_FRONT_LEFT;
|
||||
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]->attachment =
|
||||
__DRI_BUFFER_BACK_LEFT;
|
||||
|
||||
swap_wl_buffers(dri2_surf, WL_BUFFER_FRONT, WL_BUFFER_BACK);
|
||||
|
||||
if (!dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT])
|
||||
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT] =
|
||||
wayland_create_buffer(dri2_surf,
|
||||
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]);
|
||||
|
||||
wl_surface_attach(dri2_surf->wl_win->surface,
|
||||
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT],
|
||||
dri2_surf->dx, dri2_surf->dy);
|
||||
dri2_surf->wl_buffer_lock[WL_BUFFER_FRONT] = 1;
|
||||
|
||||
dri2_surf->wl_win->attached_width = dri2_surf->base.Width;
|
||||
dri2_surf->wl_win->attached_height = dri2_surf->base.Height;
|
||||
/* reset resize growing parameters */
|
||||
dri2_surf->dx = 0;
|
||||
dri2_surf->dy = 0;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
dri2_surf->back->age = 1;
|
||||
dri2_surf->current = dri2_surf->back;
|
||||
dri2_surf->back = NULL;
|
||||
|
||||
if (dri2_surf->current->wl_buffer == NULL) {
|
||||
dri2_surf->current->wl_buffer =
|
||||
wl_drm_create_buffer(dri2_dpy->wl_drm,
|
||||
dri2_surf->current->dri_buffer->name,
|
||||
dri2_surf->base.Width,
|
||||
dri2_surf->base.Height,
|
||||
dri2_surf->current->dri_buffer->pitch,
|
||||
dri2_surf->format);
|
||||
wl_proxy_set_queue((struct wl_proxy *) dri2_surf->current->wl_buffer,
|
||||
dri2_dpy->wl_queue);
|
||||
wl_buffer_add_listener(dri2_surf->current->wl_buffer,
|
||||
&wl_buffer_listener, dri2_surf);
|
||||
}
|
||||
|
||||
wl_surface_attach(dri2_surf->wl_win->surface,
|
||||
dri2_surf->current->wl_buffer,
|
||||
dri2_surf->dx, dri2_surf->dy);
|
||||
|
||||
dri2_surf->wl_win->attached_width = dri2_surf->base.Width;
|
||||
dri2_surf->wl_win->attached_height = dri2_surf->base.Height;
|
||||
/* reset resize growing parameters */
|
||||
dri2_surf->dx = 0;
|
||||
dri2_surf->dy = 0;
|
||||
|
||||
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);
|
||||
|
||||
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
|
||||
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static EGLint
|
||||
dri2_query_buffer_age(_EGLDriver *drv,
|
||||
_EGLDisplay *disp, _EGLSurface *surface)
|
||||
{
|
||||
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
|
||||
__DRIbuffer buffer;
|
||||
|
||||
if (get_back_bo(dri2_surf, &buffer) < 0) {
|
||||
_eglError(EGL_BAD_ALLOC, "dri2_query_buffer_age");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return dri2_surf->back->age;
|
||||
}
|
||||
|
||||
static int
|
||||
dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id)
|
||||
{
|
||||
@@ -662,7 +736,6 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
drv->API.DestroySurface = dri2_destroy_surface;
|
||||
drv->API.SwapBuffers = dri2_swap_buffers;
|
||||
drv->API.Terminate = dri2_terminate;
|
||||
drv->API.QueryBufferAge = dri2_query_buffer_age;
|
||||
|
||||
dri2_dpy = calloc(1, sizeof *dri2_dpy);
|
||||
if (!dri2_dpy)
|
||||
@@ -727,7 +800,6 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
}
|
||||
|
||||
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
|
||||
disp->Extensions.EXT_buffer_age = EGL_TRUE;
|
||||
dri2_dpy->authenticate = dri2_wayland_authenticate;
|
||||
|
||||
/* we're supporting EGL 1.4 */
|
||||
|
1
src/egl/main/.gitignore
vendored
Normal file
1
src/egl/main/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Makefile
|
1
src/egl/wayland/.gitignore
vendored
1
src/egl/wayland/.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
Makefile
|
||||
wayland-drm-client-protocol.h
|
||||
wayland-drm-server-protocol.h
|
||||
wayland-drm-protocol.c
|
||||
|
1
src/gallium/.gitignore
vendored
Normal file
1
src/gallium/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/Makefile
|
@@ -1,5 +0,0 @@
|
||||
GALLIUM_CFLAGS = \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src/gallium/include \
|
||||
-I$(top_srcdir)/src/gallium/auxiliary \
|
||||
$(DEFINES)
|
73
src/gallium/Makefile.template
Normal file
73
src/gallium/Makefile.template
Normal file
@@ -0,0 +1,73 @@
|
||||
# src/gallium/Makefile.template
|
||||
|
||||
# Template makefile for gallium libraries.
|
||||
#
|
||||
# Usage:
|
||||
# The minimum that the including makefile needs to define
|
||||
# is TOP, LIBNAME and one of of the *_SOURCES.
|
||||
#
|
||||
# Optional defines:
|
||||
# LIBRARY_INCLUDES are appended to the list of includes directories.
|
||||
# LIBRARY_DEFINES is not used for makedepend, but for compilation.
|
||||
|
||||
### Basic defines ###
|
||||
|
||||
OBJECTS = $(C_SOURCES:.c=.o) \
|
||||
$(CPP_SOURCES:.cpp=.o) \
|
||||
$(ASM_SOURCES:.S=.o)
|
||||
|
||||
INCLUDES = \
|
||||
-I. \
|
||||
-I$(TOP)/src/gallium/include \
|
||||
-I$(TOP)/src/gallium/auxiliary \
|
||||
-I$(TOP)/src/gallium/drivers \
|
||||
$(LIBRARY_INCLUDES)
|
||||
|
||||
ifeq ($(MESA_LLVM),1)
|
||||
LIBRARY_DEFINES += $(LLVM_CFLAGS)
|
||||
endif
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
default: depend lib$(LIBNAME).a $(PROGS)
|
||||
|
||||
lib$(LIBNAME).a: $(OBJECTS) $(EXTRA_OBJECTS) Makefile $(TOP)/src/gallium/Makefile.template
|
||||
$(MKLIB) -o $(LIBNAME) -static $(OBJECTS) $(EXTRA_OBJECTS)
|
||||
|
||||
depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES)
|
||||
rm -f depend
|
||||
touch depend
|
||||
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(GENERATED_SOURCES) 2> /dev/null
|
||||
|
||||
$(PROGS): % : %.o $(PROGS_DEPS)
|
||||
$(LD) $(LDFLAGS) $(filter %.o,$^) -o $@ -Wl,--start-group $(LIBS) -Wl,--end-group
|
||||
|
||||
# Emacs tags
|
||||
tags:
|
||||
etags `find . -name \*.[ch]` `find $(TOP)/src/gallium/include -name \*.h`
|
||||
|
||||
# Remove .o and backup files
|
||||
clean:
|
||||
rm -f $(OBJECTS) $(GENERATED_SOURCES) $(PROGS) lib$(LIBNAME).a depend depend.bak $(CLEAN_EXTRA)
|
||||
|
||||
# Dummy target
|
||||
install:
|
||||
@echo -n ""
|
||||
|
||||
##### RULES #####
|
||||
|
||||
%.s: %.c
|
||||
$(CC) -S $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) -c $(INCLUDES) $(CXXFLAGS) $(LIBRARY_DEFINES) $< -o $@
|
||||
|
||||
%.o: %.S
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
|
||||
|
||||
|
||||
sinclude depend
|
47
src/gallium/auxiliary/Makefile
Normal file
47
src/gallium/auxiliary/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
TOP = ../../..
|
||||
include $(TOP)/configs/current
|
||||
|
||||
LIBNAME = gallium
|
||||
|
||||
# get source lists
|
||||
include Makefile.sources
|
||||
|
||||
C_SOURCES += $(GENERATED_SOURCES)
|
||||
|
||||
ifeq ($(MESA_LLVM),1)
|
||||
C_SOURCES += \
|
||||
$(GALLIVM_SOURCES)
|
||||
CPP_SOURCES += \
|
||||
$(GALLIVM_CPP_SOURCES)
|
||||
|
||||
# LLVM >= 3.2 requires -fno-rtti
|
||||
ifeq ($(shell expr `echo $(LLVM_VERSION) | sed -e 's/\([0-9]\)\.\([0-9]\)/\10\2/g'` \>= 302),1)
|
||||
CXXFLAGS += -fno-rtti
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
include ../Makefile.template
|
||||
|
||||
default install clean: %: subdirs-%
|
||||
|
||||
subdirs-%:
|
||||
@for dir in $(SUBDIRS) ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
(cd $$dir && $(MAKE) $*) || exit 1; \
|
||||
fi \
|
||||
done
|
||||
|
||||
indices/u_indices_gen.c: indices/u_indices_gen.py
|
||||
$(PYTHON2) $< > $@
|
||||
|
||||
indices/u_unfilled_gen.c: indices/u_unfilled_gen.py
|
||||
$(PYTHON2) $< > $@
|
||||
|
||||
util/u_format_srgb.c: util/u_format_srgb.py
|
||||
$(PYTHON2) $< > $@
|
||||
|
||||
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 > $@
|
||||
|
||||
# DO NOT DELETE
|
@@ -1,47 +0,0 @@
|
||||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
|
||||
include Makefile.sources
|
||||
include $(top_srcdir)/src/gallium/Automake.inc
|
||||
|
||||
noinst_LTLIBRARIES = libgallium.la
|
||||
|
||||
AM_CFLAGS = \
|
||||
-I$(top_srcdir)/src/gallium/auxiliary/util \
|
||||
$(GALLIUM_CFLAGS)
|
||||
|
||||
libgallium_la_SOURCES = \
|
||||
$(C_SOURCES) \
|
||||
$(GENERATED_SOURCES)
|
||||
|
||||
if HAVE_MESA_LLVM
|
||||
|
||||
AM_CFLAGS += \
|
||||
$(LLVM_CFLAGS)
|
||||
|
||||
AM_CXXFLAGS = \
|
||||
$(GALLIUM_CFLAGS) \
|
||||
$(LLVM_CXXFLAGS)
|
||||
|
||||
if LLVM_NEEDS_FNORTTI
|
||||
|
||||
AM_CXXFLAGS += -fno-rtti
|
||||
|
||||
endif
|
||||
|
||||
libgallium_la_SOURCES += \
|
||||
$(GALLIVM_SOURCES) \
|
||||
$(GALLIVM_CPP_SOURCES)
|
||||
|
||||
endif
|
||||
|
||||
indices/u_indices_gen.c: $(srcdir)/indices/u_indices_gen.py
|
||||
$(AM_V_GEN) $(PYTHON2) $< > $@
|
||||
|
||||
indices/u_unfilled_gen.c: $(srcdir)/indices/u_unfilled_gen.py
|
||||
$(AM_V_GEN) $(PYTHON2) $< > $@
|
||||
|
||||
util/u_format_srgb.c: $(srcdir)/util/u_format_srgb.py
|
||||
$(AM_V_GEN) $(PYTHON2) $< > $@
|
||||
|
||||
util/u_format_table.c: $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format_pack.py $(srcdir)/util/u_format_parse.py $(srcdir)/util/u_format.csv
|
||||
$(AM_V_GEN) $(PYTHON2) $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format.csv > $@
|
@@ -36,6 +36,7 @@ C_SOURCES := \
|
||||
draw/draw_vertex.c \
|
||||
draw/draw_vs.c \
|
||||
draw/draw_vs_exec.c \
|
||||
draw/draw_vs_ppc.c \
|
||||
draw/draw_vs_variant.c \
|
||||
os/os_misc.c \
|
||||
os/os_time.c \
|
||||
@@ -63,6 +64,7 @@ C_SOURCES := \
|
||||
rbug/rbug_shader.c \
|
||||
rtasm/rtasm_cpu.c \
|
||||
rtasm/rtasm_execmem.c \
|
||||
rtasm/rtasm_ppc.c \
|
||||
rtasm/rtasm_x86sse.c \
|
||||
tgsi/tgsi_build.c \
|
||||
tgsi/tgsi_dump.c \
|
||||
@@ -70,6 +72,7 @@ C_SOURCES := \
|
||||
tgsi/tgsi_info.c \
|
||||
tgsi/tgsi_iterate.c \
|
||||
tgsi/tgsi_parse.c \
|
||||
tgsi/tgsi_ppc.c \
|
||||
tgsi/tgsi_sanity.c \
|
||||
tgsi/tgsi_scan.c \
|
||||
tgsi/tgsi_strings.c \
|
||||
|
@@ -129,10 +129,6 @@ static boolean TAG(do_cliptest)( struct pt_post_vs *pvs,
|
||||
need_pipeline |= out->clipmask;
|
||||
}
|
||||
|
||||
/*
|
||||
* Transform the vertex position from clip coords to window coords,
|
||||
* if the vertex is unclipped.
|
||||
*/
|
||||
if ((flags & DO_VIEWPORT) && mask == 0)
|
||||
{
|
||||
/* divide by w */
|
||||
@@ -144,18 +140,6 @@ static boolean TAG(do_cliptest)( struct pt_post_vs *pvs,
|
||||
position[2] = position[2] * w * scale[2] + trans[2];
|
||||
position[3] = w;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
/* For debug builds, set the clipped vertex's window coordinate
|
||||
* to NaN to help catch potential errors later.
|
||||
*/
|
||||
else {
|
||||
float zero = 0.0f;
|
||||
position[0] =
|
||||
position[1] =
|
||||
position[2] =
|
||||
position[3] = zero / zero; /* MSVC doesn't accept 0.0 / 0.0 */
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((flags & DO_EDGEFLAG) && ef) {
|
||||
const float *edgeflag = out->data[ef];
|
||||
|
@@ -762,11 +762,11 @@ draw_set_sampler_views(struct draw_context *draw,
|
||||
unsigned i;
|
||||
|
||||
debug_assert(shader_stage < PIPE_SHADER_TYPES);
|
||||
debug_assert(num <= PIPE_MAX_SHADER_SAMPLER_VIEWS);
|
||||
debug_assert(num <= PIPE_MAX_SAMPLERS);
|
||||
|
||||
for (i = 0; i < num; ++i)
|
||||
draw->sampler_views[shader_stage][i] = views[i];
|
||||
for (i = num; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; ++i)
|
||||
for (i = num; i < PIPE_MAX_SAMPLERS; ++i)
|
||||
draw->sampler_views[shader_stage][i] = NULL;
|
||||
|
||||
draw->num_sampler_views[shader_stage] = num;
|
||||
|
@@ -85,6 +85,11 @@ create_jit_texture_type(struct gallivm_state *gallivm, const char *struct_name)
|
||||
elem_types[DRAW_JIT_TEXTURE_IMG_STRIDE] =
|
||||
elem_types[DRAW_JIT_TEXTURE_MIP_OFFSETS] =
|
||||
LLVMArrayType(int32_type, PIPE_MAX_TEXTURE_LEVELS);
|
||||
elem_types[DRAW_JIT_TEXTURE_MIN_LOD] =
|
||||
elem_types[DRAW_JIT_TEXTURE_MAX_LOD] =
|
||||
elem_types[DRAW_JIT_TEXTURE_LOD_BIAS] = LLVMFloatTypeInContext(gallivm->context);
|
||||
elem_types[DRAW_JIT_TEXTURE_BORDER_COLOR] =
|
||||
LLVMArrayType(LLVMFloatTypeInContext(gallivm->context), 4);
|
||||
|
||||
texture_type = LLVMStructTypeInContext(gallivm->context, elem_types,
|
||||
Elements(elem_types), 0);
|
||||
@@ -125,6 +130,18 @@ create_jit_texture_type(struct gallivm_state *gallivm, const char *struct_name)
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, mip_offsets,
|
||||
target, texture_type,
|
||||
DRAW_JIT_TEXTURE_MIP_OFFSETS);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, min_lod,
|
||||
target, texture_type,
|
||||
DRAW_JIT_TEXTURE_MIN_LOD);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, max_lod,
|
||||
target, texture_type,
|
||||
DRAW_JIT_TEXTURE_MAX_LOD);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, lod_bias,
|
||||
target, texture_type,
|
||||
DRAW_JIT_TEXTURE_LOD_BIAS);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, border_color,
|
||||
target, texture_type,
|
||||
DRAW_JIT_TEXTURE_BORDER_COLOR);
|
||||
|
||||
LP_CHECK_STRUCT_SIZE(struct draw_jit_texture, target, texture_type);
|
||||
|
||||
@@ -133,63 +150,15 @@ create_jit_texture_type(struct gallivm_state *gallivm, const char *struct_name)
|
||||
|
||||
|
||||
/**
|
||||
* Create LLVM type for struct draw_jit_sampler
|
||||
*/
|
||||
static LLVMTypeRef
|
||||
create_jit_sampler_type(struct gallivm_state *gallivm, const char *struct_name)
|
||||
{
|
||||
LLVMTargetDataRef target = gallivm->target;
|
||||
LLVMTypeRef sampler_type;
|
||||
LLVMTypeRef elem_types[DRAW_JIT_SAMPLER_NUM_FIELDS];
|
||||
|
||||
elem_types[DRAW_JIT_SAMPLER_MIN_LOD] =
|
||||
elem_types[DRAW_JIT_SAMPLER_MAX_LOD] =
|
||||
elem_types[DRAW_JIT_SAMPLER_LOD_BIAS] = LLVMFloatTypeInContext(gallivm->context);
|
||||
elem_types[DRAW_JIT_SAMPLER_BORDER_COLOR] =
|
||||
LLVMArrayType(LLVMFloatTypeInContext(gallivm->context), 4);
|
||||
|
||||
sampler_type = LLVMStructTypeInContext(gallivm->context, elem_types,
|
||||
Elements(elem_types), 0);
|
||||
|
||||
#if HAVE_LLVM < 0x0300
|
||||
LLVMAddTypeName(gallivm->module, struct_name, sampler_type);
|
||||
|
||||
/* Make sure the target's struct layout cache doesn't return
|
||||
* stale/invalid data.
|
||||
*/
|
||||
LLVMInvalidateStructLayout(gallivm->target, sampler_type);
|
||||
#endif
|
||||
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_sampler, min_lod,
|
||||
target, sampler_type,
|
||||
DRAW_JIT_SAMPLER_MIN_LOD);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_sampler, max_lod,
|
||||
target, sampler_type,
|
||||
DRAW_JIT_SAMPLER_MAX_LOD);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_sampler, lod_bias,
|
||||
target, sampler_type,
|
||||
DRAW_JIT_SAMPLER_LOD_BIAS);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_sampler, border_color,
|
||||
target, sampler_type,
|
||||
DRAW_JIT_SAMPLER_BORDER_COLOR);
|
||||
|
||||
LP_CHECK_STRUCT_SIZE(struct draw_jit_sampler, target, sampler_type);
|
||||
|
||||
return sampler_type;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create LLVM type for struct draw_jit_context
|
||||
* Create LLVM type for struct draw_jit_texture
|
||||
*/
|
||||
static LLVMTypeRef
|
||||
create_jit_context_type(struct gallivm_state *gallivm,
|
||||
LLVMTypeRef texture_type, LLVMTypeRef sampler_type,
|
||||
const char *struct_name)
|
||||
LLVMTypeRef texture_type, const char *struct_name)
|
||||
{
|
||||
LLVMTargetDataRef target = gallivm->target;
|
||||
LLVMTypeRef float_type = LLVMFloatTypeInContext(gallivm->context);
|
||||
LLVMTypeRef elem_types[6];
|
||||
LLVMTypeRef elem_types[5];
|
||||
LLVMTypeRef context_type;
|
||||
|
||||
elem_types[0] = LLVMArrayType(LLVMPointerType(float_type, 0), /* vs_constants */
|
||||
@@ -199,9 +168,7 @@ create_jit_context_type(struct gallivm_state *gallivm,
|
||||
DRAW_TOTAL_CLIP_PLANES), 0);
|
||||
elem_types[3] = LLVMPointerType(float_type, 0); /* viewport */
|
||||
elem_types[4] = LLVMArrayType(texture_type,
|
||||
PIPE_MAX_SHADER_SAMPLER_VIEWS); /* textures */
|
||||
elem_types[5] = LLVMArrayType(sampler_type,
|
||||
PIPE_MAX_SAMPLERS); /* samplers */
|
||||
PIPE_MAX_SAMPLERS); /* textures */
|
||||
context_type = LLVMStructTypeInContext(gallivm->context, elem_types,
|
||||
Elements(elem_types), 0);
|
||||
#if HAVE_LLVM < 0x0300
|
||||
@@ -216,14 +183,9 @@ create_jit_context_type(struct gallivm_state *gallivm,
|
||||
target, context_type, 1);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, planes,
|
||||
target, context_type, 2);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, viewport,
|
||||
target, context_type, 3);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, textures,
|
||||
target, context_type,
|
||||
DRAW_JIT_CTX_TEXTURES);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, samplers,
|
||||
target, context_type,
|
||||
DRAW_JIT_CTX_SAMPLERS);
|
||||
LP_CHECK_STRUCT_SIZE(struct draw_jit_context,
|
||||
target, context_type);
|
||||
|
||||
@@ -329,13 +291,11 @@ static void
|
||||
create_jit_types(struct draw_llvm_variant *variant)
|
||||
{
|
||||
struct gallivm_state *gallivm = variant->gallivm;
|
||||
LLVMTypeRef texture_type, sampler_type, context_type, buffer_type, vb_type;
|
||||
LLVMTypeRef texture_type, context_type, buffer_type, vb_type;
|
||||
|
||||
texture_type = create_jit_texture_type(gallivm, "texture");
|
||||
sampler_type = create_jit_sampler_type(gallivm, "sampler");
|
||||
|
||||
context_type = create_jit_context_type(gallivm, texture_type, sampler_type,
|
||||
"draw_jit_context");
|
||||
context_type = create_jit_context_type(gallivm, texture_type, "draw_jit_context");
|
||||
variant->context_ptr_type = LLVMPointerType(context_type, 0);
|
||||
|
||||
buffer_type = LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 8), 0);
|
||||
@@ -1359,7 +1319,7 @@ draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store)
|
||||
{
|
||||
unsigned i;
|
||||
struct draw_llvm_variant_key *key;
|
||||
struct draw_sampler_static_state *draw_sampler;
|
||||
struct lp_sampler_static_state *sampler;
|
||||
|
||||
key = (struct draw_llvm_variant_key *)store;
|
||||
|
||||
@@ -1385,29 +1345,19 @@ draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store)
|
||||
* sampler array.
|
||||
*/
|
||||
key->nr_samplers = llvm->draw->vs.vertex_shader->info.file_max[TGSI_FILE_SAMPLER] + 1;
|
||||
if (llvm->draw->vs.vertex_shader->info.file_max[TGSI_FILE_SAMPLER_VIEW] != -1) {
|
||||
key->nr_sampler_views =
|
||||
llvm->draw->vs.vertex_shader->info.file_max[TGSI_FILE_SAMPLER_VIEW] + 1;
|
||||
}
|
||||
else {
|
||||
key->nr_sampler_views = key->nr_samplers;
|
||||
}
|
||||
|
||||
draw_sampler = draw_llvm_variant_key_samplers(key);
|
||||
sampler = draw_llvm_variant_key_samplers(key);
|
||||
|
||||
memcpy(key->vertex_element,
|
||||
llvm->draw->pt.vertex_element,
|
||||
sizeof(struct pipe_vertex_element) * key->nr_vertex_elements);
|
||||
|
||||
memset(draw_sampler, 0, MAX2(key->nr_samplers, key->nr_sampler_views) * sizeof *draw_sampler);
|
||||
|
||||
memset(sampler, 0, key->nr_samplers * sizeof *sampler);
|
||||
|
||||
for (i = 0 ; i < key->nr_samplers; i++) {
|
||||
lp_sampler_static_sampler_state(&draw_sampler[i].sampler_state,
|
||||
llvm->draw->samplers[PIPE_SHADER_VERTEX][i]);
|
||||
}
|
||||
for (i = 0 ; i < key->nr_sampler_views; i++) {
|
||||
lp_sampler_static_texture_state(&draw_sampler[i].texture_state,
|
||||
llvm->draw->sampler_views[PIPE_SHADER_VERTEX][i]);
|
||||
lp_sampler_static_state(&sampler[i],
|
||||
llvm->draw->sampler_views[PIPE_SHADER_VERTEX][i],
|
||||
llvm->draw->samplers[PIPE_SHADER_VERTEX][i]);
|
||||
}
|
||||
|
||||
return key;
|
||||
@@ -1418,7 +1368,7 @@ void
|
||||
draw_llvm_dump_variant_key(struct draw_llvm_variant_key *key)
|
||||
{
|
||||
unsigned i;
|
||||
struct draw_sampler_static_state *sampler = draw_llvm_variant_key_samplers(key);
|
||||
struct lp_sampler_static_state *sampler = draw_llvm_variant_key_samplers(key);
|
||||
|
||||
debug_printf("clamp_vertex_color = %u\n", key->clamp_vertex_color);
|
||||
debug_printf("clip_xy = %u\n", key->clip_xy);
|
||||
@@ -1436,8 +1386,8 @@ draw_llvm_dump_variant_key(struct draw_llvm_variant_key *key)
|
||||
debug_printf("vertex_element[%i].src_format = %s\n", i, util_format_name(key->vertex_element[i].src_format));
|
||||
}
|
||||
|
||||
for (i = 0 ; i < key->nr_sampler_views; i++) {
|
||||
debug_printf("sampler[%i].src_format = %s\n", i, util_format_name(sampler[i].texture_state.format));
|
||||
for (i = 0 ; i < key->nr_samplers; i++) {
|
||||
debug_printf("sampler[%i].src_format = %s\n", i, util_format_name(sampler[i].format));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1480,15 +1430,15 @@ draw_llvm_set_sampler_state(struct draw_context *draw)
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < draw->num_samplers[PIPE_SHADER_VERTEX]; i++) {
|
||||
struct draw_jit_sampler *jit_sam = &draw->llvm->jit_context.samplers[i];
|
||||
struct draw_jit_texture *jit_tex = &draw->llvm->jit_context.textures[i];
|
||||
|
||||
if (draw->samplers[i]) {
|
||||
const struct pipe_sampler_state *s
|
||||
= draw->samplers[PIPE_SHADER_VERTEX][i];
|
||||
jit_sam->min_lod = s->min_lod;
|
||||
jit_sam->max_lod = s->max_lod;
|
||||
jit_sam->lod_bias = s->lod_bias;
|
||||
COPY_4V(jit_sam->border_color, s->border_color.f);
|
||||
jit_tex->min_lod = s->min_lod;
|
||||
jit_tex->max_lod = s->max_lod;
|
||||
jit_tex->lod_bias = s->lod_bias;
|
||||
COPY_4V(jit_tex->border_color, s->border_color.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -52,30 +52,12 @@ struct draw_jit_texture
|
||||
uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS];
|
||||
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS];
|
||||
uint32_t mip_offsets[PIPE_MAX_TEXTURE_LEVELS];
|
||||
};
|
||||
|
||||
|
||||
struct draw_sampler_static_state
|
||||
{
|
||||
/*
|
||||
* These attributes are effectively interleaved for more sane key handling.
|
||||
* However, there might be lots of null space if the amount of samplers and
|
||||
* textures isn't the same.
|
||||
*/
|
||||
struct lp_static_sampler_state sampler_state;
|
||||
struct lp_static_texture_state texture_state;
|
||||
};
|
||||
|
||||
|
||||
struct draw_jit_sampler
|
||||
{
|
||||
float min_lod;
|
||||
float max_lod;
|
||||
float lod_bias;
|
||||
float border_color[4];
|
||||
};
|
||||
|
||||
|
||||
enum {
|
||||
DRAW_JIT_TEXTURE_WIDTH = 0,
|
||||
DRAW_JIT_TEXTURE_HEIGHT,
|
||||
@@ -86,19 +68,13 @@ enum {
|
||||
DRAW_JIT_TEXTURE_ROW_STRIDE,
|
||||
DRAW_JIT_TEXTURE_IMG_STRIDE,
|
||||
DRAW_JIT_TEXTURE_MIP_OFFSETS,
|
||||
DRAW_JIT_TEXTURE_MIN_LOD,
|
||||
DRAW_JIT_TEXTURE_MAX_LOD,
|
||||
DRAW_JIT_TEXTURE_LOD_BIAS,
|
||||
DRAW_JIT_TEXTURE_BORDER_COLOR,
|
||||
DRAW_JIT_TEXTURE_NUM_FIELDS /* number of fields above */
|
||||
};
|
||||
|
||||
|
||||
enum {
|
||||
DRAW_JIT_SAMPLER_MIN_LOD,
|
||||
DRAW_JIT_SAMPLER_MAX_LOD,
|
||||
DRAW_JIT_SAMPLER_LOD_BIAS,
|
||||
DRAW_JIT_SAMPLER_BORDER_COLOR,
|
||||
DRAW_JIT_SAMPLER_NUM_FIELDS /* number of fields above */
|
||||
};
|
||||
|
||||
|
||||
enum {
|
||||
DRAW_JIT_VERTEX_VERTEX_ID = 0,
|
||||
DRAW_JIT_VERTEX_CLIP,
|
||||
@@ -106,9 +82,6 @@ enum {
|
||||
DRAW_JIT_VERTEX_DATA
|
||||
};
|
||||
|
||||
#define DRAW_JIT_CTX_TEXTURES 4
|
||||
#define DRAW_JIT_CTX_SAMPLERS 5
|
||||
|
||||
/**
|
||||
* This structure is passed directly to the generated vertex shader.
|
||||
*
|
||||
@@ -127,8 +100,7 @@ struct draw_jit_context
|
||||
float (*planes) [DRAW_TOTAL_CLIP_PLANES][4];
|
||||
float *viewport;
|
||||
|
||||
struct draw_jit_texture textures[PIPE_MAX_SHADER_SAMPLER_VIEWS];
|
||||
struct draw_jit_sampler samplers[PIPE_MAX_SAMPLERS];
|
||||
struct draw_jit_texture textures[PIPE_MAX_SAMPLERS];
|
||||
};
|
||||
|
||||
|
||||
@@ -145,14 +117,10 @@ struct draw_jit_context
|
||||
lp_build_struct_get(_gallivm, _ptr, 3, "viewport")
|
||||
|
||||
#define DRAW_JIT_CTX_TEXTURES 4
|
||||
#define DRAW_JIT_CTX_SAMPLERS 5
|
||||
|
||||
#define draw_jit_context_textures(_gallivm, _ptr) \
|
||||
lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_CTX_TEXTURES, "textures")
|
||||
|
||||
#define draw_jit_context_samplers(_gallivm, _ptr) \
|
||||
lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_CTX_SAMPLERS, "samplers")
|
||||
|
||||
#define draw_jit_header_id(_gallivm, _ptr) \
|
||||
lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_VERTEX_VERTEX_ID, "id")
|
||||
|
||||
@@ -198,7 +166,6 @@ struct draw_llvm_variant_key
|
||||
{
|
||||
unsigned nr_vertex_elements:8;
|
||||
unsigned nr_samplers:8;
|
||||
unsigned nr_sampler_views:8;
|
||||
unsigned clamp_vertex_color:1;
|
||||
unsigned clip_xy:1;
|
||||
unsigned clip_z:1;
|
||||
@@ -207,7 +174,7 @@ struct draw_llvm_variant_key
|
||||
unsigned bypass_viewport:1;
|
||||
unsigned need_edgeflags:1;
|
||||
unsigned ucp_enable:PIPE_MAX_CLIP_PLANES;
|
||||
unsigned pad:33-PIPE_MAX_CLIP_PLANES;
|
||||
unsigned pad:9-PIPE_MAX_CLIP_PLANES;
|
||||
|
||||
/* Variable number of vertex elements:
|
||||
*/
|
||||
@@ -215,33 +182,34 @@ struct draw_llvm_variant_key
|
||||
|
||||
/* Followed by variable number of samplers:
|
||||
*/
|
||||
/* struct draw_sampler_static_state sampler; */
|
||||
/* struct lp_sampler_static_state sampler; */
|
||||
};
|
||||
|
||||
#define DRAW_LLVM_MAX_VARIANT_KEY_SIZE \
|
||||
(sizeof(struct draw_llvm_variant_key) + \
|
||||
PIPE_MAX_SHADER_SAMPLER_VIEWS * sizeof(struct draw_sampler_static_state) + \
|
||||
PIPE_MAX_SAMPLERS * sizeof(struct lp_sampler_static_state) + \
|
||||
(PIPE_MAX_ATTRIBS-1) * sizeof(struct pipe_vertex_element))
|
||||
|
||||
|
||||
static INLINE size_t
|
||||
draw_llvm_variant_key_size(unsigned nr_vertex_elements,
|
||||
unsigned nr_samplers)
|
||||
unsigned nr_samplers)
|
||||
{
|
||||
return (sizeof(struct draw_llvm_variant_key) +
|
||||
nr_samplers * sizeof(struct draw_sampler_static_state) +
|
||||
(nr_vertex_elements - 1) * sizeof(struct pipe_vertex_element));
|
||||
nr_samplers * sizeof(struct lp_sampler_static_state) +
|
||||
(nr_vertex_elements - 1) * sizeof(struct pipe_vertex_element));
|
||||
}
|
||||
|
||||
|
||||
static INLINE struct draw_sampler_static_state *
|
||||
static INLINE struct lp_sampler_static_state *
|
||||
draw_llvm_variant_key_samplers(struct draw_llvm_variant_key *key)
|
||||
{
|
||||
return (struct draw_sampler_static_state *)
|
||||
return (struct lp_sampler_static_state *)
|
||||
&key->vertex_element[key->nr_vertex_elements];
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct draw_llvm_variant_list_item
|
||||
{
|
||||
struct draw_llvm_variant *base;
|
||||
@@ -307,8 +275,8 @@ draw_llvm_destroy(struct draw_llvm *llvm);
|
||||
|
||||
struct draw_llvm_variant *
|
||||
draw_llvm_create_variant(struct draw_llvm *llvm,
|
||||
unsigned num_vertex_header_attribs,
|
||||
const struct draw_llvm_variant_key *key);
|
||||
unsigned num_vertex_header_attribs,
|
||||
const struct draw_llvm_variant_key *key);
|
||||
|
||||
void
|
||||
draw_llvm_destroy_variant(struct draw_llvm_variant *variant);
|
||||
@@ -320,7 +288,7 @@ void
|
||||
draw_llvm_dump_variant_key(struct draw_llvm_variant_key *key);
|
||||
|
||||
struct lp_build_sampler_soa *
|
||||
draw_llvm_sampler_soa_create(const struct draw_sampler_static_state *static_state,
|
||||
draw_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state,
|
||||
LLVMValueRef context_ptr);
|
||||
|
||||
void
|
||||
|
@@ -58,7 +58,7 @@ struct draw_llvm_sampler_dynamic_state
|
||||
{
|
||||
struct lp_sampler_dynamic_state base;
|
||||
|
||||
const struct draw_sampler_static_state *static_state;
|
||||
const struct lp_sampler_static_state *static_state;
|
||||
|
||||
LLVMValueRef context_ptr;
|
||||
};
|
||||
@@ -86,7 +86,7 @@ struct draw_llvm_sampler_soa
|
||||
static LLVMValueRef
|
||||
draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit,
|
||||
unsigned unit,
|
||||
unsigned member_index,
|
||||
const char *member_name,
|
||||
boolean emit_load)
|
||||
@@ -98,14 +98,14 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
|
||||
LLVMValueRef ptr;
|
||||
LLVMValueRef res;
|
||||
|
||||
debug_assert(texture_unit < PIPE_MAX_SHADER_SAMPLER_VIEWS);
|
||||
debug_assert(unit < PIPE_MAX_SAMPLERS);
|
||||
|
||||
/* context[0] */
|
||||
indices[0] = lp_build_const_int32(gallivm, 0);
|
||||
/* context[0].textures */
|
||||
indices[1] = lp_build_const_int32(gallivm, DRAW_JIT_CTX_TEXTURES);
|
||||
/* context[0].textures[unit] */
|
||||
indices[2] = lp_build_const_int32(gallivm, texture_unit);
|
||||
indices[2] = lp_build_const_int32(gallivm, unit);
|
||||
/* context[0].textures[unit].member */
|
||||
indices[3] = lp_build_const_int32(gallivm, member_index);
|
||||
|
||||
@@ -116,54 +116,7 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
|
||||
else
|
||||
res = ptr;
|
||||
|
||||
lp_build_name(res, "context.texture%u.%s", texture_unit, member_name);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fetch the specified member of the lp_jit_sampler structure.
|
||||
* \param emit_load if TRUE, emit the LLVM load instruction to actually
|
||||
* fetch the field's value. Otherwise, just emit the
|
||||
* GEP code to address the field.
|
||||
*
|
||||
* @sa http://llvm.org/docs/GetElementPtr.html
|
||||
*/
|
||||
static LLVMValueRef
|
||||
draw_llvm_sampler_member(const struct lp_sampler_dynamic_state *base,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned sampler_unit,
|
||||
unsigned member_index,
|
||||
const char *member_name,
|
||||
boolean emit_load)
|
||||
{
|
||||
LLVMBuilderRef builder = gallivm->builder;
|
||||
struct draw_llvm_sampler_dynamic_state *state =
|
||||
(struct draw_llvm_sampler_dynamic_state *)base;
|
||||
LLVMValueRef indices[4];
|
||||
LLVMValueRef ptr;
|
||||
LLVMValueRef res;
|
||||
|
||||
debug_assert(sampler_unit < PIPE_MAX_SAMPLERS);
|
||||
|
||||
/* context[0] */
|
||||
indices[0] = lp_build_const_int32(gallivm, 0);
|
||||
/* context[0].samplers */
|
||||
indices[1] = lp_build_const_int32(gallivm, DRAW_JIT_CTX_SAMPLERS);
|
||||
/* context[0].samplers[unit] */
|
||||
indices[2] = lp_build_const_int32(gallivm, sampler_unit);
|
||||
/* context[0].samplers[unit].member */
|
||||
indices[3] = lp_build_const_int32(gallivm, member_index);
|
||||
|
||||
ptr = LLVMBuildGEP(builder, state->context_ptr, indices, Elements(indices), "");
|
||||
|
||||
if (emit_load)
|
||||
res = LLVMBuildLoad(builder, ptr, "");
|
||||
else
|
||||
res = ptr;
|
||||
|
||||
lp_build_name(res, "context.sampler%u.%s", sampler_unit, member_name);
|
||||
lp_build_name(res, "context.texture%u.%s", unit, member_name);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -182,9 +135,9 @@ draw_llvm_sampler_member(const struct lp_sampler_dynamic_state *base,
|
||||
static LLVMValueRef \
|
||||
draw_llvm_texture_##_name( const struct lp_sampler_dynamic_state *base, \
|
||||
struct gallivm_state *gallivm, \
|
||||
unsigned texture_unit) \
|
||||
unsigned unit) \
|
||||
{ \
|
||||
return draw_llvm_texture_member(base, gallivm, texture_unit, _index, #_name, _emit_load ); \
|
||||
return draw_llvm_texture_member(base, gallivm, unit, _index, #_name, _emit_load ); \
|
||||
}
|
||||
|
||||
|
||||
@@ -197,22 +150,10 @@ DRAW_LLVM_TEXTURE_MEMBER(base_ptr, DRAW_JIT_TEXTURE_BASE, TRUE)
|
||||
DRAW_LLVM_TEXTURE_MEMBER(row_stride, DRAW_JIT_TEXTURE_ROW_STRIDE, FALSE)
|
||||
DRAW_LLVM_TEXTURE_MEMBER(img_stride, DRAW_JIT_TEXTURE_IMG_STRIDE, FALSE)
|
||||
DRAW_LLVM_TEXTURE_MEMBER(mip_offsets, DRAW_JIT_TEXTURE_MIP_OFFSETS, FALSE)
|
||||
|
||||
|
||||
#define DRAW_LLVM_SAMPLER_MEMBER(_name, _index, _emit_load) \
|
||||
static LLVMValueRef \
|
||||
draw_llvm_sampler_##_name( const struct lp_sampler_dynamic_state *base, \
|
||||
struct gallivm_state *gallivm, \
|
||||
unsigned sampler_unit) \
|
||||
{ \
|
||||
return draw_llvm_sampler_member(base, gallivm, sampler_unit, _index, #_name, _emit_load ); \
|
||||
}
|
||||
|
||||
|
||||
DRAW_LLVM_SAMPLER_MEMBER(min_lod, DRAW_JIT_SAMPLER_MIN_LOD, TRUE)
|
||||
DRAW_LLVM_SAMPLER_MEMBER(max_lod, DRAW_JIT_SAMPLER_MAX_LOD, TRUE)
|
||||
DRAW_LLVM_SAMPLER_MEMBER(lod_bias, DRAW_JIT_SAMPLER_LOD_BIAS, TRUE)
|
||||
DRAW_LLVM_SAMPLER_MEMBER(border_color, DRAW_JIT_SAMPLER_BORDER_COLOR, FALSE)
|
||||
DRAW_LLVM_TEXTURE_MEMBER(min_lod, DRAW_JIT_TEXTURE_MIN_LOD, TRUE)
|
||||
DRAW_LLVM_TEXTURE_MEMBER(max_lod, DRAW_JIT_TEXTURE_MAX_LOD, TRUE)
|
||||
DRAW_LLVM_TEXTURE_MEMBER(lod_bias, DRAW_JIT_TEXTURE_LOD_BIAS, TRUE)
|
||||
DRAW_LLVM_TEXTURE_MEMBER(border_color, DRAW_JIT_TEXTURE_BORDER_COLOR, FALSE)
|
||||
|
||||
|
||||
static void
|
||||
@@ -231,8 +172,7 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
|
||||
struct gallivm_state *gallivm,
|
||||
struct lp_type type,
|
||||
boolean is_fetch,
|
||||
unsigned texture_index,
|
||||
unsigned sampler_index,
|
||||
unsigned unit,
|
||||
const LLVMValueRef *coords,
|
||||
const LLVMValueRef *offsets,
|
||||
const struct lp_derivatives *derivs,
|
||||
@@ -242,17 +182,14 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
|
||||
{
|
||||
struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
|
||||
|
||||
assert(texture_index < PIPE_MAX_SHADER_SAMPLER_VIEWS);
|
||||
assert(sampler_index < PIPE_MAX_SAMPLERS);
|
||||
assert(unit < PIPE_MAX_SAMPLERS);
|
||||
|
||||
lp_build_sample_soa(gallivm,
|
||||
&sampler->dynamic_state.static_state[texture_index].texture_state,
|
||||
&sampler->dynamic_state.static_state[sampler_index].sampler_state,
|
||||
&sampler->dynamic_state.static_state[unit],
|
||||
&sampler->dynamic_state.base,
|
||||
type,
|
||||
is_fetch,
|
||||
texture_index,
|
||||
sampler_index,
|
||||
unit,
|
||||
coords,
|
||||
offsets,
|
||||
derivs,
|
||||
@@ -268,25 +205,25 @@ 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 texture_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef explicit_lod, /* optional */
|
||||
LLVMValueRef *sizes_out)
|
||||
{
|
||||
struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
|
||||
|
||||
assert(texture_unit < PIPE_MAX_SHADER_SAMPLER_VIEWS);
|
||||
assert(unit < PIPE_MAX_SAMPLERS);
|
||||
|
||||
lp_build_size_query_soa(gallivm,
|
||||
&sampler->dynamic_state.static_state[texture_unit].texture_state,
|
||||
&sampler->dynamic_state.static_state[unit],
|
||||
&sampler->dynamic_state.base,
|
||||
type,
|
||||
texture_unit,
|
||||
unit,
|
||||
explicit_lod,
|
||||
sizes_out);
|
||||
}
|
||||
|
||||
struct lp_build_sampler_soa *
|
||||
draw_llvm_sampler_soa_create(const struct draw_sampler_static_state *static_state,
|
||||
draw_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state,
|
||||
LLVMValueRef context_ptr)
|
||||
{
|
||||
struct draw_llvm_sampler_soa *sampler;
|
||||
@@ -307,10 +244,10 @@ draw_llvm_sampler_soa_create(const struct draw_sampler_static_state *static_stat
|
||||
sampler->dynamic_state.base.img_stride = draw_llvm_texture_img_stride;
|
||||
sampler->dynamic_state.base.base_ptr = draw_llvm_texture_base_ptr;
|
||||
sampler->dynamic_state.base.mip_offsets = draw_llvm_texture_mip_offsets;
|
||||
sampler->dynamic_state.base.min_lod = draw_llvm_sampler_min_lod;
|
||||
sampler->dynamic_state.base.max_lod = draw_llvm_sampler_max_lod;
|
||||
sampler->dynamic_state.base.lod_bias = draw_llvm_sampler_lod_bias;
|
||||
sampler->dynamic_state.base.border_color = draw_llvm_sampler_border_color;
|
||||
sampler->dynamic_state.base.min_lod = draw_llvm_texture_min_lod;
|
||||
sampler->dynamic_state.base.max_lod = draw_llvm_texture_max_lod;
|
||||
sampler->dynamic_state.base.lod_bias = draw_llvm_texture_lod_bias;
|
||||
sampler->dynamic_state.base.border_color = draw_llvm_texture_border_color;
|
||||
sampler->dynamic_state.static_state = static_state;
|
||||
sampler->dynamic_state.context_ptr = context_ptr;
|
||||
|
||||
|
@@ -42,10 +42,6 @@
|
||||
#include "draw_fs.h"
|
||||
|
||||
|
||||
/** Set to 1 to enable printing of coords before/after clipping */
|
||||
#define DEBUG_CLIP 0
|
||||
|
||||
|
||||
#ifndef IS_NEGATIVE
|
||||
#define IS_NEGATIVE(X) ((X) < 0.0)
|
||||
#endif
|
||||
@@ -168,9 +164,9 @@ static void interp( const struct clip_stage *clip,
|
||||
int k;
|
||||
t_nopersp = t;
|
||||
for (k = 0; k < 2; k++)
|
||||
if (in->clip[k] != out->clip[k]) {
|
||||
t_nopersp = (dst->clip[k] - out->clip[k]) /
|
||||
(in->clip[k] - out->clip[k]);
|
||||
if (in->data[pos_attr][k] != out->data[pos_attr][k]) {
|
||||
t_nopersp = (dst->data[pos_attr][k] - out->data[pos_attr][k]) /
|
||||
(in->data[pos_attr][k] - out->data[pos_attr][k]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -241,17 +237,12 @@ static void emit_poly( struct draw_stage *stage,
|
||||
if (i == n - 1 && edgeflags[i])
|
||||
header.flags |= edge_last;
|
||||
|
||||
if (DEBUG_CLIP) {
|
||||
if (0) {
|
||||
const struct draw_vertex_shader *vs = stage->draw->vs.vertex_shader;
|
||||
uint j, k;
|
||||
debug_printf("Clipped tri: (flat-shade-first = %d)\n",
|
||||
stage->draw->rasterizer->flatshade_first);
|
||||
for (j = 0; j < 3; j++) {
|
||||
debug_printf(" Vert %d: clip: %f %f %f %f\n", j,
|
||||
header.v[j]->clip[0],
|
||||
header.v[j]->clip[1],
|
||||
header.v[j]->clip[2],
|
||||
header.v[j]->clip[3]);
|
||||
for (k = 0; k < vs->info.num_outputs; k++) {
|
||||
debug_printf(" Vert %d: Attr %d: %f %f %f %f\n", j, k,
|
||||
header.v[j]->data[k][0],
|
||||
@@ -324,16 +315,6 @@ do_clip_tri( struct draw_stage *stage,
|
||||
inlist[1] = header->v[1];
|
||||
inlist[2] = header->v[2];
|
||||
|
||||
if (DEBUG_CLIP) {
|
||||
const float *v0 = header->v[0]->clip;
|
||||
const float *v1 = header->v[1]->clip;
|
||||
const float *v2 = header->v[2]->clip;
|
||||
debug_printf("Clip triangle:\n");
|
||||
debug_printf(" %f, %f, %f, %f\n", v0[0], v0[1], v0[2], v0[3]);
|
||||
debug_printf(" %f, %f, %f, %f\n", v1[0], v1[1], v1[2], v1[3]);
|
||||
debug_printf(" %f, %f, %f, %f\n", v2[0], v2[1], v2[2], v2[3]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: at this point we can't just use the per-vertex edge flags.
|
||||
* We have to observe the edge flag bits set in header->flags which
|
||||
|
@@ -310,7 +310,7 @@ struct draw_context
|
||||
* 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_SHADER_SAMPLER_VIEWS];
|
||||
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];
|
||||
|
@@ -159,6 +159,11 @@ struct draw_vertex_shader *
|
||||
draw_create_vs_exec(struct draw_context *draw,
|
||||
const struct pipe_shader_state *templ);
|
||||
|
||||
struct draw_vertex_shader *
|
||||
draw_create_vs_ppc(struct draw_context *draw,
|
||||
const struct pipe_shader_state *templ);
|
||||
|
||||
|
||||
struct draw_vs_variant_key;
|
||||
struct draw_vertex_shader;
|
||||
|
||||
|
240
src/gallium/auxiliary/draw/draw_vs_ppc.c
Normal file
240
src/gallium/auxiliary/draw/draw_vs_ppc.c
Normal file
@@ -0,0 +1,240 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* 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, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* Keith Whitwell <keith@tungstengraphics.com>
|
||||
* Brian Paul
|
||||
*/
|
||||
|
||||
#include "util/u_math.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "pipe/p_config.h"
|
||||
|
||||
#include "draw_vs.h"
|
||||
|
||||
#if defined(PIPE_ARCH_PPC)
|
||||
|
||||
#include "pipe/p_shader_tokens.h"
|
||||
|
||||
#include "draw_private.h"
|
||||
#include "draw_context.h"
|
||||
|
||||
#include "rtasm/rtasm_cpu.h"
|
||||
#include "rtasm/rtasm_ppc.h"
|
||||
#include "tgsi/tgsi_ppc.h"
|
||||
#include "tgsi/tgsi_parse.h"
|
||||
#include "tgsi/tgsi_exec.h"
|
||||
|
||||
|
||||
|
||||
typedef void (PIPE_CDECL *codegen_function) (float (*inputs)[4][4],
|
||||
float (*outputs)[4][4],
|
||||
float (*temps)[4][4],
|
||||
float (*immeds)[4],
|
||||
float (*consts)[4],
|
||||
const float *builtins);
|
||||
|
||||
|
||||
struct draw_ppc_vertex_shader {
|
||||
struct draw_vertex_shader base;
|
||||
struct ppc_function ppc_program;
|
||||
|
||||
codegen_function func;
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
vs_ppc_prepare( struct draw_vertex_shader *base,
|
||||
struct draw_context *draw )
|
||||
{
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Simplified vertex shader interface for the pt paths. Given the
|
||||
* complexity of code-generating all the above operations together,
|
||||
* it's time to try doing all the other stuff separately.
|
||||
*/
|
||||
static void
|
||||
vs_ppc_run_linear( struct draw_vertex_shader *base,
|
||||
const float (*input)[4],
|
||||
float (*output)[4],
|
||||
const void *constants[PIPE_MAX_CONSTANT_BUFFERS],
|
||||
unsigned count,
|
||||
unsigned input_stride,
|
||||
unsigned output_stride )
|
||||
{
|
||||
struct draw_ppc_vertex_shader *shader = (struct draw_ppc_vertex_shader *)base;
|
||||
unsigned int i;
|
||||
|
||||
#define MAX_VERTICES 4
|
||||
|
||||
/* loop over verts */
|
||||
for (i = 0; i < count; i += MAX_VERTICES) {
|
||||
const uint max_vertices = MIN2(MAX_VERTICES, count - i);
|
||||
PIPE_ALIGN_VAR(16) float inputs_soa[PIPE_MAX_SHADER_INPUTS][4][4];
|
||||
PIPE_ALIGN_VAR(16) float outputs_soa[PIPE_MAX_SHADER_OUTPUTS][4][4];
|
||||
PIPE_ALIGN_VAR(16) float temps_soa[TGSI_EXEC_NUM_TEMPS][4][4];
|
||||
uint attr;
|
||||
|
||||
/* convert (up to) four input verts to SoA format */
|
||||
for (attr = 0; attr < base->info.num_inputs; attr++) {
|
||||
const float *vIn = (const float *) input;
|
||||
uint vert;
|
||||
for (vert = 0; vert < max_vertices; vert++) {
|
||||
#if 0
|
||||
if (attr==0)
|
||||
printf("Input v%d a%d: %f %f %f %f\n",
|
||||
vert, attr, vIn[0], vIn[1], vIn[2], vIn[3]);
|
||||
#endif
|
||||
inputs_soa[attr][0][vert] = vIn[attr * 4 + 0];
|
||||
inputs_soa[attr][1][vert] = vIn[attr * 4 + 1];
|
||||
inputs_soa[attr][2][vert] = vIn[attr * 4 + 2];
|
||||
inputs_soa[attr][3][vert] = vIn[attr * 4 + 3];
|
||||
vIn += input_stride / 4;
|
||||
}
|
||||
}
|
||||
|
||||
/* run compiled shader
|
||||
*/
|
||||
shader->func(inputs_soa, outputs_soa, temps_soa,
|
||||
(float (*)[4]) shader->base.immediates,
|
||||
(float (*)[4])constants[0],
|
||||
ppc_builtin_constants);
|
||||
|
||||
/* convert (up to) four output verts from SoA back to AoS format */
|
||||
for (attr = 0; attr < base->info.num_outputs; attr++) {
|
||||
float *vOut = (float *) output;
|
||||
uint vert;
|
||||
for (vert = 0; vert < max_vertices; vert++) {
|
||||
vOut[attr * 4 + 0] = outputs_soa[attr][0][vert];
|
||||
vOut[attr * 4 + 1] = outputs_soa[attr][1][vert];
|
||||
vOut[attr * 4 + 2] = outputs_soa[attr][2][vert];
|
||||
vOut[attr * 4 + 3] = outputs_soa[attr][3][vert];
|
||||
#if 0
|
||||
if (attr==0)
|
||||
printf("Output v%d a%d: %f %f %f %f\n",
|
||||
vert, attr, vOut[0], vOut[1], vOut[2], vOut[3]);
|
||||
#endif
|
||||
vOut += output_stride / 4;
|
||||
}
|
||||
}
|
||||
|
||||
/* advance to next group of four input/output verts */
|
||||
input = (const float (*)[4])((const char *)input + input_stride * max_vertices);
|
||||
output = (float (*)[4])((char *)output + output_stride * max_vertices);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
vs_ppc_delete( struct draw_vertex_shader *base )
|
||||
{
|
||||
struct draw_ppc_vertex_shader *shader = (struct draw_ppc_vertex_shader *)base;
|
||||
|
||||
ppc_release_func( &shader->ppc_program );
|
||||
|
||||
align_free( (void *) shader->base.immediates );
|
||||
|
||||
FREE( (void*) shader->base.state.tokens );
|
||||
FREE( shader );
|
||||
}
|
||||
|
||||
|
||||
struct draw_vertex_shader *
|
||||
draw_create_vs_ppc(struct draw_context *draw,
|
||||
const struct pipe_shader_state *templ)
|
||||
{
|
||||
struct draw_ppc_vertex_shader *vs;
|
||||
|
||||
vs = CALLOC_STRUCT( draw_ppc_vertex_shader );
|
||||
if (vs == NULL)
|
||||
return NULL;
|
||||
|
||||
/* we make a private copy of the tokens */
|
||||
vs->base.state.tokens = tgsi_dup_tokens(templ->tokens);
|
||||
if (!vs->base.state.tokens)
|
||||
goto fail;
|
||||
|
||||
tgsi_scan_shader(templ->tokens, &vs->base.info);
|
||||
|
||||
vs->base.draw = draw;
|
||||
vs->base.create_variant = draw_vs_create_variant_generic;
|
||||
vs->base.prepare = vs_ppc_prepare;
|
||||
vs->base.run_linear = vs_ppc_run_linear;
|
||||
vs->base.delete = vs_ppc_delete;
|
||||
|
||||
vs->base.immediates = align_malloc(TGSI_EXEC_NUM_IMMEDIATES * 4 *
|
||||
sizeof(float), 16);
|
||||
|
||||
ppc_init_func( &vs->ppc_program );
|
||||
|
||||
#if 0
|
||||
ppc_print_code(&vs->ppc_program, TRUE);
|
||||
ppc_indent(&vs->ppc_program, 8);
|
||||
#endif
|
||||
|
||||
if (!tgsi_emit_ppc( (struct tgsi_token *) vs->base.state.tokens,
|
||||
&vs->ppc_program,
|
||||
(float (*)[4]) vs->base.immediates,
|
||||
TRUE ))
|
||||
goto fail;
|
||||
|
||||
vs->func = (codegen_function) ppc_get_func( &vs->ppc_program );
|
||||
if (!vs->func) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return &vs->base;
|
||||
|
||||
fail:
|
||||
/*
|
||||
debug_error("tgsi_emit_ppc() failed, falling back to interpreter\n");
|
||||
*/
|
||||
|
||||
ppc_release_func( &vs->ppc_program );
|
||||
|
||||
FREE(vs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#else /* PIPE_ARCH_PPC */
|
||||
|
||||
|
||||
struct draw_vertex_shader *
|
||||
draw_create_vs_ppc( struct draw_context *draw,
|
||||
const struct pipe_shader_state *templ )
|
||||
{
|
||||
return (void *) 0;
|
||||
}
|
||||
|
||||
|
||||
#endif /* PIPE_ARCH_PPC */
|
@@ -93,7 +93,7 @@ lp_build_unpack_rgba_soa(struct gallivm_state *gallivm,
|
||||
LLVMValueRef rgba_out[4]);
|
||||
|
||||
void
|
||||
lp_build_rgba8_to_fi32_soa(struct gallivm_state *gallivm,
|
||||
lp_build_rgba8_to_f32_soa(struct gallivm_state *gallivm,
|
||||
struct lp_type dst_type,
|
||||
LLVMValueRef packed,
|
||||
LLVMValueRef *rgba);
|
||||
|
@@ -710,8 +710,6 @@ lp_build_fetch_rgba_aos(struct gallivm_state *gallivm,
|
||||
return res;
|
||||
}
|
||||
|
||||
assert(!util_format_is_pure_integer(format_desc->format));
|
||||
|
||||
assert(0);
|
||||
return lp_build_undef(gallivm, type);
|
||||
}
|
||||
|
@@ -148,7 +148,7 @@ lp_build_fetch_rgba_aos_array(struct gallivm_state *gallivm,
|
||||
|
||||
tmp_type = dst_type;
|
||||
if (pure_integer) {
|
||||
/* some callers expect (fake) floats other real ints. */
|
||||
assert(dst_type.floating);
|
||||
tmp_type.floating = 0;
|
||||
tmp_type.sign = src_type.sign;
|
||||
}
|
||||
@@ -160,8 +160,8 @@ lp_build_fetch_rgba_aos_array(struct gallivm_state *gallivm,
|
||||
lp_build_context_init(&bld, gallivm, tmp_type);
|
||||
res = lp_build_format_swizzle_aos(format_desc, &bld, res);
|
||||
|
||||
/* Bitcast to floats (for pure integers) when requested */
|
||||
if (pure_integer && dst_type.floating) {
|
||||
/* Bitcast to floats (for pure integers) */
|
||||
if (pure_integer) {
|
||||
res = LLVMBuildBitCast(builder, res, lp_build_vec_type(gallivm, dst_type), "");
|
||||
}
|
||||
|
||||
|
@@ -114,6 +114,7 @@ lp_build_unpack_rgba_soa(struct gallivm_state *gallivm,
|
||||
assert(format_desc->block.height == 1);
|
||||
assert(format_desc->block.bits <= type.width);
|
||||
/* FIXME: Support more output types */
|
||||
assert(type.floating);
|
||||
assert(type.width == 32);
|
||||
|
||||
lp_build_context_init(&bld, gallivm, type);
|
||||
@@ -161,11 +162,10 @@ lp_build_unpack_rgba_soa(struct gallivm_state *gallivm,
|
||||
input = LLVMBuildSIToFP(builder, input,
|
||||
lp_build_vec_type(gallivm, type), "");
|
||||
}
|
||||
else if (format_desc->channel[chan].pure_integer) {
|
||||
/* Nothing to do */
|
||||
} else {
|
||||
/* FIXME */
|
||||
assert(0);
|
||||
else {
|
||||
/* FIXME */
|
||||
assert(0);
|
||||
input = lp_build_undef(gallivm, type);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -203,11 +203,10 @@ lp_build_unpack_rgba_soa(struct gallivm_state *gallivm,
|
||||
input = LLVMBuildFMul(builder, input, scale_val, "");
|
||||
}
|
||||
}
|
||||
else if (format_desc->channel[chan].pure_integer) {
|
||||
/* Nothing to do */
|
||||
} else {
|
||||
/* FIXME */
|
||||
assert(0);
|
||||
else {
|
||||
/* FIXME */
|
||||
assert(0);
|
||||
input = lp_build_undef(gallivm, type);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -255,28 +254,16 @@ lp_build_unpack_rgba_soa(struct gallivm_state *gallivm,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert a vector of rgba8 values into 32bit wide SoA vectors.
|
||||
*
|
||||
* \param dst_type The desired return type. For pure integer formats
|
||||
* this should be a 32bit wide int or uint vector type,
|
||||
* otherwise a float vector type.
|
||||
*
|
||||
* \param packed The rgba8 values to pack.
|
||||
*
|
||||
* \param rgba The 4 SoA return vectors.
|
||||
*/
|
||||
void
|
||||
lp_build_rgba8_to_fi32_soa(struct gallivm_state *gallivm,
|
||||
struct lp_type dst_type,
|
||||
LLVMValueRef packed,
|
||||
LLVMValueRef *rgba)
|
||||
lp_build_rgba8_to_f32_soa(struct gallivm_state *gallivm,
|
||||
struct lp_type dst_type,
|
||||
LLVMValueRef packed,
|
||||
LLVMValueRef *rgba)
|
||||
{
|
||||
LLVMBuilderRef builder = gallivm->builder;
|
||||
LLVMValueRef mask = lp_build_const_int_vec(gallivm, dst_type, 0xff);
|
||||
unsigned chan;
|
||||
|
||||
/* XXX technically shouldn't use that for uint dst_type */
|
||||
packed = LLVMBuildBitCast(builder, packed,
|
||||
lp_build_int_vec_type(gallivm, dst_type), "");
|
||||
|
||||
@@ -295,8 +282,7 @@ lp_build_rgba8_to_fi32_soa(struct gallivm_state *gallivm,
|
||||
if (stop < 32)
|
||||
input = LLVMBuildAnd(builder, input, mask, "");
|
||||
|
||||
if (dst_type.floating)
|
||||
input = lp_build_unsigned_norm_to_float(gallivm, 8, dst_type, input);
|
||||
input = lp_build_unsigned_norm_to_float(gallivm, 8, dst_type, input);
|
||||
|
||||
rgba[chan] = input;
|
||||
}
|
||||
@@ -386,7 +372,7 @@ lp_build_fetch_rgba_soa(struct gallivm_state *gallivm,
|
||||
tmp = lp_build_fetch_rgba_aos(gallivm, format_desc, tmp_type,
|
||||
base_ptr, offset, i, j);
|
||||
|
||||
lp_build_rgba8_to_fi32_soa(gallivm,
|
||||
lp_build_rgba8_to_f32_soa(gallivm,
|
||||
type,
|
||||
tmp,
|
||||
rgba_out);
|
||||
|
@@ -87,54 +87,24 @@ lp_sampler_wrap_mode_uses_border_color(unsigned mode,
|
||||
|
||||
|
||||
/**
|
||||
* Initialize lp_sampler_static_texture_state object with the gallium
|
||||
* texture/sampler_view state (this contains the parts which are
|
||||
* considered static).
|
||||
* Initialize lp_sampler_static_state object with the gallium sampler
|
||||
* and texture state.
|
||||
* The former is considered to be static and the later dynamic.
|
||||
*/
|
||||
void
|
||||
lp_sampler_static_texture_state(struct lp_static_texture_state *state,
|
||||
const struct pipe_sampler_view *view)
|
||||
lp_sampler_static_state(struct lp_sampler_static_state *state,
|
||||
const struct pipe_sampler_view *view,
|
||||
const struct pipe_sampler_state *sampler)
|
||||
{
|
||||
const struct pipe_resource *texture;
|
||||
|
||||
memset(state, 0, sizeof *state);
|
||||
|
||||
if (!view || !view->texture)
|
||||
if (!sampler || !view || !view->texture)
|
||||
return;
|
||||
|
||||
texture = view->texture;
|
||||
|
||||
state->format = view->format;
|
||||
state->swizzle_r = view->swizzle_r;
|
||||
state->swizzle_g = view->swizzle_g;
|
||||
state->swizzle_b = view->swizzle_b;
|
||||
state->swizzle_a = view->swizzle_a;
|
||||
|
||||
state->target = texture->target;
|
||||
state->pot_width = util_is_power_of_two(texture->width0);
|
||||
state->pot_height = util_is_power_of_two(texture->height0);
|
||||
state->pot_depth = util_is_power_of_two(texture->depth0);
|
||||
state->level_zero_only = !view->u.tex.last_level;
|
||||
|
||||
/*
|
||||
* FIXME: Handle the remainder of pipe_sampler_view.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize lp_sampler_static_sampler_state object with the gallium sampler
|
||||
* state (this contains the parts which are considered static).
|
||||
*/
|
||||
void
|
||||
lp_sampler_static_sampler_state(struct lp_static_sampler_state *state,
|
||||
const struct pipe_sampler_state *sampler)
|
||||
{
|
||||
memset(state, 0, sizeof *state);
|
||||
|
||||
if (!sampler)
|
||||
return;
|
||||
|
||||
/*
|
||||
* We don't copy sampler state over unless it is actually enabled, to avoid
|
||||
* spurious recompiles, as the sampler static state is part of the shader
|
||||
@@ -147,13 +117,24 @@ lp_sampler_static_sampler_state(struct lp_static_sampler_state *state,
|
||||
* regarding 1D/2D/3D/CUBE textures, wrap modes, etc.
|
||||
*/
|
||||
|
||||
state->format = view->format;
|
||||
state->swizzle_r = view->swizzle_r;
|
||||
state->swizzle_g = view->swizzle_g;
|
||||
state->swizzle_b = view->swizzle_b;
|
||||
state->swizzle_a = view->swizzle_a;
|
||||
|
||||
state->target = texture->target;
|
||||
state->pot_width = util_is_power_of_two(texture->width0);
|
||||
state->pot_height = util_is_power_of_two(texture->height0);
|
||||
state->pot_depth = util_is_power_of_two(texture->depth0);
|
||||
|
||||
state->wrap_s = sampler->wrap_s;
|
||||
state->wrap_t = sampler->wrap_t;
|
||||
state->wrap_r = sampler->wrap_r;
|
||||
state->min_img_filter = sampler->min_img_filter;
|
||||
state->mag_img_filter = sampler->mag_img_filter;
|
||||
|
||||
if (sampler->max_lod > 0.0f) {
|
||||
if (view->u.tex.last_level && sampler->max_lod > 0.0f) {
|
||||
state->min_mip_filter = sampler->min_mip_filter;
|
||||
} else {
|
||||
state->min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
|
||||
@@ -174,11 +155,7 @@ lp_sampler_static_sampler_state(struct lp_static_sampler_state *state,
|
||||
state->apply_min_lod = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* XXX this won't do anything with the mesa state tracker which always
|
||||
* sets max_lod to not more than actually present mip maps...
|
||||
*/
|
||||
if (sampler->max_lod < (PIPE_MAX_TEXTURE_LEVELS - 1)) {
|
||||
if (sampler->max_lod < (float)view->u.tex.last_level) {
|
||||
state->apply_max_lod = 1;
|
||||
}
|
||||
}
|
||||
@@ -190,6 +167,10 @@ lp_sampler_static_sampler_state(struct lp_static_sampler_state *state,
|
||||
}
|
||||
|
||||
state->normalized_coords = sampler->normalized_coords;
|
||||
|
||||
/*
|
||||
* FIXME: Handle the remainder of pipe_sampler_view.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +182,7 @@ lp_sampler_static_sampler_state(struct lp_static_sampler_state *state,
|
||||
*/
|
||||
static LLVMValueRef
|
||||
lp_build_rho(struct lp_build_sample_context *bld,
|
||||
unsigned texture_unit,
|
||||
unsigned unit,
|
||||
const struct lp_derivatives *derivs)
|
||||
{
|
||||
struct gallivm_state *gallivm = bld->gallivm;
|
||||
@@ -283,7 +264,7 @@ lp_build_rho(struct lp_build_sample_context *bld,
|
||||
rho_vec = lp_build_max(coord_bld, rho_xvec, rho_yvec);
|
||||
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, texture_unit);
|
||||
bld->gallivm, unit);
|
||||
first_level_vec = lp_build_broadcast_scalar(int_size_bld, first_level);
|
||||
int_size = lp_build_minify(int_size_bld, bld->int_size, first_level_vec);
|
||||
float_size = lp_build_int_to_float(float_size_bld, int_size);
|
||||
@@ -508,8 +489,7 @@ lp_build_brilinear_rho(struct lp_build_context *bld,
|
||||
*/
|
||||
void
|
||||
lp_build_lod_selector(struct lp_build_sample_context *bld,
|
||||
unsigned texture_unit,
|
||||
unsigned sampler_unit,
|
||||
unsigned unit,
|
||||
const struct lp_derivatives *derivs,
|
||||
LLVMValueRef lod_bias, /* optional */
|
||||
LLVMValueRef explicit_lod, /* optional */
|
||||
@@ -525,13 +505,12 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
|
||||
*out_lod_ipart = bld->perquadi_bld.zero;
|
||||
*out_lod_fpart = perquadf_bld->zero;
|
||||
|
||||
if (bld->static_sampler_state->min_max_lod_equal) {
|
||||
if (bld->static_state->min_max_lod_equal) {
|
||||
/* User is forcing sampling from a particular mipmap level.
|
||||
* This is hit during mipmap generation.
|
||||
*/
|
||||
LLVMValueRef min_lod =
|
||||
bld->dynamic_state->min_lod(bld->dynamic_state,
|
||||
bld->gallivm, sampler_unit);
|
||||
bld->dynamic_state->min_lod(bld->dynamic_state, bld->gallivm, unit);
|
||||
|
||||
lod = lp_build_broadcast_scalar(perquadf_bld, min_lod);
|
||||
}
|
||||
@@ -543,16 +522,16 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
|
||||
else {
|
||||
LLVMValueRef rho;
|
||||
|
||||
rho = lp_build_rho(bld, texture_unit, derivs);
|
||||
rho = lp_build_rho(bld, unit, derivs);
|
||||
|
||||
/*
|
||||
* Compute lod = log2(rho)
|
||||
*/
|
||||
|
||||
if (!lod_bias &&
|
||||
!bld->static_sampler_state->lod_bias_non_zero &&
|
||||
!bld->static_sampler_state->apply_max_lod &&
|
||||
!bld->static_sampler_state->apply_min_lod) {
|
||||
!bld->static_state->lod_bias_non_zero &&
|
||||
!bld->static_state->apply_max_lod &&
|
||||
!bld->static_state->apply_min_lod) {
|
||||
/*
|
||||
* Special case when there are no post-log2 adjustments, which
|
||||
* saves instructions but keeping the integer and fractional lod
|
||||
@@ -589,28 +568,25 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
|
||||
}
|
||||
|
||||
/* add sampler lod bias */
|
||||
if (bld->static_sampler_state->lod_bias_non_zero) {
|
||||
if (bld->static_state->lod_bias_non_zero) {
|
||||
LLVMValueRef sampler_lod_bias =
|
||||
bld->dynamic_state->lod_bias(bld->dynamic_state,
|
||||
bld->gallivm, sampler_unit);
|
||||
bld->dynamic_state->lod_bias(bld->dynamic_state, bld->gallivm, unit);
|
||||
sampler_lod_bias = lp_build_broadcast_scalar(perquadf_bld,
|
||||
sampler_lod_bias);
|
||||
lod = LLVMBuildFAdd(builder, lod, sampler_lod_bias, "sampler_lod_bias");
|
||||
}
|
||||
|
||||
/* clamp lod */
|
||||
if (bld->static_sampler_state->apply_max_lod) {
|
||||
if (bld->static_state->apply_max_lod) {
|
||||
LLVMValueRef max_lod =
|
||||
bld->dynamic_state->max_lod(bld->dynamic_state,
|
||||
bld->gallivm, sampler_unit);
|
||||
bld->dynamic_state->max_lod(bld->dynamic_state, bld->gallivm, unit);
|
||||
max_lod = lp_build_broadcast_scalar(perquadf_bld, max_lod);
|
||||
|
||||
lod = lp_build_min(perquadf_bld, lod, max_lod);
|
||||
}
|
||||
if (bld->static_sampler_state->apply_min_lod) {
|
||||
if (bld->static_state->apply_min_lod) {
|
||||
LLVMValueRef min_lod =
|
||||
bld->dynamic_state->min_lod(bld->dynamic_state,
|
||||
bld->gallivm, sampler_unit);
|
||||
bld->dynamic_state->min_lod(bld->dynamic_state, bld->gallivm, unit);
|
||||
min_lod = lp_build_broadcast_scalar(perquadf_bld, min_lod);
|
||||
|
||||
lod = lp_build_max(perquadf_bld, lod, min_lod);
|
||||
@@ -647,7 +623,7 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
|
||||
*/
|
||||
void
|
||||
lp_build_nearest_mip_level(struct lp_build_sample_context *bld,
|
||||
unsigned texture_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef lod_ipart,
|
||||
LLVMValueRef *level_out)
|
||||
{
|
||||
@@ -655,9 +631,9 @@ lp_build_nearest_mip_level(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef first_level, last_level, level;
|
||||
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, texture_unit);
|
||||
bld->gallivm, unit);
|
||||
last_level = bld->dynamic_state->last_level(bld->dynamic_state,
|
||||
bld->gallivm, texture_unit);
|
||||
bld->gallivm, unit);
|
||||
first_level = lp_build_broadcast_scalar(perquadi_bld, first_level);
|
||||
last_level = lp_build_broadcast_scalar(perquadi_bld, last_level);
|
||||
|
||||
@@ -675,7 +651,7 @@ lp_build_nearest_mip_level(struct lp_build_sample_context *bld,
|
||||
*/
|
||||
void
|
||||
lp_build_linear_mip_levels(struct lp_build_sample_context *bld,
|
||||
unsigned texture_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef lod_ipart,
|
||||
LLVMValueRef *lod_fpart_inout,
|
||||
LLVMValueRef *level0_out,
|
||||
@@ -689,9 +665,9 @@ lp_build_linear_mip_levels(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef clamp_max;
|
||||
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, texture_unit);
|
||||
bld->gallivm, unit);
|
||||
last_level = bld->dynamic_state->last_level(bld->dynamic_state,
|
||||
bld->gallivm, texture_unit);
|
||||
bld->gallivm, unit);
|
||||
first_level = lp_build_broadcast_scalar(perquadi_bld, first_level);
|
||||
last_level = lp_build_broadcast_scalar(perquadi_bld, last_level);
|
||||
|
||||
@@ -741,9 +717,9 @@ lp_build_linear_mip_levels(struct lp_build_sample_context *bld,
|
||||
*lod_fpart_inout = LLVMBuildSelect(builder, clamp_max,
|
||||
perquadf_bld->zero, *lod_fpart_inout, "");
|
||||
|
||||
lp_build_name(*level0_out, "texture%u_miplevel0", texture_unit);
|
||||
lp_build_name(*level1_out, "texture%u_miplevel1", texture_unit);
|
||||
lp_build_name(*lod_fpart_inout, "texture%u_mipweight", texture_unit);
|
||||
lp_build_name(*level0_out, "sampler%u_miplevel0", unit);
|
||||
lp_build_name(*level1_out, "sampler%u_miplevel1", unit);
|
||||
lp_build_name(*lod_fpart_inout, "sampler%u_mipweight", unit);
|
||||
}
|
||||
|
||||
|
||||
@@ -1012,9 +988,9 @@ lp_build_mipmap_level_sizes(struct lp_build_sample_context *bld,
|
||||
ilevel);
|
||||
}
|
||||
if (dims == 3 ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
bld->static_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
*img_stride_vec = lp_build_get_level_stride_vec(bld,
|
||||
bld->img_stride_array,
|
||||
ilevel);
|
||||
|
@@ -61,12 +61,12 @@ struct lp_derivatives
|
||||
|
||||
|
||||
/**
|
||||
* Texture static state.
|
||||
* Sampler static state.
|
||||
*
|
||||
* These are the bits of state from pipe_resource/pipe_sampler_view that
|
||||
* These are the bits of state from pipe_resource and pipe_sampler_state that
|
||||
* are embedded in the generated code.
|
||||
*/
|
||||
struct lp_static_texture_state
|
||||
struct lp_sampler_static_state
|
||||
{
|
||||
/* pipe_sampler_view's state */
|
||||
enum pipe_format format;
|
||||
@@ -80,18 +80,7 @@ struct lp_static_texture_state
|
||||
unsigned pot_width:1; /**< is the width a power of two? */
|
||||
unsigned pot_height:1;
|
||||
unsigned pot_depth:1;
|
||||
unsigned level_zero_only:1;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Sampler static state.
|
||||
*
|
||||
* These are the bits of state from pipe_sampler_state that
|
||||
* are embedded in the generated code.
|
||||
*/
|
||||
struct lp_static_sampler_state
|
||||
{
|
||||
/* pipe_sampler_state's state */
|
||||
unsigned wrap_s:3;
|
||||
unsigned wrap_t:3;
|
||||
@@ -116,8 +105,8 @@ struct lp_static_sampler_state
|
||||
/**
|
||||
* Sampler dynamic state.
|
||||
*
|
||||
* These are the bits of state from pipe_resource/pipe_sampler_view
|
||||
* as well as from sampler state that are computed at runtime.
|
||||
* These are the bits of state from pipe_resource and pipe_sampler_state that
|
||||
* are computed in runtime.
|
||||
*
|
||||
* There are obtained through callbacks, as we don't want to tie the texture
|
||||
* sampling code generation logic to any particular texture layout or pipe
|
||||
@@ -125,83 +114,80 @@ struct lp_static_sampler_state
|
||||
*/
|
||||
struct lp_sampler_dynamic_state
|
||||
{
|
||||
/* First callbacks for sampler view state */
|
||||
|
||||
/** Obtain the base texture width (returns int32) */
|
||||
LLVMValueRef
|
||||
(*width)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
unsigned unit);
|
||||
|
||||
/** Obtain the base texture height (returns int32) */
|
||||
LLVMValueRef
|
||||
(*height)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
unsigned unit);
|
||||
|
||||
/** Obtain the base texture depth (returns int32) */
|
||||
LLVMValueRef
|
||||
(*depth)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
unsigned unit);
|
||||
|
||||
/** Obtain the first mipmap level (base level) (returns int32) */
|
||||
LLVMValueRef
|
||||
(*first_level)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
unsigned unit);
|
||||
|
||||
/** Obtain the number of mipmap levels minus one (returns int32) */
|
||||
LLVMValueRef
|
||||
(*last_level)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
unsigned unit);
|
||||
|
||||
/** Obtain stride in bytes between image rows/blocks (returns int32) */
|
||||
LLVMValueRef
|
||||
(*row_stride)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
unsigned unit);
|
||||
|
||||
/** Obtain stride in bytes between image slices (returns int32) */
|
||||
LLVMValueRef
|
||||
(*img_stride)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
unsigned unit);
|
||||
|
||||
/** Obtain pointer to base of texture */
|
||||
LLVMValueRef
|
||||
(*base_ptr)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
unsigned unit);
|
||||
|
||||
/** Obtain pointer to array of mipmap offsets */
|
||||
LLVMValueRef
|
||||
(*mip_offsets)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
|
||||
/* These are callbacks for sampler state */
|
||||
unsigned unit);
|
||||
|
||||
/** Obtain texture min lod (returns float) */
|
||||
LLVMValueRef
|
||||
(*min_lod)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm, unsigned sampler_unit);
|
||||
struct gallivm_state *gallivm, unsigned unit);
|
||||
|
||||
/** Obtain texture max lod (returns float) */
|
||||
LLVMValueRef
|
||||
(*max_lod)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm, unsigned sampler_unit);
|
||||
struct gallivm_state *gallivm, unsigned unit);
|
||||
|
||||
/** Obtain texture lod bias (returns float) */
|
||||
LLVMValueRef
|
||||
(*lod_bias)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm, unsigned sampler_unit);
|
||||
struct gallivm_state *gallivm, unsigned unit);
|
||||
|
||||
/** Obtain texture border color (returns ptr to float[4]) */
|
||||
LLVMValueRef
|
||||
(*border_color)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm, unsigned sampler_unit);
|
||||
struct gallivm_state *gallivm, unsigned unit);
|
||||
};
|
||||
|
||||
|
||||
@@ -212,8 +198,7 @@ struct lp_build_sample_context
|
||||
{
|
||||
struct gallivm_state *gallivm;
|
||||
|
||||
const struct lp_static_texture_state *static_texture_state;
|
||||
const struct lp_static_sampler_state *static_sampler_state;
|
||||
const struct lp_sampler_static_state *static_state;
|
||||
|
||||
struct lp_sampler_dynamic_state *dynamic_state;
|
||||
|
||||
@@ -310,10 +295,10 @@ apply_sampler_swizzle(struct lp_build_sample_context *bld,
|
||||
{
|
||||
unsigned char swizzles[4];
|
||||
|
||||
swizzles[0] = bld->static_texture_state->swizzle_r;
|
||||
swizzles[1] = bld->static_texture_state->swizzle_g;
|
||||
swizzles[2] = bld->static_texture_state->swizzle_b;
|
||||
swizzles[3] = bld->static_texture_state->swizzle_a;
|
||||
swizzles[0] = bld->static_state->swizzle_r;
|
||||
swizzles[1] = bld->static_state->swizzle_g;
|
||||
swizzles[2] = bld->static_state->swizzle_b;
|
||||
swizzles[3] = bld->static_state->swizzle_a;
|
||||
|
||||
lp_build_swizzle_soa_inplace(&bld->texel_bld, texel, swizzles);
|
||||
}
|
||||
@@ -353,19 +338,14 @@ lp_sampler_wrap_mode_uses_border_color(unsigned mode,
|
||||
* Derive the sampler static state.
|
||||
*/
|
||||
void
|
||||
lp_sampler_static_sampler_state(struct lp_static_sampler_state *state,
|
||||
const struct pipe_sampler_state *sampler);
|
||||
|
||||
|
||||
void
|
||||
lp_sampler_static_texture_state(struct lp_static_texture_state *state,
|
||||
const struct pipe_sampler_view *view);
|
||||
lp_sampler_static_state(struct lp_sampler_static_state *state,
|
||||
const struct pipe_sampler_view *view,
|
||||
const struct pipe_sampler_state *sampler);
|
||||
|
||||
|
||||
void
|
||||
lp_build_lod_selector(struct lp_build_sample_context *bld,
|
||||
unsigned texture_index,
|
||||
unsigned sampler_index,
|
||||
unsigned unit,
|
||||
const struct lp_derivatives *derivs,
|
||||
LLVMValueRef lod_bias, /* optional */
|
||||
LLVMValueRef explicit_lod, /* optional */
|
||||
@@ -375,13 +355,13 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
|
||||
|
||||
void
|
||||
lp_build_nearest_mip_level(struct lp_build_sample_context *bld,
|
||||
unsigned texture_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef lod,
|
||||
LLVMValueRef *level_out);
|
||||
|
||||
void
|
||||
lp_build_linear_mip_levels(struct lp_build_sample_context *bld,
|
||||
unsigned texture_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef lod_ipart,
|
||||
LLVMValueRef *lod_fpart_inout,
|
||||
LLVMValueRef *level0_out,
|
||||
@@ -457,13 +437,11 @@ lp_build_sample_offset(struct lp_build_context *bld,
|
||||
|
||||
void
|
||||
lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
const struct lp_static_texture_state *static_texture_state,
|
||||
const struct lp_static_sampler_state *static_sampler_state,
|
||||
struct lp_sampler_dynamic_state *dynamic_texture_state,
|
||||
const struct lp_sampler_static_state *static_state,
|
||||
struct lp_sampler_dynamic_state *dynamic_state,
|
||||
struct lp_type fp_type,
|
||||
boolean is_fetch,
|
||||
unsigned texture_index,
|
||||
unsigned sampler_index,
|
||||
unsigned unit,
|
||||
const LLVMValueRef *coords,
|
||||
const LLVMValueRef *offsets,
|
||||
const struct lp_derivatives *derivs,
|
||||
@@ -483,10 +461,10 @@ lp_build_coord_repeat_npot_linear(struct lp_build_sample_context *bld,
|
||||
|
||||
void
|
||||
lp_build_size_query_soa(struct gallivm_state *gallivm,
|
||||
const struct lp_static_texture_state *static_state,
|
||||
const struct lp_sampler_static_state *static_state,
|
||||
struct lp_sampler_dynamic_state *dynamic_state,
|
||||
struct lp_type int_type,
|
||||
unsigned texture_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef explicit_lod,
|
||||
LLVMValueRef *sizes_out);
|
||||
|
||||
|
@@ -152,7 +152,7 @@ lp_build_sample_wrap_nearest_float(struct lp_build_sample_context *bld,
|
||||
break;
|
||||
case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
|
||||
length_minus_one = lp_build_sub(coord_bld, length, coord_bld->one);
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
/* scale coord to length */
|
||||
coord = lp_build_mul(coord_bld, coord, length);
|
||||
}
|
||||
@@ -407,7 +407,7 @@ lp_build_sample_wrap_linear_float(struct lp_build_sample_context *bld,
|
||||
}
|
||||
break;
|
||||
case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
/* mul by tex size */
|
||||
coord = lp_build_mul(coord_bld, coord, length);
|
||||
}
|
||||
@@ -549,7 +549,7 @@ lp_build_sample_image_nearest(struct lp_build_sample_context *bld,
|
||||
|
||||
s_float = s; t_float = t; r_float = r;
|
||||
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
LLVMValueRef scaled_size;
|
||||
LLVMValueRef flt_size;
|
||||
|
||||
@@ -594,8 +594,8 @@ lp_build_sample_image_nearest(struct lp_build_sample_context *bld,
|
||||
bld->format_desc->block.width,
|
||||
s_ipart, s_float,
|
||||
width_vec, x_stride,
|
||||
bld->static_texture_state->pot_width,
|
||||
bld->static_sampler_state->wrap_s,
|
||||
bld->static_state->pot_width,
|
||||
bld->static_state->wrap_s,
|
||||
&x_offset, &x_subcoord);
|
||||
offset = x_offset;
|
||||
if (dims >= 2) {
|
||||
@@ -604,8 +604,8 @@ lp_build_sample_image_nearest(struct lp_build_sample_context *bld,
|
||||
bld->format_desc->block.height,
|
||||
t_ipart, t_float,
|
||||
height_vec, row_stride_vec,
|
||||
bld->static_texture_state->pot_height,
|
||||
bld->static_sampler_state->wrap_t,
|
||||
bld->static_state->pot_height,
|
||||
bld->static_state->wrap_t,
|
||||
&y_offset, &y_subcoord);
|
||||
offset = lp_build_add(&bld->int_coord_bld, offset, y_offset);
|
||||
if (dims >= 3) {
|
||||
@@ -614,15 +614,15 @@ lp_build_sample_image_nearest(struct lp_build_sample_context *bld,
|
||||
1, /* block length (depth) */
|
||||
r_ipart, r_float,
|
||||
depth_vec, img_stride_vec,
|
||||
bld->static_texture_state->pot_depth,
|
||||
bld->static_sampler_state->wrap_r,
|
||||
bld->static_state->pot_depth,
|
||||
bld->static_state->wrap_r,
|
||||
&z_offset, &z_subcoord);
|
||||
offset = lp_build_add(&bld->int_coord_bld, offset, z_offset);
|
||||
}
|
||||
}
|
||||
if (bld->static_texture_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
if (bld->static_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
LLVMValueRef z_offset;
|
||||
/* The r coord is the cube face in [0,5] or array layer */
|
||||
z_offset = lp_build_mul(&bld->int_coord_bld, r, img_stride_vec);
|
||||
@@ -678,28 +678,28 @@ lp_build_sample_image_nearest_afloat(struct lp_build_sample_context *bld,
|
||||
/* Do texcoord wrapping */
|
||||
lp_build_sample_wrap_nearest_float(bld,
|
||||
s, width_vec,
|
||||
bld->static_texture_state->pot_width,
|
||||
bld->static_sampler_state->wrap_s,
|
||||
bld->static_state->pot_width,
|
||||
bld->static_state->wrap_s,
|
||||
&x_icoord);
|
||||
|
||||
if (dims >= 2) {
|
||||
lp_build_sample_wrap_nearest_float(bld,
|
||||
t, height_vec,
|
||||
bld->static_texture_state->pot_height,
|
||||
bld->static_sampler_state->wrap_t,
|
||||
bld->static_state->pot_height,
|
||||
bld->static_state->wrap_t,
|
||||
&y_icoord);
|
||||
|
||||
if (dims >= 3) {
|
||||
lp_build_sample_wrap_nearest_float(bld,
|
||||
r, depth_vec,
|
||||
bld->static_texture_state->pot_depth,
|
||||
bld->static_sampler_state->wrap_r,
|
||||
bld->static_state->pot_depth,
|
||||
bld->static_state->wrap_r,
|
||||
&z_icoord);
|
||||
}
|
||||
}
|
||||
if (bld->static_texture_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
if (bld->static_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
z_icoord = r;
|
||||
}
|
||||
|
||||
@@ -885,7 +885,7 @@ lp_build_sample_fetch_image_linear(struct lp_build_sample_context *bld,
|
||||
/*
|
||||
* Linear interpolation with 8.8 fixed point.
|
||||
*/
|
||||
if (bld->static_sampler_state->force_nearest_s) {
|
||||
if (bld->static_state->force_nearest_s) {
|
||||
/* special case 1-D lerp */
|
||||
packed_lo = lp_build_lerp(&h16,
|
||||
t_fpart_lo,
|
||||
@@ -897,7 +897,7 @@ lp_build_sample_fetch_image_linear(struct lp_build_sample_context *bld,
|
||||
neighbors_hi[0][1][0],
|
||||
neighbors_hi[0][1][0]);
|
||||
}
|
||||
else if (bld->static_sampler_state->force_nearest_t) {
|
||||
else if (bld->static_state->force_nearest_t) {
|
||||
/* special case 1-D lerp */
|
||||
packed_lo = lp_build_lerp(&h16,
|
||||
s_fpart_lo,
|
||||
@@ -1016,7 +1016,7 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
|
||||
s_float = s; t_float = t; r_float = r;
|
||||
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
LLVMValueRef scaled_size;
|
||||
LLVMValueRef flt_size;
|
||||
|
||||
@@ -1045,10 +1045,10 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
|
||||
/* subtract 0.5 (add -128) */
|
||||
i32_c128 = lp_build_const_int_vec(bld->gallivm, i32.type, -128);
|
||||
if (!bld->static_sampler_state->force_nearest_s) {
|
||||
if (!bld->static_state->force_nearest_s) {
|
||||
s = LLVMBuildAdd(builder, s, i32_c128, "");
|
||||
}
|
||||
if (dims >= 2 && !bld->static_sampler_state->force_nearest_t) {
|
||||
if (dims >= 2 && !bld->static_state->force_nearest_t) {
|
||||
t = LLVMBuildAdd(builder, t, i32_c128, "");
|
||||
}
|
||||
if (dims >= 3) {
|
||||
@@ -1082,15 +1082,15 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
bld->format_desc->block.width,
|
||||
s_ipart, &s_fpart, s_float,
|
||||
width_vec, x_stride,
|
||||
bld->static_texture_state->pot_width,
|
||||
bld->static_sampler_state->wrap_s,
|
||||
bld->static_state->pot_width,
|
||||
bld->static_state->wrap_s,
|
||||
&x_offset0, &x_offset1,
|
||||
&x_subcoord[0], &x_subcoord[1]);
|
||||
|
||||
/* add potential cube/array/mip offsets now as they are constant per pixel */
|
||||
if (bld->static_texture_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
if (bld->static_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
LLVMValueRef z_offset;
|
||||
z_offset = lp_build_mul(&bld->int_coord_bld, r, img_stride_vec);
|
||||
/* The r coord is the cube face in [0,5] or array layer */
|
||||
@@ -1114,8 +1114,8 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
bld->format_desc->block.height,
|
||||
t_ipart, &t_fpart, t_float,
|
||||
height_vec, y_stride,
|
||||
bld->static_texture_state->pot_height,
|
||||
bld->static_sampler_state->wrap_t,
|
||||
bld->static_state->pot_height,
|
||||
bld->static_state->wrap_t,
|
||||
&y_offset0, &y_offset1,
|
||||
&y_subcoord[0], &y_subcoord[1]);
|
||||
|
||||
@@ -1134,8 +1134,8 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
bld->format_desc->block.height,
|
||||
r_ipart, &r_fpart, r_float,
|
||||
depth_vec, z_stride,
|
||||
bld->static_texture_state->pot_depth,
|
||||
bld->static_sampler_state->wrap_r,
|
||||
bld->static_state->pot_depth,
|
||||
bld->static_state->wrap_r,
|
||||
&z_offset0, &z_offset1,
|
||||
&z_subcoord[0], &z_subcoord[1]);
|
||||
for (y = 0; y < 2; y++) {
|
||||
@@ -1205,28 +1205,28 @@ lp_build_sample_image_linear_afloat(struct lp_build_sample_context *bld,
|
||||
lp_build_sample_wrap_linear_float(bld,
|
||||
bld->format_desc->block.width,
|
||||
s, width_vec,
|
||||
bld->static_texture_state->pot_width,
|
||||
bld->static_sampler_state->wrap_s,
|
||||
bld->static_state->pot_width,
|
||||
bld->static_state->wrap_s,
|
||||
&x_icoord0, &x_icoord1,
|
||||
&s_fpart,
|
||||
bld->static_sampler_state->force_nearest_s);
|
||||
bld->static_state->force_nearest_s);
|
||||
|
||||
if (dims >= 2) {
|
||||
lp_build_sample_wrap_linear_float(bld,
|
||||
bld->format_desc->block.height,
|
||||
t, height_vec,
|
||||
bld->static_texture_state->pot_height,
|
||||
bld->static_sampler_state->wrap_t,
|
||||
bld->static_state->pot_height,
|
||||
bld->static_state->wrap_t,
|
||||
&y_icoord0, &y_icoord1,
|
||||
&t_fpart,
|
||||
bld->static_sampler_state->force_nearest_t);
|
||||
bld->static_state->force_nearest_t);
|
||||
|
||||
if (dims >= 3) {
|
||||
lp_build_sample_wrap_linear_float(bld,
|
||||
bld->format_desc->block.height,
|
||||
r, depth_vec,
|
||||
bld->static_texture_state->pot_depth,
|
||||
bld->static_sampler_state->wrap_r,
|
||||
bld->static_state->pot_depth,
|
||||
bld->static_state->wrap_r,
|
||||
&z_icoord0, &z_icoord1,
|
||||
&r_fpart, 0);
|
||||
}
|
||||
@@ -1259,9 +1259,9 @@ lp_build_sample_image_linear_afloat(struct lp_build_sample_context *bld,
|
||||
&x_offset1, &x_subcoord[1]);
|
||||
|
||||
/* add potential cube/array/mip offsets now as they are constant per pixel */
|
||||
if (bld->static_texture_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
if (bld->static_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
LLVMValueRef z_offset;
|
||||
z_offset = lp_build_mul(&bld->int_coord_bld, r, img_stride_vec);
|
||||
/* The r coord is the cube face in [0,5] or array layer */
|
||||
@@ -1570,7 +1570,7 @@ lp_build_sample_mipmap(struct lp_build_sample_context *bld,
|
||||
*/
|
||||
void
|
||||
lp_build_sample_aos(struct lp_build_sample_context *bld,
|
||||
unsigned sampler_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef s,
|
||||
LLVMValueRef t,
|
||||
LLVMValueRef r,
|
||||
@@ -1582,20 +1582,20 @@ lp_build_sample_aos(struct lp_build_sample_context *bld,
|
||||
{
|
||||
struct lp_build_context *int_bld = &bld->int_bld;
|
||||
LLVMBuilderRef builder = bld->gallivm->builder;
|
||||
const unsigned mip_filter = bld->static_sampler_state->min_mip_filter;
|
||||
const unsigned min_filter = bld->static_sampler_state->min_img_filter;
|
||||
const unsigned mag_filter = bld->static_sampler_state->mag_img_filter;
|
||||
const unsigned mip_filter = bld->static_state->min_mip_filter;
|
||||
const unsigned min_filter = bld->static_state->min_img_filter;
|
||||
const unsigned mag_filter = bld->static_state->mag_img_filter;
|
||||
const unsigned dims = bld->dims;
|
||||
LLVMValueRef packed, packed_lo, packed_hi;
|
||||
LLVMValueRef unswizzled[4];
|
||||
struct lp_build_context h16_bld;
|
||||
|
||||
/* we only support the common/simple wrap modes at this time */
|
||||
assert(lp_is_simple_wrap_mode(bld->static_sampler_state->wrap_s));
|
||||
assert(lp_is_simple_wrap_mode(bld->static_state->wrap_s));
|
||||
if (dims >= 2)
|
||||
assert(lp_is_simple_wrap_mode(bld->static_sampler_state->wrap_t));
|
||||
assert(lp_is_simple_wrap_mode(bld->static_state->wrap_t));
|
||||
if (dims >= 3)
|
||||
assert(lp_is_simple_wrap_mode(bld->static_sampler_state->wrap_r));
|
||||
assert(lp_is_simple_wrap_mode(bld->static_state->wrap_r));
|
||||
|
||||
|
||||
/* make 16-bit fixed-pt builder context */
|
||||
@@ -1673,7 +1673,7 @@ lp_build_sample_aos(struct lp_build_sample_context *bld,
|
||||
/*
|
||||
* Convert to SoA and swizzle.
|
||||
*/
|
||||
lp_build_rgba8_to_fi32_soa(bld->gallivm,
|
||||
lp_build_rgba8_to_f32_soa(bld->gallivm,
|
||||
bld->texel_type,
|
||||
packed, unswizzled);
|
||||
|
||||
|
@@ -42,7 +42,7 @@
|
||||
|
||||
void
|
||||
lp_build_sample_aos(struct lp_build_sample_context *bld,
|
||||
unsigned sampler_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef s,
|
||||
LLVMValueRef t,
|
||||
LLVMValueRef r,
|
||||
|
@@ -72,7 +72,7 @@
|
||||
*/
|
||||
static void
|
||||
lp_build_sample_texel_soa(struct lp_build_sample_context *bld,
|
||||
unsigned sampler_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef width,
|
||||
LLVMValueRef height,
|
||||
LLVMValueRef depth,
|
||||
@@ -85,7 +85,7 @@ lp_build_sample_texel_soa(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef mipoffsets,
|
||||
LLVMValueRef texel_out[4])
|
||||
{
|
||||
const struct lp_static_sampler_state *static_state = bld->static_sampler_state;
|
||||
const struct lp_sampler_static_state *static_state = bld->static_state;
|
||||
const unsigned dims = bld->dims;
|
||||
struct lp_build_context *int_coord_bld = &bld->int_coord_bld;
|
||||
LLVMBuilderRef builder = bld->gallivm->builder;
|
||||
@@ -182,7 +182,7 @@ lp_build_sample_texel_soa(struct lp_build_sample_context *bld,
|
||||
/* select texel color or border color depending on use_border */
|
||||
LLVMValueRef border_color_ptr =
|
||||
bld->dynamic_state->border_color(bld->dynamic_state,
|
||||
bld->gallivm, sampler_unit);
|
||||
bld->gallivm, unit);
|
||||
int chan;
|
||||
for (chan = 0; chan < 4; chan++) {
|
||||
LLVMValueRef border_chan =
|
||||
@@ -190,11 +190,6 @@ lp_build_sample_texel_soa(struct lp_build_sample_context *bld,
|
||||
lp_build_const_int32(bld->gallivm, chan));
|
||||
LLVMValueRef border_chan_vec =
|
||||
lp_build_broadcast_scalar(&bld->float_vec_bld, border_chan);
|
||||
|
||||
if (!bld->texel_type.floating) {
|
||||
border_chan_vec = LLVMBuildBitCast(builder, border_chan_vec,
|
||||
bld->texel_bld.vec_type, "");
|
||||
}
|
||||
texel_out[chan] = lp_build_select(&bld->texel_bld, use_border,
|
||||
border_chan_vec, texel_out[chan]);
|
||||
}
|
||||
@@ -317,7 +312,7 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld,
|
||||
break;
|
||||
|
||||
case PIPE_TEX_WRAP_CLAMP:
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
/* scale coord to length */
|
||||
coord = lp_build_mul(coord_bld, coord, length_f);
|
||||
}
|
||||
@@ -337,7 +332,7 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld,
|
||||
struct lp_build_context abs_coord_bld = bld->coord_bld;
|
||||
abs_coord_bld.type.sign = FALSE;
|
||||
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
/* mul by tex size */
|
||||
coord = lp_build_mul(coord_bld, coord, length_f);
|
||||
}
|
||||
@@ -356,7 +351,7 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld,
|
||||
}
|
||||
|
||||
case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
/* scale coord to length */
|
||||
coord = lp_build_mul(coord_bld, coord, length_f);
|
||||
}
|
||||
@@ -389,7 +384,7 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld,
|
||||
case PIPE_TEX_WRAP_MIRROR_CLAMP:
|
||||
coord = lp_build_abs(coord_bld, coord);
|
||||
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
/* scale coord to length */
|
||||
coord = lp_build_mul(coord_bld, coord, length_f);
|
||||
}
|
||||
@@ -411,7 +406,7 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld,
|
||||
abs_coord_bld.type.sign = FALSE;
|
||||
coord = lp_build_abs(coord_bld, coord);
|
||||
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
/* scale coord to length */
|
||||
coord = lp_build_mul(coord_bld, coord, length_f);
|
||||
}
|
||||
@@ -433,7 +428,7 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld,
|
||||
{
|
||||
coord = lp_build_abs(coord_bld, coord);
|
||||
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
/* scale coord to length */
|
||||
coord = lp_build_mul(coord_bld, coord, length_f);
|
||||
}
|
||||
@@ -500,7 +495,7 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld,
|
||||
|
||||
case PIPE_TEX_WRAP_CLAMP:
|
||||
case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
/* scale coord to length */
|
||||
coord = lp_build_mul(coord_bld, coord, length_f);
|
||||
}
|
||||
@@ -515,7 +510,7 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld,
|
||||
break;
|
||||
|
||||
case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
/* scale coord to length */
|
||||
coord = lp_build_mul(coord_bld, coord, length_f);
|
||||
}
|
||||
@@ -528,7 +523,7 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld,
|
||||
coord = lp_build_coord_mirror(bld, coord);
|
||||
|
||||
/* scale coord to length */
|
||||
assert(bld->static_sampler_state->normalized_coords);
|
||||
assert(bld->static_state->normalized_coords);
|
||||
coord = lp_build_mul(coord_bld, coord, length_f);
|
||||
|
||||
/* itrunc == ifloor here */
|
||||
@@ -542,7 +537,7 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld,
|
||||
case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE:
|
||||
coord = lp_build_abs(coord_bld, coord);
|
||||
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
/* scale coord to length */
|
||||
coord = lp_build_mul(coord_bld, coord, length_f);
|
||||
}
|
||||
@@ -557,7 +552,7 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld,
|
||||
case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER:
|
||||
coord = lp_build_abs(coord_bld, coord);
|
||||
|
||||
if (bld->static_sampler_state->normalized_coords) {
|
||||
if (bld->static_state->normalized_coords) {
|
||||
/* scale coord to length */
|
||||
coord = lp_build_mul(coord_bld, coord, length_f);
|
||||
}
|
||||
@@ -581,7 +576,7 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld,
|
||||
*/
|
||||
static void
|
||||
lp_build_sample_image_nearest(struct lp_build_sample_context *bld,
|
||||
unsigned sampler_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef size,
|
||||
LLVMValueRef row_stride_vec,
|
||||
LLVMValueRef img_stride_vec,
|
||||
@@ -620,26 +615,26 @@ lp_build_sample_image_nearest(struct lp_build_sample_context *bld,
|
||||
* Compute integer texcoords.
|
||||
*/
|
||||
x = lp_build_sample_wrap_nearest(bld, s, width_vec, flt_width_vec,
|
||||
bld->static_texture_state->pot_width,
|
||||
bld->static_sampler_state->wrap_s);
|
||||
bld->static_state->pot_width,
|
||||
bld->static_state->wrap_s);
|
||||
lp_build_name(x, "tex.x.wrapped");
|
||||
|
||||
if (dims >= 2) {
|
||||
y = lp_build_sample_wrap_nearest(bld, t, height_vec, flt_height_vec,
|
||||
bld->static_texture_state->pot_height,
|
||||
bld->static_sampler_state->wrap_t);
|
||||
bld->static_state->pot_height,
|
||||
bld->static_state->wrap_t);
|
||||
lp_build_name(y, "tex.y.wrapped");
|
||||
|
||||
if (dims == 3) {
|
||||
z = lp_build_sample_wrap_nearest(bld, r, depth_vec, flt_depth_vec,
|
||||
bld->static_texture_state->pot_depth,
|
||||
bld->static_sampler_state->wrap_r);
|
||||
bld->static_state->pot_depth,
|
||||
bld->static_state->wrap_r);
|
||||
lp_build_name(z, "tex.z.wrapped");
|
||||
}
|
||||
}
|
||||
if (bld->static_texture_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
if (bld->static_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
z = r;
|
||||
lp_build_name(z, "tex.z.layer");
|
||||
}
|
||||
@@ -647,7 +642,7 @@ lp_build_sample_image_nearest(struct lp_build_sample_context *bld,
|
||||
/*
|
||||
* Get texture colors.
|
||||
*/
|
||||
lp_build_sample_texel_soa(bld, sampler_unit,
|
||||
lp_build_sample_texel_soa(bld, unit,
|
||||
width_vec, height_vec, depth_vec,
|
||||
x, y, z,
|
||||
row_stride_vec, img_stride_vec,
|
||||
@@ -661,7 +656,7 @@ lp_build_sample_image_nearest(struct lp_build_sample_context *bld,
|
||||
*/
|
||||
static void
|
||||
lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
unsigned sampler_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef size,
|
||||
LLVMValueRef row_stride_vec,
|
||||
LLVMValueRef img_stride_vec,
|
||||
@@ -703,32 +698,32 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
* Compute integer texcoords.
|
||||
*/
|
||||
lp_build_sample_wrap_linear(bld, s, width_vec, flt_width_vec,
|
||||
bld->static_texture_state->pot_width,
|
||||
bld->static_sampler_state->wrap_s,
|
||||
bld->static_state->pot_width,
|
||||
bld->static_state->wrap_s,
|
||||
&x0, &x1, &s_fpart);
|
||||
lp_build_name(x0, "tex.x0.wrapped");
|
||||
lp_build_name(x1, "tex.x1.wrapped");
|
||||
|
||||
if (dims >= 2) {
|
||||
lp_build_sample_wrap_linear(bld, t, height_vec, flt_height_vec,
|
||||
bld->static_texture_state->pot_height,
|
||||
bld->static_sampler_state->wrap_t,
|
||||
bld->static_state->pot_height,
|
||||
bld->static_state->wrap_t,
|
||||
&y0, &y1, &t_fpart);
|
||||
lp_build_name(y0, "tex.y0.wrapped");
|
||||
lp_build_name(y1, "tex.y1.wrapped");
|
||||
|
||||
if (dims == 3) {
|
||||
lp_build_sample_wrap_linear(bld, r, depth_vec, flt_depth_vec,
|
||||
bld->static_texture_state->pot_depth,
|
||||
bld->static_sampler_state->wrap_r,
|
||||
bld->static_state->pot_depth,
|
||||
bld->static_state->wrap_r,
|
||||
&z0, &z1, &r_fpart);
|
||||
lp_build_name(z0, "tex.z0.wrapped");
|
||||
lp_build_name(z1, "tex.z1.wrapped");
|
||||
}
|
||||
}
|
||||
if (bld->static_texture_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
if (bld->static_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_state->target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
bld->static_state->target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
z0 = z1 = r; /* cube face or array layer */
|
||||
lp_build_name(z0, "tex.z0.layer");
|
||||
lp_build_name(z1, "tex.z1.layer");
|
||||
@@ -739,12 +734,12 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
* Get texture colors.
|
||||
*/
|
||||
/* get x0/x1 texels */
|
||||
lp_build_sample_texel_soa(bld, sampler_unit,
|
||||
lp_build_sample_texel_soa(bld, unit,
|
||||
width_vec, height_vec, depth_vec,
|
||||
x0, y0, z0,
|
||||
row_stride_vec, img_stride_vec,
|
||||
data_ptr, mipoffsets, neighbors[0][0]);
|
||||
lp_build_sample_texel_soa(bld, sampler_unit,
|
||||
lp_build_sample_texel_soa(bld, unit,
|
||||
width_vec, height_vec, depth_vec,
|
||||
x1, y0, z0,
|
||||
row_stride_vec, img_stride_vec,
|
||||
@@ -763,12 +758,12 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef colors0[4];
|
||||
|
||||
/* get x0/x1 texels at y1 */
|
||||
lp_build_sample_texel_soa(bld, sampler_unit,
|
||||
lp_build_sample_texel_soa(bld, unit,
|
||||
width_vec, height_vec, depth_vec,
|
||||
x0, y1, z0,
|
||||
row_stride_vec, img_stride_vec,
|
||||
data_ptr, mipoffsets, neighbors[1][0]);
|
||||
lp_build_sample_texel_soa(bld, sampler_unit,
|
||||
lp_build_sample_texel_soa(bld, unit,
|
||||
width_vec, height_vec, depth_vec,
|
||||
x1, y1, z0,
|
||||
row_stride_vec, img_stride_vec,
|
||||
@@ -789,22 +784,22 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef colors1[4];
|
||||
|
||||
/* get x0/x1/y0/y1 texels at z1 */
|
||||
lp_build_sample_texel_soa(bld, sampler_unit,
|
||||
lp_build_sample_texel_soa(bld, unit,
|
||||
width_vec, height_vec, depth_vec,
|
||||
x0, y0, z1,
|
||||
row_stride_vec, img_stride_vec,
|
||||
data_ptr, mipoffsets, neighbors1[0][0]);
|
||||
lp_build_sample_texel_soa(bld, sampler_unit,
|
||||
lp_build_sample_texel_soa(bld, unit,
|
||||
width_vec, height_vec, depth_vec,
|
||||
x1, y0, z1,
|
||||
row_stride_vec, img_stride_vec,
|
||||
data_ptr, mipoffsets, neighbors1[0][1]);
|
||||
lp_build_sample_texel_soa(bld, sampler_unit,
|
||||
lp_build_sample_texel_soa(bld, unit,
|
||||
width_vec, height_vec, depth_vec,
|
||||
x0, y1, z1,
|
||||
row_stride_vec, img_stride_vec,
|
||||
data_ptr, mipoffsets, neighbors1[1][0]);
|
||||
lp_build_sample_texel_soa(bld, sampler_unit,
|
||||
lp_build_sample_texel_soa(bld, unit,
|
||||
width_vec, height_vec, depth_vec,
|
||||
x1, y1, z1,
|
||||
row_stride_vec, img_stride_vec,
|
||||
@@ -845,7 +840,7 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
*/
|
||||
static void
|
||||
lp_build_sample_mipmap(struct lp_build_sample_context *bld,
|
||||
unsigned sampler_unit,
|
||||
unsigned unit,
|
||||
unsigned img_filter,
|
||||
unsigned mip_filter,
|
||||
LLVMValueRef s,
|
||||
@@ -883,7 +878,7 @@ lp_build_sample_mipmap(struct lp_build_sample_context *bld,
|
||||
mipoff0 = lp_build_get_mip_offsets(bld, ilevel0);
|
||||
}
|
||||
if (img_filter == PIPE_TEX_FILTER_NEAREST) {
|
||||
lp_build_sample_image_nearest(bld, sampler_unit,
|
||||
lp_build_sample_image_nearest(bld, unit,
|
||||
size0,
|
||||
row_stride0_vec, img_stride0_vec,
|
||||
data_ptr0, mipoff0, s, t, r,
|
||||
@@ -891,7 +886,7 @@ lp_build_sample_mipmap(struct lp_build_sample_context *bld,
|
||||
}
|
||||
else {
|
||||
assert(img_filter == PIPE_TEX_FILTER_LINEAR);
|
||||
lp_build_sample_image_linear(bld, sampler_unit,
|
||||
lp_build_sample_image_linear(bld, unit,
|
||||
size0,
|
||||
row_stride0_vec, img_stride0_vec,
|
||||
data_ptr0, mipoff0, s, t, r,
|
||||
@@ -947,14 +942,14 @@ lp_build_sample_mipmap(struct lp_build_sample_context *bld,
|
||||
mipoff1 = lp_build_get_mip_offsets(bld, ilevel1);
|
||||
}
|
||||
if (img_filter == PIPE_TEX_FILTER_NEAREST) {
|
||||
lp_build_sample_image_nearest(bld, sampler_unit,
|
||||
lp_build_sample_image_nearest(bld, unit,
|
||||
size1,
|
||||
row_stride1_vec, img_stride1_vec,
|
||||
data_ptr1, mipoff1, s, t, r,
|
||||
colors1);
|
||||
}
|
||||
else {
|
||||
lp_build_sample_image_linear(bld, sampler_unit,
|
||||
lp_build_sample_image_linear(bld, unit,
|
||||
size1,
|
||||
row_stride1_vec, img_stride1_vec,
|
||||
data_ptr1, mipoff1, s, t, r,
|
||||
@@ -984,13 +979,13 @@ lp_build_sample_mipmap(struct lp_build_sample_context *bld,
|
||||
*/
|
||||
static LLVMValueRef
|
||||
lp_build_layer_coord(struct lp_build_sample_context *bld,
|
||||
unsigned texture_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef layer)
|
||||
{
|
||||
LLVMValueRef maxlayer;
|
||||
|
||||
maxlayer = bld->dynamic_state->depth(bld->dynamic_state,
|
||||
bld->gallivm, texture_unit);
|
||||
bld->gallivm, unit);
|
||||
maxlayer = lp_build_sub(&bld->int_bld, maxlayer, bld->int_bld.one);
|
||||
maxlayer = lp_build_broadcast_scalar(&bld->int_coord_bld, maxlayer);
|
||||
return lp_build_clamp(&bld->int_coord_bld, layer,
|
||||
@@ -1004,8 +999,7 @@ lp_build_layer_coord(struct lp_build_sample_context *bld,
|
||||
*/
|
||||
static void
|
||||
lp_build_sample_common(struct lp_build_sample_context *bld,
|
||||
unsigned texture_index,
|
||||
unsigned sampler_index,
|
||||
unsigned unit,
|
||||
LLVMValueRef *s,
|
||||
LLVMValueRef *t,
|
||||
LLVMValueRef *r,
|
||||
@@ -1017,10 +1011,10 @@ lp_build_sample_common(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef *ilevel0,
|
||||
LLVMValueRef *ilevel1)
|
||||
{
|
||||
const unsigned mip_filter = bld->static_sampler_state->min_mip_filter;
|
||||
const unsigned min_filter = bld->static_sampler_state->min_img_filter;
|
||||
const unsigned mag_filter = bld->static_sampler_state->mag_img_filter;
|
||||
const unsigned target = bld->static_texture_state->target;
|
||||
const unsigned mip_filter = bld->static_state->min_mip_filter;
|
||||
const unsigned min_filter = bld->static_state->min_img_filter;
|
||||
const unsigned mag_filter = bld->static_state->mag_img_filter;
|
||||
const unsigned target = bld->static_state->target;
|
||||
LLVMValueRef first_level;
|
||||
struct lp_derivatives face_derivs;
|
||||
|
||||
@@ -1047,11 +1041,11 @@ lp_build_sample_common(struct lp_build_sample_context *bld,
|
||||
}
|
||||
else if (target == PIPE_TEXTURE_1D_ARRAY) {
|
||||
*r = lp_build_iround(&bld->coord_bld, *t);
|
||||
*r = lp_build_layer_coord(bld, texture_index, *r);
|
||||
*r = lp_build_layer_coord(bld, unit, *r);
|
||||
}
|
||||
else if (target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
*r = lp_build_iround(&bld->coord_bld, *r);
|
||||
*r = lp_build_layer_coord(bld, texture_index, *r);
|
||||
*r = lp_build_layer_coord(bld, unit, *r);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1062,8 +1056,8 @@ lp_build_sample_common(struct lp_build_sample_context *bld,
|
||||
/* Need to compute lod either to choose mipmap levels or to
|
||||
* distinguish between minification/magnification with one mipmap level.
|
||||
*/
|
||||
lp_build_lod_selector(bld, texture_index, sampler_index,
|
||||
derivs, lod_bias, explicit_lod,
|
||||
lp_build_lod_selector(bld, unit, derivs,
|
||||
lod_bias, explicit_lod,
|
||||
mip_filter,
|
||||
lod_ipart, lod_fpart);
|
||||
} else {
|
||||
@@ -1086,23 +1080,23 @@ lp_build_sample_common(struct lp_build_sample_context *bld,
|
||||
* XXX should probably disable that on other llvm versions.
|
||||
*/
|
||||
assert(*lod_ipart);
|
||||
lp_build_nearest_mip_level(bld, texture_index, *lod_ipart, ilevel0);
|
||||
lp_build_nearest_mip_level(bld, unit, *lod_ipart, ilevel0);
|
||||
}
|
||||
else {
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, texture_index);
|
||||
bld->gallivm, unit);
|
||||
first_level = lp_build_broadcast_scalar(&bld->perquadi_bld, first_level);
|
||||
*ilevel0 = first_level;
|
||||
}
|
||||
break;
|
||||
case PIPE_TEX_MIPFILTER_NEAREST:
|
||||
assert(*lod_ipart);
|
||||
lp_build_nearest_mip_level(bld, texture_index, *lod_ipart, ilevel0);
|
||||
lp_build_nearest_mip_level(bld, unit, *lod_ipart, ilevel0);
|
||||
break;
|
||||
case PIPE_TEX_MIPFILTER_LINEAR:
|
||||
assert(*lod_ipart);
|
||||
assert(*lod_fpart);
|
||||
lp_build_linear_mip_levels(bld, texture_index,
|
||||
lp_build_linear_mip_levels(bld, unit,
|
||||
*lod_ipart, lod_fpart,
|
||||
ilevel0, ilevel1);
|
||||
break;
|
||||
@@ -1116,7 +1110,7 @@ lp_build_sample_common(struct lp_build_sample_context *bld,
|
||||
*/
|
||||
static void
|
||||
lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
unsigned sampler_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef s,
|
||||
LLVMValueRef t,
|
||||
LLVMValueRef r,
|
||||
@@ -1128,9 +1122,9 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
{
|
||||
struct lp_build_context *int_bld = &bld->int_bld;
|
||||
LLVMBuilderRef builder = bld->gallivm->builder;
|
||||
const unsigned mip_filter = bld->static_sampler_state->min_mip_filter;
|
||||
const unsigned min_filter = bld->static_sampler_state->min_img_filter;
|
||||
const unsigned mag_filter = bld->static_sampler_state->mag_img_filter;
|
||||
const unsigned mip_filter = bld->static_state->min_mip_filter;
|
||||
const unsigned min_filter = bld->static_state->min_img_filter;
|
||||
const unsigned mag_filter = bld->static_state->mag_img_filter;
|
||||
LLVMValueRef texels[4];
|
||||
unsigned chan;
|
||||
|
||||
@@ -1140,12 +1134,12 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
|
||||
for (chan = 0; chan < 4; ++chan) {
|
||||
texels[chan] = lp_build_alloca(bld->gallivm, bld->texel_bld.vec_type, "");
|
||||
lp_build_name(texels[chan], "sampler%u_texel_%c_var", sampler_unit, "xyzw"[chan]);
|
||||
lp_build_name(texels[chan], "sampler%u_texel_%c_var", unit, "xyzw"[chan]);
|
||||
}
|
||||
|
||||
if (min_filter == mag_filter) {
|
||||
/* no need to distinguish between minification and magnification */
|
||||
lp_build_sample_mipmap(bld, sampler_unit,
|
||||
lp_build_sample_mipmap(bld, unit,
|
||||
min_filter, mip_filter,
|
||||
s, t, r,
|
||||
ilevel0, ilevel1, lod_fpart,
|
||||
@@ -1178,7 +1172,7 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
lp_build_if(&if_ctx, bld->gallivm, minify);
|
||||
{
|
||||
/* Use the minification filter */
|
||||
lp_build_sample_mipmap(bld, sampler_unit,
|
||||
lp_build_sample_mipmap(bld, unit,
|
||||
min_filter, mip_filter,
|
||||
s, t, r,
|
||||
ilevel0, ilevel1, lod_fpart,
|
||||
@@ -1187,7 +1181,7 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
lp_build_else(&if_ctx);
|
||||
{
|
||||
/* Use the magnification filter */
|
||||
lp_build_sample_mipmap(bld, sampler_unit,
|
||||
lp_build_sample_mipmap(bld, unit,
|
||||
mag_filter, PIPE_TEX_MIPFILTER_NONE,
|
||||
s, t, r,
|
||||
ilevel0, NULL, NULL,
|
||||
@@ -1198,7 +1192,7 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
|
||||
for (chan = 0; chan < 4; ++chan) {
|
||||
colors_out[chan] = LLVMBuildLoad(builder, texels[chan], "");
|
||||
lp_build_name(colors_out[chan], "sampler%u_texel_%c", sampler_unit, "xyzw"[chan]);
|
||||
lp_build_name(colors_out[chan], "sampler%u_texel_%c", unit, "xyzw"[chan]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1213,7 +1207,7 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
*/
|
||||
static void
|
||||
lp_build_fetch_texel(struct lp_build_sample_context *bld,
|
||||
unsigned texture_unit,
|
||||
unsigned unit,
|
||||
const LLVMValueRef *coords,
|
||||
LLVMValueRef explicit_lod,
|
||||
const LLVMValueRef *offsets,
|
||||
@@ -1222,7 +1216,7 @@ lp_build_fetch_texel(struct lp_build_sample_context *bld,
|
||||
struct lp_build_context *perquadi_bld = &bld->perquadi_bld;
|
||||
struct lp_build_context *int_coord_bld = &bld->int_coord_bld;
|
||||
unsigned dims = bld->dims, chan;
|
||||
unsigned target = bld->static_texture_state->target;
|
||||
unsigned target = bld->static_state->target;
|
||||
LLVMValueRef size, ilevel;
|
||||
LLVMValueRef row_stride_vec = NULL, img_stride_vec = NULL;
|
||||
LLVMValueRef x = coords[0], y = coords[1], z = coords[2];
|
||||
@@ -1230,10 +1224,10 @@ lp_build_fetch_texel(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef offset, out_of_bounds, out1;
|
||||
|
||||
/* XXX just like ordinary sampling, we don't handle per-pixel lod (yet). */
|
||||
if (explicit_lod && bld->static_texture_state->target != PIPE_BUFFER) {
|
||||
if (explicit_lod && bld->static_state->target != PIPE_BUFFER) {
|
||||
ilevel = lp_build_pack_aos_scalars(bld->gallivm, int_coord_bld->type,
|
||||
perquadi_bld->type, explicit_lod, 0);
|
||||
lp_build_nearest_mip_level(bld, texture_unit, ilevel, &ilevel);
|
||||
lp_build_nearest_mip_level(bld, unit, ilevel, &ilevel);
|
||||
}
|
||||
else {
|
||||
bld->num_lods = 1;
|
||||
@@ -1248,10 +1242,10 @@ lp_build_fetch_texel(struct lp_build_sample_context *bld,
|
||||
if (target == PIPE_TEXTURE_1D_ARRAY ||
|
||||
target == PIPE_TEXTURE_2D_ARRAY) {
|
||||
if (target == PIPE_TEXTURE_1D_ARRAY) {
|
||||
z = lp_build_layer_coord(bld, texture_unit, y);
|
||||
z = lp_build_layer_coord(bld, unit, y);
|
||||
}
|
||||
else {
|
||||
z = lp_build_layer_coord(bld, texture_unit, z);
|
||||
z = lp_build_layer_coord(bld, unit, z);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1289,7 +1283,7 @@ lp_build_fetch_texel(struct lp_build_sample_context *bld,
|
||||
x, y, z, row_stride_vec, img_stride_vec,
|
||||
&offset, &i, &j);
|
||||
|
||||
if (bld->static_texture_state->target != PIPE_BUFFER) {
|
||||
if (bld->static_state->target != PIPE_BUFFER) {
|
||||
offset = lp_build_add(int_coord_bld, offset,
|
||||
lp_build_get_mip_offsets(bld, ilevel));
|
||||
}
|
||||
@@ -1334,11 +1328,11 @@ lp_build_sample_compare(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef res, p;
|
||||
const unsigned chan = 0;
|
||||
|
||||
if (bld->static_sampler_state->compare_mode == PIPE_TEX_COMPARE_NONE)
|
||||
if (bld->static_state->compare_mode == PIPE_TEX_COMPARE_NONE)
|
||||
return;
|
||||
|
||||
if (bld->static_texture_state->target == PIPE_TEXTURE_2D_ARRAY ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_CUBE) {
|
||||
if (bld->static_state->target == PIPE_TEXTURE_2D_ARRAY ||
|
||||
bld->static_state->target == PIPE_TEXTURE_CUBE) {
|
||||
p = coords[3];
|
||||
}
|
||||
else {
|
||||
@@ -1360,7 +1354,7 @@ lp_build_sample_compare(struct lp_build_sample_context *bld,
|
||||
bld->coord_bld.one);
|
||||
|
||||
/* result = (p FUNC texel) ? 1 : 0 */
|
||||
res = lp_build_cmp(texel_bld, bld->static_sampler_state->compare_func,
|
||||
res = lp_build_cmp(texel_bld, bld->static_state->compare_func,
|
||||
p, texel[chan]);
|
||||
res = lp_build_select(texel_bld, res, texel_bld->one, texel_bld->zero);
|
||||
|
||||
@@ -1401,13 +1395,11 @@ lp_build_sample_nop(struct gallivm_state *gallivm,
|
||||
*/
|
||||
void
|
||||
lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
const struct lp_static_texture_state *static_texture_state,
|
||||
const struct lp_static_sampler_state *static_sampler_state,
|
||||
const struct lp_sampler_static_state *static_state,
|
||||
struct lp_sampler_dynamic_state *dynamic_state,
|
||||
struct lp_type type,
|
||||
boolean is_fetch,
|
||||
unsigned texture_index,
|
||||
unsigned sampler_index,
|
||||
unsigned unit,
|
||||
const LLVMValueRef *coords,
|
||||
const LLVMValueRef *offsets,
|
||||
const struct lp_derivatives *derivs,
|
||||
@@ -1415,11 +1407,10 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
LLVMValueRef explicit_lod, /* optional */
|
||||
LLVMValueRef texel_out[4])
|
||||
{
|
||||
unsigned dims = texture_dims(static_texture_state->target);
|
||||
unsigned dims = texture_dims(static_state->target);
|
||||
unsigned num_quads = type.length / 4;
|
||||
unsigned mip_filter;
|
||||
unsigned mip_filter = static_state->min_mip_filter;
|
||||
struct lp_build_sample_context bld;
|
||||
struct lp_static_sampler_state derived_sampler_state = *static_sampler_state;
|
||||
LLVMTypeRef i32t = LLVMInt32TypeInContext(gallivm->context);
|
||||
LLVMBuilderRef builder = gallivm->builder;
|
||||
LLVMValueRef tex_width, tex_height, tex_depth;
|
||||
@@ -1428,7 +1419,7 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
LLVMValueRef r;
|
||||
|
||||
if (0) {
|
||||
enum pipe_format fmt = static_texture_state->format;
|
||||
enum pipe_format fmt = static_state->format;
|
||||
debug_printf("Sample from %s\n", util_format_name(fmt));
|
||||
}
|
||||
|
||||
@@ -1437,10 +1428,9 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
/* Setup our build context */
|
||||
memset(&bld, 0, sizeof bld);
|
||||
bld.gallivm = gallivm;
|
||||
bld.static_sampler_state = &derived_sampler_state;
|
||||
bld.static_texture_state = static_texture_state;
|
||||
bld.static_state = static_state;
|
||||
bld.dynamic_state = dynamic_state;
|
||||
bld.format_desc = util_format_description(static_texture_state->format);
|
||||
bld.format_desc = util_format_description(static_state->format);
|
||||
bld.dims = dims;
|
||||
|
||||
bld.vector_width = lp_type_width(type);
|
||||
@@ -1458,35 +1448,11 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
bld.perquadf_type.length = type.length > 4 ? ((type.length + 15) / 16) * 4 : 1;
|
||||
bld.perquadi_type = lp_int_type(bld.perquadf_type);
|
||||
|
||||
/* always using the first channel hopefully should be safe,
|
||||
* if not things WILL break in other places anyway.
|
||||
*/
|
||||
if (bld.format_desc->colorspace == UTIL_FORMAT_COLORSPACE_RGB &&
|
||||
bld.format_desc->channel[0].pure_integer) {
|
||||
if (bld.format_desc->channel[0].type == UTIL_FORMAT_TYPE_SIGNED) {
|
||||
bld.texel_type = lp_type_int_vec(type.width, type.width * type.length);
|
||||
}
|
||||
else if (bld.format_desc->channel[0].type == UTIL_FORMAT_TYPE_UNSIGNED) {
|
||||
bld.texel_type = lp_type_uint_vec(type.width, type.width * type.length);
|
||||
}
|
||||
}
|
||||
|
||||
if (!static_texture_state->level_zero_only) {
|
||||
derived_sampler_state.min_mip_filter = static_sampler_state->min_mip_filter;
|
||||
} else {
|
||||
derived_sampler_state.min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
|
||||
}
|
||||
mip_filter = derived_sampler_state.min_mip_filter;
|
||||
|
||||
if (0) {
|
||||
debug_printf(" .min_mip_filter = %u\n", derived_sampler_state.min_mip_filter);
|
||||
}
|
||||
|
||||
/*
|
||||
* There are other situations where at least the multiple int lods could be
|
||||
* avoided like min and max lod being equal.
|
||||
*/
|
||||
if ((is_fetch && explicit_lod && bld.static_texture_state->target != PIPE_BUFFER) ||
|
||||
if ((is_fetch && explicit_lod && bld.static_state->target != PIPE_BUFFER) ||
|
||||
(!is_fetch && mip_filter != PIPE_TEX_MIPFILTER_NONE)) {
|
||||
bld.num_lods = num_quads;
|
||||
}
|
||||
@@ -1513,13 +1479,13 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
lp_build_context_init(&bld.perquadi_bld, gallivm, bld.perquadi_type);
|
||||
|
||||
/* Get the dynamic state */
|
||||
tex_width = dynamic_state->width(dynamic_state, gallivm, texture_index);
|
||||
tex_height = dynamic_state->height(dynamic_state, gallivm, texture_index);
|
||||
tex_depth = dynamic_state->depth(dynamic_state, gallivm, texture_index);
|
||||
bld.row_stride_array = dynamic_state->row_stride(dynamic_state, gallivm, texture_index);
|
||||
bld.img_stride_array = dynamic_state->img_stride(dynamic_state, gallivm, texture_index);
|
||||
bld.base_ptr = dynamic_state->base_ptr(dynamic_state, gallivm, texture_index);
|
||||
bld.mip_offsets = dynamic_state->mip_offsets(dynamic_state, gallivm, texture_index);
|
||||
tex_width = dynamic_state->width(dynamic_state, gallivm, unit);
|
||||
tex_height = dynamic_state->height(dynamic_state, gallivm, unit);
|
||||
tex_depth = dynamic_state->depth(dynamic_state, gallivm, unit);
|
||||
bld.row_stride_array = dynamic_state->row_stride(dynamic_state, gallivm, unit);
|
||||
bld.img_stride_array = dynamic_state->img_stride(dynamic_state, gallivm, unit);
|
||||
bld.base_ptr = dynamic_state->base_ptr(dynamic_state, gallivm, unit);
|
||||
bld.mip_offsets = dynamic_state->mip_offsets(dynamic_state, gallivm, unit);
|
||||
/* Note that mip_offsets is an array[level] of offsets to texture images */
|
||||
|
||||
s = coords[0];
|
||||
@@ -1550,33 +1516,38 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
coords,
|
||||
texel_out);
|
||||
}
|
||||
|
||||
else if (is_fetch) {
|
||||
lp_build_fetch_texel(&bld, texture_index, coords,
|
||||
explicit_lod, offsets,
|
||||
texel_out);
|
||||
}
|
||||
|
||||
else {
|
||||
LLVMValueRef lod_ipart = NULL, lod_fpart = NULL;
|
||||
LLVMValueRef ilevel0 = NULL, ilevel1 = NULL;
|
||||
boolean use_aos = util_format_fits_8unorm(bld.format_desc) &&
|
||||
lp_is_simple_wrap_mode(static_sampler_state->wrap_s) &&
|
||||
lp_is_simple_wrap_mode(static_sampler_state->wrap_t);
|
||||
lp_is_simple_wrap_mode(static_state->wrap_s) &&
|
||||
lp_is_simple_wrap_mode(static_state->wrap_t);
|
||||
|
||||
if ((gallivm_debug & GALLIVM_DEBUG_PERF) &&
|
||||
!use_aos && util_format_fits_8unorm(bld.format_desc)) {
|
||||
debug_printf("%s: using floating point linear filtering for %s\n",
|
||||
__FUNCTION__, bld.format_desc->short_name);
|
||||
debug_printf(" min_img %d mag_img %d mip %d wraps %d wrapt %d\n",
|
||||
static_sampler_state->min_img_filter,
|
||||
static_sampler_state->mag_img_filter,
|
||||
static_sampler_state->min_mip_filter,
|
||||
static_sampler_state->wrap_s,
|
||||
static_sampler_state->wrap_t);
|
||||
static_state->min_img_filter,
|
||||
static_state->mag_img_filter,
|
||||
static_state->min_mip_filter,
|
||||
static_state->wrap_s,
|
||||
static_state->wrap_t);
|
||||
}
|
||||
|
||||
lp_build_sample_common(&bld, texture_index, sampler_index,
|
||||
if (is_fetch) {
|
||||
lp_build_fetch_texel(&bld, unit, coords,
|
||||
explicit_lod, offsets,
|
||||
texel_out);
|
||||
|
||||
if (static_state->target != PIPE_BUFFER) {
|
||||
apply_sampler_swizzle(&bld, texel_out);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
lp_build_sample_common(&bld, unit,
|
||||
&s, &t, &r,
|
||||
derivs, lod_bias, explicit_lod,
|
||||
&lod_ipart, &lod_fpart,
|
||||
@@ -1602,7 +1573,7 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
}
|
||||
if (use_aos) {
|
||||
/* do sampling/filtering with fixed pt arithmetic */
|
||||
lp_build_sample_aos(&bld, sampler_index,
|
||||
lp_build_sample_aos(&bld, unit,
|
||||
s, t, r,
|
||||
lod_ipart, lod_fpart,
|
||||
ilevel0, ilevel1,
|
||||
@@ -1610,7 +1581,7 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
}
|
||||
|
||||
else {
|
||||
lp_build_sample_general(&bld, sampler_index,
|
||||
lp_build_sample_general(&bld, unit,
|
||||
s, t, r,
|
||||
lod_ipart, lod_fpart,
|
||||
ilevel0, ilevel1,
|
||||
@@ -1630,8 +1601,7 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
/* Setup our build context */
|
||||
memset(&bld4, 0, sizeof bld4);
|
||||
bld4.gallivm = bld.gallivm;
|
||||
bld4.static_texture_state = bld.static_texture_state;
|
||||
bld4.static_sampler_state = bld.static_sampler_state;
|
||||
bld4.static_state = bld.static_state;
|
||||
bld4.dynamic_state = bld.dynamic_state;
|
||||
bld4.format_desc = bld.format_desc;
|
||||
bld4.dims = bld.dims;
|
||||
@@ -1650,8 +1620,7 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
bld4.float_size_in_type = lp_type_float(32);
|
||||
bld4.float_size_in_type.length = dims > 1 ? 4 : 1;
|
||||
bld4.int_size_in_type = lp_int_type(bld4.float_size_in_type);
|
||||
bld4.texel_type = bld.texel_type;
|
||||
bld4.texel_type.length = 4;
|
||||
bld4.texel_type = type4;
|
||||
bld4.perquadf_type = type4;
|
||||
/* we want native vector size to be able to use our intrinsics */
|
||||
bld4.perquadf_type.length = 1;
|
||||
@@ -1692,7 +1661,7 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
|
||||
if (use_aos) {
|
||||
/* do sampling/filtering with fixed pt arithmetic */
|
||||
lp_build_sample_aos(&bld4, sampler_index,
|
||||
lp_build_sample_aos(&bld4, unit,
|
||||
s4, t4, r4,
|
||||
lod_iparts, lod_fparts,
|
||||
ilevel0s, ilevel1s,
|
||||
@@ -1700,7 +1669,7 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
}
|
||||
|
||||
else {
|
||||
lp_build_sample_general(&bld4, sampler_index,
|
||||
lp_build_sample_general(&bld4, unit,
|
||||
s4, t4, r4,
|
||||
lod_iparts, lod_fparts,
|
||||
ilevel0s, ilevel1s,
|
||||
@@ -1715,33 +1684,19 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
|
||||
texel_out[j] = lp_build_concat(gallivm, texelouttmp[j], type4, num_quads);
|
||||
}
|
||||
}
|
||||
|
||||
lp_build_sample_compare(&bld, coords, texel_out);
|
||||
}
|
||||
|
||||
if (static_texture_state->target != PIPE_BUFFER) {
|
||||
apply_sampler_swizzle(&bld, texel_out);
|
||||
}
|
||||
lp_build_sample_compare(&bld, coords, texel_out);
|
||||
|
||||
/*
|
||||
* texel type can be a (32bit) int/uint (for pure int formats only),
|
||||
* however we are expected to always return floats (storage is untyped).
|
||||
*/
|
||||
if (!bld.texel_type.floating) {
|
||||
unsigned chan;
|
||||
for (chan = 0; chan < 4; chan++) {
|
||||
texel_out[chan] = LLVMBuildBitCast(builder, texel_out[chan],
|
||||
lp_build_vec_type(gallivm, type), "");
|
||||
}
|
||||
}
|
||||
apply_sampler_swizzle(&bld, texel_out);
|
||||
}
|
||||
|
||||
void
|
||||
lp_build_size_query_soa(struct gallivm_state *gallivm,
|
||||
const struct lp_static_texture_state *static_state,
|
||||
const struct lp_sampler_static_state *static_state,
|
||||
struct lp_sampler_dynamic_state *dynamic_state,
|
||||
struct lp_type int_type,
|
||||
unsigned texture_unit,
|
||||
unsigned unit,
|
||||
LLVMValueRef explicit_lod,
|
||||
LLVMValueRef *sizes_out)
|
||||
{
|
||||
@@ -1784,7 +1739,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm,
|
||||
if (explicit_lod) {
|
||||
LLVMValueRef first_level;
|
||||
lod = LLVMBuildExtractElement(gallivm->builder, explicit_lod, lp_build_const_int32(gallivm, 0), "");
|
||||
first_level = dynamic_state->first_level(dynamic_state, gallivm, texture_unit);
|
||||
first_level = dynamic_state->first_level(dynamic_state, gallivm, unit);
|
||||
lod = lp_build_broadcast_scalar(&bld_int_vec,
|
||||
LLVMBuildAdd(gallivm->builder, lod, first_level, "lod"));
|
||||
|
||||
@@ -1795,18 +1750,18 @@ lp_build_size_query_soa(struct gallivm_state *gallivm,
|
||||
size = bld_int_vec.undef;
|
||||
|
||||
size = LLVMBuildInsertElement(gallivm->builder, size,
|
||||
dynamic_state->width(dynamic_state, gallivm, texture_unit),
|
||||
dynamic_state->width(dynamic_state, gallivm, unit),
|
||||
lp_build_const_int32(gallivm, 0), "");
|
||||
|
||||
if (dims >= 2) {
|
||||
size = LLVMBuildInsertElement(gallivm->builder, size,
|
||||
dynamic_state->height(dynamic_state, gallivm, texture_unit),
|
||||
dynamic_state->height(dynamic_state, gallivm, unit),
|
||||
lp_build_const_int32(gallivm, 1), "");
|
||||
}
|
||||
|
||||
if (dims >= 3) {
|
||||
size = LLVMBuildInsertElement(gallivm->builder, size,
|
||||
dynamic_state->depth(dynamic_state, gallivm, texture_unit),
|
||||
dynamic_state->depth(dynamic_state, gallivm, unit),
|
||||
lp_build_const_int32(gallivm, 2), "");
|
||||
}
|
||||
|
||||
@@ -1814,7 +1769,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm,
|
||||
|
||||
if (has_array)
|
||||
size = LLVMBuildInsertElement(gallivm->builder, size,
|
||||
dynamic_state->depth(dynamic_state, gallivm, texture_unit),
|
||||
dynamic_state->depth(dynamic_state, gallivm, unit),
|
||||
lp_build_const_int32(gallivm, dims), "");
|
||||
|
||||
for (i = 0; i < dims + (has_array ? 1 : 0); i++) {
|
||||
|
@@ -173,8 +173,7 @@ struct lp_build_sampler_soa
|
||||
struct gallivm_state *gallivm,
|
||||
struct lp_type type,
|
||||
boolean is_fetch,
|
||||
unsigned texture_index,
|
||||
unsigned sampler_index,
|
||||
unsigned unit,
|
||||
const LLVMValueRef *coords,
|
||||
const LLVMValueRef *offsets,
|
||||
const struct lp_derivatives *derivs,
|
||||
|
@@ -1331,8 +1331,7 @@ emit_tex( struct lp_build_tgsi_soa_context *bld,
|
||||
bld->bld_base.base.gallivm,
|
||||
bld->bld_base.base.type,
|
||||
FALSE,
|
||||
unit, unit,
|
||||
coords,
|
||||
unit, coords,
|
||||
offsets,
|
||||
&derivs,
|
||||
lod_bias, explicit_lod,
|
||||
@@ -1418,8 +1417,7 @@ emit_txf( struct lp_build_tgsi_soa_context *bld,
|
||||
bld->bld_base.base.gallivm,
|
||||
bld->bld_base.base.type,
|
||||
TRUE,
|
||||
unit, unit,
|
||||
coords,
|
||||
unit, coords,
|
||||
offsets,
|
||||
&derivs,
|
||||
NULL, explicit_lod,
|
||||
|
1
src/gallium/auxiliary/pipe-loader/.gitignore
vendored
Normal file
1
src/gallium/auxiliary/pipe-loader/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/Makefile
|
@@ -7,6 +7,8 @@ AM_CPPFLAGS = $(DEFINES) \
|
||||
-I$(top_srcdir)/src/gallium/auxiliary \
|
||||
-I$(top_srcdir)/src/gallium/winsys
|
||||
|
||||
AM_CFLAGS = $(PIC_FLAGS)
|
||||
|
||||
noinst_LTLIBRARIES =
|
||||
|
||||
if HAVE_LOADER_GALLIUM
|
||||
@@ -20,6 +22,17 @@ libpipe_loader_la_SOURCES = \
|
||||
|
||||
if HAVE_DRM_LOADER_GALLIUM
|
||||
libpipe_loader_la_SOURCES += pipe_loader_drm.c
|
||||
AM_CFLAGS = $(LIBDRM_CFLAGS)
|
||||
AM_CFLAGS += $(LIBDRM_CFLAGS)
|
||||
endif
|
||||
|
||||
# Provide compatibility with scripts for the old Mesa build system for
|
||||
# a while by putting a link to the library in the current directory.
|
||||
all-local: libpipe_loader.la
|
||||
ln -f .libs/libpipe_loader.a .
|
||||
|
||||
clean-local:
|
||||
rm -f libpipe_loader.a
|
||||
endif
|
||||
|
||||
# FIXME: Remove when the rest of Gallium is converted to automake.
|
||||
default: all
|
||||
|
18
src/gallium/auxiliary/pipebuffer/Makefile
Normal file
18
src/gallium/auxiliary/pipebuffer/Makefile
Normal file
@@ -0,0 +1,18 @@
|
||||
TOP = ../../../..
|
||||
include $(TOP)/configs/current
|
||||
|
||||
LIBNAME = pipebuffer
|
||||
|
||||
C_SOURCES = \
|
||||
pb_buffer_fenced.c \
|
||||
pb_buffer_malloc.c \
|
||||
pb_bufmgr_alt.c \
|
||||
pb_bufmgr_cache.c \
|
||||
pb_bufmgr_debug.c \
|
||||
pb_bufmgr_mm.c \
|
||||
pb_bufmgr_ondemand.c \
|
||||
pb_bufmgr_pool.c \
|
||||
pb_bufmgr_slab.c \
|
||||
pb_validate.c
|
||||
|
||||
include ../../Makefile.template
|
1077
src/gallium/auxiliary/rtasm/rtasm_ppc.c
Normal file
1077
src/gallium/auxiliary/rtasm/rtasm_ppc.c
Normal file
File diff suppressed because it is too large
Load Diff
342
src/gallium/auxiliary/rtasm/rtasm_ppc.h
Normal file
342
src/gallium/auxiliary/rtasm/rtasm_ppc.h
Normal file
@@ -0,0 +1,342 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright (C) 2008 Tungsten Graphics, Inc. All Rights Reserved.
|
||||
* Copyright (C) 2009 VMware, 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 and this permission notice 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
|
||||
* BRIAN PAUL 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
/**
|
||||
* PPC code generation.
|
||||
* \author Brian Paul
|
||||
*/
|
||||
|
||||
|
||||
#ifndef RTASM_PPC_H
|
||||
#define RTASM_PPC_H
|
||||
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
|
||||
|
||||
#define PPC_INST_SIZE 4 /**< 4 bytes / instruction */
|
||||
|
||||
#define PPC_NUM_REGS 32
|
||||
#define PPC_NUM_FP_REGS 32
|
||||
#define PPC_NUM_VEC_REGS 32
|
||||
|
||||
/** Stack pointer register */
|
||||
#define PPC_REG_SP 1
|
||||
|
||||
/** Branch conditions */
|
||||
#define BRANCH_COND_ALWAYS 0x14 /* binary 1z1zz (z=ignored) */
|
||||
|
||||
/** Branch hints */
|
||||
#define BRANCH_HINT_SUB_RETURN 0x0 /* binary 00 */
|
||||
|
||||
|
||||
struct ppc_function
|
||||
{
|
||||
uint32_t *store; /**< instruction buffer */
|
||||
uint num_inst;
|
||||
uint max_inst;
|
||||
uint32_t reg_used; /** used/free general-purpose registers bitmask */
|
||||
uint32_t fp_used; /** used/free floating point registers bitmask */
|
||||
uint32_t vec_used; /** used/free vector registers bitmask */
|
||||
int indent;
|
||||
boolean print;
|
||||
};
|
||||
|
||||
|
||||
|
||||
extern void ppc_init_func(struct ppc_function *p);
|
||||
extern void ppc_release_func(struct ppc_function *p);
|
||||
extern uint ppc_num_instructions(const struct ppc_function *p);
|
||||
extern void (*ppc_get_func( struct ppc_function *p ))( void );
|
||||
extern void ppc_dump_func(const struct ppc_function *p);
|
||||
|
||||
extern void ppc_print_code(struct ppc_function *p, boolean enable);
|
||||
extern void ppc_indent(struct ppc_function *p, int spaces);
|
||||
extern void ppc_comment(struct ppc_function *p, int rel_indent, const char *s);
|
||||
|
||||
extern int ppc_reserve_register(struct ppc_function *p, int reg);
|
||||
extern int ppc_allocate_register(struct ppc_function *p);
|
||||
extern void ppc_release_register(struct ppc_function *p, int reg);
|
||||
extern int ppc_allocate_fp_register(struct ppc_function *p);
|
||||
extern void ppc_release_fp_register(struct ppc_function *p, int reg);
|
||||
extern int ppc_allocate_vec_register(struct ppc_function *p);
|
||||
extern void ppc_release_vec_register(struct ppc_function *p, int reg);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
** float vector arithmetic
|
||||
**/
|
||||
|
||||
/** vector float add */
|
||||
extern void
|
||||
ppc_vaddfp(struct ppc_function *p,uint vD, uint vA, uint vB);
|
||||
|
||||
/** vector float substract */
|
||||
extern void
|
||||
ppc_vsubfp(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
||||
/** vector float min */
|
||||
extern void
|
||||
ppc_vminfp(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
||||
/** vector float max */
|
||||
extern void
|
||||
ppc_vmaxfp(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
||||
/** vector float mult add: vD = vA * vB + vC */
|
||||
extern void
|
||||
ppc_vmaddfp(struct ppc_function *p, uint vD, uint vA, uint vB, uint vC);
|
||||
|
||||
/** vector float negative mult subtract: vD = vA - vB * vC */
|
||||
extern void
|
||||
ppc_vnmsubfp(struct ppc_function *p, uint vD, uint vA, uint vB, uint vC);
|
||||
|
||||
/** vector float compare greater than */
|
||||
extern void
|
||||
ppc_vcmpgtfpx(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
||||
/** vector float compare greater than or equal to */
|
||||
extern void
|
||||
ppc_vcmpgefpx(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
||||
/** vector float compare equal */
|
||||
extern void
|
||||
ppc_vcmpeqfpx(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
||||
/** vector float 2^x */
|
||||
extern void
|
||||
ppc_vexptefp(struct ppc_function *p, uint vD, uint vB);
|
||||
|
||||
/** vector float log2(x) */
|
||||
extern void
|
||||
ppc_vlogefp(struct ppc_function *p, uint vD, uint vB);
|
||||
|
||||
/** vector float reciprocol */
|
||||
extern void
|
||||
ppc_vrefp(struct ppc_function *p, uint vD, uint vB);
|
||||
|
||||
/** vector float reciprocol sqrt estimate */
|
||||
extern void
|
||||
ppc_vrsqrtefp(struct ppc_function *p, uint vD, uint vB);
|
||||
|
||||
/** vector float round to negative infinity */
|
||||
extern void
|
||||
ppc_vrfim(struct ppc_function *p, uint vD, uint vB);
|
||||
|
||||
/** vector float round to positive infinity */
|
||||
extern void
|
||||
ppc_vrfip(struct ppc_function *p, uint vD, uint vB);
|
||||
|
||||
/** vector float round to nearest int */
|
||||
extern void
|
||||
ppc_vrfin(struct ppc_function *p, uint vD, uint vB);
|
||||
|
||||
/** vector float round to int toward zero */
|
||||
extern void
|
||||
ppc_vrfiz(struct ppc_function *p, uint vD, uint vB);
|
||||
|
||||
|
||||
/** vector store: store vR at mem[vA+vB] */
|
||||
extern void
|
||||
ppc_stvx(struct ppc_function *p, uint vR, uint vA, uint vB);
|
||||
|
||||
/** vector load: vR = mem[vA+vB] */
|
||||
extern void
|
||||
ppc_lvx(struct ppc_function *p, uint vR, uint vA, uint vB);
|
||||
|
||||
/** load vector element word: vR = mem_word[vA+vB] */
|
||||
extern void
|
||||
ppc_lvewx(struct ppc_function *p, uint vR, uint vA, uint vB);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
** vector bitwise operations
|
||||
**/
|
||||
|
||||
|
||||
/** vector and */
|
||||
extern void
|
||||
ppc_vand(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
||||
/** vector and complement */
|
||||
extern void
|
||||
ppc_vandc(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
||||
/** vector or */
|
||||
extern void
|
||||
ppc_vor(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
||||
/** vector nor */
|
||||
extern void
|
||||
ppc_vnor(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
||||
/** vector xor */
|
||||
extern void
|
||||
ppc_vxor(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
||||
/** Pseudo-instruction: vector move */
|
||||
extern void
|
||||
ppc_vmove(struct ppc_function *p, uint vD, uint vA);
|
||||
|
||||
/** Set vector register to {0,0,0,0} */
|
||||
extern void
|
||||
ppc_vzero(struct ppc_function *p, uint vr);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
** Vector shuffle / select / splat / etc
|
||||
**/
|
||||
|
||||
/** vector permute */
|
||||
extern void
|
||||
ppc_vperm(struct ppc_function *p, uint vD, uint vA, uint vB, uint vC);
|
||||
|
||||
/** vector select */
|
||||
extern void
|
||||
ppc_vsel(struct ppc_function *p, uint vD, uint vA, uint vB, uint vC);
|
||||
|
||||
/** vector splat byte */
|
||||
extern void
|
||||
ppc_vspltb(struct ppc_function *p, uint vD, uint vB, uint imm);
|
||||
|
||||
/** vector splat half word */
|
||||
extern void
|
||||
ppc_vsplthw(struct ppc_function *p, uint vD, uint vB, uint imm);
|
||||
|
||||
/** vector splat word */
|
||||
extern void
|
||||
ppc_vspltw(struct ppc_function *p, uint vD, uint vB, uint imm);
|
||||
|
||||
/** vector splat signed immediate word */
|
||||
extern void
|
||||
ppc_vspltisw(struct ppc_function *p, uint vD, int imm);
|
||||
|
||||
/** vector shift left word: vD[word] = vA[word] << (vB[word] & 0x1f) */
|
||||
extern void
|
||||
ppc_vslw(struct ppc_function *p, uint vD, uint vA, uint vB);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
** scalar arithmetic
|
||||
**/
|
||||
|
||||
extern void
|
||||
ppc_add(struct ppc_function *p, uint rt, uint ra, uint rb);
|
||||
|
||||
extern void
|
||||
ppc_addi(struct ppc_function *p, uint rt, uint ra, int imm);
|
||||
|
||||
extern void
|
||||
ppc_addis(struct ppc_function *p, uint rt, uint ra, int imm);
|
||||
|
||||
extern void
|
||||
ppc_and(struct ppc_function *p, uint rt, uint ra, uint rb);
|
||||
|
||||
extern void
|
||||
ppc_andi(struct ppc_function *p, uint rt, uint ra, int imm);
|
||||
|
||||
extern void
|
||||
ppc_or(struct ppc_function *p, uint rt, uint ra, uint rb);
|
||||
|
||||
extern void
|
||||
ppc_ori(struct ppc_function *p, uint rt, uint ra, int imm);
|
||||
|
||||
extern void
|
||||
ppc_xor(struct ppc_function *p, uint rt, uint ra, uint rb);
|
||||
|
||||
extern void
|
||||
ppc_xori(struct ppc_function *p, uint rt, uint ra, int imm);
|
||||
|
||||
extern void
|
||||
ppc_mr(struct ppc_function *p, uint rt, uint ra);
|
||||
|
||||
extern void
|
||||
ppc_li(struct ppc_function *p, uint rt, int imm);
|
||||
|
||||
extern void
|
||||
ppc_lis(struct ppc_function *p, uint rt, int imm);
|
||||
|
||||
extern void
|
||||
ppc_load_int(struct ppc_function *p, uint rt, int imm);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
** scalar load/store
|
||||
**/
|
||||
|
||||
extern void
|
||||
ppc_stwu(struct ppc_function *p, uint rs, uint ra, int d);
|
||||
|
||||
extern void
|
||||
ppc_stw(struct ppc_function *p, uint rs, uint ra, int d);
|
||||
|
||||
extern void
|
||||
ppc_lwz(struct ppc_function *p, uint rs, uint ra, int d);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
** Float (non-vector) arithmetic
|
||||
**/
|
||||
|
||||
extern void
|
||||
ppc_fadd(struct ppc_function *p, uint frt, uint fra, uint frb);
|
||||
|
||||
extern void
|
||||
ppc_fsub(struct ppc_function *p, uint frt, uint fra, uint frb);
|
||||
|
||||
extern void
|
||||
ppc_fctiwz(struct ppc_function *p, uint rt, uint ra);
|
||||
|
||||
extern void
|
||||
ppc_stfs(struct ppc_function *p, uint frs, uint ra, int offset);
|
||||
|
||||
extern void
|
||||
ppc_stfiwx(struct ppc_function *p, uint frs, uint ra, uint rb);
|
||||
|
||||
extern void
|
||||
ppc_lfs(struct ppc_function *p, uint frt, uint ra, int offset);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
** branch instructions
|
||||
**/
|
||||
|
||||
extern void
|
||||
ppc_blr(struct ppc_function *p);
|
||||
|
||||
void
|
||||
ppc_bclr(struct ppc_function *p, uint condOp, uint branchHint, uint condReg);
|
||||
|
||||
extern void
|
||||
ppc_return(struct ppc_function *p);
|
||||
|
||||
|
||||
#endif /* RTASM_PPC_H */
|
1359
src/gallium/auxiliary/tgsi/tgsi_ppc.c
Normal file
1359
src/gallium/auxiliary/tgsi/tgsi_ppc.c
Normal file
File diff suppressed because it is too large
Load Diff
51
src/gallium/auxiliary/tgsi/tgsi_ppc.h
Normal file
51
src/gallium/auxiliary/tgsi/tgsi_ppc.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* 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, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef TGSI_PPC_H
|
||||
#define TGSI_PPC_H
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct tgsi_token;
|
||||
struct ppc_function;
|
||||
|
||||
extern const float ppc_builtin_constants[];
|
||||
|
||||
|
||||
boolean
|
||||
tgsi_emit_ppc(const struct tgsi_token *tokens,
|
||||
struct ppc_function *function,
|
||||
float (*immediates)[4],
|
||||
boolean do_swizzles);
|
||||
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TGSI_PPC_H */
|
@@ -1816,8 +1816,7 @@ void util_blitter_custom_color(struct blitter_context *blitter,
|
||||
blitter_disable_render_cond(ctx);
|
||||
|
||||
/* bind states */
|
||||
pipe->bind_blend_state(pipe, custom_blend ? custom_blend
|
||||
: ctx->blend[PIPE_MASK_RGBA]);
|
||||
pipe->bind_blend_state(pipe, custom_blend);
|
||||
pipe->bind_depth_stencil_alpha_state(pipe, ctx->dsa_keep_depth_stencil);
|
||||
ctx->bind_fs_state(pipe, blitter_get_fs_col(ctx, 1, FALSE));
|
||||
pipe->bind_vertex_elements_state(pipe, ctx->velem_state);
|
||||
|
@@ -232,7 +232,7 @@ debug_get_flags_option(const char *name,
|
||||
unsigned long result;
|
||||
const char *str;
|
||||
const struct debug_named_value *orig = flags;
|
||||
unsigned namealign = 0;
|
||||
int namealign = 0;
|
||||
|
||||
str = os_get_option(name);
|
||||
if(!str)
|
||||
@@ -386,10 +386,6 @@ static const struct debug_named_value pipe_prim_names[] = {
|
||||
DEBUG_NAMED_VALUE(PIPE_PRIM_QUADS),
|
||||
DEBUG_NAMED_VALUE(PIPE_PRIM_QUAD_STRIP),
|
||||
DEBUG_NAMED_VALUE(PIPE_PRIM_POLYGON),
|
||||
DEBUG_NAMED_VALUE(PIPE_PRIM_LINES_ADJACENCY),
|
||||
DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_STRIP_ADJACENCY),
|
||||
DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLES_ADJACENCY),
|
||||
DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY),
|
||||
#endif
|
||||
DEBUG_NAMED_VALUE_END
|
||||
};
|
||||
|
@@ -52,7 +52,6 @@ union util_color {
|
||||
ubyte ub;
|
||||
ushort us;
|
||||
uint ui;
|
||||
ushort h[4]; /* half float */
|
||||
float f[4];
|
||||
double d[4];
|
||||
};
|
||||
@@ -330,8 +329,6 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc,
|
||||
|
||||
/**
|
||||
* Note rgba outside [0,1] will be clamped for int pixel formats.
|
||||
* This will not work (and might not really be useful with float input)
|
||||
* for pure integer formats (which lack the pack_rgba_float function).
|
||||
*/
|
||||
static INLINE void
|
||||
util_pack_color(const float rgba[4], enum pipe_format format, union util_color *uc)
|
||||
|
@@ -316,39 +316,13 @@ util_make_fragment_tex_shader_writestencil(struct pipe_context *pipe,
|
||||
|
||||
|
||||
/**
|
||||
* Make simple fragment color pass-through shader that replicates OUT[0]
|
||||
* to all bound colorbuffers.
|
||||
* Make simple fragment color pass-through shader.
|
||||
*/
|
||||
void *
|
||||
util_make_fragment_passthrough_shader(struct pipe_context *pipe,
|
||||
int input_semantic,
|
||||
int input_interpolate)
|
||||
util_make_fragment_passthrough_shader(struct pipe_context *pipe)
|
||||
{
|
||||
static const char shader_templ[] =
|
||||
"FRAG\n"
|
||||
"PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1\n"
|
||||
"DCL IN[0], %s[0], %s\n"
|
||||
"DCL OUT[0], COLOR[0]\n"
|
||||
|
||||
"MOV OUT[0], IN[0]\n"
|
||||
"END\n";
|
||||
|
||||
char text[sizeof(shader_templ)+100];
|
||||
struct tgsi_token tokens[1000];
|
||||
struct pipe_shader_state state = {tokens};
|
||||
|
||||
sprintf(text, shader_templ, tgsi_semantic_names[input_semantic],
|
||||
tgsi_interpolate_names[input_interpolate]);
|
||||
|
||||
if (!tgsi_text_translate(text, tokens, Elements(tokens))) {
|
||||
assert(0);
|
||||
return NULL;
|
||||
}
|
||||
#if 0
|
||||
tgsi_dump(state.tokens, 0);
|
||||
#endif
|
||||
|
||||
return pipe->create_fs_state(pipe, &state);
|
||||
return util_make_fragment_cloneinput_shader(pipe, 1, TGSI_SEMANTIC_COLOR,
|
||||
TGSI_INTERPOLATE_PERSPECTIVE);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -87,9 +87,7 @@ util_make_fragment_tex_shader_writestencil(struct pipe_context *pipe,
|
||||
|
||||
|
||||
extern void *
|
||||
util_make_fragment_passthrough_shader(struct pipe_context *pipe,
|
||||
int input_semantic,
|
||||
int input_interpolate);
|
||||
util_make_fragment_passthrough_shader(struct pipe_context *pipe);
|
||||
|
||||
|
||||
extern void *
|
||||
|
@@ -421,10 +421,10 @@ util_clear_depth_stencil(struct pipe_context *pipe,
|
||||
else {
|
||||
uint32_t dst_mask;
|
||||
if (format == PIPE_FORMAT_Z24_UNORM_S8_UINT)
|
||||
dst_mask = 0x00ffffff;
|
||||
dst_mask = 0xffffff00;
|
||||
else {
|
||||
assert(format == PIPE_FORMAT_S8_UINT_Z24_UNORM);
|
||||
dst_mask = 0xffffff00;
|
||||
dst_mask = 0xffffff;
|
||||
}
|
||||
if (clear_flags & PIPE_CLEAR_DEPTH)
|
||||
dst_mask = ~dst_mask;
|
||||
|
@@ -806,7 +806,7 @@ pipe_put_tile_z(struct pipe_transfer *pt,
|
||||
for (j = 0; j < w; j++) {
|
||||
/* convert 32-bit integer Z to float Z */
|
||||
const double scale = 1.0 / 0xffffffffU;
|
||||
pDest[j] = (float) (ptrc[j] * scale);
|
||||
pDest[j] = ptrc[j] * scale;
|
||||
}
|
||||
pDest += pt->stride/4;
|
||||
ptrc += srcStride;
|
||||
@@ -820,7 +820,7 @@ pipe_put_tile_z(struct pipe_transfer *pt,
|
||||
for (j = 0; j < w; j++) {
|
||||
/* convert 32-bit integer Z to float Z */
|
||||
const double scale = 1.0 / 0xffffffffU;
|
||||
pDest[j*2] = (float) (ptrc[j] * scale);
|
||||
pDest[j*2] = ptrc[j] * scale;
|
||||
}
|
||||
pDest += pt->stride/4;
|
||||
ptrc += srcStride;
|
||||
|
@@ -45,13 +45,13 @@ struct pipe_transfer;
|
||||
static INLINE boolean
|
||||
u_clip_tile(uint x, uint y, uint *w, uint *h, const struct pipe_box *box)
|
||||
{
|
||||
if ((int) x >= box->width)
|
||||
if (x >= box->width)
|
||||
return TRUE;
|
||||
if ((int) y >= box->height)
|
||||
if (y >= box->height)
|
||||
return TRUE;
|
||||
if ((int) (x + *w) > box->width)
|
||||
if (x + *w > box->width)
|
||||
*w = box->width - x;
|
||||
if ((int) (y + *h) > box->height)
|
||||
if (y + *h > box->height)
|
||||
*h = box->height - y;
|
||||
return FALSE;
|
||||
}
|
||||
|
@@ -163,13 +163,6 @@ enum pipe_error u_upload_alloc( struct u_upload_mgr *upload,
|
||||
unsigned alloc_offset = align(min_out_offset, upload->alignment);
|
||||
unsigned offset;
|
||||
|
||||
/* Init these return values here in case we fail below to make
|
||||
* sure the caller doesn't get garbage values.
|
||||
*/
|
||||
*out_offset = ~0;
|
||||
pipe_resource_reference(outbuf, NULL);
|
||||
*ptr = NULL;
|
||||
|
||||
/* Make sure we have enough space in the upload buffer
|
||||
* for the sub-allocation. */
|
||||
if (MAX2(upload->offset, alloc_offset) + alloc_size > upload->size) {
|
||||
@@ -189,6 +182,8 @@ enum pipe_error u_upload_alloc( struct u_upload_mgr *upload,
|
||||
PIPE_TRANSFER_UNSYNCHRONIZED,
|
||||
&upload->transfer);
|
||||
if (!upload->map) {
|
||||
pipe_resource_reference(outbuf, NULL);
|
||||
*ptr = NULL;
|
||||
upload->transfer = NULL;
|
||||
return PIPE_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
@@ -323,7 +323,7 @@ void u_vbuf_destroy(struct u_vbuf *mgr)
|
||||
FREE(mgr);
|
||||
}
|
||||
|
||||
static enum pipe_error
|
||||
static void
|
||||
u_vbuf_translate_buffers(struct u_vbuf *mgr, struct translate_key *key,
|
||||
unsigned vb_mask, unsigned out_vb,
|
||||
int start_vertex, unsigned num_vertices,
|
||||
@@ -335,7 +335,6 @@ u_vbuf_translate_buffers(struct u_vbuf *mgr, struct translate_key *key,
|
||||
struct pipe_resource *out_buffer = NULL;
|
||||
uint8_t *out_map;
|
||||
unsigned out_offset, mask;
|
||||
enum pipe_error err;
|
||||
|
||||
/* Get a translate object. */
|
||||
tr = translate_cache_find(mgr->translate_cache, key);
|
||||
@@ -382,14 +381,6 @@ u_vbuf_translate_buffers(struct u_vbuf *mgr, struct translate_key *key,
|
||||
|
||||
assert((ib->buffer || ib->user_buffer) && ib->index_size);
|
||||
|
||||
/* Create and map the output buffer. */
|
||||
err = u_upload_alloc(mgr->uploader, 0,
|
||||
key->output_stride * num_indices,
|
||||
&out_offset, &out_buffer,
|
||||
(void**)&out_map);
|
||||
if (err != PIPE_OK)
|
||||
return err;
|
||||
|
||||
if (ib->user_buffer) {
|
||||
map = (uint8_t*)ib->user_buffer + offset;
|
||||
} else {
|
||||
@@ -398,6 +389,12 @@ u_vbuf_translate_buffers(struct u_vbuf *mgr, struct translate_key *key,
|
||||
PIPE_TRANSFER_READ, &transfer);
|
||||
}
|
||||
|
||||
/* Create and map the output buffer. */
|
||||
u_upload_alloc(mgr->uploader, 0,
|
||||
key->output_stride * num_indices,
|
||||
&out_offset, &out_buffer,
|
||||
(void**)&out_map);
|
||||
|
||||
switch (ib->index_size) {
|
||||
case 4:
|
||||
tr->run_elts(tr, (unsigned*)map, num_indices, 0, out_map);
|
||||
@@ -415,13 +412,11 @@ u_vbuf_translate_buffers(struct u_vbuf *mgr, struct translate_key *key,
|
||||
}
|
||||
} else {
|
||||
/* Create and map the output buffer. */
|
||||
err = u_upload_alloc(mgr->uploader,
|
||||
key->output_stride * start_vertex,
|
||||
key->output_stride * num_vertices,
|
||||
&out_offset, &out_buffer,
|
||||
(void**)&out_map);
|
||||
if (err != PIPE_OK)
|
||||
return err;
|
||||
u_upload_alloc(mgr->uploader,
|
||||
key->output_stride * start_vertex,
|
||||
key->output_stride * num_vertices,
|
||||
&out_offset, &out_buffer,
|
||||
(void**)&out_map);
|
||||
|
||||
out_offset -= key->output_stride * start_vertex;
|
||||
|
||||
@@ -446,8 +441,6 @@ u_vbuf_translate_buffers(struct u_vbuf *mgr, struct translate_key *key,
|
||||
pipe_resource_reference(
|
||||
&mgr->real_vertex_buffer[out_vb].buffer, NULL);
|
||||
mgr->real_vertex_buffer[out_vb].buffer = out_buffer;
|
||||
|
||||
return PIPE_OK;
|
||||
}
|
||||
|
||||
static boolean
|
||||
@@ -595,14 +588,11 @@ u_vbuf_translate_begin(struct u_vbuf *mgr,
|
||||
/* Translate buffers. */
|
||||
for (type = 0; type < VB_NUM; type++) {
|
||||
if (key[type].nr_elements) {
|
||||
enum pipe_error err;
|
||||
err = u_vbuf_translate_buffers(mgr, &key[type], mask[type],
|
||||
mgr->fallback_vbs[type],
|
||||
start[type], num[type],
|
||||
start_index, num_indices, min_index,
|
||||
unroll_indices && type == VB_VERTEX);
|
||||
if (err != PIPE_OK)
|
||||
return FALSE;
|
||||
u_vbuf_translate_buffers(mgr, &key[type], mask[type],
|
||||
mgr->fallback_vbs[type],
|
||||
start[type], num[type],
|
||||
start_index, num_indices, min_index,
|
||||
unroll_indices && type == VB_VERTEX);
|
||||
|
||||
/* Fixup the stride for constant attribs. */
|
||||
if (type == VB_CONST) {
|
||||
@@ -894,7 +884,7 @@ void u_vbuf_set_index_buffer(struct u_vbuf *mgr,
|
||||
pipe->set_index_buffer(pipe, ib);
|
||||
}
|
||||
|
||||
static enum pipe_error
|
||||
static void
|
||||
u_vbuf_upload_buffers(struct u_vbuf *mgr,
|
||||
int start_vertex, unsigned num_vertices,
|
||||
int start_instance, unsigned num_instances)
|
||||
@@ -963,7 +953,6 @@ u_vbuf_upload_buffers(struct u_vbuf *mgr,
|
||||
unsigned start, end;
|
||||
struct pipe_vertex_buffer *real_vb;
|
||||
const uint8_t *ptr;
|
||||
enum pipe_error err;
|
||||
|
||||
i = u_bit_scan(&buffer_mask);
|
||||
|
||||
@@ -974,15 +963,11 @@ u_vbuf_upload_buffers(struct u_vbuf *mgr,
|
||||
real_vb = &mgr->real_vertex_buffer[i];
|
||||
ptr = mgr->vertex_buffer[i].user_buffer;
|
||||
|
||||
err = u_upload_data(mgr->uploader, start, end - start, ptr + start,
|
||||
&real_vb->buffer_offset, &real_vb->buffer);
|
||||
if (err != PIPE_OK)
|
||||
return err;
|
||||
u_upload_data(mgr->uploader, start, end - start, ptr + start,
|
||||
&real_vb->buffer_offset, &real_vb->buffer);
|
||||
|
||||
real_vb->buffer_offset -= start;
|
||||
}
|
||||
|
||||
return PIPE_OK;
|
||||
}
|
||||
|
||||
static boolean u_vbuf_need_minmax_index(struct u_vbuf *mgr)
|
||||
@@ -1191,13 +1176,11 @@ void u_vbuf_draw_vbo(struct u_vbuf *mgr, const struct pipe_draw_info *info)
|
||||
if (unroll_indices ||
|
||||
incompatible_vb_mask ||
|
||||
mgr->ve->incompatible_elem_mask) {
|
||||
if (!u_vbuf_translate_begin(mgr, start_vertex, num_vertices,
|
||||
info->start_instance, info->instance_count,
|
||||
info->start, info->count, min_index,
|
||||
unroll_indices)) {
|
||||
debug_warn_once("u_vbuf_translate_begin() failed");
|
||||
return;
|
||||
}
|
||||
/* XXX check the return value */
|
||||
u_vbuf_translate_begin(mgr, start_vertex, num_vertices,
|
||||
info->start_instance, info->instance_count,
|
||||
info->start, info->count, min_index,
|
||||
unroll_indices);
|
||||
|
||||
user_vb_mask &= ~(incompatible_vb_mask |
|
||||
mgr->ve->incompatible_vb_mask_all);
|
||||
@@ -1205,13 +1188,8 @@ void u_vbuf_draw_vbo(struct u_vbuf *mgr, const struct pipe_draw_info *info)
|
||||
|
||||
/* Upload user buffers. */
|
||||
if (user_vb_mask) {
|
||||
if (u_vbuf_upload_buffers(mgr, start_vertex, num_vertices,
|
||||
info->start_instance,
|
||||
info->instance_count) != PIPE_OK) {
|
||||
debug_warn_once("u_vbuf_upload_buffers() failed");
|
||||
return;
|
||||
}
|
||||
|
||||
u_vbuf_upload_buffers(mgr, start_vertex, num_vertices,
|
||||
info->start_instance, info->instance_count);
|
||||
mgr->dirty_real_vb_mask |= user_vb_mask;
|
||||
}
|
||||
|
||||
|
@@ -199,15 +199,13 @@ create_frag_shader_weave(struct vl_compositor *c)
|
||||
|
||||
/* calculate the texture offsets
|
||||
* t_tc.x = i_tc.x
|
||||
* t_tc.y = (round(i_tc.y - 0.5) + 0.5) / height * 2
|
||||
* t_tc.y = (round(i_tc.y) + 0.5) / height * 2
|
||||
*/
|
||||
for (i = 0; i < 2; ++i) {
|
||||
ureg_MOV(shader, ureg_writemask(t_tc[i], TGSI_WRITEMASK_X), i_tc[i]);
|
||||
ureg_SUB(shader, ureg_writemask(t_tc[i], TGSI_WRITEMASK_YZ),
|
||||
i_tc[i], ureg_imm1f(shader, 0.5f));
|
||||
ureg_ROUND(shader, ureg_writemask(t_tc[i], TGSI_WRITEMASK_YZ), ureg_src(t_tc[i]));
|
||||
ureg_ROUND(shader, ureg_writemask(t_tc[i], TGSI_WRITEMASK_YZ), i_tc[i]);
|
||||
ureg_MOV(shader, ureg_writemask(t_tc[i], TGSI_WRITEMASK_W),
|
||||
ureg_imm1f(shader, i ? -0.25f : 0.25f));
|
||||
ureg_imm1f(shader, i ? 0.75f : 0.25f));
|
||||
ureg_ADD(shader, ureg_writemask(t_tc[i], TGSI_WRITEMASK_YZ),
|
||||
ureg_src(t_tc[i]), ureg_imm1f(shader, 0.5f));
|
||||
ureg_MUL(shader, ureg_writemask(t_tc[i], TGSI_WRITEMASK_Y),
|
||||
@@ -236,11 +234,11 @@ create_frag_shader_weave(struct vl_compositor *c)
|
||||
ureg_ROUND(shader, ureg_writemask(t_tc[0], TGSI_WRITEMASK_YZ), i_tc[0]);
|
||||
ureg_ADD(shader, ureg_writemask(t_tc[0], TGSI_WRITEMASK_YZ),
|
||||
ureg_src(t_tc[0]), ureg_negate(i_tc[0]));
|
||||
ureg_MUL(shader, ureg_writemask(t_tc[0], TGSI_WRITEMASK_YZ),
|
||||
ureg_MUL(shader, ureg_writemask(t_tc[0], TGSI_WRITEMASK_XY),
|
||||
ureg_abs(ureg_src(t_tc[0])), ureg_imm1f(shader, 2.0f));
|
||||
ureg_LRP(shader, t_texel[0], ureg_swizzle(ureg_src(t_tc[0]),
|
||||
TGSI_SWIZZLE_Y, TGSI_SWIZZLE_Z, TGSI_SWIZZLE_Z, TGSI_SWIZZLE_Z),
|
||||
ureg_src(t_texel[0]), ureg_src(t_texel[1]));
|
||||
ureg_src(t_texel[1]), ureg_src(t_texel[0]));
|
||||
|
||||
/* and finally do colour space transformation
|
||||
* fragment = csc * texel
|
||||
|
@@ -356,20 +356,20 @@ vl_video_buffer_surfaces(struct pipe_video_buffer *buffer)
|
||||
pipe = buf->base.context;
|
||||
|
||||
depth = buffer->interlaced ? 2 : 1;
|
||||
for (i = 0, surf = 0; i < VL_NUM_COMPONENTS; ++i) {
|
||||
for (j = 0; j < depth; ++j, ++surf) {
|
||||
for (i = 0, surf = 0; i < depth; ++i ) {
|
||||
for (j = 0; j < VL_NUM_COMPONENTS; ++j, ++surf) {
|
||||
assert(surf < (VL_NUM_COMPONENTS * 2));
|
||||
|
||||
if (!buf->resources[i]) {
|
||||
if (!buf->resources[j]) {
|
||||
pipe_surface_reference(&buf->surfaces[surf], NULL);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!buf->surfaces[surf]) {
|
||||
memset(&surf_templ, 0, sizeof(surf_templ));
|
||||
surf_templ.format = vl_video_buffer_surface_format(buf->resources[i]->format);
|
||||
surf_templ.u.tex.first_layer = surf_templ.u.tex.last_layer = j;
|
||||
buf->surfaces[surf] = pipe->create_surface(pipe, buf->resources[i], &surf_templ);
|
||||
surf_templ.format = vl_video_buffer_surface_format(buf->resources[j]->format);
|
||||
surf_templ.u.tex.first_layer = surf_templ.u.tex.last_layer = i;
|
||||
buf->surfaces[surf] = pipe->create_surface(pipe, buf->resources[j], &surf_templ);
|
||||
if (!buf->surfaces[surf])
|
||||
goto error;
|
||||
}
|
||||
|
@@ -65,7 +65,7 @@ struct vl_dri_screen
|
||||
xcb_dri2_wait_sbc_cookie_t wait_cookie;
|
||||
xcb_dri2_get_buffers_cookie_t buffers_cookie;
|
||||
|
||||
int64_t last_ust, ns_frame, last_msc, next_msc;
|
||||
int64_t last_ust, ns_frame, last_msc, next_msc, skew_msc;
|
||||
};
|
||||
|
||||
static const unsigned int attachments[1] = { XCB_DRI2_ATTACHMENT_BUFFER_BACK_LEFT };
|
||||
@@ -81,6 +81,9 @@ vl_dri2_handle_stamps(struct vl_dri_screen* scrn,
|
||||
if (scrn->last_ust && scrn->last_msc && (ust > scrn->last_ust) && (msc > scrn->last_msc))
|
||||
scrn->ns_frame = (ust - scrn->last_ust) / (msc - scrn->last_msc);
|
||||
|
||||
if (scrn->next_msc && (scrn->next_msc < msc))
|
||||
scrn->skew_msc++;
|
||||
|
||||
scrn->last_ust = ust;
|
||||
scrn->last_msc = msc;
|
||||
}
|
||||
@@ -279,7 +282,7 @@ vl_screen_set_next_timestamp(struct vl_screen *vscreen, uint64_t stamp)
|
||||
struct vl_dri_screen *scrn = (struct vl_dri_screen*)vscreen;
|
||||
assert(scrn);
|
||||
if (stamp && scrn->last_ust && scrn->ns_frame && scrn->last_msc)
|
||||
scrn->next_msc = ((int64_t)stamp - scrn->last_ust + scrn->ns_frame/2) / scrn->ns_frame + scrn->last_msc;
|
||||
scrn->next_msc = ((int64_t)stamp - scrn->last_ust) / scrn->ns_frame + scrn->last_msc + scrn->skew_msc;
|
||||
else
|
||||
scrn->next_msc = 0;
|
||||
}
|
||||
|
@@ -207,7 +207,8 @@ the framebuffer to particular RGBA, depth, or stencil values.
|
||||
Currently, this does not take into account color or stencil write masks (as
|
||||
used by GL), and always clears the whole surfaces (no scissoring as used by
|
||||
GL clear or explicit rectangles like d3d9 uses). It can, however, also clear
|
||||
only depth or stencil in a combined depth/stencil surface.
|
||||
only depth or stencil in a combined depth/stencil surface, if the driver
|
||||
supports PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE.
|
||||
If a surface includes several layers then all layers will be cleared.
|
||||
|
||||
``clear_render_target`` clears a single color rendertarget with the specified
|
||||
|
@@ -61,6 +61,8 @@ The integer capabilities:
|
||||
* ``PIPE_CAP_INDEP_BLEND_FUNC``: Whether per-rendertarget blend functions are
|
||||
available. If 0, then the first rendertarget's blend functions affect all
|
||||
MRTs.
|
||||
* ``PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE``: Whether clearing only depth or only
|
||||
stencil in a combined depth-stencil buffer is supported.
|
||||
* ``PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS``: The maximum number of texture array
|
||||
layers supported. If 0, the array textures are not supported at all and
|
||||
the ARRAY texture targets are invalid.
|
||||
|
1
src/gallium/drivers/.gitignore
vendored
Normal file
1
src/gallium/drivers/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Makefile
|
@@ -4,21 +4,22 @@ AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/gallium/include \
|
||||
-I$(top_srcdir)/src/gallium/auxiliary \
|
||||
-I$(top_srcdir)/src/gallium/drivers \
|
||||
$(DEFINES)
|
||||
$(DEFINES) \
|
||||
$(PIC_FLAGS)
|
||||
|
||||
AM_CFLAGS = $(VISIBILITY_CFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES =
|
||||
noinst_LIBRARIES =
|
||||
|
||||
SUBDIRS = .
|
||||
SUBDIRS =
|
||||
|
||||
################################################################################
|
||||
|
||||
if HAVE_GALAHAD_GALLIUM
|
||||
|
||||
noinst_LTLIBRARIES += galahad/libgalahad.la
|
||||
noinst_LIBRARIES+= galahad/libgalahad.a
|
||||
|
||||
galahad_libgalahad_la_SOURCES = \
|
||||
galahad_libgalahad_a_SOURCES = \
|
||||
galahad/glhd_objects.c \
|
||||
galahad/glhd_context.c \
|
||||
galahad/glhd_screen.c
|
||||
@@ -29,9 +30,9 @@ endif
|
||||
|
||||
if HAVE_IDENTITY_GALLIUM
|
||||
|
||||
noinst_LTLIBRARIES += identity/libidentity.la
|
||||
noinst_LIBRARIES+= identity/libidentity.a
|
||||
|
||||
identity_libidentity_la_SOURCES = \
|
||||
identity_libidentity_a_SOURCES = \
|
||||
identity/id_objects.c \
|
||||
identity/id_context.c \
|
||||
identity/id_screen.c
|
||||
@@ -45,9 +46,9 @@ if HAVE_NOOP_GALLIUM
|
||||
# Meta-driver which combines whichever software rasterizers have been
|
||||
# built into a single convenience library.
|
||||
|
||||
noinst_LTLIBRARIES += noop/libnoop.la
|
||||
noinst_LIBRARIES+= noop/libnoop.a
|
||||
|
||||
noop_libnoop_la_SOURCES = \
|
||||
noop_libnoop_a_SOURCES = \
|
||||
noop/noop_pipe.c \
|
||||
noop/noop_state.c
|
||||
|
||||
@@ -57,10 +58,14 @@ endif
|
||||
|
||||
if NEED_RADEON_GALLIUM
|
||||
|
||||
SUBDIRS += radeon
|
||||
SUBDIRS+= radeon
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
SUBDIRS += $(GALLIUM_MAKE_DIRS)
|
||||
SUBDIRS+= $(GALLIUM_MAKE_DIRS)
|
||||
|
||||
# FIXME: Remove when the rest of Gallium is converted to automake.
|
||||
default: all
|
||||
|
||||
|
9
src/gallium/drivers/i915/Makefile
Normal file
9
src/gallium/drivers/i915/Makefile
Normal file
@@ -0,0 +1,9 @@
|
||||
TOP = ../../../..
|
||||
include $(TOP)/configs/current
|
||||
|
||||
LIBNAME = i915
|
||||
|
||||
# get C_SOURCES
|
||||
include Makefile.sources
|
||||
|
||||
include ../../Makefile.template
|
@@ -1,33 +0,0 @@
|
||||
# Copyright © 2012 Intel Corporation
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
|
||||
include Makefile.sources
|
||||
include $(top_srcdir)/src/gallium/Automake.inc
|
||||
|
||||
noinst_LTLIBRARIES = libi915.la
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/gallium/drivers \
|
||||
-I$(top_srcdir)/include \
|
||||
$(GALLIUM_CFLAGS)
|
||||
|
||||
libi915_la_SOURCES = $(C_SOURCES)
|
@@ -170,6 +170,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
|
||||
switch (cap) {
|
||||
/* Supported features (boolean caps). */
|
||||
case PIPE_CAP_ANISOTROPIC_FILTER:
|
||||
case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE:
|
||||
case PIPE_CAP_NPOT_TEXTURES:
|
||||
case PIPE_CAP_POINT_SPRITE:
|
||||
case PIPE_CAP_PRIMITIVE_RESTART: /* draw module */
|
||||
|
70
src/gallium/drivers/llvmpipe/Makefile
Normal file
70
src/gallium/drivers/llvmpipe/Makefile
Normal file
@@ -0,0 +1,70 @@
|
||||
TOP = ../../../..
|
||||
include $(TOP)/configs/current
|
||||
|
||||
LIBNAME = llvmpipe
|
||||
|
||||
C_SOURCES = \
|
||||
lp_bld_alpha.c \
|
||||
lp_bld_blend.c \
|
||||
lp_bld_blend_aos.c \
|
||||
lp_bld_blend_logicop.c \
|
||||
lp_bld_depth.c \
|
||||
lp_bld_interp.c \
|
||||
lp_clear.c \
|
||||
lp_context.c \
|
||||
lp_draw_arrays.c \
|
||||
lp_fence.c \
|
||||
lp_flush.c \
|
||||
lp_jit.c \
|
||||
lp_memory.c \
|
||||
lp_perf.c \
|
||||
lp_query.c \
|
||||
lp_rast.c \
|
||||
lp_rast_debug.c \
|
||||
lp_rast_tri.c \
|
||||
lp_scene.c \
|
||||
lp_scene_queue.c \
|
||||
lp_screen.c \
|
||||
lp_setup.c \
|
||||
lp_setup_line.c \
|
||||
lp_setup_point.c \
|
||||
lp_setup_tri.c \
|
||||
lp_setup_vbuf.c \
|
||||
lp_state_blend.c \
|
||||
lp_state_clip.c \
|
||||
lp_state_derived.c \
|
||||
lp_state_fs.c \
|
||||
lp_state_setup.c \
|
||||
lp_state_gs.c \
|
||||
lp_state_rasterizer.c \
|
||||
lp_state_sampler.c \
|
||||
lp_state_so.c \
|
||||
lp_state_surface.c \
|
||||
lp_state_vertex.c \
|
||||
lp_state_vs.c \
|
||||
lp_surface.c \
|
||||
lp_tex_sample.c \
|
||||
lp_texture.c \
|
||||
lp_tile_image.c
|
||||
|
||||
CPP_SOURCES = \
|
||||
|
||||
PROGS := lp_test_format \
|
||||
lp_test_arit \
|
||||
lp_test_blend \
|
||||
lp_test_conv \
|
||||
lp_test_printf
|
||||
|
||||
# Need this for the lp_test_*.o files
|
||||
CLEAN_EXTRA = *.o
|
||||
|
||||
include ../../Makefile.template
|
||||
|
||||
PROGS_DEPS := ../../auxiliary/libgallium.a
|
||||
|
||||
LDFLAGS += $(LLVM_LDFLAGS)
|
||||
LIBS += -L../../auxiliary/ -lgallium libllvmpipe.a $(LLVM_LIBS) $(GL_LIB_DEPS)
|
||||
LD=$(CXX)
|
||||
|
||||
$(PROGS): lp_test_main.o libllvmpipe.a
|
||||
|
@@ -1,114 +0,0 @@
|
||||
# Copyright © 2012 Intel Corporation
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
|
||||
include $(top_srcdir)/src/gallium/Automake.inc
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/gallium/drivers \
|
||||
-I$(top_srcdir)/include \
|
||||
$(GALLIUM_CFLAGS)
|
||||
AM_CFLAGS = $(LLVM_CFLAGS)
|
||||
AM_CXXFLAGS= $(LLVM_CXXFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES = libllvmpipe.la
|
||||
|
||||
libllvmpipe_la_SOURCES = \
|
||||
lp_bld_alpha.c \
|
||||
lp_bld_blend.c \
|
||||
lp_bld_blend_aos.c \
|
||||
lp_bld_blend_logicop.c \
|
||||
lp_bld_depth.c \
|
||||
lp_bld_interp.c \
|
||||
lp_clear.c \
|
||||
lp_context.c \
|
||||
lp_draw_arrays.c \
|
||||
lp_fence.c \
|
||||
lp_flush.c \
|
||||
lp_jit.c \
|
||||
lp_memory.c \
|
||||
lp_perf.c \
|
||||
lp_query.c \
|
||||
lp_rast.c \
|
||||
lp_rast_debug.c \
|
||||
lp_rast_tri.c \
|
||||
lp_scene.c \
|
||||
lp_scene_queue.c \
|
||||
lp_screen.c \
|
||||
lp_setup.c \
|
||||
lp_setup_line.c \
|
||||
lp_setup_point.c \
|
||||
lp_setup_tri.c \
|
||||
lp_setup_vbuf.c \
|
||||
lp_state_blend.c \
|
||||
lp_state_clip.c \
|
||||
lp_state_derived.c \
|
||||
lp_state_fs.c \
|
||||
lp_state_setup.c \
|
||||
lp_state_gs.c \
|
||||
lp_state_rasterizer.c \
|
||||
lp_state_sampler.c \
|
||||
lp_state_so.c \
|
||||
lp_state_surface.c \
|
||||
lp_state_vertex.c \
|
||||
lp_state_vs.c \
|
||||
lp_surface.c \
|
||||
lp_tex_sample.c \
|
||||
lp_texture.c \
|
||||
lp_tile_image.c
|
||||
|
||||
libllvmpipe_la_LDFLAGS = $(LLVM_LDFLAGS)
|
||||
|
||||
check_PROGRAMS = \
|
||||
lp_test_format \
|
||||
lp_test_arit \
|
||||
lp_test_blend \
|
||||
lp_test_conv \
|
||||
lp_test_printf
|
||||
TESTS = $(check_PROGRAMS)
|
||||
|
||||
TEST_LIBS = \
|
||||
libllvmpipe.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
|
||||
$(LLVM_LIBS) \
|
||||
$(DLOPEN_LIBS) \
|
||||
$(PTHREAD_LIBS)
|
||||
|
||||
lp_test_format_SOURCES = lp_test_format.c lp_test_main.c
|
||||
lp_test_format_LDADD = $(TEST_LIBS)
|
||||
nodist_EXTRA_lp_test_format_SOURCES = dummy.cpp
|
||||
|
||||
lp_test_arit_SOURCES = lp_test_arit.c lp_test_main.c
|
||||
lp_test_arit_LDADD = $(TEST_LIBS)
|
||||
nodist_EXTRA_lp_test_arit_SOURCES = dummy.cpp
|
||||
|
||||
lp_test_blend_SOURCES = lp_test_blend.c lp_test_main.c
|
||||
lp_test_blend_LDADD = $(TEST_LIBS)
|
||||
nodist_EXTRA_lp_test_blend_SOURCES = dummy.cpp
|
||||
|
||||
lp_test_conv_SOURCES = lp_test_conv.c lp_test_main.c
|
||||
lp_test_conv_LDADD = $(TEST_LIBS)
|
||||
nodist_EXTRA_lp_test_conv_SOURCES = dummy.cpp
|
||||
|
||||
lp_test_printf_SOURCES = lp_test_printf.c lp_test_main.c
|
||||
lp_test_printf_LDADD = $(TEST_LIBS)
|
||||
nodist_EXTRA_lp_test_printf_SOURCES = dummy.cpp
|
||||
|
@@ -56,7 +56,7 @@ lp_build_blend(struct lp_build_context *bld,
|
||||
LLVMValueRef
|
||||
lp_build_blend_aos(struct gallivm_state *gallivm,
|
||||
const struct pipe_blend_state *blend,
|
||||
const enum pipe_format cbuf_format,
|
||||
const enum pipe_format *cbuf_format,
|
||||
struct lp_type type,
|
||||
unsigned rt,
|
||||
LLVMValueRef src,
|
||||
|
@@ -266,7 +266,7 @@ lp_build_blend_factor(struct lp_build_blend_aos_context *bld,
|
||||
* @param blend the blend state of the shader variant
|
||||
* @param cbuf_format format of the colour buffer
|
||||
* @param type data type of the pixel vector
|
||||
* @param rt render target index
|
||||
* @param rt rt number
|
||||
* @param src blend src
|
||||
* @param dst blend dst
|
||||
* @param mask optional mask to apply to the blending result
|
||||
@@ -278,7 +278,7 @@ lp_build_blend_factor(struct lp_build_blend_aos_context *bld,
|
||||
LLVMValueRef
|
||||
lp_build_blend_aos(struct gallivm_state *gallivm,
|
||||
const struct pipe_blend_state *blend,
|
||||
const enum pipe_format cbuf_format,
|
||||
const enum pipe_format *cbuf_format,
|
||||
struct lp_type type,
|
||||
unsigned rt,
|
||||
LLVMValueRef src,
|
||||
@@ -298,7 +298,7 @@ lp_build_blend_aos(struct gallivm_state *gallivm,
|
||||
unsigned alpha_swizzle = UTIL_FORMAT_SWIZZLE_NONE;
|
||||
unsigned i;
|
||||
|
||||
desc = util_format_description(cbuf_format);
|
||||
desc = util_format_description(cbuf_format[rt]);
|
||||
|
||||
/* Setup build context */
|
||||
memset(&bld, 0, sizeof bld);
|
||||
|
@@ -59,5 +59,5 @@ llvmpipe_clear(struct pipe_context *pipe,
|
||||
if (LP_PERF & PERF_NO_DEPTH)
|
||||
buffers &= ~PIPE_CLEAR_DEPTHSTENCIL;
|
||||
|
||||
lp_setup_clear( llvmpipe->setup, color, depth, stencil, buffers );
|
||||
lp_setup_clear( llvmpipe->setup, color->f, depth, stencil, buffers );
|
||||
}
|
||||
|
@@ -76,12 +76,12 @@ struct llvmpipe_context {
|
||||
struct pipe_framebuffer_state framebuffer;
|
||||
struct pipe_poly_stipple poly_stipple;
|
||||
struct pipe_scissor_state scissor;
|
||||
struct pipe_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];
|
||||
struct pipe_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
|
||||
|
||||
struct pipe_viewport_state viewport;
|
||||
struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
|
||||
struct pipe_index_buffer index_buffer;
|
||||
struct pipe_resource *mapped_vs_tex[PIPE_MAX_SHADER_SAMPLER_VIEWS];
|
||||
struct pipe_resource *mapped_vs_tex[PIPE_MAX_SAMPLERS];
|
||||
|
||||
unsigned num_samplers[PIPE_SHADER_TYPES];
|
||||
unsigned num_sampler_views[PIPE_SHADER_TYPES];
|
||||
|
@@ -45,7 +45,7 @@ lp_jit_create_types(struct lp_fragment_shader_variant *lp)
|
||||
{
|
||||
struct gallivm_state *gallivm = lp->gallivm;
|
||||
LLVMContextRef lc = gallivm->context;
|
||||
LLVMTypeRef texture_type, sampler_type;
|
||||
LLVMTypeRef texture_type;
|
||||
|
||||
/* struct lp_jit_texture */
|
||||
{
|
||||
@@ -61,6 +61,11 @@ lp_jit_create_types(struct lp_fragment_shader_variant *lp)
|
||||
elem_types[LP_JIT_TEXTURE_IMG_STRIDE] =
|
||||
elem_types[LP_JIT_TEXTURE_MIP_OFFSETS] =
|
||||
LLVMArrayType(LLVMInt32TypeInContext(lc), LP_MAX_TEXTURE_LEVELS);
|
||||
elem_types[LP_JIT_TEXTURE_MIN_LOD] =
|
||||
elem_types[LP_JIT_TEXTURE_MAX_LOD] =
|
||||
elem_types[LP_JIT_TEXTURE_LOD_BIAS] = LLVMFloatTypeInContext(lc);
|
||||
elem_types[LP_JIT_TEXTURE_BORDER_COLOR] =
|
||||
LLVMArrayType(LLVMFloatTypeInContext(lc), 4);
|
||||
|
||||
texture_type = LLVMStructTypeInContext(lc, elem_types,
|
||||
Elements(elem_types), 0);
|
||||
@@ -97,43 +102,23 @@ lp_jit_create_types(struct lp_fragment_shader_variant *lp)
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, mip_offsets,
|
||||
gallivm->target, texture_type,
|
||||
LP_JIT_TEXTURE_MIP_OFFSETS);
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, min_lod,
|
||||
gallivm->target, texture_type,
|
||||
LP_JIT_TEXTURE_MIN_LOD);
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, max_lod,
|
||||
gallivm->target, texture_type,
|
||||
LP_JIT_TEXTURE_MAX_LOD);
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, lod_bias,
|
||||
gallivm->target, texture_type,
|
||||
LP_JIT_TEXTURE_LOD_BIAS);
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, border_color,
|
||||
gallivm->target, texture_type,
|
||||
LP_JIT_TEXTURE_BORDER_COLOR);
|
||||
|
||||
LP_CHECK_STRUCT_SIZE(struct lp_jit_texture,
|
||||
gallivm->target, texture_type);
|
||||
}
|
||||
|
||||
{
|
||||
/* struct lp_jit_sampler */
|
||||
LLVMTypeRef elem_types[LP_JIT_SAMPLER_NUM_FIELDS];
|
||||
elem_types[LP_JIT_SAMPLER_MIN_LOD] =
|
||||
elem_types[LP_JIT_SAMPLER_MAX_LOD] =
|
||||
elem_types[LP_JIT_SAMPLER_LOD_BIAS] = LLVMFloatTypeInContext(lc);
|
||||
elem_types[LP_JIT_SAMPLER_BORDER_COLOR] =
|
||||
LLVMArrayType(LLVMFloatTypeInContext(lc), 4);
|
||||
|
||||
sampler_type = LLVMStructTypeInContext(lc, elem_types,
|
||||
Elements(elem_types), 0);
|
||||
#if HAVE_LLVM < 0x0300
|
||||
LLVMAddTypeName(gallivm->module, "texture", texture_type);
|
||||
|
||||
LLVMInvalidateStructLayout(gallivm->target, texture_type);
|
||||
#endif
|
||||
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_sampler, min_lod,
|
||||
gallivm->target, texture_type,
|
||||
LP_JIT_SAMPLER_MIN_LOD);
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_sampler, max_lod,
|
||||
gallivm->target, texture_type,
|
||||
LP_JIT_SAMPLER_MAX_LOD);
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_sampler, lod_bias,
|
||||
gallivm->target, texture_type,
|
||||
LP_JIT_SAMPLER_LOD_BIAS);
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_sampler, border_color,
|
||||
gallivm->target, texture_type,
|
||||
LP_JIT_SAMPLER_BORDER_COLOR);
|
||||
LP_CHECK_STRUCT_SIZE(struct lp_jit_sampler,
|
||||
gallivm->target, sampler_type);
|
||||
}
|
||||
|
||||
/* struct lp_jit_context */
|
||||
{
|
||||
LLVMTypeRef elem_types[LP_JIT_CTX_COUNT];
|
||||
@@ -147,8 +132,6 @@ lp_jit_create_types(struct lp_fragment_shader_variant *lp)
|
||||
elem_types[LP_JIT_CTX_U8_BLEND_COLOR] = LLVMPointerType(LLVMInt8TypeInContext(lc), 0);
|
||||
elem_types[LP_JIT_CTX_F_BLEND_COLOR] = LLVMPointerType(LLVMFloatTypeInContext(lc), 0);
|
||||
elem_types[LP_JIT_CTX_TEXTURES] = LLVMArrayType(texture_type,
|
||||
PIPE_MAX_SHADER_SAMPLER_VIEWS);
|
||||
elem_types[LP_JIT_CTX_SAMPLERS] = LLVMArrayType(sampler_type,
|
||||
PIPE_MAX_SAMPLERS);
|
||||
|
||||
context_type = LLVMStructTypeInContext(lc, elem_types,
|
||||
@@ -181,9 +164,6 @@ lp_jit_create_types(struct lp_fragment_shader_variant *lp)
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_context, textures,
|
||||
gallivm->target, context_type,
|
||||
LP_JIT_CTX_TEXTURES);
|
||||
LP_CHECK_MEMBER_OFFSET(struct lp_jit_context, samplers,
|
||||
gallivm->target, context_type,
|
||||
LP_JIT_CTX_SAMPLERS);
|
||||
LP_CHECK_STRUCT_SIZE(struct lp_jit_context,
|
||||
gallivm->target, context_type);
|
||||
|
||||
|
@@ -58,11 +58,7 @@ struct lp_jit_texture
|
||||
uint32_t row_stride[LP_MAX_TEXTURE_LEVELS];
|
||||
uint32_t img_stride[LP_MAX_TEXTURE_LEVELS];
|
||||
uint32_t mip_offsets[LP_MAX_TEXTURE_LEVELS];
|
||||
};
|
||||
|
||||
|
||||
struct lp_jit_sampler
|
||||
{
|
||||
/* sampler state, actually */
|
||||
float min_lod;
|
||||
float max_lod;
|
||||
float lod_bias;
|
||||
@@ -80,18 +76,14 @@ enum {
|
||||
LP_JIT_TEXTURE_ROW_STRIDE,
|
||||
LP_JIT_TEXTURE_IMG_STRIDE,
|
||||
LP_JIT_TEXTURE_MIP_OFFSETS,
|
||||
LP_JIT_TEXTURE_MIN_LOD,
|
||||
LP_JIT_TEXTURE_MAX_LOD,
|
||||
LP_JIT_TEXTURE_LOD_BIAS,
|
||||
LP_JIT_TEXTURE_BORDER_COLOR,
|
||||
LP_JIT_TEXTURE_NUM_FIELDS /* number of fields above */
|
||||
};
|
||||
|
||||
|
||||
enum {
|
||||
LP_JIT_SAMPLER_MIN_LOD,
|
||||
LP_JIT_SAMPLER_MAX_LOD,
|
||||
LP_JIT_SAMPLER_LOD_BIAS,
|
||||
LP_JIT_SAMPLER_BORDER_COLOR,
|
||||
LP_JIT_SAMPLER_NUM_FIELDS /* number of fields above */
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* This structure is passed directly to the generated fragment shader.
|
||||
@@ -115,8 +107,7 @@ struct lp_jit_context
|
||||
uint8_t *u8_blend_color;
|
||||
float *f_blend_color;
|
||||
|
||||
struct lp_jit_texture textures[PIPE_MAX_SHADER_SAMPLER_VIEWS];
|
||||
struct lp_jit_sampler samplers[PIPE_MAX_SAMPLERS];
|
||||
struct lp_jit_texture textures[PIPE_MAX_SAMPLERS];
|
||||
};
|
||||
|
||||
|
||||
@@ -132,7 +123,6 @@ enum {
|
||||
LP_JIT_CTX_U8_BLEND_COLOR,
|
||||
LP_JIT_CTX_F_BLEND_COLOR,
|
||||
LP_JIT_CTX_TEXTURES,
|
||||
LP_JIT_CTX_SAMPLERS,
|
||||
LP_JIT_CTX_COUNT
|
||||
};
|
||||
|
||||
@@ -158,8 +148,6 @@ enum {
|
||||
#define lp_jit_context_textures(_gallivm, _ptr) \
|
||||
lp_build_struct_get_ptr(_gallivm, _ptr, LP_JIT_CTX_TEXTURES, "textures")
|
||||
|
||||
#define lp_jit_context_samplers(_gallivm, _ptr) \
|
||||
lp_build_struct_get_ptr(_gallivm, _ptr, LP_JIT_CTX_SAMPLERS, "samplers")
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -146,91 +146,35 @@ lp_rast_clear_color(struct lp_rasterizer_task *task,
|
||||
const union lp_rast_cmd_arg arg)
|
||||
{
|
||||
const struct lp_scene *scene = task->scene;
|
||||
uint8_t clear_color[4];
|
||||
|
||||
if (scene->fb.nr_cbufs) {
|
||||
unsigned i;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < 4; ++i) {
|
||||
clear_color[i] = float_to_ubyte(arg.clear_color[i]);
|
||||
}
|
||||
|
||||
LP_DBG(DEBUG_RAST, "%s 0x%x,0x%x,0x%x,0x%x\n", __FUNCTION__,
|
||||
clear_color[0],
|
||||
clear_color[1],
|
||||
clear_color[2],
|
||||
clear_color[3]);
|
||||
|
||||
for (i = 0; i < scene->fb.nr_cbufs; i++) {
|
||||
const struct lp_scene *scene = task->scene;
|
||||
union util_color uc;
|
||||
|
||||
if (util_format_is_pure_integer(scene->fb.cbufs[0]->format)) {
|
||||
/*
|
||||
* We expect int/uint clear values here, though some APIs
|
||||
* might disagree (but in any case util_pack_color()
|
||||
* couldn't handle it)...
|
||||
*/
|
||||
LP_DBG(DEBUG_RAST, "%s pure int 0x%x,0x%x,0x%x,0x%x\n", __FUNCTION__,
|
||||
arg.clear_color.ui[0],
|
||||
arg.clear_color.ui[1],
|
||||
arg.clear_color.ui[2],
|
||||
arg.clear_color.ui[3]);
|
||||
util_pack_color(arg.clear_color,
|
||||
scene->fb.cbufs[i]->format, &uc);
|
||||
|
||||
for (i = 0; i < scene->fb.nr_cbufs; i++) {
|
||||
enum pipe_format format = scene->fb.cbufs[i]->format;
|
||||
/*
|
||||
* XXX the format_write_4i/ui functions do clamping to max value
|
||||
* and I'm not sure that's actually right - spec doesn't seem to
|
||||
* say much about that topic. If it is should probably adjust the
|
||||
* border color handling to do the same. If not and chopping off
|
||||
* bits is the way to go, the write_4i and write_4ui functions
|
||||
* would be identical.
|
||||
*/
|
||||
if (util_format_is_pure_sint(format)) {
|
||||
int rgba[4];
|
||||
rgba[0] = arg.clear_color.i[0];
|
||||
rgba[1] = arg.clear_color.i[1];
|
||||
rgba[2] = arg.clear_color.i[2];
|
||||
rgba[3] = arg.clear_color.i[3];
|
||||
|
||||
util_format_write_4i(format, rgba, 0, &uc, 0, 0, 0, 1, 1);
|
||||
}
|
||||
else {
|
||||
unsigned rgba[4];
|
||||
rgba[0] = arg.clear_color.ui[0];
|
||||
rgba[1] = arg.clear_color.ui[1];
|
||||
rgba[2] = arg.clear_color.ui[2];
|
||||
rgba[3] = arg.clear_color.ui[3];
|
||||
|
||||
assert(util_format_is_pure_uint(format));
|
||||
util_format_write_4ui(format, rgba, 0, &uc, 0, 0, 0, 1, 1);
|
||||
}
|
||||
|
||||
util_fill_rect(scene->cbufs[i].map,
|
||||
scene->fb.cbufs[i]->format,
|
||||
scene->cbufs[i].stride,
|
||||
task->x,
|
||||
task->y,
|
||||
TILE_SIZE,
|
||||
TILE_SIZE,
|
||||
&uc);
|
||||
}
|
||||
}
|
||||
else {
|
||||
uint8_t clear_color[4];
|
||||
|
||||
for (i = 0; i < 4; ++i) {
|
||||
clear_color[i] = float_to_ubyte(arg.clear_color.f[i]);
|
||||
}
|
||||
|
||||
LP_DBG(DEBUG_RAST, "%s 0x%x,0x%x,0x%x,0x%x\n", __FUNCTION__,
|
||||
clear_color[0],
|
||||
clear_color[1],
|
||||
clear_color[2],
|
||||
clear_color[3]);
|
||||
|
||||
for (i = 0; i < scene->fb.nr_cbufs; i++) {
|
||||
|
||||
util_pack_color(arg.clear_color.f,
|
||||
scene->fb.cbufs[i]->format, &uc);
|
||||
|
||||
util_fill_rect(scene->cbufs[i].map,
|
||||
scene->fb.cbufs[i]->format,
|
||||
scene->cbufs[i].stride,
|
||||
task->x,
|
||||
task->y,
|
||||
TILE_SIZE,
|
||||
TILE_SIZE,
|
||||
&uc);
|
||||
}
|
||||
}
|
||||
util_fill_rect(scene->cbufs[i].map,
|
||||
scene->fb.cbufs[i]->format,
|
||||
scene->cbufs[i].stride,
|
||||
task->x,
|
||||
task->y,
|
||||
TILE_SIZE,
|
||||
TILE_SIZE,
|
||||
&uc);
|
||||
}
|
||||
|
||||
LP_COUNT(nr_color_tile_clear);
|
||||
|
@@ -152,7 +152,7 @@ union lp_rast_cmd_arg {
|
||||
unsigned plane_mask;
|
||||
} triangle;
|
||||
const struct lp_rast_state *set_state;
|
||||
union pipe_color_union clear_color;
|
||||
float clear_color[4];
|
||||
struct {
|
||||
uint32_t value;
|
||||
uint32_t mask;
|
||||
|
@@ -158,6 +158,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
return 0;
|
||||
case PIPE_CAP_PRIMITIVE_RESTART:
|
||||
return 1;
|
||||
case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE:
|
||||
return 1;
|
||||
case PIPE_CAP_DEPTH_CLIP_DISABLE:
|
||||
return 0;
|
||||
case PIPE_CAP_SHADER_STENCIL_EXPORT:
|
||||
@@ -332,20 +334,6 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
|
||||
|
||||
if (!format_desc->is_array && !format_desc->is_bitmask)
|
||||
return FALSE;
|
||||
|
||||
/*
|
||||
* XXX refuse formats known to crash in generate_unswizzled_blend().
|
||||
* These include all 3-channel 24bit RGB8 variants, plus 48bit
|
||||
* (except those using floats) 3-channel RGB16 variants (the latter
|
||||
* seems to be more of a llvm bug though).
|
||||
* The mesa state tracker only seems to use these for SINT/UINT formats.
|
||||
*/
|
||||
if (format_desc->is_array && format_desc->nr_channels == 3) {
|
||||
if (format_desc->block.bits == 24 || (format_desc->block.bits == 48 &&
|
||||
!util_format_is_float(format))) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bind & PIPE_BIND_DISPLAY_TARGET) {
|
||||
@@ -370,10 +358,14 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
|
||||
}
|
||||
|
||||
/*
|
||||
* Everything can be supported by u_format
|
||||
* (those without fetch_rgba_float might be not but shouldn't hit that)
|
||||
* Everything can be supported by u_format.
|
||||
*/
|
||||
|
||||
if (format_desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS &&
|
||||
!format_desc->fetch_rgba_float) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@@ -385,7 +385,7 @@ lp_setup_bind_framebuffer( struct lp_setup_context *setup,
|
||||
|
||||
static boolean
|
||||
lp_setup_try_clear( struct lp_setup_context *setup,
|
||||
const union pipe_color_union *color,
|
||||
const float *color,
|
||||
double depth,
|
||||
unsigned stencil,
|
||||
unsigned flags )
|
||||
@@ -399,7 +399,7 @@ lp_setup_try_clear( struct lp_setup_context *setup,
|
||||
|
||||
if (flags & PIPE_CLEAR_COLOR) {
|
||||
for (i = 0; i < 4; i++)
|
||||
color_arg.clear_color.i[i] = color->i[i];
|
||||
color_arg.clear_color[i] = color[i];
|
||||
}
|
||||
|
||||
if (flags & PIPE_CLEAR_DEPTHSTENCIL) {
|
||||
@@ -458,7 +458,7 @@ lp_setup_try_clear( struct lp_setup_context *setup,
|
||||
}
|
||||
|
||||
if (flags & PIPE_CLEAR_COLOR) {
|
||||
memcpy(&setup->clear.color.clear_color,
|
||||
memcpy(setup->clear.color.clear_color,
|
||||
&color_arg,
|
||||
sizeof setup->clear.color.clear_color);
|
||||
}
|
||||
@@ -469,7 +469,7 @@ lp_setup_try_clear( struct lp_setup_context *setup,
|
||||
|
||||
void
|
||||
lp_setup_clear( struct lp_setup_context *setup,
|
||||
const union pipe_color_union *color,
|
||||
const float *color,
|
||||
double depth,
|
||||
unsigned stencil,
|
||||
unsigned flags )
|
||||
@@ -668,9 +668,9 @@ lp_setup_set_fragment_sampler_views(struct lp_setup_context *setup,
|
||||
|
||||
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
|
||||
|
||||
assert(num <= PIPE_MAX_SHADER_SAMPLER_VIEWS);
|
||||
assert(num <= PIPE_MAX_SAMPLERS);
|
||||
|
||||
for (i = 0; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; i++) {
|
||||
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
|
||||
struct pipe_sampler_view *view = i < num ? views[i] : NULL;
|
||||
|
||||
if (view) {
|
||||
@@ -780,13 +780,13 @@ lp_setup_set_fragment_sampler_state(struct lp_setup_context *setup,
|
||||
const struct pipe_sampler_state *sampler = i < num ? samplers[i] : NULL;
|
||||
|
||||
if (sampler) {
|
||||
struct lp_jit_sampler *jit_sam;
|
||||
jit_sam = &setup->fs.current.jit_context.samplers[i];
|
||||
struct lp_jit_texture *jit_tex;
|
||||
jit_tex = &setup->fs.current.jit_context.textures[i];
|
||||
|
||||
jit_sam->min_lod = sampler->min_lod;
|
||||
jit_sam->max_lod = sampler->max_lod;
|
||||
jit_sam->lod_bias = sampler->lod_bias;
|
||||
COPY_4V(jit_sam->border_color, sampler->border_color.f);
|
||||
jit_tex->min_lod = sampler->min_lod;
|
||||
jit_tex->max_lod = sampler->max_lod;
|
||||
jit_tex->lod_bias = sampler->lod_bias;
|
||||
COPY_4V(jit_tex->border_color, sampler->border_color.f);
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user