Compare commits
171 Commits
cros-mesa-
...
mesa-10.5.
Author | SHA1 | Date | |
---|---|---|---|
|
c4b8bff6e2 | ||
|
b17312cac2 | ||
|
37d925a635 | ||
|
b3bb6b1963 | ||
|
42854fdf2c | ||
|
64bb117f6d | ||
|
b7c44cd5ab | ||
|
a02e05f0fa | ||
|
11e7ae0741 | ||
|
b6ce705dac | ||
|
71367a1bb4 | ||
|
f3b2698f6a | ||
|
88e05a251f | ||
|
64d0f0e3b2 | ||
|
9a3a2479d4 | ||
|
61fc1295af | ||
|
ac46cf31fc | ||
|
c8d962c205 | ||
|
407365e375 | ||
|
712466fb53 | ||
|
ff87ae1e00 | ||
|
5e59f895c4 | ||
|
ebbfa79755 | ||
|
fda3bc1e03 | ||
|
e98909b056 | ||
|
d83d2ea9a6 | ||
|
d6413ed98f | ||
|
3147f0bd25 | ||
|
c2760f0a16 | ||
|
859b4afc97 | ||
|
d33bf8150f | ||
|
8ebda1f144 | ||
|
0410d9b186 | ||
|
af3e6e2858 | ||
|
29810e43da | ||
|
2e0f2ad59c | ||
|
411f975a81 | ||
|
3fa76f3f79 | ||
|
5e572b1cce | ||
|
2beab3c01c | ||
|
d80bc65016 | ||
|
2abba086ca | ||
|
11c0ff60ef | ||
|
0f32ac3920 | ||
|
ce13666feb | ||
|
065a24bd96 | ||
|
1dec8bbb8e | ||
|
af4d1096f7 | ||
|
645d7f464b | ||
|
80c4ba0c83 | ||
|
aca5fdae06 | ||
|
7abc57b669 | ||
|
20ea65beb3 | ||
|
38777e1345 | ||
|
4de2f25083 | ||
|
fbd06fe65c | ||
|
c232d765af | ||
|
0d625e1ae7 | ||
|
e9e182658d | ||
|
82ef4994dd | ||
|
c3fc8b2870 | ||
|
aea510a95f | ||
|
c898d5c931 | ||
|
32a7f119dc | ||
|
578ac079c7 | ||
|
0ea3c150cf | ||
|
b542424ab8 | ||
|
d8ed6aa474 | ||
|
5b1bd4fc9e | ||
|
cddbb3a7ba | ||
|
e4d3bd6855 | ||
|
614e7ebdad | ||
|
7f32fa0dcb | ||
|
a15de1ae1a | ||
|
31fcb21ef5 | ||
|
0cd8e357e3 | ||
|
8b4db9c687 | ||
|
b0400a58db | ||
|
ef1c87ba09 | ||
|
a71223eb59 | ||
|
47a3ae1f20 | ||
|
dbf974636a | ||
|
35909f0e12 | ||
|
b83333ac5b | ||
|
30079d6846 | ||
|
e5eab59b57 | ||
|
57f54b067b | ||
|
e0670715bc | ||
|
8357abf4c3 | ||
|
b0f60c891a | ||
|
73efd2891f | ||
|
73f8e342a7 | ||
|
53d66c0c7c | ||
|
560fb4ee45 | ||
|
446aa309e1 | ||
|
4c45e23938 | ||
|
9267820be6 | ||
|
b730f6e18e | ||
|
f5fbed4831 | ||
|
f7cc5fb2cb | ||
|
0d3e4ed134 | ||
|
97357d475f | ||
|
c899144da6 | ||
|
b973acc093 | ||
|
90411b56f6 | ||
|
19422e433c | ||
|
1b00847bb2 | ||
|
a0264d4076 | ||
|
c7d4987897 | ||
|
c32d835281 | ||
|
54cc3cdff4 | ||
|
c0f425bb81 | ||
|
7c448551eb | ||
|
3e54be2e8a | ||
|
6f52686d77 | ||
|
1527f569e5 | ||
|
dfbaa8a843 | ||
|
9e8446beb1 | ||
|
9e5af14163 | ||
|
ed7272ade9 | ||
|
3592cbb21f | ||
|
5e026a2f63 | ||
|
04dc301669 | ||
|
4952a37697 | ||
|
aac12f4542 | ||
|
760407ff9e | ||
|
3cb2120088 | ||
|
b97e7ad355 | ||
|
bf563d59b2 | ||
|
7f7c35e854 | ||
|
b554a10e82 | ||
|
11cab7b36a | ||
|
80ec8ee3a1 | ||
|
d7fe0d9ce7 | ||
|
afe00ddc20 | ||
|
b9b8c10273 | ||
|
7f72b69c62 | ||
|
9bd832c24c | ||
|
ae275a653a | ||
|
86aaa10ce7 | ||
|
3e513ea65c | ||
|
2f8e96f71d | ||
|
c65ca6c815 | ||
|
4fa129cd9b | ||
|
4c2e35e0aa | ||
|
474f33e690 | ||
|
20471e9423 | ||
|
f0a736160b | ||
|
3a2043fddd | ||
|
39d823fa58 | ||
|
7bcdde5174 | ||
|
f2e513b2c0 | ||
|
c6b0a1638c | ||
|
694d656551 | ||
|
c38068f5c1 | ||
|
88d47387b8 | ||
|
c08e9605c2 | ||
|
fe98850c5f | ||
|
6f14955b71 | ||
|
8ab5a28bd6 | ||
|
4d6bc2c0ff | ||
|
631e76500d | ||
|
28650815ac | ||
|
b9518a41d4 | ||
|
550d7c26e7 | ||
|
716886c338 | ||
|
8898b68a3f | ||
|
93675c7aac | ||
|
6555c00b19 | ||
|
d03de1dd7d | ||
|
b1b7b5b068 |
16
Makefile.am
16
Makefile.am
@@ -44,15 +44,13 @@ EXTRA_DIST = \
|
||||
scons \
|
||||
SConstruct
|
||||
|
||||
noinst_HEADERS = \
|
||||
include/c99_alloca.h \
|
||||
include/c99_compat.h \
|
||||
include/c99_math.h \
|
||||
include/c99 \
|
||||
include/c11 \
|
||||
include/D3D9 \
|
||||
include/HaikuGL \
|
||||
include/no_extern_c.h \
|
||||
noinst_HEADERS = \
|
||||
include/c99_compat.h \
|
||||
include/c99 \
|
||||
include/c11 \
|
||||
include/D3D9 \
|
||||
include/VG \
|
||||
include/HaikuGL \
|
||||
include/pci_ids
|
||||
|
||||
# We list some directories in EXTRA_DIST, but don't actually want to include
|
||||
|
@@ -6,8 +6,8 @@ test -z "$srcdir" && srcdir=.
|
||||
ORIGDIR=`pwd`
|
||||
cd "$srcdir"
|
||||
|
||||
autoreconf --force --verbose --install || exit 1
|
||||
cd "$ORIGDIR" || exit $?
|
||||
autoreconf -v --install || exit 1
|
||||
cd $ORIGDIR || exit $?
|
||||
|
||||
if test -z "$NOCONFIGURE"; then
|
||||
"$srcdir"/configure "$@"
|
||||
|
26
bin/.cherry-ignore
Normal file
26
bin/.cherry-ignore
Normal file
@@ -0,0 +1,26 @@
|
||||
# Cherry-picked without -x
|
||||
# nir: resolve nir.h dependency list (fix make distcheck)
|
||||
556fc4b84df99a1cd4b18c11fb16f7854a948b2a
|
||||
|
||||
# nir: add missing header to the sources list
|
||||
72e602905dd9d86450a936d5a22bf21758844b38
|
||||
|
||||
# configure: rework wayland_scanner handling(fix make distcheck)
|
||||
153539bd9d4445b504110958306f00632222f840
|
||||
|
||||
# auxiliary/vl: bring back the VL code for the dri targets
|
||||
c39dbfdd0f764b1aaa7319b4694e7335692993dd
|
||||
|
||||
# mesa: rename format_info.c to format_info.h
|
||||
3f6c28f2a976e35128b7a4a513cfa60af00301e1
|
||||
# mesa: fix dependency tracking of generated sources
|
||||
d22391cb165af4ed2f9a9e5d6233072a432cc969
|
||||
# mesa: drop Makefile from get_hash.h dependency list
|
||||
2c0f72d5389a9838cc4fbf4cc4f4291aa56c7845
|
||||
# mapi: fix *glapi dependency tracking
|
||||
fe5fddd7e2df74233a2a02ae021418485f39d11c
|
||||
# xmlpool: make sure we ship options.h
|
||||
8d8ca64c28170ec7e9ffa01638bcf8fd30a96088
|
||||
|
||||
# The optimisations mentioned are not available in 10.5
|
||||
627c68308683abbd6e563a09af6013a33938a790 i965/fs: in MAD optimizations, switch last argument to be immediate
|
97
common.py
97
common.py
@@ -26,28 +26,28 @@ else:
|
||||
target_platform = host_platform
|
||||
|
||||
_machine_map = {
|
||||
'x86': 'x86',
|
||||
'i386': 'x86',
|
||||
'i486': 'x86',
|
||||
'i586': 'x86',
|
||||
'i686': 'x86',
|
||||
'BePC': 'x86',
|
||||
'Intel': 'x86',
|
||||
'ppc': 'ppc',
|
||||
'BeBox': 'ppc',
|
||||
'BeMac': 'ppc',
|
||||
'AMD64': 'x86_64',
|
||||
'x86_64': 'x86_64',
|
||||
'sparc': 'sparc',
|
||||
'sun4u': 'sparc',
|
||||
'x86': 'x86',
|
||||
'i386': 'x86',
|
||||
'i486': 'x86',
|
||||
'i586': 'x86',
|
||||
'i686': 'x86',
|
||||
'BePC': 'x86',
|
||||
'Intel': 'x86',
|
||||
'ppc' : 'ppc',
|
||||
'BeBox': 'ppc',
|
||||
'BeMac': 'ppc',
|
||||
'AMD64': 'x86_64',
|
||||
'x86_64': 'x86_64',
|
||||
'sparc': 'sparc',
|
||||
'sun4u': 'sparc',
|
||||
}
|
||||
|
||||
|
||||
# find host_machine value
|
||||
if 'PROCESSOR_ARCHITECTURE' in os.environ:
|
||||
host_machine = os.environ['PROCESSOR_ARCHITECTURE']
|
||||
host_machine = os.environ['PROCESSOR_ARCHITECTURE']
|
||||
else:
|
||||
host_machine = _platform.machine()
|
||||
host_machine = _platform.machine()
|
||||
host_machine = _machine_map.get(host_machine, 'generic')
|
||||
|
||||
default_machine = host_machine
|
||||
@@ -65,8 +65,7 @@ else:
|
||||
default_llvm = 'no'
|
||||
try:
|
||||
if target_platform != 'windows' and \
|
||||
subprocess.call(['llvm-config', '--version'],
|
||||
stdout=subprocess.PIPE) == 0:
|
||||
subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
|
||||
default_llvm = 'yes'
|
||||
except:
|
||||
pass
|
||||
@@ -76,38 +75,30 @@ else:
|
||||
# Common options
|
||||
|
||||
def AddOptions(opts):
|
||||
try:
|
||||
from SCons.Variables.BoolVariable import BoolVariable as BoolOption
|
||||
except ImportError:
|
||||
from SCons.Options.BoolOption import BoolOption
|
||||
try:
|
||||
from SCons.Variables.EnumVariable import EnumVariable as EnumOption
|
||||
except ImportError:
|
||||
from SCons.Options.EnumOption import EnumOption
|
||||
opts.Add(EnumOption('build', 'build type', 'debug',
|
||||
allowed_values=('debug', 'checked', 'profile',
|
||||
'release')))
|
||||
opts.Add(BoolOption('verbose', 'verbose output', 'no'))
|
||||
opts.Add(EnumOption('machine', 'use machine-specific assembly code',
|
||||
default_machine,
|
||||
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
|
||||
opts.Add(EnumOption('platform', 'target platform', host_platform,
|
||||
allowed_values=('cygwin', 'darwin', 'freebsd', 'haiku',
|
||||
'linux', 'sunos', 'windows')))
|
||||
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
|
||||
opts.Add(BoolOption('analyze',
|
||||
'enable static code analysis where available', 'no'))
|
||||
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
|
||||
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support',
|
||||
'no'))
|
||||
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
|
||||
opts.Add(BoolOption('openmp', 'EXPERIMENTAL: compile with openmp (swrast)',
|
||||
'no'))
|
||||
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
|
||||
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
|
||||
opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
|
||||
opts.Add(BoolOption('texture_float',
|
||||
'enable floating-point textures and renderbuffers',
|
||||
'no'))
|
||||
if host_platform == 'windows':
|
||||
opts.Add('MSVC_VERSION', 'Microsoft Visual C/C++ version')
|
||||
try:
|
||||
from SCons.Variables.BoolVariable import BoolVariable as BoolOption
|
||||
except ImportError:
|
||||
from SCons.Options.BoolOption import BoolOption
|
||||
try:
|
||||
from SCons.Variables.EnumVariable import EnumVariable as EnumOption
|
||||
except ImportError:
|
||||
from SCons.Options.EnumOption import EnumOption
|
||||
opts.Add(EnumOption('build', 'build type', 'debug',
|
||||
allowed_values=('debug', 'checked', 'profile', 'release')))
|
||||
opts.Add(BoolOption('verbose', 'verbose output', 'no'))
|
||||
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
|
||||
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
|
||||
opts.Add(EnumOption('platform', 'target platform', host_platform,
|
||||
allowed_values=('cygwin', 'darwin', 'freebsd', 'haiku', 'linux', 'sunos', 'windows')))
|
||||
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
|
||||
opts.Add(BoolOption('analyze', 'enable static code analysis where available', 'no'))
|
||||
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
|
||||
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
|
||||
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
|
||||
opts.Add(BoolOption('openmp', 'EXPERIMENTAL: compile with openmp (swrast)', 'no'))
|
||||
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
|
||||
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
|
||||
opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
|
||||
opts.Add(BoolOption('texture_float', 'enable floating-point textures and renderbuffers', 'no'))
|
||||
if host_platform == 'windows':
|
||||
opts.Add('MSVC_VERSION', 'Microsoft Visual C/C++ version')
|
||||
|
254
configure.ac
254
configure.ac
@@ -9,7 +9,6 @@ dnl Copyright © 2009-2014 Jon TURNEY
|
||||
dnl Copyright © 2011-2012 Benjamin Franzke
|
||||
dnl Copyright © 2008-2014 David Airlie
|
||||
dnl Copyright © 2009-2013 Brian Paul
|
||||
dnl Copyright © 2003-2007 Keith Packard, Daniel Stone
|
||||
dnl
|
||||
dnl Permission is hereby granted, free of charge, to any person obtaining a
|
||||
dnl copy of this software and associated documentation files (the "Software"),
|
||||
@@ -46,13 +45,6 @@ AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_INIT_AUTOMAKE([foreign tar-ustar dist-xz])
|
||||
|
||||
dnl We only support native Windows builds (MinGW/MSVC) through SCons.
|
||||
case "$host_os" in
|
||||
mingw*)
|
||||
AC_MSG_ERROR([MinGW build not supported through autoconf/automake, use SCons instead])
|
||||
;;
|
||||
esac
|
||||
|
||||
# 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
|
||||
@@ -68,7 +60,7 @@ AC_SUBST([OSMESA_VERSION])
|
||||
dnl Versions for external dependencies
|
||||
LIBDRM_REQUIRED=2.4.38
|
||||
LIBDRM_RADEON_REQUIRED=2.4.56
|
||||
LIBDRM_INTEL_REQUIRED=2.4.60
|
||||
LIBDRM_INTEL_REQUIRED=2.4.52
|
||||
LIBDRM_NVVIEUX_REQUIRED=2.4.33
|
||||
LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
|
||||
LIBDRM_FREEDRENO_REQUIRED=2.4.57
|
||||
@@ -209,7 +201,6 @@ AX_GCC_FUNC_ATTRIBUTE([flatten])
|
||||
AX_GCC_FUNC_ATTRIBUTE([format])
|
||||
AX_GCC_FUNC_ATTRIBUTE([malloc])
|
||||
AX_GCC_FUNC_ATTRIBUTE([packed])
|
||||
AX_GCC_FUNC_ATTRIBUTE([unused])
|
||||
|
||||
AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
|
||||
|
||||
@@ -284,30 +275,6 @@ if test "x$GCC" = xyes; then
|
||||
# gcc's builtin memcmp is slower than glibc's
|
||||
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
|
||||
CFLAGS="$CFLAGS -fno-builtin-memcmp"
|
||||
|
||||
# Flags to help ensure that certain portions of the code -- and only those
|
||||
# portions -- can be built with MSVC:
|
||||
# - src/util, src/gallium/auxiliary, and src/gallium/drivers/llvmpipe needs
|
||||
# to build with Windows SDK 7.0.7600, which bundles MSVC 2008
|
||||
# - non-Linux/Posix OpenGL portions needs to build on MSVC 2013 (which
|
||||
# supports most of C99)
|
||||
# - the rest has no compiler compiler restrictions
|
||||
MSVC2013_COMPAT_CFLAGS="-Werror=pointer-arith"
|
||||
MSVC2013_COMPAT_CXXFLAGS="-Werror=pointer-arith"
|
||||
|
||||
# Enable -Werror=vla if compiler supports it
|
||||
save_CFLAGS="$CFLAGS"
|
||||
AC_MSG_CHECKING([whether $CC supports -Werror=vla])
|
||||
CFLAGS="$CFLAGS -Werror=vla"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
|
||||
[MSVC2013_COMPAT_CFLAGS="$MSVC2013_COMPAT_CFLAGS -Werror=vla";
|
||||
MSVC2013_COMPAT_CXXFLAGS="$MSVC2013_COMPAT_CXXFLAGS -Werror=vla";
|
||||
AC_MSG_RESULT([yes])],
|
||||
AC_MSG_RESULT([no]));
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
MSVC2008_COMPAT_CFLAGS="$MSVC2013_COMPAT_CFLAGS -Werror=declaration-after-statement"
|
||||
MSVC2008_COMPAT_CXXFLAGS="$MSVC2013_COMPAT_CXXFLAGS"
|
||||
fi
|
||||
if test "x$GXX" = xyes; then
|
||||
CXXFLAGS="$CXXFLAGS -Wall"
|
||||
@@ -333,11 +300,6 @@ if test "x$GXX" = xyes; then
|
||||
CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp"
|
||||
fi
|
||||
|
||||
AC_SUBST([MSVC2013_COMPAT_CFLAGS])
|
||||
AC_SUBST([MSVC2013_COMPAT_CXXFLAGS])
|
||||
AC_SUBST([MSVC2008_COMPAT_CFLAGS])
|
||||
AC_SUBST([MSVC2008_COMPAT_CXXFLAGS])
|
||||
|
||||
dnl even if the compiler appears to support it, using visibility attributes isn't
|
||||
dnl going to do anything useful currently on cygwin apart from emit lots of warnings
|
||||
case "$host_os" in
|
||||
@@ -420,8 +382,6 @@ if test "x$enable_debug" = xyes; then
|
||||
CXXFLAGS="$CXXFLAGS -O0"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
DEFINES="$DEFINES -DNDEBUG"
|
||||
fi
|
||||
|
||||
dnl
|
||||
@@ -665,7 +625,7 @@ AC_CHECK_FUNCS([dladdr])
|
||||
LIBS="$save_LIBS"
|
||||
|
||||
case "$host_os" in
|
||||
darwin*)
|
||||
darwin*|mingw*)
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
|
||||
@@ -679,10 +639,13 @@ dnl See if posix_memalign is available
|
||||
AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
|
||||
|
||||
dnl Check for pthreads
|
||||
AX_PTHREAD
|
||||
if test "x$ax_pthread_ok" = xno; then
|
||||
AC_MSG_ERROR([Building mesa on this platform requires pthreads])
|
||||
fi
|
||||
case "$host_os" in
|
||||
mingw*)
|
||||
;;
|
||||
*)
|
||||
AX_PTHREAD
|
||||
;;
|
||||
esac
|
||||
dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
|
||||
dnl to -pthread, which causes problems if we need -lpthread to appear in
|
||||
dnl pkgconfig files.
|
||||
@@ -722,6 +685,11 @@ AC_ARG_ENABLE([gles2],
|
||||
[enable support for OpenGL ES 2.x API @<:@default=disabled@:>@])],
|
||||
[enable_gles2="$enableval"],
|
||||
[enable_gles2=no])
|
||||
AC_ARG_ENABLE([openvg],
|
||||
[AS_HELP_STRING([--enable-openvg],
|
||||
[enable support for OpenVG API @<:@default=disabled@:>@])],
|
||||
[enable_openvg="$enableval"],
|
||||
[enable_openvg=no])
|
||||
|
||||
AC_ARG_ENABLE([dri],
|
||||
[AS_HELP_STRING([--enable-dri],
|
||||
@@ -852,6 +820,7 @@ if test "x$enable_opengl" = xno -a \
|
||||
"x$enable_gles1" = xno -a \
|
||||
"x$enable_gles2" = xno -a \
|
||||
"x$enable_nine" = xno -a \
|
||||
"x$enable_openvg" = xno -a \
|
||||
"x$enable_xa" = xno -a \
|
||||
"x$enable_xvmc" = xno -a \
|
||||
"x$enable_vdpau" = xno -a \
|
||||
@@ -913,7 +882,7 @@ AM_CONDITIONAL(HAVE_DRI_GLX, test "x$enable_glx" = xyes -a \
|
||||
case "$host_os" in
|
||||
darwin*)
|
||||
dri_platform='apple' ;;
|
||||
gnu*|cygwin*)
|
||||
gnu*|mingw*|cygwin*)
|
||||
dri_platform='none' ;;
|
||||
*)
|
||||
dri_platform='drm' ;;
|
||||
@@ -978,144 +947,6 @@ fi
|
||||
|
||||
AC_SUBST([MESA_LLVM])
|
||||
|
||||
# SHA1 hashing
|
||||
AC_ARG_WITH([sha1],
|
||||
[AS_HELP_STRING([--with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI],
|
||||
[choose SHA1 implementation])])
|
||||
case "x$with_sha1" in
|
||||
x | xlibc | xlibmd | xlibnettle | xlibgcrypt | xlibcrypto | xlibsha1 | xCommonCrypto | xCryptoAPI)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Illegal value for --with-sha1: $with_sha1])
|
||||
esac
|
||||
|
||||
AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes])
|
||||
if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then
|
||||
with_sha1=libc
|
||||
fi
|
||||
if test "x$with_sha1" = xlibc && test "x$HAVE_SHA1_IN_LIBC" != xyes; then
|
||||
AC_MSG_ERROR([sha1 in libc requested but not found])
|
||||
fi
|
||||
if test "x$with_sha1" = xlibc; then
|
||||
AC_DEFINE([HAVE_SHA1_IN_LIBC], [1],
|
||||
[Use libc SHA1 functions])
|
||||
SHA1_LIBS=""
|
||||
fi
|
||||
AC_CHECK_FUNC([CC_SHA1_Init], [HAVE_SHA1_IN_COMMONCRYPTO=yes])
|
||||
if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_COMMONCRYPTO" = xyes; then
|
||||
with_sha1=CommonCrypto
|
||||
fi
|
||||
if test "x$with_sha1" = xCommonCrypto && test "x$HAVE_SHA1_IN_COMMONCRYPTO" != xyes; then
|
||||
AC_MSG_ERROR([CommonCrypto requested but not found])
|
||||
fi
|
||||
if test "x$with_sha1" = xCommonCrypto; then
|
||||
AC_DEFINE([HAVE_SHA1_IN_COMMONCRYPTO], [1],
|
||||
[Use CommonCrypto SHA1 functions])
|
||||
SHA1_LIBS=""
|
||||
fi
|
||||
dnl stdcall functions cannot be tested with AC_CHECK_LIB
|
||||
AC_CHECK_HEADER([wincrypt.h], [HAVE_SHA1_IN_CRYPTOAPI=yes], [], [#include <windows.h>])
|
||||
if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_CRYPTOAPI" = xyes; then
|
||||
with_sha1=CryptoAPI
|
||||
fi
|
||||
if test "x$with_sha1" = xCryptoAPI && test "x$HAVE_SHA1_IN_CRYPTOAPI" != xyes; then
|
||||
AC_MSG_ERROR([CryptoAPI requested but not found])
|
||||
fi
|
||||
if test "x$with_sha1" = xCryptoAPI; then
|
||||
AC_DEFINE([HAVE_SHA1_IN_CRYPTOAPI], [1],
|
||||
[Use CryptoAPI SHA1 functions])
|
||||
SHA1_LIBS=""
|
||||
fi
|
||||
AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes])
|
||||
if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then
|
||||
with_sha1=libmd
|
||||
fi
|
||||
if test "x$with_sha1" = xlibmd && test "x$HAVE_LIBMD" != xyes; then
|
||||
AC_MSG_ERROR([libmd requested but not found])
|
||||
fi
|
||||
if test "x$with_sha1" = xlibmd; then
|
||||
AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1],
|
||||
[Use libmd SHA1 functions])
|
||||
SHA1_LIBS=-lmd
|
||||
fi
|
||||
PKG_CHECK_MODULES([LIBSHA1], [libsha1], [HAVE_LIBSHA1=yes], [HAVE_LIBSHA1=no])
|
||||
if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then
|
||||
with_sha1=libsha1
|
||||
fi
|
||||
if test "x$with_sha1" = xlibsha1 && test "x$HAVE_LIBSHA1" != xyes; then
|
||||
AC_MSG_ERROR([libsha1 requested but not found])
|
||||
fi
|
||||
if test "x$with_sha1" = xlibsha1; then
|
||||
AC_DEFINE([HAVE_SHA1_IN_LIBSHA1], [1],
|
||||
[Use libsha1 for SHA1])
|
||||
SHA1_LIBS=-lsha1
|
||||
fi
|
||||
AC_CHECK_LIB([nettle], [nettle_sha1_init], [HAVE_LIBNETTLE=yes])
|
||||
if test "x$with_sha1" = x && test "x$HAVE_LIBNETTLE" = xyes; then
|
||||
with_sha1=libnettle
|
||||
fi
|
||||
if test "x$with_sha1" = xlibnettle && test "x$HAVE_LIBNETTLE" != xyes; then
|
||||
AC_MSG_ERROR([libnettle requested but not found])
|
||||
fi
|
||||
if test "x$with_sha1" = xlibnettle; then
|
||||
AC_DEFINE([HAVE_SHA1_IN_LIBNETTLE], [1],
|
||||
[Use libnettle SHA1 functions])
|
||||
SHA1_LIBS=-lnettle
|
||||
fi
|
||||
AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes])
|
||||
if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then
|
||||
with_sha1=libgcrypt
|
||||
fi
|
||||
if test "x$with_sha1" = xlibgcrypt && test "x$HAVE_LIBGCRYPT" != xyes; then
|
||||
AC_MSG_ERROR([libgcrypt requested but not found])
|
||||
fi
|
||||
if test "x$with_sha1" = xlibgcrypt; then
|
||||
AC_DEFINE([HAVE_SHA1_IN_LIBGCRYPT], [1],
|
||||
[Use libgcrypt SHA1 functions])
|
||||
SHA1_LIBS=-lgcrypt
|
||||
fi
|
||||
# We don't need all of the OpenSSL libraries, just libcrypto
|
||||
AC_CHECK_LIB([crypto], [SHA1_Init], [HAVE_LIBCRYPTO=yes])
|
||||
PKG_CHECK_MODULES([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes],
|
||||
[HAVE_OPENSSL_PKC=no])
|
||||
if test "x$HAVE_LIBCRYPTO" = xyes || test "x$HAVE_OPENSSL_PKC" = xyes; then
|
||||
if test "x$with_sha1" = x; then
|
||||
with_sha1=libcrypto
|
||||
fi
|
||||
else
|
||||
if test "x$with_sha1" = xlibcrypto; then
|
||||
AC_MSG_ERROR([OpenSSL libcrypto requested but not found])
|
||||
fi
|
||||
fi
|
||||
if test "x$with_sha1" = xlibcrypto; then
|
||||
if test "x$HAVE_LIBCRYPTO" = xyes; then
|
||||
SHA1_LIBS=-lcrypto
|
||||
else
|
||||
SHA1_LIBS="$OPENSSL_LIBS"
|
||||
SHA1_CFLAGS="$OPENSSL_CFLAGS"
|
||||
fi
|
||||
fi
|
||||
AC_MSG_CHECKING([for SHA1 implementation])
|
||||
AC_MSG_RESULT([$with_sha1])
|
||||
AC_SUBST(SHA1_LIBS)
|
||||
AC_SUBST(SHA1_CFLAGS)
|
||||
|
||||
# Allow user to configure out the shader-cache feature
|
||||
AC_ARG_ENABLE([shader-cache],
|
||||
AS_HELP_STRING([--disable-shader-cache], [Disable binary shader cache]),
|
||||
[enable_shader_cache="$enableval"],
|
||||
[if test "x$with_sha1" != "x"; then
|
||||
enable_shader_cache=yes
|
||||
else
|
||||
enable_shader_cache=no
|
||||
fi])
|
||||
if test "x$with_sha1" = "x"; then
|
||||
if test "x$enable_shader_cache" = "xyes"; then
|
||||
AC_MSG_ERROR([Cannot enable shader cache (no SHA-1 implementation found)])
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL([ENABLE_SHADER_CACHE], [test x$enable_shader_cache = xyes])
|
||||
|
||||
# Check for libdrm
|
||||
PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
|
||||
[have_libdrm=yes], [have_libdrm=no])
|
||||
@@ -1571,6 +1402,29 @@ if test "x$enable_xa" = xyes; then
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_ST_XA, test "x$enable_xa" = xyes)
|
||||
|
||||
dnl
|
||||
dnl OpenVG configuration
|
||||
dnl
|
||||
VG_LIB_DEPS=""
|
||||
|
||||
if test "x$enable_openvg" = xyes; then
|
||||
if test "x$enable_egl" = xno; then
|
||||
AC_MSG_ERROR([cannot enable OpenVG without EGL])
|
||||
fi
|
||||
if test -z "$with_gallium_drivers"; then
|
||||
AC_MSG_ERROR([cannot enable OpenVG without Gallium])
|
||||
fi
|
||||
|
||||
AC_MSG_ERROR([Cannot enable OpenVG, because egl_gallium has been removed and
|
||||
OpenVG has not been integrated into standard libEGL yet])
|
||||
|
||||
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
|
||||
VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
|
||||
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 Gallium G3DVL configuration
|
||||
dnl
|
||||
@@ -1789,7 +1643,7 @@ for plat in $egl_platforms; do
|
||||
AC_MSG_ERROR([EGL platform drm requires libdrm >= $LIBDRM_REQUIRED])
|
||||
;;
|
||||
|
||||
android|gdi|null)
|
||||
android|fbdev|gdi|null)
|
||||
;;
|
||||
|
||||
*)
|
||||
@@ -1818,6 +1672,7 @@ fi
|
||||
AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep -q 'x11')
|
||||
AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep -q 'wayland')
|
||||
AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep -q 'drm')
|
||||
AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep -q 'fbdev')
|
||||
AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep -q 'null')
|
||||
|
||||
AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
|
||||
@@ -1832,6 +1687,21 @@ if ! echo "$egl_platforms" | grep -q 'x11'; then
|
||||
GL_PC_CFLAGS="$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([max-width],
|
||||
[AS_HELP_STRING([--with-max-width=N],
|
||||
[Maximum framebuffer width (4096)])],
|
||||
[DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
|
||||
AS_IF([test "${withval}" -gt "4096"],
|
||||
[AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
|
||||
)
|
||||
AC_ARG_WITH([max-height],
|
||||
[AS_HELP_STRING([--with-max-height=N],
|
||||
[Maximum framebuffer height (4096)])],
|
||||
[DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
|
||||
AS_IF([test "${withval}" -gt "4096"],
|
||||
[AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
|
||||
)
|
||||
|
||||
dnl
|
||||
dnl Gallium LLVM
|
||||
dnl
|
||||
@@ -2361,7 +2231,9 @@ AC_CONFIG_FILES([Makefile
|
||||
src/gallium/auxiliary/Makefile
|
||||
src/gallium/auxiliary/pipe-loader/Makefile
|
||||
src/gallium/drivers/freedreno/Makefile
|
||||
src/gallium/drivers/galahad/Makefile
|
||||
src/gallium/drivers/i915/Makefile
|
||||
src/gallium/drivers/identity/Makefile
|
||||
src/gallium/drivers/ilo/Makefile
|
||||
src/gallium/drivers/llvmpipe/Makefile
|
||||
src/gallium/drivers/noop/Makefile
|
||||
@@ -2384,6 +2256,7 @@ AC_CONFIG_FILES([Makefile
|
||||
src/gallium/state_trackers/osmesa/Makefile
|
||||
src/gallium/state_trackers/va/Makefile
|
||||
src/gallium/state_trackers/vdpau/Makefile
|
||||
src/gallium/state_trackers/vega/Makefile
|
||||
src/gallium/state_trackers/xa/Makefile
|
||||
src/gallium/state_trackers/xvmc/Makefile
|
||||
src/gallium/targets/d3dadapter9/Makefile
|
||||
@@ -2409,8 +2282,10 @@ AC_CONFIG_FILES([Makefile
|
||||
src/gallium/winsys/radeon/drm/Makefile
|
||||
src/gallium/winsys/svga/drm/Makefile
|
||||
src/gallium/winsys/sw/dri/Makefile
|
||||
src/gallium/winsys/sw/fbdev/Makefile
|
||||
src/gallium/winsys/sw/kms-dri/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/gallium/winsys/vc4/drm/Makefile
|
||||
@@ -2459,6 +2334,7 @@ echo " includedir: $includedir"
|
||||
dnl API info
|
||||
echo ""
|
||||
echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
|
||||
echo " OpenVG: $enable_openvg"
|
||||
|
||||
dnl Driver info
|
||||
echo ""
|
||||
@@ -2527,12 +2403,6 @@ else
|
||||
echo " Gallium: no"
|
||||
fi
|
||||
|
||||
dnl Shader cache
|
||||
echo ""
|
||||
echo " Shader cache: $enable_shader_cache"
|
||||
if test "x$enable_shader_cache" = "xyes"; then
|
||||
echo " With SHA1 from: $with_sha1"
|
||||
fi
|
||||
|
||||
dnl Libraries
|
||||
echo ""
|
||||
|
98
docs/GL3.txt
98
docs/GL3.txt
@@ -21,23 +21,23 @@ Feature Status
|
||||
GL 3.0, GLSL 1.30 --- all DONE: i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe
|
||||
|
||||
glBindFragDataLocation, glGetFragDataLocation DONE
|
||||
Conditional rendering (GL_NV_conditional_render) DONE ()
|
||||
Map buffer subranges (GL_ARB_map_buffer_range) DONE ()
|
||||
Clamping controls (GL_ARB_color_buffer_float) DONE ()
|
||||
Float textures, renderbuffers (GL_ARB_texture_float) DONE ()
|
||||
Conditional rendering (GL_NV_conditional_render) DONE (r300, swrast)
|
||||
Map buffer subranges (GL_ARB_map_buffer_range) DONE (r300, swrast)
|
||||
Clamping controls (GL_ARB_color_buffer_float) DONE (r300)
|
||||
Float textures, renderbuffers (GL_ARB_texture_float) DONE (r300)
|
||||
GL_EXT_packed_float DONE ()
|
||||
GL_EXT_texture_shared_exponent DONE ()
|
||||
GL_EXT_texture_shared_exponent DONE (swrast)
|
||||
Float depth buffers (GL_ARB_depth_buffer_float) DONE ()
|
||||
Framebuffer objects (GL_ARB_framebuffer_object) DONE ()
|
||||
Framebuffer objects (GL_ARB_framebuffer_object) DONE (r300, swrast)
|
||||
GL_ARB_half_float_pixel DONE (all drivers)
|
||||
GL_ARB_half_float_vertex DONE ()
|
||||
GL_ARB_half_float_vertex DONE (r300, swrast)
|
||||
GL_EXT_texture_integer DONE ()
|
||||
GL_EXT_texture_array DONE ()
|
||||
Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE ()
|
||||
GL_EXT_texture_compression_rgtc DONE ()
|
||||
GL_ARB_texture_rg DONE ()
|
||||
Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE (swrast)
|
||||
GL_EXT_texture_compression_rgtc DONE (r300, swrast)
|
||||
GL_ARB_texture_rg DONE (r300, swrast)
|
||||
Transform feedback (GL_EXT_transform_feedback) DONE ()
|
||||
Vertex array objects (GL_ARB_vertex_array_object) DONE ()
|
||||
Vertex array objects (GL_ARB_vertex_array_object) DONE (all drivers)
|
||||
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) DONE ()
|
||||
glClearBuffer commands DONE
|
||||
glGetStringi command DONE
|
||||
@@ -45,7 +45,7 @@ GL 3.0, GLSL 1.30 --- all DONE: i965, nv50, nvc0, r600, radeonsi, llvmpipe, soft
|
||||
glVertexAttribI commands DONE
|
||||
Depth format cube textures DONE ()
|
||||
GLX_ARB_create_context (GLX 1.4 is required) DONE
|
||||
Multisample anti-aliasing DONE (llvmpipe (*), softpipe (*))
|
||||
Multisample anti-aliasing DONE (llvmpipe (*), softpipe (*), r300)
|
||||
|
||||
(*) llvmpipe and softpipe have fake Multisample anti-aliasing support
|
||||
|
||||
@@ -53,28 +53,28 @@ GL 3.0, GLSL 1.30 --- all DONE: i965, nv50, nvc0, r600, radeonsi, llvmpipe, soft
|
||||
GL 3.1, GLSL 1.40 --- all DONE: i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe
|
||||
|
||||
Forward compatible context support/deprecations DONE ()
|
||||
Instanced drawing (GL_ARB_draw_instanced) DONE ()
|
||||
Buffer copying (GL_ARB_copy_buffer) DONE ()
|
||||
Primitive restart (GL_NV_primitive_restart) DONE ()
|
||||
Instanced drawing (GL_ARB_draw_instanced) DONE (swrast)
|
||||
Buffer copying (GL_ARB_copy_buffer) DONE (r300, swrast)
|
||||
Primitive restart (GL_NV_primitive_restart) DONE (r300)
|
||||
16 vertex texture image units DONE ()
|
||||
Texture buffer objs (GL_ARB_texture_buffer_object) DONE for OpenGL 3.1 contexts ()
|
||||
Rectangular textures (GL_ARB_texture_rectangle) DONE ()
|
||||
Uniform buffer objs (GL_ARB_uniform_buffer_object) DONE ()
|
||||
Signed normalized textures (GL_EXT_texture_snorm) DONE ()
|
||||
Rectangular textures (GL_ARB_texture_rectangle) DONE (r300, swrast)
|
||||
Uniform buffer objs (GL_ARB_uniform_buffer_object) DONE (swrast)
|
||||
Signed normalized textures (GL_EXT_texture_snorm) DONE (r300)
|
||||
|
||||
|
||||
GL 3.2, GLSL 1.50 --- all DONE: i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe
|
||||
|
||||
Core/compatibility profiles DONE
|
||||
Geometry shaders DONE ()
|
||||
BGRA vertex order (GL_ARB_vertex_array_bgra) DONE ()
|
||||
Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE ()
|
||||
Frag shader coord (GL_ARB_fragment_coord_conventions) DONE ()
|
||||
Provoking vertex (GL_ARB_provoking_vertex) DONE ()
|
||||
BGRA vertex order (GL_ARB_vertex_array_bgra) DONE (r300, swrast)
|
||||
Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE (r300, swrast)
|
||||
Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (r300, swrast)
|
||||
Provoking vertex (GL_ARB_provoking_vertex) DONE (r300, swrast)
|
||||
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE ()
|
||||
Multisample textures (GL_ARB_texture_multisample) DONE ()
|
||||
Frag depth clamp (GL_ARB_depth_clamp) DONE ()
|
||||
Fence objects (GL_ARB_sync) DONE ()
|
||||
Frag depth clamp (GL_ARB_depth_clamp) DONE (swrast)
|
||||
Fence objects (GL_ARB_sync) DONE (r300, swrast)
|
||||
GLX_ARB_create_context_profile DONE
|
||||
|
||||
|
||||
@@ -82,40 +82,40 @@ GL 3.3, GLSL 3.30 --- all DONE: i965, nv50, nvc0, r600, radeonsi, llvmpipe, soft
|
||||
|
||||
GL_ARB_blend_func_extended DONE ()
|
||||
GL_ARB_explicit_attrib_location DONE (all drivers that support GLSL)
|
||||
GL_ARB_occlusion_query2 DONE ()
|
||||
GL_ARB_occlusion_query2 DONE (r300, swrast)
|
||||
GL_ARB_sampler_objects DONE (all drivers)
|
||||
GL_ARB_shader_bit_encoding DONE ()
|
||||
GL_ARB_texture_rgb10_a2ui DONE ()
|
||||
GL_ARB_texture_swizzle DONE ()
|
||||
GL_ARB_texture_swizzle DONE (r300, swrast)
|
||||
GL_ARB_timer_query DONE ()
|
||||
GL_ARB_instanced_arrays DONE ()
|
||||
GL_ARB_instanced_arrays DONE (r300)
|
||||
GL_ARB_vertex_type_2_10_10_10_rev DONE ()
|
||||
|
||||
|
||||
GL 4.0, GLSL 4.00:
|
||||
|
||||
GL_ARB_draw_buffers_blend DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_draw_indirect DONE (i965, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_draw_indirect DONE (i965, nvc0, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_gpu_shader5 DONE (i965, nvc0)
|
||||
- 'precise' qualifier DONE
|
||||
- Dynamically uniform sampler array indices DONE (r600)
|
||||
- Dynamically uniform UBO array indices DONE (r600)
|
||||
- Implicit signed -> unsigned conversions DONE
|
||||
- Fused multiply-add DONE ()
|
||||
- Packing/bitfield/conversion functions DONE (r600, radeonsi)
|
||||
- Packing/bitfield/conversion functions DONE (r600)
|
||||
- Enhanced textureGather DONE (r600, radeonsi)
|
||||
- Geometry shader instancing DONE (r600)
|
||||
- Geometry shader multiple streams DONE ()
|
||||
- Enhanced per-sample shading DONE (r600, radeonsi)
|
||||
- Enhanced per-sample shading DONE (r600)
|
||||
- Interpolation functions DONE (r600)
|
||||
- New overload resolution rules DONE
|
||||
GL_ARB_gpu_shader_fp64 DONE (nvc0, softpipe)
|
||||
GL_ARB_gpu_shader_fp64 started (Dave)
|
||||
GL_ARB_sample_shading DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_shader_subroutine not started
|
||||
GL_ARB_tessellation_shader started (Chris, Ilia)
|
||||
GL_ARB_texture_buffer_object_rgb32 DONE (i965, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_texture_cube_map_array DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_texture_gather DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe)
|
||||
GL_ARB_texture_gather DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_texture_query_lod DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_transform_feedback2 DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_transform_feedback3 DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
@@ -123,7 +123,7 @@ GL 4.0, GLSL 4.00:
|
||||
|
||||
GL 4.1, GLSL 4.10:
|
||||
|
||||
GL_ARB_ES2_compatibility DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_ES2_compatibility DONE (i965, nv50, nvc0, r300, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_get_program_binary DONE (0 binary formats)
|
||||
GL_ARB_separate_shader_objects DONE (all drivers)
|
||||
GL_ARB_shader_precision started (Micah)
|
||||
@@ -142,8 +142,7 @@ GL 4.2, GLSL 4.20:
|
||||
GL_ARB_shader_image_load_store in progress (curro)
|
||||
GL_ARB_conservative_depth DONE (all drivers that support GLSL 1.30)
|
||||
GL_ARB_shading_language_420pack DONE (all drivers that support GLSL 1.30)
|
||||
GL_ARB_shading_language_packing DONE (all drivers)
|
||||
GL_ARB_internalformat_query DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_internalformat_query DONE (i965, nv50, nvc0, r300, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_map_buffer_alignment DONE (all drivers)
|
||||
|
||||
|
||||
@@ -160,7 +159,7 @@ GL 4.3, GLSL 4.30:
|
||||
GL_ARB_framebuffer_no_attachments not started
|
||||
GL_ARB_internalformat_query2 not started
|
||||
GL_ARB_invalidate_subdata DONE (all drivers)
|
||||
GL_ARB_multi_draw_indirect DONE (i965, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_multi_draw_indirect DONE (i965, nvc0, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_program_interface_query not started
|
||||
GL_ARB_robust_buffer_access_behavior not started
|
||||
GL_ARB_shader_image_size not started
|
||||
@@ -176,57 +175,54 @@ GL 4.3, GLSL 4.30:
|
||||
GL 4.4, GLSL 4.40:
|
||||
|
||||
GL_MAX_VERTEX_ATTRIB_STRIDE DONE (all drivers)
|
||||
GL_ARB_buffer_storage DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_buffer_storage DONE (i965, nv30, nv50, nvc0, r300, r600, radeonsi)
|
||||
GL_ARB_clear_texture DONE (i965)
|
||||
GL_ARB_enhanced_layouts not started
|
||||
GL_ARB_multi_bind DONE (all drivers)
|
||||
GL_ARB_query_buffer_object not started
|
||||
GL_ARB_texture_mirror_clamp_to_edge DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_texture_mirror_clamp_to_edge DONE (i965, nv30, nv50, nvc0, r300, r600, radeonsi, swrast, llvmpipe, softpipe)
|
||||
GL_ARB_texture_stencil8 not started
|
||||
GL_ARB_vertex_type_10f_11f_11f_rev DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
|
||||
GL 4.5, GLSL 4.50:
|
||||
|
||||
GL_ARB_ES3_1_compatibility not started
|
||||
GL_ARB_clip_control DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_clip_control DONE (nv50, nvc0, r300, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_conditional_render_inverted DONE (i965, nv50, nvc0, llvmpipe, softpipe)
|
||||
GL_ARB_cull_distance not started
|
||||
GL_ARB_derivative_control DONE (i965, nv50, nvc0, r600)
|
||||
GL_ARB_direct_state_access started
|
||||
- Transform Feedback object DONE
|
||||
- Buffer object DONE
|
||||
- Transform Feedback object started (Martin Peres)
|
||||
- Buffer object started (Laura Ekstrand)
|
||||
- Framebuffer object started (Laura Ekstrand)
|
||||
- Renderbuffer object DONE
|
||||
- Texture object DONE
|
||||
- Renderbuffer object not started
|
||||
- Texture object started (Laura Ekstrand)
|
||||
- Vertex array object started (Fredrik Höglund)
|
||||
- Sampler object DONE
|
||||
- Program Pipeline object DONE
|
||||
- Query object DONE (will require changes when GL_ARB_query_buffer_object lands)
|
||||
- Sampler object not started
|
||||
- Program Pipeline object not started
|
||||
- Query object started (Martin Peres)
|
||||
GL_ARB_get_texture_sub_image started (Brian Paul)
|
||||
GL_ARB_shader_texture_image_samples not started
|
||||
GL_ARB_texture_barrier DONE (nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_texture_barrier DONE (nv50, nvc0, r300, r600, radeonsi)
|
||||
GL_KHR_context_flush_control DONE (all - but needs GLX/EXT extension to be useful)
|
||||
GL_KHR_robust_buffer_access_behavior not started
|
||||
GL_KHR_robustness 90% done (the ARB variant)
|
||||
GL_EXT_shader_integer_mix DONE (all drivers that support GLSL)
|
||||
|
||||
These are the extensions cherry-picked to make GLES 3.1
|
||||
GLES3.1, GLSL ES 3.1
|
||||
GL_ARB_arrays_of_arrays started (Timothy)
|
||||
GL_ARB_compute_shader in progress (jljusten)
|
||||
GL_ARB_draw_indirect DONE (i965, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_explicit_uniform_location DONE (all drivers that support GLSL)
|
||||
GL_ARB_framebuffer_no_attachments not started
|
||||
GL_ARB_program_interface_query not started
|
||||
GL_ARB_shader_atomic_counters DONE (i965)
|
||||
GL_ARB_shader_image_load_store in progress (curro)
|
||||
GL_ARB_shader_storage_buffer_object not started
|
||||
GL_ARB_shading_language_packing DONE (all drivers)
|
||||
GL_ARB_separate_shader_objects DONE (all drivers)
|
||||
GL_ARB_stencil_texturing DONE (i965/gen8+, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_vertex_attrib_binding DONE (all drivers)
|
||||
GS5 Enhanced textureGather DONE (i965, nvc0, r600, radeonsi)
|
||||
GS5 Packing/bitfield/conversion functions DONE (i965, nvc0, r600, radeonsi)
|
||||
GS5 Packing/bitfield/conversion functions DONE (i965, nvc0, r600)
|
||||
GL_EXT_shader_integer_mix DONE (all drivers that support GLSL)
|
||||
|
||||
|
||||
|
@@ -11,6 +11,10 @@ no longer shipped or supported.
|
||||
|
||||
Run
|
||||
|
||||
scons osmesa mesagdi
|
||||
|
||||
to build classic mesa Windows GDI drivers; or
|
||||
|
||||
scons libgl-gdi
|
||||
|
||||
to build gallium based GDI driver.
|
||||
|
@@ -61,6 +61,7 @@
|
||||
<li><a href="shading.html" target="_parent">Shading Language</a>
|
||||
<li><a href="egl.html" target="_parent">EGL</a>
|
||||
<li><a href="opengles.html" target="_parent">OpenGL ES</a>
|
||||
<li><a href="openvg.html" target="_parent">OpenVG / Vega</a>
|
||||
<li><a href="envvars.html" target="_parent">Environment Variables</a>
|
||||
<li><a href="osmesa.html" target="_parent">Off-Screen Rendering</a>
|
||||
<li><a href="debugging.html" target="_parent">Debugging Tips</a>
|
||||
|
@@ -204,8 +204,9 @@ terribly relevant.</p>
|
||||
few preprocessor defines.</p>
|
||||
|
||||
<ul>
|
||||
<li>If <tt>GLX_USE_TLS</tt> is defined, method #3 is used.</li>
|
||||
<li>If <tt>HAVE_PTHREAD</tt> is defined, method #2 is used.</li>
|
||||
<li>If <tt>GLX_USE_TLS</tt> is defined, method #4 is used.</li>
|
||||
<li>If <tt>HAVE_PTHREAD</tt> is defined, method #3 is used.</li>
|
||||
<li>If <tt>WIN32_THREADS</tt> is defined, method #2 is used.</li>
|
||||
<li>If none of the preceding are defined, method #1 is used.</li>
|
||||
</ul>
|
||||
|
||||
|
@@ -88,11 +88,8 @@ types such as <code>EGLNativeDisplayType</code> or
|
||||
<code>EGLNativeWindowType</code> defined for.</p>
|
||||
|
||||
<p>The available platforms are <code>x11</code>, <code>drm</code>,
|
||||
<code>wayland</code>, <code>null</code>, <code>android</code>,
|
||||
<code>haiku</code>, and <code>gdi</code>. The <code>android</code> platform
|
||||
can only be built as a system component, part of AOSP, while the
|
||||
<code>haiku</code> and <code>gdi</code> platforms can only be built with SCons.
|
||||
Unless for special needs, the build system should
|
||||
<code>fbdev</code>, and <code>gdi</code>. The <code>gdi</code> platform can
|
||||
only be built with SCons. Unless for special needs, the build system should
|
||||
select the right platforms automatically.</p>
|
||||
|
||||
</dd>
|
||||
@@ -115,6 +112,13 @@ is required if applications mix OpenGL and OpenGL ES.</p>
|
||||
|
||||
</dd>
|
||||
|
||||
<dt><code>--enable-openvg</code></dt>
|
||||
<dd>
|
||||
|
||||
<p>OpenVG must be explicitly enabled by this option.</p>
|
||||
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
<h2>Use EGL</h2>
|
||||
@@ -208,15 +212,38 @@ the X server directly using (XCB-)DRI2 protocol.</p>
|
||||
|
||||
</dd>
|
||||
|
||||
<dt><code>egl_gallium</code></dt>
|
||||
<dd>
|
||||
|
||||
<p>This driver is based on Gallium3D. It supports all rendering APIs and
|
||||
hardware supported by Gallium3D. It is the only driver that supports OpenVG.
|
||||
The supported platforms are X11, DRM, FBDEV, and GDI.</p>
|
||||
|
||||
<p>This driver comes with its own hardware drivers
|
||||
(<code>pipe_<hw></code>) and client API modules
|
||||
(<code>st_<api></code>).</p>
|
||||
|
||||
</dd>
|
||||
|
||||
<h2>Packaging</h2>
|
||||
|
||||
<p>The ABI between the main library and its drivers are not stable. Nor is
|
||||
there a plan to stabilize it at the moment.</p>
|
||||
there a plan to stabilize it at the moment. Of the EGL drivers,
|
||||
<code>egl_gallium</code> has its own hardware drivers and client API modules.
|
||||
They are considered internal to <code>egl_gallium</code> and there is also no
|
||||
stable ABI between them. These should be kept in mind when packaging for
|
||||
distribution.</p>
|
||||
|
||||
<p>Generally, <code>egl_dri2</code> is preferred over <code>egl_gallium</code>
|
||||
when the system already has DRI drivers. As <code>egl_gallium</code> is loaded
|
||||
before <code>egl_dri2</code> when both are available, <code>egl_gallium</code>
|
||||
is disabled by default.</p>
|
||||
|
||||
<h2>Developers</h2>
|
||||
|
||||
<p>The sources of the main library and drivers can be found at
|
||||
<code>src/egl/</code>.</p>
|
||||
<p>The sources of the main library and the classic drivers can be found at
|
||||
<code>src/egl/</code>. The sources of the <code>egl</code> state tracker can
|
||||
be found at <code>src/gallium/state_trackers/egl/</code>.</p>
|
||||
|
||||
<h3>Lifetime of Display Resources</h3>
|
||||
|
||||
|
@@ -16,43 +16,6 @@
|
||||
|
||||
<h1>News</h1>
|
||||
|
||||
<h2>March 28, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.5.2.html">Mesa 10.5.2</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>March 20, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.4.7.html">Mesa 10.4.7</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>March 13, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.5.1.html">Mesa 10.5.1</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>March 06, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.5.0.html">Mesa 10.5.0</a> is released. This is a new
|
||||
development release. See the release notes for more information about
|
||||
the release.
|
||||
</p>
|
||||
|
||||
<h2>March 06, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.4.6.html">Mesa 10.4.6</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>February 21, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.4.5.html">Mesa 10.4.5</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>February 06, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.4.4.html">Mesa 10.4.4</a> is released.
|
||||
|
@@ -55,8 +55,8 @@ Versions 2.5.35 and 2.4.1, respectively, (or later) should work.
|
||||
<br>
|
||||
On Windows with MinGW, install flex and bison with:
|
||||
<pre>mingw-get install msys-flex msys-bison</pre>
|
||||
For MSVC on Windows, install
|
||||
<a href="http://winflexbison.sourceforge.net/">Win flex-bison</a>.
|
||||
For MSVC on Windows, you can find flex/bison programs on the
|
||||
<a href="ftp://ftp.freedesktop.org/pub/mesa/windows-utils/">Mesa ftp site</a>.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -127,13 +127,14 @@ by -debug for debug builds.
|
||||
To build Mesa with SCons for Windows on Linux using the MinGW crosscompiler toolchain do
|
||||
</p>
|
||||
<pre>
|
||||
scons platform=windows toolchain=crossmingw machine=x86 libgl-gdi
|
||||
scons platform=windows toolchain=crossmingw machine=x86 mesagdi libgl-gdi
|
||||
</pre>
|
||||
<p>
|
||||
This will create:
|
||||
</p>
|
||||
<ul>
|
||||
<li>build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll — Mesa + Gallium + softpipe (or llvmpipe), binary compatible with Windows's opengl32.dll
|
||||
<li>build/windows-x86-debug/mesa/drivers/windows/gdi/opengl32.dll — Mesa + swrast, binary compatible with Windows's opengl32.dll
|
||||
<li>build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll — Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll
|
||||
</ul>
|
||||
<p>
|
||||
Put them all in the same directory to test them.
|
||||
|
59
docs/openvg.html
Normal file
59
docs/openvg.html
Normal file
@@ -0,0 +1,59 @@
|
||||
<!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>OpenVG State Tracker</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>OpenVG State Tracker</h1>
|
||||
|
||||
<p>
|
||||
The current version of the OpenVG state tracker implements OpenVG 1.1.
|
||||
</p>
|
||||
<p>
|
||||
More information about OpenVG can be found at
|
||||
<a href="http://www.khronos.org/openvg/">
|
||||
http://www.khronos.org/openvg/</a> .
|
||||
</p>
|
||||
<p>
|
||||
The OpenVG state tracker depends on the Gallium architecture and a working EGL implementation.
|
||||
Please refer to <a href="egl.html">Mesa EGL</a> for more information about EGL.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>Building the library</h2>
|
||||
<ol>
|
||||
<li>Run <code>configure</code> with <code>--enable-openvg</code> and
|
||||
<code>--enable-gallium-egl</code>. If you do not need OpenGL, you can add
|
||||
<code>--disable-opengl</code> to save the compilation time.</li>
|
||||
|
||||
<li>Build and install Mesa as usual.</li>
|
||||
</ol>
|
||||
|
||||
<h3>Sample build</h3>
|
||||
A sample build looks as follows:
|
||||
<pre>
|
||||
$ ./configure --disable-opengl --enable-openvg --enable-gallium-egl
|
||||
$ make
|
||||
$ make install
|
||||
</pre>
|
||||
|
||||
<p>It will install <code>libOpenVG.so</code>, <code>libEGL.so</code>, and one
|
||||
or more EGL drivers.</p>
|
||||
|
||||
<h2>OpenVG Demos</h2>
|
||||
|
||||
<p>OpenVG demos can be found in mesa/demos repository.</p>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -21,12 +21,6 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="relnotes/10.5.2.html">10.5.2 release notes</a>
|
||||
<li><a href="relnotes/10.4.7.html">10.4.7 release notes</a>
|
||||
<li><a href="relnotes/10.5.1.html">10.5.1 release notes</a>
|
||||
<li><a href="relnotes/10.5.0.html">10.5.0 release notes</a>
|
||||
<li><a href="relnotes/10.4.6.html">10.4.6 release notes</a>
|
||||
<li><a href="relnotes/10.4.5.html">10.4.5 release notes</a>
|
||||
<li><a href="relnotes/10.4.4.html">10.4.4 release notes</a>
|
||||
<li><a href="relnotes/10.4.3.html">10.4.3 release notes</a>
|
||||
<li><a href="relnotes/10.4.2.html">10.4.2 release notes</a>
|
||||
|
@@ -1,114 +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 10.4.5 Release Notes / February 21, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.4.5 is a bug fix release which fixes bugs found since the 10.4.4 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.4.5 implements the OpenGL 3.3 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.3. OpenGL
|
||||
3.3 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
e12bbdaee9a758617e8ebd0bb0e987f72addd11db2e4da25ba695e386cd63843 MesaLib-10.4.5.tar.gz
|
||||
bf60000700a9d58e3aca2bfeee7e781053b0d839e61a95b1883e05a2dee247a0 MesaLib-10.4.5.tar.bz2
|
||||
3b926de8eee500bb67cf85332c51292f826cc539b8636382aadbb8e70c76527a MesaLib-10.4.5.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=82477">Bug 82477</a> - [softpipe] piglit fp-long-alu regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88658">Bug 88658</a> - (bisected) Slow video playback on Kabini</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89069">Bug 89069</a> - Lack of grass in The Talos Principle on radeonsi (native\wine\nine)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Carl Worth (1):</p>
|
||||
<ul>
|
||||
<li>Revert use of Mesa IR optimizer for ARB_fragment_programs</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (3):</p>
|
||||
<ul>
|
||||
<li>docs: Add sha256 sums for the 10.4.4 release</li>
|
||||
<li>get-pick-list.sh: Require explicit "10.4" for nominating stable patches</li>
|
||||
<li>Update version to 10.4.5</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (3):</p>
|
||||
<ul>
|
||||
<li>nvc0: bail out of 2d blits with non-A8_UNORM alpha formats</li>
|
||||
<li>st/mesa: treat resource-less xfb buffers as if they weren't there</li>
|
||||
<li>nvc0: allow holes in xfb target lists</li>
|
||||
</ul>
|
||||
|
||||
<p>Jeremy Huddleston Sequoia (2):</p>
|
||||
<ul>
|
||||
<li>darwin: build fix</li>
|
||||
<li>darwin: build fix</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (4):</p>
|
||||
<ul>
|
||||
<li>i965: Override swizzles for integer luminance formats.</li>
|
||||
<li>i965: Use a gl_color_union for sampler border color.</li>
|
||||
<li>i965: Fix integer border color on Haswell.</li>
|
||||
<li>glsl: Reduce memory consumption of copy propagation passes.</li>
|
||||
</ul>
|
||||
|
||||
<p>Laura Ekstrand (1):</p>
|
||||
<ul>
|
||||
<li>main: Fixed _mesa_GetCompressedTexImage_sw to copy slices correctly.</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (5):</p>
|
||||
<ul>
|
||||
<li>r600g,radeonsi: don't append to streamout buffers that haven't been used yet</li>
|
||||
<li>radeonsi: fix instanced arrays with non-zero start instance</li>
|
||||
<li>radeonsi: small fix in SPI state</li>
|
||||
<li>mesa: fix AtomicBuffer typo in _mesa_DeleteBuffers</li>
|
||||
<li>radeonsi: fix a crash if a stencil ref state is set before a DSA state</li>
|
||||
</ul>
|
||||
|
||||
<p>Michel Dänzer (2):</p>
|
||||
<ul>
|
||||
<li>st/mesa: Don't use PIPE_USAGE_STREAM for GL_PIXEL_UNPACK_BUFFER_ARB</li>
|
||||
<li>Revert "radeon/llvm: enable unsafe math for graphics shaders"</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -1,143 +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 10.4.6 Release Notes / March 06, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.4.6 is a bug fix release which fixes bugs found since the 10.4.5 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.4.6 implements the OpenGL 3.3 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.3. OpenGL
|
||||
3.3 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
46c9082142e811c01e49a2c332a9ac0a1eb98f2908985fb9df216539d7eaeaf4 MesaLib-10.4.6.tar.gz
|
||||
d8baedd20e79ccd98a5a7b05e23d59a30892e68de1fcc057ca6873dafca02735 MesaLib-10.4.6.tar.bz2
|
||||
6aded6eac7f0d4d55117b8b581d8424710bbb4c768fc90f7b881f29311a751aa MesaLib-10.4.6.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=45348">Bug 45348</a> - [swrast] piglit fbo-drawbuffers-arbfp regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84613">Bug 84613</a> - [G965, bisected] piglit regressions : glslparsertest.glsl2</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87516">Bug 87516</a> - glProgramBinary violates spec</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88885">Bug 88885</a> - Transform feedback uses incorrect interleaving if a previous draw did not write gl_Position</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89180">Bug 89180</a> - [IVB regression] Rendering issues in Mass Effect through VMware Workstation</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Abdiel Janulgue (2):</p>
|
||||
<ul>
|
||||
<li>glsl: Don't optimize min/max into saturate when EmitNoSat is set</li>
|
||||
<li>st/mesa: For vertex shaders, don't emit saturate when SM 3.0 is unsupported</li>
|
||||
</ul>
|
||||
|
||||
<p>Andreas Boll (1):</p>
|
||||
<ul>
|
||||
<li>glx: Fix returned values of GLX_RENDERER_PREFERRED_PROFILE_MESA</li>
|
||||
</ul>
|
||||
|
||||
<p>Brian Paul (2):</p>
|
||||
<ul>
|
||||
<li>swrast: fix multiple color buffer writing</li>
|
||||
<li>st/mesa: fix sampler view reference counting bug in glDraw/CopyPixels</li>
|
||||
</ul>
|
||||
|
||||
<p>Chris Forbes (1):</p>
|
||||
<ul>
|
||||
<li>i965/gs: Check newly-generated GS-out VUE map against correct stage</li>
|
||||
</ul>
|
||||
|
||||
<p>Eduardo Lima Mitev (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Fix error validating args for TexSubImage3D</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (6):</p>
|
||||
<ul>
|
||||
<li>docs: Add sha256 sums for the 10.4.5 release</li>
|
||||
<li>install-lib-links: remove the .install-lib-links file</li>
|
||||
<li>Revert "mesa: Correct backwards NULL check."</li>
|
||||
<li>mesa: cherry-pick the second half of commit 2aa71e9485a</li>
|
||||
<li>Revert "gallivm: Update for RTDyldMemoryManager becoming an unique_ptr."</li>
|
||||
<li>Update version to 10.4.6</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (3):</p>
|
||||
<ul>
|
||||
<li>mesa: Add missing error checks in _mesa_ProgramBinary</li>
|
||||
<li>mesa: Ensure that length is set to zero in _mesa_GetProgramBinary</li>
|
||||
<li>mesa: Always generate GL_INVALID_OPERATION in _mesa_GetProgramBinary</li>
|
||||
</ul>
|
||||
|
||||
<p>Jonathan Gray (1):</p>
|
||||
<ul>
|
||||
<li>auxilary/os: correct sysctl use in os_get_total_physical_memory()</li>
|
||||
</ul>
|
||||
|
||||
<p>José Fonseca (1):</p>
|
||||
<ul>
|
||||
<li>gallivm: Update for RTDyldMemoryManager becoming an unique_ptr.</li>
|
||||
</ul>
|
||||
|
||||
<p>Leo Liu (1):</p>
|
||||
<ul>
|
||||
<li>st/omx/dec/h264: fix picture out-of-order with poc type 0 v2</li>
|
||||
</ul>
|
||||
|
||||
<p>Lucas Stach (1):</p>
|
||||
<ul>
|
||||
<li>install-lib-links: don't depend on .libs directory</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (2):</p>
|
||||
<ul>
|
||||
<li>vbo: fix an unitialized-variable warning</li>
|
||||
<li>radeonsi: fix point sprites</li>
|
||||
</ul>
|
||||
|
||||
<p>Matt Turner (4):</p>
|
||||
<ul>
|
||||
<li>glsl: Rewrite and fix min/max to saturate optimization.</li>
|
||||
<li>mesa: Correct backwards NULL check.</li>
|
||||
<li>i965/fs: Don't use backend_visitor::instructions after creating the CFG.</li>
|
||||
<li>mesa: Correct backwards NULL check.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -1,134 +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 10.4.7 Release Notes / March 20, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.4.7 is a bug fix release which fixes bugs found since the 10.4.6 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.4.7 implements the OpenGL 3.3 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.3. OpenGL
|
||||
3.3 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
9e7b59267199658808f8b33e0410b86fbafbdcd52378658b9df65fac9d24947f MesaLib-10.4.7.tar.gz
|
||||
2c351c98671f9a7ab3fd9c601bb7a255801b1580f5dd0992639f99152801b0d2 MesaLib-10.4.7.tar.bz2
|
||||
d14ac578b5ce16560757b53fbd1cb4d6b34652f8e110e4b10a019adc82e67ffd MesaLib-10.4.7.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=79202">Bug 79202</a> - valgrind errors in glsl-fs-uniform-array-loop-unroll.shader_test; random code generation</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89156">Bug 89156</a> - r300g: GL_COMPRESSED_RED_RGTC1 / ATI1N support broken</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89224">Bug 89224</a> - Incorrect rendering of Unigine Valley running in VM on VMware Workstation</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89530">Bug 89530</a> - FTBFS in loader: missing fstat</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Andrey Sudnik (1):</p>
|
||||
<ul>
|
||||
<li>i965/vec4: Don't lose the saturate modifier in copy propagation.</li>
|
||||
</ul>
|
||||
|
||||
<p>Daniel Stone (1):</p>
|
||||
<ul>
|
||||
<li>egl: Take alpha bits into account when selecting GBM formats</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (6):</p>
|
||||
<ul>
|
||||
<li>docs: Add sha256 sums for the 10.4.6 release</li>
|
||||
<li>cherry-ignore: add not applicable/rejected commits</li>
|
||||
<li>mesa: rename format_info.c to format_info.h</li>
|
||||
<li>loader: include <sys/stat.h> for non-sysfs builds</li>
|
||||
<li>auxiliary/os: fix the android build - s/drm_munmap/os_munmap/</li>
|
||||
<li>Update version to 10.4.7</li>
|
||||
</ul>
|
||||
|
||||
<p>Iago Toral Quiroga (1):</p>
|
||||
<ul>
|
||||
<li>i965: Fix out-of-bounds accesses into pull_constant_loc array</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (4):</p>
|
||||
<ul>
|
||||
<li>freedreno: move fb state copy after checking for size change</li>
|
||||
<li>freedreno/ir3: fix array count returned by TXQ</li>
|
||||
<li>freedreno/ir3: get the # of miplevels from getinfo</li>
|
||||
<li>freedreno: fix slice pitch calculations</li>
|
||||
</ul>
|
||||
|
||||
<p>Marc-Andre Lureau (1):</p>
|
||||
<ul>
|
||||
<li>gallium/auxiliary/indices: fix start param</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (4):</p>
|
||||
<ul>
|
||||
<li>r300g: fix RGTC1 and LATC1 SNORM formats</li>
|
||||
<li>r300g: fix a crash when resolving into an sRGB texture</li>
|
||||
<li>r300g: fix sRGB->sRGB blits</li>
|
||||
<li>radeonsi: increase coords array size for radeon_llvm_emit_prepare_cube_coords</li>
|
||||
</ul>
|
||||
|
||||
<p>Mario Kleiner (1):</p>
|
||||
<ul>
|
||||
<li>glx: Handle out-of-sequence swap completion events correctly. (v2)</li>
|
||||
</ul>
|
||||
|
||||
<p>Matt Turner (2):</p>
|
||||
<ul>
|
||||
<li>r300g: Use PATH_MAX instead of limiting ourselves to 100 chars.</li>
|
||||
<li>r300g: Check return value of snprintf().</li>
|
||||
</ul>
|
||||
|
||||
<p>Rob Clark (2):</p>
|
||||
<ul>
|
||||
<li>freedreno/ir3: fix silly typo for binning pass shaders</li>
|
||||
<li>freedreno: update generated headers</li>
|
||||
</ul>
|
||||
|
||||
<p>Samuel Iglesias Gonsalvez (1):</p>
|
||||
<ul>
|
||||
<li>glsl: optimize (0 cmp x + y) into (-x cmp y).</li>
|
||||
</ul>
|
||||
|
||||
<p>Stefan Dösinger (1):</p>
|
||||
<ul>
|
||||
<li>r300g: Fix the ATI1N swizzle (RGTC1 and LATC1)</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
124
docs/relnotes/10.5.3.html
Normal file
124
docs/relnotes/10.5.3.html
Normal file
@@ -0,0 +1,124 @@
|
||||
<!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 10.5.3 Release Notes / April 12, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.5.3 is a bug fix release which fixes bugs found since the 10.5.2 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.5.3 implements the OpenGL 3.3 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.3. OpenGL
|
||||
3.3 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
TBD
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None</p>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<p>This list is likely incomplete.</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83962">Bug 83962</a> - [HSW/BYT]Piglit spec_ARB_gpu_shader5_arb_gpu_shader5-emitstreamvertex_nodraw fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89679">Bug 89679</a> - [NV50] Portal/Half-Life 2 will not start (native Steam)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89746">Bug 89746</a> - Mesa and LLVM 3.6+ break opengl for genymotion</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89754">Bug 89754</a> - vertexAttrib fails WebGL Conformance test with mesa drivers</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89758">Bug 89758</a> - pow WebGL Conformance test with mesa drivers</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89759">Bug 89759</a> - WebGL OGL ES GLSL conformance test with mesa drivers fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89905">Bug 89905</a> - scons build broken on 10.5.2 due to activated vega st</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Dave Airlie (1):</p>
|
||||
<ul>
|
||||
<li>st_glsl_to_tgsi: only do mov copy propagation on temps (v2)</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (5):</p>
|
||||
<ul>
|
||||
<li>docs: Add sha256 sums for the 10.5.2 release</li>
|
||||
<li>xmlpool: don't forget to ship the MOS</li>
|
||||
<li>configure.ac: error out if python/mako is not found when required</li>
|
||||
<li>dist: add the VG depedencies into the tarball</li>
|
||||
<li>Update version to 10.5.3</li>
|
||||
</ul>
|
||||
|
||||
<p>Iago Toral Quiroga (1):</p>
|
||||
<ul>
|
||||
<li>i965: Do not render primitives in non-zero streams then TF is disabled</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (7):</p>
|
||||
<ul>
|
||||
<li>st/mesa: update arrays when the current attrib has been updated</li>
|
||||
<li>nv50/ir: take postFactor into account when doing peephole optimizations</li>
|
||||
<li>nv50/ir/gk110: fix offset flag position for TXD opcode</li>
|
||||
<li>freedreno/a3xx: fix 3d texture layout</li>
|
||||
<li>freedreno/a3xx: point size should not be divided by 2</li>
|
||||
<li>nv50: allocate more offset space for occlusion queries</li>
|
||||
<li>nv50,nvc0: limit the y-tiling of 3d textures to the first level's tiling</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (2):</p>
|
||||
<ul>
|
||||
<li>i965: Fix instanced geometry shaders on Gen8+.</li>
|
||||
<li>i965: Add forgotten multi-stream code to Gen8 SOL state.</li>
|
||||
</ul>
|
||||
|
||||
<p>Marcin Ślusarz (1):</p>
|
||||
<ul>
|
||||
<li>nouveau: synchronize "scratch runout" destruction with the command stream</li>
|
||||
</ul>
|
||||
|
||||
<p>Michel Dänzer (1):</p>
|
||||
<ul>
|
||||
<li>radeonsi: Cache LLVMTargetMachineRef in context instead of in screen</li>
|
||||
</ul>
|
||||
|
||||
<p>Tom Stellard (1):</p>
|
||||
<ul>
|
||||
<li>clover: Return CL_BUILD_ERROR for CL_PROGRAM_BUILD_STATUS when compilation fails v2</li>
|
||||
</ul>
|
||||
|
||||
<p>Ville Syrjälä (1):</p>
|
||||
<ul>
|
||||
<li>i965: Fix URB size for CHV</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -1,77 +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 10.6.0 Release Notes / TBD</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.6.0 is a new development release.
|
||||
People who are concerned with stability and reliability should stick
|
||||
with a previous release or wait for Mesa 10.6.1.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.6.0 implements the OpenGL 3.3 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.3. OpenGL
|
||||
3.3 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
TBD.
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
|
||||
<p>
|
||||
Note: some of the new features are only available with certain drivers.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>GL_AMD_pinned_memory on r600, radeonsi</li>
|
||||
<li>GL_ARB_draw_indirect, GL_ARB_multi_draw_indirect on r600</li>
|
||||
<li>GL_ARB_draw_instanced on freedreno</li>
|
||||
<li>GL_ARB_gpu_shader_fp64 on nvc0, softpipe</li>
|
||||
<li>GL_ARB_instanced_arrays on freedreno</li>
|
||||
<li>GL_ARB_pipeline_statistics_query on i965, nv50, nvc0, r600, radeonsi, softpipe</li>
|
||||
<li>GL_ARB_uniform_buffer_object on freedreno</li>
|
||||
<li>GL_EXT_draw_buffers2 on freedreno</li>
|
||||
<li>GL_ARB_clip_control on i965</li>
|
||||
</ul>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
TBD.
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<ul>
|
||||
<li>Removed classic Windows software rasterizer.</li>
|
||||
<li>Removed egl_gallium EGL driver.</li>
|
||||
<li>Removed gbm_gallium GBM driver.</li>
|
||||
<li>Removed OpenVG support.</li>
|
||||
<li>Removed the galahad gallium driver.</li>
|
||||
<li>Removed the identity gallium driver.</li>
|
||||
<li>Removed the EGL loader from the Windows SCons build.</li>
|
||||
<li>Removed the classic osmesa from the Windows SCons build.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -48,7 +48,7 @@ c49c19c2bbef4f3b7f1389974dff25f4 MesaGLUT-7.6.zip
|
||||
|
||||
<h2>New features</h2>
|
||||
<ul>
|
||||
<li>OpenVG front-end (state tracker for Gallium).
|
||||
<li><a href="../openvg.html">OpenVG</a> front-end (state tracker for Gallium).
|
||||
This was written by Zack Rusin at Tungsten Graphics.
|
||||
<li>GL_ARB_vertex_array_object and GL_APPLE_vertex_array_object extensions
|
||||
(supported in Gallium drivers, Intel DRI drivers, and software drivers)</li>
|
||||
|
@@ -133,8 +133,10 @@ each directory.
|
||||
<ul>
|
||||
<li><b>clover</b> - OpenCL state tracker
|
||||
<li><b>dri</b> - Meta state tracker for DRI drivers
|
||||
<li><b>egl</b> - Meta state tracker for EGL drivers
|
||||
<li><b>glx</b> - Meta state tracker for GLX
|
||||
<li><b>vdpau</b> - VDPAU state tracker
|
||||
<li><b>vega</b> - OpenVG 1.x state tracker
|
||||
<li><b>wgl</b> -
|
||||
<li><b>xorg</b> - Meta state tracker for Xorg video drivers
|
||||
<li><b>xvmc</b> - XvMC state tracker
|
||||
|
@@ -1,142 +0,0 @@
|
||||
Name
|
||||
|
||||
MESA_image_dma_buf_export
|
||||
|
||||
Name Strings
|
||||
|
||||
EGL_MESA_image_dma_buf_export
|
||||
|
||||
Contributors
|
||||
|
||||
Dave Airlie
|
||||
|
||||
Contact
|
||||
|
||||
Dave Airlie (airlied 'at' redhat 'dot' com)
|
||||
|
||||
Status
|
||||
|
||||
Proposal
|
||||
|
||||
Version
|
||||
|
||||
Version 2, Mar 30, 2015
|
||||
|
||||
Number
|
||||
|
||||
EGL Extension #not assigned
|
||||
|
||||
Dependencies
|
||||
|
||||
Reguires EGL 1.4 or later. This extension is written against the
|
||||
wording of the EGL 1.4 specification.
|
||||
|
||||
EGL_KHR_base_image is required.
|
||||
|
||||
The EGL implementation must be running on a Linux kernel supporting the
|
||||
dma_buf buffer sharing mechanism.
|
||||
|
||||
Overview
|
||||
|
||||
This extension provides entry points for integrating EGLImage with the
|
||||
dma-buf infrastructure. The extension allows creating a Linux dma_buf
|
||||
file descriptor or multiple file descriptors, in the case of multi-plane
|
||||
YUV image, from an EGLImage.
|
||||
|
||||
It is designed to provide the complementary functionality to EGL_EXT_image_dma_buf_import.
|
||||
|
||||
IP Status
|
||||
|
||||
Open-source; freely implementable.
|
||||
|
||||
New Types
|
||||
|
||||
This is a 64 bit unsigned integer.
|
||||
|
||||
typedef khronos_uint64_t EGLuint64MESA;
|
||||
|
||||
|
||||
New Procedures and Functions
|
||||
|
||||
EGLBoolean eglExportDMABUFImageQueryMESA(EGLDisplay dpy,
|
||||
EGLImageKHR image,
|
||||
int *fourcc,
|
||||
int *num_planes,
|
||||
EGLuint64MESA *modifiers);
|
||||
|
||||
EGLBoolean eglExportDMABUFImageMESA(EGLDisplay dpy,
|
||||
EGLImageKHR image,
|
||||
int *fds,
|
||||
EGLint *strides,
|
||||
EGLint *offsets);
|
||||
|
||||
New Tokens
|
||||
|
||||
None
|
||||
|
||||
|
||||
Additions to the EGL 1.4 Specification:
|
||||
|
||||
To mirror the import extension, this extension attempts to return
|
||||
enough information to enable an exported dma-buf to be imported
|
||||
via eglCreateImageKHR and EGL_LINUX_DMA_BUF_EXT token.
|
||||
|
||||
Retrieving the information is a two step process, so two APIs
|
||||
are required.
|
||||
|
||||
The first entrypoint
|
||||
EGLBoolean eglExportDMABUFImageQueryMESA(EGLDisplay dpy,
|
||||
EGLImageKHR image,
|
||||
int *fourcc,
|
||||
int *num_planes,
|
||||
EGLuint64MESA *modifiers);
|
||||
|
||||
is used to retrieve the pixel format of the buffer, as specified by
|
||||
drm_fourcc.h, the number of planes in the image and the Linux
|
||||
drm modifiers. <fourcc>, <num_planes> and <modifiers> may be NULL,
|
||||
in which case no value is retrieved.
|
||||
|
||||
The second entrypoint retrieves the dma_buf file descriptors,
|
||||
strides and offsets for the image. The caller should pass
|
||||
arrays sized according to the num_planes values retrieved previously.
|
||||
Passing arrays of the wrong size will have undefined results.
|
||||
If the number of fds is less than the number of planes, then
|
||||
subsequent fd slots should contain -1.
|
||||
|
||||
EGLBoolean eglExportDMABUFImageMESA(EGLDisplay dpy,
|
||||
EGLImageKHR image,
|
||||
int *fds,
|
||||
EGLint *strides,
|
||||
EGLint *offsets);
|
||||
|
||||
<fds>, <strides>, <offsets> can be NULL if the infomatation isn't
|
||||
required by the caller.
|
||||
|
||||
Issues
|
||||
|
||||
1. Should the API look more like an attribute getting API?
|
||||
|
||||
ANSWER: No, from a user interface pov, having to iterate across calling
|
||||
the API up to 12 times using attribs seems like the wrong solution.
|
||||
|
||||
2. Should the API take a plane and just get the fd/stride/offset for that
|
||||
plane?
|
||||
|
||||
ANSWER: UNKNOWN,this might be just as valid an API.
|
||||
|
||||
3. Does ownership of the file descriptor remain with the app?
|
||||
|
||||
ANSWER: Yes, the app is responsible for closing any fds retrieved.
|
||||
|
||||
4. If number of planes and number of fds differ what should we do?
|
||||
|
||||
ANSWER: Return -1 for the secondary slots, as this avoids having
|
||||
to dup the fd extra times to make the interface sane.
|
||||
|
||||
Revision History
|
||||
|
||||
Version 2, March, 2015
|
||||
Add a query interface (Dave Airlie)
|
||||
Version 1, June 3, 2014
|
||||
Initial draft (Dave Airlie)
|
||||
|
@@ -19,7 +19,6 @@
|
||||
<p>
|
||||
This page lists known issues with
|
||||
<a href="http://www.spec.org/gwpg/gpc.static/vp11info.html" target="_main">SPEC Viewperf 11</a>
|
||||
and <a href="https://www.spec.org/gwpg/gpc.static/vp12info.html" target="_main">SPEC Viewperf 12</a>
|
||||
when running on Mesa-based drivers.
|
||||
</p>
|
||||
|
||||
@@ -41,15 +40,13 @@ These issues have been reported to the SPEC organization in the hope that
|
||||
they'll be fixed in the future.
|
||||
</p>
|
||||
|
||||
<h2><u>Viewperf 11</u></h2>
|
||||
|
||||
<p>
|
||||
Some of the Viewperf 11 tests use a lot of memory.
|
||||
Some of the Viewperf tests use a lot of memory.
|
||||
At least 2GB of RAM is recommended.
|
||||
</p>
|
||||
|
||||
|
||||
<h3>Catia-03 test 2</h3>
|
||||
<h2>Catia-03 test 2</h2>
|
||||
|
||||
<p>
|
||||
This test creates over 38000 vertex buffer objects. On some systems
|
||||
@@ -62,7 +59,7 @@ either in Viewperf or the Mesa driver.
|
||||
|
||||
|
||||
|
||||
<h3>Catia-03 tests 3, 4, 8</h3>
|
||||
<h2>Catia-03 tests 3, 4, 8</h2>
|
||||
|
||||
<p>
|
||||
These tests use features of the
|
||||
@@ -82,7 +79,7 @@ Subsequent drawing calls become no-ops and the rendering is incorrect.
|
||||
|
||||
|
||||
|
||||
<h3>sw-02 tests 1, 2, 4, 6</h3>
|
||||
<h2>sw-02 tests 1, 2, 4, 6</h2>
|
||||
|
||||
<p>
|
||||
These tests depend on the
|
||||
@@ -102,7 +99,7 @@ color. This is probably due to some uninitialized state somewhere.
|
||||
|
||||
|
||||
|
||||
<h3>sw-02 test 6</h3>
|
||||
<h2>sw-02 test 6</h2>
|
||||
|
||||
<p>
|
||||
The lines drawn in this test appear in a random color.
|
||||
@@ -114,7 +111,7 @@ situation, we get a random color.
|
||||
|
||||
|
||||
|
||||
<h3>Lightwave-01 test 3</h3>
|
||||
<h2>Lightwave-01 test 3</h2>
|
||||
|
||||
<p>
|
||||
This test uses a number of mipmapped textures, but the textures are
|
||||
@@ -175,7 +172,7 @@ However, we have no plans to implement this work-around in Mesa.
|
||||
</p>
|
||||
|
||||
|
||||
<h3>Maya-03 test 2</h3>
|
||||
<h2>Maya-03 test 2</h2>
|
||||
|
||||
<p>
|
||||
This test makes some unusual calls to glRotate. For example:
|
||||
@@ -207,7 +204,7 @@ and with a semi-random color (between white and black) since GL_FOG is enabled.
|
||||
</p>
|
||||
|
||||
|
||||
<h3>Proe-05 test 1</h3>
|
||||
<h2>Proe-05 test 1</h2>
|
||||
|
||||
<p>
|
||||
This uses depth testing but there's two problems:
|
||||
@@ -235,7 +232,7 @@ glClear is called so clearing the depth buffer would be a no-op anyway.
|
||||
</p>
|
||||
|
||||
|
||||
<h3>Proe-05 test 6</h3>
|
||||
<h2>Proe-05 test 6</h2>
|
||||
|
||||
<p>
|
||||
This test draws an engine model with a two-pass algorithm.
|
||||
@@ -264,79 +261,6 @@ blending with appropriate patterns/modes to ensure the same fragments
|
||||
are produced in both passes.
|
||||
</p>
|
||||
|
||||
<h2><u>Viewperf 12</u></h2>
|
||||
|
||||
<p>
|
||||
Note that Viewperf 12 only runs on 64-bit Windows 7 or later.
|
||||
</p>
|
||||
|
||||
<h3>catia-04</h3>
|
||||
|
||||
<p>
|
||||
One of the catia tests calls wglGetProcAddress() to get some
|
||||
GL_EXT_direct_state_access functions (such as glBindMultiTextureEXT) and some
|
||||
GL_NV_half_float functions (such as glMultiTexCoord3hNV).
|
||||
If the extension/function is not supported, wglGetProcAddress() can return NULL.
|
||||
Unfortunately, Viewperf doesn't check for null pointers and crashes when it
|
||||
later tries to use the pointer.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Another catia test uses OpenGL 3.1's primitive restart feature.
|
||||
But when Viewperf creates an OpenGL context, it doesn't request version 3.1
|
||||
If the driver returns version 3.0 or earlier all the calls related to primitive
|
||||
restart generate an OpenGL error.
|
||||
Some of the rendering is then incorrect.
|
||||
</p>
|
||||
|
||||
|
||||
<h3>energy-01</h3>
|
||||
|
||||
<p>
|
||||
This test creates a 3D luminance texture of size 1K x 1K x 1K.
|
||||
If the OpenGL driver/device doesn't support a texture of this size
|
||||
the glTexImage3D() call will fail with GL_INVALID_VALUE or GL_OUT_OF_MEMORY
|
||||
and all that's rendered is plain white polygons.
|
||||
Ideally, the test would use a proxy texture to determine the max 3D
|
||||
texture size. But it does not do that.
|
||||
</p>
|
||||
|
||||
<h3>maya-04</h3>
|
||||
|
||||
<p>
|
||||
This test generates many GL_INVALID_OPERATION errors in its calls to
|
||||
glUniform().
|
||||
Causes include:
|
||||
<ul>
|
||||
<li> Trying to set float uniforms with glUniformi()
|
||||
<li> Trying to set float uniforms with glUniform3f()
|
||||
<li> Trying to set matrix uniforms with glUniform() instead of glUniformMatrix().
|
||||
</ul>
|
||||
<p>
|
||||
Apparently, the indexes returned by glGetUniformLocation() were hard-coded
|
||||
into the application trace when it was created.
|
||||
Since different implementations of glGetUniformLocation() may return different
|
||||
values for any given uniform name, subsequent calls to glUniform() will be
|
||||
invalid since they refer to the wrong uniform variables.
|
||||
This causes many OpenGL errors and leads to incorrect rendering.
|
||||
</p>
|
||||
|
||||
<h3>medical-01</h3>
|
||||
|
||||
<p>
|
||||
This test uses a single GLSL fragment shader which contains a GLSL 1.20
|
||||
array initializer statement, but it neglects to specify
|
||||
<code>#version 120</code> at the top of the shader code.
|
||||
So, the shader does not compile and all that's rendered is plain white polygons.
|
||||
</p>
|
||||
|
||||
<h3>showcase-01</h3>
|
||||
|
||||
<p>
|
||||
This is actually a DX11 test based on Autodesk's Showcase product.
|
||||
As such, it won't run with Mesa.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
@@ -170,14 +170,6 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EG
|
||||
#define EGL_NO_CONFIG_MESA ((EGLConfig)0)
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64
|
||||
#ifndef EGL_MESA_image_dma_buf_export
|
||||
#define EGL_MESA_image_dma_buf_export 1
|
||||
typedef khronos_uint64_t EGLuint64MESA;
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageQueryMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *fourcc, EGLint *nplanes, EGLuint64MESA *modifiers);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1006,7 +1006,7 @@ struct __DRIdri2ExtensionRec {
|
||||
* extensions.
|
||||
*/
|
||||
#define __DRI_IMAGE "DRI_IMAGE"
|
||||
#define __DRI_IMAGE_VERSION 11
|
||||
#define __DRI_IMAGE_VERSION 10
|
||||
|
||||
/**
|
||||
* These formats correspond to the similarly named MESA_FORMAT_*
|
||||
@@ -1097,8 +1097,6 @@ struct __DRIdri2ExtensionRec {
|
||||
#define __DRI_IMAGE_ATTRIB_FD 0x2007 /* available in versions
|
||||
* 7+. Each query will return a
|
||||
* new fd. */
|
||||
#define __DRI_IMAGE_ATTRIB_FOURCC 0x2008 /* available in versions 11 */
|
||||
#define __DRI_IMAGE_ATTRIB_NUM_PLANES 0x2009 /* available in versions 11 */
|
||||
|
||||
enum __DRIYUVColorSpace {
|
||||
__DRI_YUV_COLOR_SPACE_UNDEFINED = 0,
|
||||
|
@@ -41,8 +41,10 @@
|
||||
* OSMesaGetIntegerv - return OSMesa state parameters
|
||||
*
|
||||
*
|
||||
* The limits on the width and height of an image buffer can be retrieved
|
||||
* via OSMesaGetIntegerv(OSMESA_MAX_WIDTH/OSMESA_MAX_HEIGHT).
|
||||
* The limits on the width and height of an image buffer are MAX_WIDTH and
|
||||
* MAX_HEIGHT as defined in Mesa/src/config.h. Defaults are 1280 and 1024.
|
||||
* You can increase them as needed but beware that many temporary arrays in
|
||||
* Mesa are dimensioned by MAX_WIDTH or MAX_HEIGHT.
|
||||
*/
|
||||
|
||||
|
||||
|
140
include/GL/wmesa.h
Normal file
140
include/GL/wmesa.h
Normal file
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Copyright (C) 1995-1998 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Windows driver by: Mark E. Peterson (markp@ic.mankato.mn.us)
|
||||
* Updated by Li Wei (liwei@aiar.xjtu.edu.cn)
|
||||
*
|
||||
*
|
||||
***************************************************************
|
||||
* WMesa *
|
||||
* version 2.3 *
|
||||
* *
|
||||
* By *
|
||||
* Li Wei *
|
||||
* Institute of Artificial Intelligence & Robotics *
|
||||
* Xi'an Jiaotong University *
|
||||
* Email: liwei@aiar.xjtu.edu.cn *
|
||||
* Web page: http://sun.aiar.xjtu.edu.cn *
|
||||
* *
|
||||
* July 7th, 1997 *
|
||||
***************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#ifndef WMESA_H
|
||||
#define WMESA_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "GL/gl.h"
|
||||
|
||||
#if defined(_MSV_VER) && !defined(__GNUC__)
|
||||
# pragma warning (disable:4273)
|
||||
# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
|
||||
# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
|
||||
# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
|
||||
# pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */
|
||||
# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
|
||||
# pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */
|
||||
# if (MESA_WARNQUIET>1)
|
||||
# pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is the WMesa context 'handle':
|
||||
*/
|
||||
typedef struct wmesa_context *WMesaContext;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Create a new WMesaContext for rendering into a window. You must
|
||||
* have already created the window of correct visual type and with an
|
||||
* appropriate colormap.
|
||||
*
|
||||
* Input:
|
||||
* hDC - Windows device or memory context
|
||||
* Pal - Palette to use
|
||||
* rgb_flag - GL_TRUE = RGB mode,
|
||||
* GL_FALSE = color index mode
|
||||
* db_flag - GL_TRUE = double-buffered,
|
||||
* GL_FALSE = single buffered
|
||||
* alpha_flag - GL_TRUE = create software alpha buffer,
|
||||
* GL_FALSE = no software alpha buffer
|
||||
*
|
||||
* Note: Indexed mode requires double buffering under Windows.
|
||||
*
|
||||
* Return: a WMesa_context or NULL if error.
|
||||
*/
|
||||
extern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal,
|
||||
GLboolean rgb_flag,
|
||||
GLboolean db_flag,
|
||||
GLboolean alpha_flag);
|
||||
|
||||
|
||||
/*
|
||||
* Destroy a rendering context as returned by WMesaCreateContext()
|
||||
*/
|
||||
extern void WMesaDestroyContext( WMesaContext ctx );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Make the specified context the current one.
|
||||
*/
|
||||
extern void WMesaMakeCurrent( WMesaContext ctx, HDC hdc );
|
||||
|
||||
|
||||
/*
|
||||
* Return a handle to the current context.
|
||||
*/
|
||||
extern WMesaContext WMesaGetCurrentContext( void );
|
||||
|
||||
|
||||
/*
|
||||
* Swap the front and back buffers for the current context. No action
|
||||
* taken if the context is not double buffered.
|
||||
*/
|
||||
extern void WMesaSwapBuffers(HDC hdc);
|
||||
|
||||
|
||||
/*
|
||||
* In indexed color mode we need to know when the palette changes.
|
||||
*/
|
||||
extern void WMesaPaletteChange(HPALETTE Pal);
|
||||
|
||||
extern void WMesaMove(void);
|
||||
|
||||
void WMesaShareLists(WMesaContext ctx_to_share, WMesaContext ctx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
746
include/VG/openvg.h
Normal file
746
include/VG/openvg.h
Normal file
@@ -0,0 +1,746 @@
|
||||
/* $Revision: 9203 $ on $Date:: 2009-10-07 02:21:52 -0700 #$ */
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*
|
||||
* OpenVG 1.1 Reference Implementation
|
||||
* -------------------------------------
|
||||
*
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and /or associated documentation files
|
||||
* (the "Materials "), to deal in the Materials without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Materials,
|
||||
* and to permit persons to whom the Materials are 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 Materials.
|
||||
*
|
||||
* THE MATERIALS ARE 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 MATERIALS OR
|
||||
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*
|
||||
*//**
|
||||
* \file
|
||||
* \brief OpenVG 1.1 API.
|
||||
*//*-------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OPENVG_H
|
||||
#define _OPENVG_H
|
||||
|
||||
#include <VG/vgplatform.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OPENVG_VERSION_1_0 1
|
||||
#define OPENVG_VERSION_1_0_1 1
|
||||
#define OPENVG_VERSION_1_1 2
|
||||
|
||||
#ifndef VG_MAXSHORT
|
||||
#define VG_MAXSHORT 0x7FFF
|
||||
#endif
|
||||
|
||||
#ifndef VG_MAXINT
|
||||
#define VG_MAXINT 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
#ifndef VG_MAX_ENUM
|
||||
#define VG_MAX_ENUM 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
typedef VGuint VGHandle;
|
||||
|
||||
typedef VGHandle VGPath;
|
||||
typedef VGHandle VGImage;
|
||||
typedef VGHandle VGMaskLayer;
|
||||
typedef VGHandle VGFont;
|
||||
typedef VGHandle VGPaint;
|
||||
|
||||
#define VG_INVALID_HANDLE ((VGHandle)0)
|
||||
|
||||
typedef enum {
|
||||
VG_FALSE = 0,
|
||||
VG_TRUE = 1,
|
||||
|
||||
VG_BOOLEAN_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGboolean;
|
||||
|
||||
typedef enum {
|
||||
VG_NO_ERROR = 0,
|
||||
VG_BAD_HANDLE_ERROR = 0x1000,
|
||||
VG_ILLEGAL_ARGUMENT_ERROR = 0x1001,
|
||||
VG_OUT_OF_MEMORY_ERROR = 0x1002,
|
||||
VG_PATH_CAPABILITY_ERROR = 0x1003,
|
||||
VG_UNSUPPORTED_IMAGE_FORMAT_ERROR = 0x1004,
|
||||
VG_UNSUPPORTED_PATH_FORMAT_ERROR = 0x1005,
|
||||
VG_IMAGE_IN_USE_ERROR = 0x1006,
|
||||
VG_NO_CONTEXT_ERROR = 0x1007,
|
||||
|
||||
VG_ERROR_CODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGErrorCode;
|
||||
|
||||
typedef enum {
|
||||
/* Mode settings */
|
||||
VG_MATRIX_MODE = 0x1100,
|
||||
VG_FILL_RULE = 0x1101,
|
||||
VG_IMAGE_QUALITY = 0x1102,
|
||||
VG_RENDERING_QUALITY = 0x1103,
|
||||
VG_BLEND_MODE = 0x1104,
|
||||
VG_IMAGE_MODE = 0x1105,
|
||||
|
||||
/* Scissoring rectangles */
|
||||
VG_SCISSOR_RECTS = 0x1106,
|
||||
|
||||
/* Color Transformation */
|
||||
VG_COLOR_TRANSFORM = 0x1170,
|
||||
VG_COLOR_TRANSFORM_VALUES = 0x1171,
|
||||
|
||||
/* Stroke parameters */
|
||||
VG_STROKE_LINE_WIDTH = 0x1110,
|
||||
VG_STROKE_CAP_STYLE = 0x1111,
|
||||
VG_STROKE_JOIN_STYLE = 0x1112,
|
||||
VG_STROKE_MITER_LIMIT = 0x1113,
|
||||
VG_STROKE_DASH_PATTERN = 0x1114,
|
||||
VG_STROKE_DASH_PHASE = 0x1115,
|
||||
VG_STROKE_DASH_PHASE_RESET = 0x1116,
|
||||
|
||||
/* Edge fill color for VG_TILE_FILL tiling mode */
|
||||
VG_TILE_FILL_COLOR = 0x1120,
|
||||
|
||||
/* Color for vgClear */
|
||||
VG_CLEAR_COLOR = 0x1121,
|
||||
|
||||
/* Glyph origin */
|
||||
VG_GLYPH_ORIGIN = 0x1122,
|
||||
|
||||
/* Enable/disable alpha masking and scissoring */
|
||||
VG_MASKING = 0x1130,
|
||||
VG_SCISSORING = 0x1131,
|
||||
|
||||
/* Pixel layout information */
|
||||
VG_PIXEL_LAYOUT = 0x1140,
|
||||
VG_SCREEN_LAYOUT = 0x1141,
|
||||
|
||||
/* Source format selection for image filters */
|
||||
VG_FILTER_FORMAT_LINEAR = 0x1150,
|
||||
VG_FILTER_FORMAT_PREMULTIPLIED = 0x1151,
|
||||
|
||||
/* Destination write enable mask for image filters */
|
||||
VG_FILTER_CHANNEL_MASK = 0x1152,
|
||||
|
||||
/* Implementation limits (read-only) */
|
||||
VG_MAX_SCISSOR_RECTS = 0x1160,
|
||||
VG_MAX_DASH_COUNT = 0x1161,
|
||||
VG_MAX_KERNEL_SIZE = 0x1162,
|
||||
VG_MAX_SEPARABLE_KERNEL_SIZE = 0x1163,
|
||||
VG_MAX_COLOR_RAMP_STOPS = 0x1164,
|
||||
VG_MAX_IMAGE_WIDTH = 0x1165,
|
||||
VG_MAX_IMAGE_HEIGHT = 0x1166,
|
||||
VG_MAX_IMAGE_PIXELS = 0x1167,
|
||||
VG_MAX_IMAGE_BYTES = 0x1168,
|
||||
VG_MAX_FLOAT = 0x1169,
|
||||
VG_MAX_GAUSSIAN_STD_DEVIATION = 0x116A,
|
||||
|
||||
VG_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGParamType;
|
||||
|
||||
typedef enum {
|
||||
VG_RENDERING_QUALITY_NONANTIALIASED = 0x1200,
|
||||
VG_RENDERING_QUALITY_FASTER = 0x1201,
|
||||
VG_RENDERING_QUALITY_BETTER = 0x1202, /* Default */
|
||||
|
||||
VG_RENDERING_QUALITY_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGRenderingQuality;
|
||||
|
||||
typedef enum {
|
||||
VG_PIXEL_LAYOUT_UNKNOWN = 0x1300,
|
||||
VG_PIXEL_LAYOUT_RGB_VERTICAL = 0x1301,
|
||||
VG_PIXEL_LAYOUT_BGR_VERTICAL = 0x1302,
|
||||
VG_PIXEL_LAYOUT_RGB_HORIZONTAL = 0x1303,
|
||||
VG_PIXEL_LAYOUT_BGR_HORIZONTAL = 0x1304,
|
||||
|
||||
VG_PIXEL_LAYOUT_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPixelLayout;
|
||||
|
||||
typedef enum {
|
||||
VG_MATRIX_PATH_USER_TO_SURFACE = 0x1400,
|
||||
VG_MATRIX_IMAGE_USER_TO_SURFACE = 0x1401,
|
||||
VG_MATRIX_FILL_PAINT_TO_USER = 0x1402,
|
||||
VG_MATRIX_STROKE_PAINT_TO_USER = 0x1403,
|
||||
VG_MATRIX_GLYPH_USER_TO_SURFACE = 0x1404,
|
||||
|
||||
VG_MATRIX_MODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGMatrixMode;
|
||||
|
||||
typedef enum {
|
||||
VG_CLEAR_MASK = 0x1500,
|
||||
VG_FILL_MASK = 0x1501,
|
||||
VG_SET_MASK = 0x1502,
|
||||
VG_UNION_MASK = 0x1503,
|
||||
VG_INTERSECT_MASK = 0x1504,
|
||||
VG_SUBTRACT_MASK = 0x1505,
|
||||
|
||||
VG_MASK_OPERATION_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGMaskOperation;
|
||||
|
||||
#define VG_PATH_FORMAT_STANDARD 0
|
||||
|
||||
typedef enum {
|
||||
VG_PATH_DATATYPE_S_8 = 0,
|
||||
VG_PATH_DATATYPE_S_16 = 1,
|
||||
VG_PATH_DATATYPE_S_32 = 2,
|
||||
VG_PATH_DATATYPE_F = 3,
|
||||
|
||||
VG_PATH_DATATYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathDatatype;
|
||||
|
||||
typedef enum {
|
||||
VG_ABSOLUTE = 0,
|
||||
VG_RELATIVE = 1,
|
||||
|
||||
VG_PATH_ABS_REL_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathAbsRel;
|
||||
|
||||
typedef enum {
|
||||
VG_CLOSE_PATH = ( 0 << 1),
|
||||
VG_MOVE_TO = ( 1 << 1),
|
||||
VG_LINE_TO = ( 2 << 1),
|
||||
VG_HLINE_TO = ( 3 << 1),
|
||||
VG_VLINE_TO = ( 4 << 1),
|
||||
VG_QUAD_TO = ( 5 << 1),
|
||||
VG_CUBIC_TO = ( 6 << 1),
|
||||
VG_SQUAD_TO = ( 7 << 1),
|
||||
VG_SCUBIC_TO = ( 8 << 1),
|
||||
VG_SCCWARC_TO = ( 9 << 1),
|
||||
VG_SCWARC_TO = (10 << 1),
|
||||
VG_LCCWARC_TO = (11 << 1),
|
||||
VG_LCWARC_TO = (12 << 1),
|
||||
|
||||
VG_PATH_SEGMENT_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathSegment;
|
||||
|
||||
typedef enum {
|
||||
VG_MOVE_TO_ABS = VG_MOVE_TO | VG_ABSOLUTE,
|
||||
VG_MOVE_TO_REL = VG_MOVE_TO | VG_RELATIVE,
|
||||
VG_LINE_TO_ABS = VG_LINE_TO | VG_ABSOLUTE,
|
||||
VG_LINE_TO_REL = VG_LINE_TO | VG_RELATIVE,
|
||||
VG_HLINE_TO_ABS = VG_HLINE_TO | VG_ABSOLUTE,
|
||||
VG_HLINE_TO_REL = VG_HLINE_TO | VG_RELATIVE,
|
||||
VG_VLINE_TO_ABS = VG_VLINE_TO | VG_ABSOLUTE,
|
||||
VG_VLINE_TO_REL = VG_VLINE_TO | VG_RELATIVE,
|
||||
VG_QUAD_TO_ABS = VG_QUAD_TO | VG_ABSOLUTE,
|
||||
VG_QUAD_TO_REL = VG_QUAD_TO | VG_RELATIVE,
|
||||
VG_CUBIC_TO_ABS = VG_CUBIC_TO | VG_ABSOLUTE,
|
||||
VG_CUBIC_TO_REL = VG_CUBIC_TO | VG_RELATIVE,
|
||||
VG_SQUAD_TO_ABS = VG_SQUAD_TO | VG_ABSOLUTE,
|
||||
VG_SQUAD_TO_REL = VG_SQUAD_TO | VG_RELATIVE,
|
||||
VG_SCUBIC_TO_ABS = VG_SCUBIC_TO | VG_ABSOLUTE,
|
||||
VG_SCUBIC_TO_REL = VG_SCUBIC_TO | VG_RELATIVE,
|
||||
VG_SCCWARC_TO_ABS = VG_SCCWARC_TO | VG_ABSOLUTE,
|
||||
VG_SCCWARC_TO_REL = VG_SCCWARC_TO | VG_RELATIVE,
|
||||
VG_SCWARC_TO_ABS = VG_SCWARC_TO | VG_ABSOLUTE,
|
||||
VG_SCWARC_TO_REL = VG_SCWARC_TO | VG_RELATIVE,
|
||||
VG_LCCWARC_TO_ABS = VG_LCCWARC_TO | VG_ABSOLUTE,
|
||||
VG_LCCWARC_TO_REL = VG_LCCWARC_TO | VG_RELATIVE,
|
||||
VG_LCWARC_TO_ABS = VG_LCWARC_TO | VG_ABSOLUTE,
|
||||
VG_LCWARC_TO_REL = VG_LCWARC_TO | VG_RELATIVE,
|
||||
|
||||
VG_PATH_COMMAND_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathCommand;
|
||||
|
||||
typedef enum {
|
||||
VG_PATH_CAPABILITY_APPEND_FROM = (1 << 0),
|
||||
VG_PATH_CAPABILITY_APPEND_TO = (1 << 1),
|
||||
VG_PATH_CAPABILITY_MODIFY = (1 << 2),
|
||||
VG_PATH_CAPABILITY_TRANSFORM_FROM = (1 << 3),
|
||||
VG_PATH_CAPABILITY_TRANSFORM_TO = (1 << 4),
|
||||
VG_PATH_CAPABILITY_INTERPOLATE_FROM = (1 << 5),
|
||||
VG_PATH_CAPABILITY_INTERPOLATE_TO = (1 << 6),
|
||||
VG_PATH_CAPABILITY_PATH_LENGTH = (1 << 7),
|
||||
VG_PATH_CAPABILITY_POINT_ALONG_PATH = (1 << 8),
|
||||
VG_PATH_CAPABILITY_TANGENT_ALONG_PATH = (1 << 9),
|
||||
VG_PATH_CAPABILITY_PATH_BOUNDS = (1 << 10),
|
||||
VG_PATH_CAPABILITY_PATH_TRANSFORMED_BOUNDS = (1 << 11),
|
||||
VG_PATH_CAPABILITY_ALL = (1 << 12) - 1,
|
||||
|
||||
VG_PATH_CAPABILITIES_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathCapabilities;
|
||||
|
||||
typedef enum {
|
||||
VG_PATH_FORMAT = 0x1600,
|
||||
VG_PATH_DATATYPE = 0x1601,
|
||||
VG_PATH_SCALE = 0x1602,
|
||||
VG_PATH_BIAS = 0x1603,
|
||||
VG_PATH_NUM_SEGMENTS = 0x1604,
|
||||
VG_PATH_NUM_COORDS = 0x1605,
|
||||
|
||||
VG_PATH_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathParamType;
|
||||
|
||||
typedef enum {
|
||||
VG_CAP_BUTT = 0x1700,
|
||||
VG_CAP_ROUND = 0x1701,
|
||||
VG_CAP_SQUARE = 0x1702,
|
||||
|
||||
VG_CAP_STYLE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGCapStyle;
|
||||
|
||||
typedef enum {
|
||||
VG_JOIN_MITER = 0x1800,
|
||||
VG_JOIN_ROUND = 0x1801,
|
||||
VG_JOIN_BEVEL = 0x1802,
|
||||
|
||||
VG_JOIN_STYLE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGJoinStyle;
|
||||
|
||||
typedef enum {
|
||||
VG_EVEN_ODD = 0x1900,
|
||||
VG_NON_ZERO = 0x1901,
|
||||
|
||||
VG_FILL_RULE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGFillRule;
|
||||
|
||||
typedef enum {
|
||||
VG_STROKE_PATH = (1 << 0),
|
||||
VG_FILL_PATH = (1 << 1),
|
||||
|
||||
VG_PAINT_MODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPaintMode;
|
||||
|
||||
typedef enum {
|
||||
/* Color paint parameters */
|
||||
VG_PAINT_TYPE = 0x1A00,
|
||||
VG_PAINT_COLOR = 0x1A01,
|
||||
VG_PAINT_COLOR_RAMP_SPREAD_MODE = 0x1A02,
|
||||
VG_PAINT_COLOR_RAMP_PREMULTIPLIED = 0x1A07,
|
||||
VG_PAINT_COLOR_RAMP_STOPS = 0x1A03,
|
||||
|
||||
/* Linear gradient paint parameters */
|
||||
VG_PAINT_LINEAR_GRADIENT = 0x1A04,
|
||||
|
||||
/* Radial gradient paint parameters */
|
||||
VG_PAINT_RADIAL_GRADIENT = 0x1A05,
|
||||
|
||||
/* Pattern paint parameters */
|
||||
VG_PAINT_PATTERN_TILING_MODE = 0x1A06,
|
||||
|
||||
VG_PAINT_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPaintParamType;
|
||||
|
||||
typedef enum {
|
||||
VG_PAINT_TYPE_COLOR = 0x1B00,
|
||||
VG_PAINT_TYPE_LINEAR_GRADIENT = 0x1B01,
|
||||
VG_PAINT_TYPE_RADIAL_GRADIENT = 0x1B02,
|
||||
VG_PAINT_TYPE_PATTERN = 0x1B03,
|
||||
|
||||
VG_PAINT_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPaintType;
|
||||
|
||||
typedef enum {
|
||||
VG_COLOR_RAMP_SPREAD_PAD = 0x1C00,
|
||||
VG_COLOR_RAMP_SPREAD_REPEAT = 0x1C01,
|
||||
VG_COLOR_RAMP_SPREAD_REFLECT = 0x1C02,
|
||||
|
||||
VG_COLOR_RAMP_SPREAD_MODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGColorRampSpreadMode;
|
||||
|
||||
typedef enum {
|
||||
VG_TILE_FILL = 0x1D00,
|
||||
VG_TILE_PAD = 0x1D01,
|
||||
VG_TILE_REPEAT = 0x1D02,
|
||||
VG_TILE_REFLECT = 0x1D03,
|
||||
|
||||
VG_TILING_MODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGTilingMode;
|
||||
|
||||
typedef enum {
|
||||
/* RGB{A,X} channel ordering */
|
||||
VG_sRGBX_8888 = 0,
|
||||
VG_sRGBA_8888 = 1,
|
||||
VG_sRGBA_8888_PRE = 2,
|
||||
VG_sRGB_565 = 3,
|
||||
VG_sRGBA_5551 = 4,
|
||||
VG_sRGBA_4444 = 5,
|
||||
VG_sL_8 = 6,
|
||||
VG_lRGBX_8888 = 7,
|
||||
VG_lRGBA_8888 = 8,
|
||||
VG_lRGBA_8888_PRE = 9,
|
||||
VG_lL_8 = 10,
|
||||
VG_A_8 = 11,
|
||||
VG_BW_1 = 12,
|
||||
VG_A_1 = 13,
|
||||
VG_A_4 = 14,
|
||||
|
||||
/* {A,X}RGB channel ordering */
|
||||
VG_sXRGB_8888 = 0 | (1 << 6),
|
||||
VG_sARGB_8888 = 1 | (1 << 6),
|
||||
VG_sARGB_8888_PRE = 2 | (1 << 6),
|
||||
VG_sARGB_1555 = 4 | (1 << 6),
|
||||
VG_sARGB_4444 = 5 | (1 << 6),
|
||||
VG_lXRGB_8888 = 7 | (1 << 6),
|
||||
VG_lARGB_8888 = 8 | (1 << 6),
|
||||
VG_lARGB_8888_PRE = 9 | (1 << 6),
|
||||
|
||||
/* BGR{A,X} channel ordering */
|
||||
VG_sBGRX_8888 = 0 | (1 << 7),
|
||||
VG_sBGRA_8888 = 1 | (1 << 7),
|
||||
VG_sBGRA_8888_PRE = 2 | (1 << 7),
|
||||
VG_sBGR_565 = 3 | (1 << 7),
|
||||
VG_sBGRA_5551 = 4 | (1 << 7),
|
||||
VG_sBGRA_4444 = 5 | (1 << 7),
|
||||
VG_lBGRX_8888 = 7 | (1 << 7),
|
||||
VG_lBGRA_8888 = 8 | (1 << 7),
|
||||
VG_lBGRA_8888_PRE = 9 | (1 << 7),
|
||||
|
||||
/* {A,X}BGR channel ordering */
|
||||
VG_sXBGR_8888 = 0 | (1 << 6) | (1 << 7),
|
||||
VG_sABGR_8888 = 1 | (1 << 6) | (1 << 7),
|
||||
VG_sABGR_8888_PRE = 2 | (1 << 6) | (1 << 7),
|
||||
VG_sABGR_1555 = 4 | (1 << 6) | (1 << 7),
|
||||
VG_sABGR_4444 = 5 | (1 << 6) | (1 << 7),
|
||||
VG_lXBGR_8888 = 7 | (1 << 6) | (1 << 7),
|
||||
VG_lABGR_8888 = 8 | (1 << 6) | (1 << 7),
|
||||
VG_lABGR_8888_PRE = 9 | (1 << 6) | (1 << 7),
|
||||
|
||||
VG_IMAGE_FORMAT_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGImageFormat;
|
||||
|
||||
typedef enum {
|
||||
VG_IMAGE_QUALITY_NONANTIALIASED = (1 << 0),
|
||||
VG_IMAGE_QUALITY_FASTER = (1 << 1),
|
||||
VG_IMAGE_QUALITY_BETTER = (1 << 2),
|
||||
|
||||
VG_IMAGE_QUALITY_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGImageQuality;
|
||||
|
||||
typedef enum {
|
||||
VG_IMAGE_FORMAT = 0x1E00,
|
||||
VG_IMAGE_WIDTH = 0x1E01,
|
||||
VG_IMAGE_HEIGHT = 0x1E02,
|
||||
|
||||
VG_IMAGE_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGImageParamType;
|
||||
|
||||
typedef enum {
|
||||
VG_DRAW_IMAGE_NORMAL = 0x1F00,
|
||||
VG_DRAW_IMAGE_MULTIPLY = 0x1F01,
|
||||
VG_DRAW_IMAGE_STENCIL = 0x1F02,
|
||||
|
||||
VG_IMAGE_MODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGImageMode;
|
||||
|
||||
typedef enum {
|
||||
VG_RED = (1 << 3),
|
||||
VG_GREEN = (1 << 2),
|
||||
VG_BLUE = (1 << 1),
|
||||
VG_ALPHA = (1 << 0),
|
||||
|
||||
VG_IMAGE_CHANNEL_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGImageChannel;
|
||||
|
||||
typedef enum {
|
||||
VG_BLEND_SRC = 0x2000,
|
||||
VG_BLEND_SRC_OVER = 0x2001,
|
||||
VG_BLEND_DST_OVER = 0x2002,
|
||||
VG_BLEND_SRC_IN = 0x2003,
|
||||
VG_BLEND_DST_IN = 0x2004,
|
||||
VG_BLEND_MULTIPLY = 0x2005,
|
||||
VG_BLEND_SCREEN = 0x2006,
|
||||
VG_BLEND_DARKEN = 0x2007,
|
||||
VG_BLEND_LIGHTEN = 0x2008,
|
||||
VG_BLEND_ADDITIVE = 0x2009,
|
||||
|
||||
VG_BLEND_MODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGBlendMode;
|
||||
|
||||
typedef enum {
|
||||
VG_FONT_NUM_GLYPHS = 0x2F00,
|
||||
|
||||
VG_FONT_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGFontParamType;
|
||||
|
||||
typedef enum {
|
||||
VG_IMAGE_FORMAT_QUERY = 0x2100,
|
||||
VG_PATH_DATATYPE_QUERY = 0x2101,
|
||||
|
||||
VG_HARDWARE_QUERY_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGHardwareQueryType;
|
||||
|
||||
typedef enum {
|
||||
VG_HARDWARE_ACCELERATED = 0x2200,
|
||||
VG_HARDWARE_UNACCELERATED = 0x2201,
|
||||
|
||||
VG_HARDWARE_QUERY_RESULT_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGHardwareQueryResult;
|
||||
|
||||
typedef enum {
|
||||
VG_VENDOR = 0x2300,
|
||||
VG_RENDERER = 0x2301,
|
||||
VG_VERSION = 0x2302,
|
||||
VG_EXTENSIONS = 0x2303,
|
||||
|
||||
VG_STRING_ID_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGStringID;
|
||||
|
||||
/* Function Prototypes */
|
||||
|
||||
#ifndef VG_API_CALL
|
||||
# error VG_API_CALL must be defined
|
||||
#endif
|
||||
|
||||
#ifndef VG_API_ENTRY
|
||||
# error VG_API_ENTRY must be defined
|
||||
#endif
|
||||
|
||||
#ifndef VG_API_EXIT
|
||||
# error VG_API_EXIT must be defined
|
||||
#endif
|
||||
|
||||
VG_API_CALL VGErrorCode VG_API_ENTRY vgGetError(void) VG_API_EXIT;
|
||||
|
||||
VG_API_CALL void VG_API_ENTRY vgFlush(void) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgFinish(void) VG_API_EXIT;
|
||||
|
||||
/* Getters and Setters */
|
||||
VG_API_CALL void VG_API_ENTRY vgSetf (VGParamType type, VGfloat value) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSeti (VGParamType type, VGint value) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetfv(VGParamType type, VGint count,
|
||||
const VGfloat * values) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetiv(VGParamType type, VGint count,
|
||||
const VGint * values) VG_API_EXIT;
|
||||
|
||||
VG_API_CALL VGfloat VG_API_ENTRY vgGetf(VGParamType type) VG_API_EXIT;
|
||||
VG_API_CALL VGint VG_API_ENTRY vgGeti(VGParamType type) VG_API_EXIT;
|
||||
VG_API_CALL VGint VG_API_ENTRY vgGetVectorSize(VGParamType type) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetfv(VGParamType type, VGint count, VGfloat * values) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetiv(VGParamType type, VGint count, VGint * values) VG_API_EXIT;
|
||||
|
||||
VG_API_CALL void VG_API_ENTRY vgSetParameterf(VGHandle object,
|
||||
VGint paramType,
|
||||
VGfloat value) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetParameteri(VGHandle object,
|
||||
VGint paramType,
|
||||
VGint value) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetParameterfv(VGHandle object,
|
||||
VGint paramType,
|
||||
VGint count, const VGfloat * values) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetParameteriv(VGHandle object,
|
||||
VGint paramType,
|
||||
VGint count, const VGint * values) VG_API_EXIT;
|
||||
|
||||
VG_API_CALL VGfloat VG_API_ENTRY vgGetParameterf(VGHandle object,
|
||||
VGint paramType) VG_API_EXIT;
|
||||
VG_API_CALL VGint VG_API_ENTRY vgGetParameteri(VGHandle object,
|
||||
VGint paramType);
|
||||
VG_API_CALL VGint VG_API_ENTRY vgGetParameterVectorSize(VGHandle object,
|
||||
VGint paramType) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetParameterfv(VGHandle object,
|
||||
VGint paramType,
|
||||
VGint count, VGfloat * values) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetParameteriv(VGHandle object,
|
||||
VGint paramType,
|
||||
VGint count, VGint * values) VG_API_EXIT;
|
||||
|
||||
/* Matrix Manipulation */
|
||||
VG_API_CALL void VG_API_ENTRY vgLoadIdentity(void) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgLoadMatrix(const VGfloat * m) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetMatrix(VGfloat * m) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgMultMatrix(const VGfloat * m) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgTranslate(VGfloat tx, VGfloat ty) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgScale(VGfloat sx, VGfloat sy) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgShear(VGfloat shx, VGfloat shy) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgRotate(VGfloat angle) VG_API_EXIT;
|
||||
|
||||
/* Masking and Clearing */
|
||||
VG_API_CALL void VG_API_ENTRY vgMask(VGHandle mask, VGMaskOperation operation,
|
||||
VGint x, VGint y,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgRenderToMask(VGPath path,
|
||||
VGbitfield paintModes,
|
||||
VGMaskOperation operation) VG_API_EXIT;
|
||||
VG_API_CALL VGMaskLayer VG_API_ENTRY vgCreateMaskLayer(VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDestroyMaskLayer(VGMaskLayer maskLayer) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgFillMaskLayer(VGMaskLayer maskLayer,
|
||||
VGint x, VGint y,
|
||||
VGint width, VGint height,
|
||||
VGfloat value) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgCopyMask(VGMaskLayer maskLayer,
|
||||
VGint dx, VGint dy,
|
||||
VGint sx, VGint sy,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgClear(VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
|
||||
|
||||
/* Paths */
|
||||
VG_API_CALL VGPath VG_API_ENTRY vgCreatePath(VGint pathFormat,
|
||||
VGPathDatatype datatype,
|
||||
VGfloat scale, VGfloat bias,
|
||||
VGint segmentCapacityHint,
|
||||
VGint coordCapacityHint,
|
||||
VGbitfield capabilities) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgClearPath(VGPath path, VGbitfield capabilities) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDestroyPath(VGPath path) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgRemovePathCapabilities(VGPath path,
|
||||
VGbitfield capabilities) VG_API_EXIT;
|
||||
VG_API_CALL VGbitfield VG_API_ENTRY vgGetPathCapabilities(VGPath path) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgAppendPath(VGPath dstPath, VGPath srcPath) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgAppendPathData(VGPath dstPath,
|
||||
VGint numSegments,
|
||||
const VGubyte * pathSegments,
|
||||
const void * pathData) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgModifyPathCoords(VGPath dstPath, VGint startIndex,
|
||||
VGint numSegments,
|
||||
const void * pathData) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgTransformPath(VGPath dstPath, VGPath srcPath) VG_API_EXIT;
|
||||
VG_API_CALL VGboolean VG_API_ENTRY vgInterpolatePath(VGPath dstPath,
|
||||
VGPath startPath,
|
||||
VGPath endPath,
|
||||
VGfloat amount) VG_API_EXIT;
|
||||
VG_API_CALL VGfloat VG_API_ENTRY vgPathLength(VGPath path,
|
||||
VGint startSegment, VGint numSegments) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgPointAlongPath(VGPath path,
|
||||
VGint startSegment, VGint numSegments,
|
||||
VGfloat distance,
|
||||
VGfloat * x, VGfloat * y,
|
||||
VGfloat * tangentX, VGfloat * tangentY) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgPathBounds(VGPath path,
|
||||
VGfloat * minX, VGfloat * minY,
|
||||
VGfloat * width, VGfloat * height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgPathTransformedBounds(VGPath path,
|
||||
VGfloat * minX, VGfloat * minY,
|
||||
VGfloat * width, VGfloat * height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDrawPath(VGPath path, VGbitfield paintModes) VG_API_EXIT;
|
||||
|
||||
/* Paint */
|
||||
VG_API_CALL VGPaint VG_API_ENTRY vgCreatePaint(void) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDestroyPaint(VGPaint paint) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetPaint(VGPaint paint, VGbitfield paintModes) VG_API_EXIT;
|
||||
VG_API_CALL VGPaint VG_API_ENTRY vgGetPaint(VGPaintMode paintMode) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetColor(VGPaint paint, VGuint rgba) VG_API_EXIT;
|
||||
VG_API_CALL VGuint VG_API_ENTRY vgGetColor(VGPaint paint) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgPaintPattern(VGPaint paint, VGImage pattern) VG_API_EXIT;
|
||||
|
||||
/* Images */
|
||||
VG_API_CALL VGImage VG_API_ENTRY vgCreateImage(VGImageFormat format,
|
||||
VGint width, VGint height,
|
||||
VGbitfield allowedQuality) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDestroyImage(VGImage image) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgClearImage(VGImage image,
|
||||
VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgImageSubData(VGImage image,
|
||||
const void * data, VGint dataStride,
|
||||
VGImageFormat dataFormat,
|
||||
VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetImageSubData(VGImage image,
|
||||
void * data, VGint dataStride,
|
||||
VGImageFormat dataFormat,
|
||||
VGint x, VGint y,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL VGImage VG_API_ENTRY vgChildImage(VGImage parent,
|
||||
VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL VGImage VG_API_ENTRY vgGetParent(VGImage image) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgCopyImage(VGImage dst, VGint dx, VGint dy,
|
||||
VGImage src, VGint sx, VGint sy,
|
||||
VGint width, VGint height,
|
||||
VGboolean dither) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDrawImage(VGImage image) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetPixels(VGint dx, VGint dy,
|
||||
VGImage src, VGint sx, VGint sy,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgWritePixels(const void * data, VGint dataStride,
|
||||
VGImageFormat dataFormat,
|
||||
VGint dx, VGint dy,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetPixels(VGImage dst, VGint dx, VGint dy,
|
||||
VGint sx, VGint sy,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgReadPixels(void * data, VGint dataStride,
|
||||
VGImageFormat dataFormat,
|
||||
VGint sx, VGint sy,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgCopyPixels(VGint dx, VGint dy,
|
||||
VGint sx, VGint sy,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
|
||||
/* Text */
|
||||
VG_API_CALL VGFont VG_API_ENTRY vgCreateFont(VGint glyphCapacityHint) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDestroyFont(VGFont font) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetGlyphToPath(VGFont font,
|
||||
VGuint glyphIndex,
|
||||
VGPath path,
|
||||
VGboolean isHinted,
|
||||
const VGfloat glyphOrigin [2],
|
||||
const VGfloat escapement[2]) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetGlyphToImage(VGFont font,
|
||||
VGuint glyphIndex,
|
||||
VGImage image,
|
||||
const VGfloat glyphOrigin [2],
|
||||
const VGfloat escapement[2]) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgClearGlyph(VGFont font,VGuint glyphIndex) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDrawGlyph(VGFont font,
|
||||
VGuint glyphIndex,
|
||||
VGbitfield paintModes,
|
||||
VGboolean allowAutoHinting) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDrawGlyphs(VGFont font,
|
||||
VGint glyphCount,
|
||||
const VGuint *glyphIndices,
|
||||
const VGfloat *adjustments_x,
|
||||
const VGfloat *adjustments_y,
|
||||
VGbitfield paintModes,
|
||||
VGboolean allowAutoHinting) VG_API_EXIT;
|
||||
|
||||
/* Image Filters */
|
||||
VG_API_CALL void VG_API_ENTRY vgColorMatrix(VGImage dst, VGImage src,
|
||||
const VGfloat * matrix) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgConvolve(VGImage dst, VGImage src,
|
||||
VGint kernelWidth, VGint kernelHeight,
|
||||
VGint shiftX, VGint shiftY,
|
||||
const VGshort * kernel,
|
||||
VGfloat scale,
|
||||
VGfloat bias,
|
||||
VGTilingMode tilingMode) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSeparableConvolve(VGImage dst, VGImage src,
|
||||
VGint kernelWidth,
|
||||
VGint kernelHeight,
|
||||
VGint shiftX, VGint shiftY,
|
||||
const VGshort * kernelX,
|
||||
const VGshort * kernelY,
|
||||
VGfloat scale,
|
||||
VGfloat bias,
|
||||
VGTilingMode tilingMode) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGaussianBlur(VGImage dst, VGImage src,
|
||||
VGfloat stdDeviationX,
|
||||
VGfloat stdDeviationY,
|
||||
VGTilingMode tilingMode) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgLookup(VGImage dst, VGImage src,
|
||||
const VGubyte * redLUT,
|
||||
const VGubyte * greenLUT,
|
||||
const VGubyte * blueLUT,
|
||||
const VGubyte * alphaLUT,
|
||||
VGboolean outputLinear,
|
||||
VGboolean outputPremultiplied) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgLookupSingle(VGImage dst, VGImage src,
|
||||
const VGuint * lookupTable,
|
||||
VGImageChannel sourceChannel,
|
||||
VGboolean outputLinear,
|
||||
VGboolean outputPremultiplied) VG_API_EXIT;
|
||||
|
||||
/* Hardware Queries */
|
||||
VG_API_CALL VGHardwareQueryResult VG_API_ENTRY vgHardwareQuery(VGHardwareQueryType key,
|
||||
VGint setting) VG_API_EXIT;
|
||||
|
||||
/* Renderer and Extension Information */
|
||||
VG_API_CALL const VGubyte * VG_API_ENTRY vgGetString(VGStringID name) VG_API_EXIT;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* _OPENVG_H */
|
233
include/VG/vgext.h
Normal file
233
include/VG/vgext.h
Normal file
@@ -0,0 +1,233 @@
|
||||
/* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*
|
||||
* VG extensions Reference Implementation
|
||||
* -------------------------------------
|
||||
*
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and /or associated documentation files
|
||||
* (the "Materials "), to deal in the Materials without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Materials,
|
||||
* and to permit persons to whom the Materials are 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 Materials.
|
||||
*
|
||||
* THE MATERIALS ARE 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 MATERIALS OR
|
||||
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*
|
||||
*//**
|
||||
* \file
|
||||
* \brief VG extensions
|
||||
*//*-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
#ifndef _VGEXT_H
|
||||
#define _VGEXT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <VG/openvg.h>
|
||||
#include <VG/vgu.h>
|
||||
|
||||
#ifndef VG_API_ENTRYP
|
||||
# define VG_API_ENTRYP VG_API_ENTRY*
|
||||
#endif
|
||||
|
||||
#ifndef VGU_API_ENTRYP
|
||||
# define VGU_API_ENTRYP VGU_API_ENTRY*
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------------
|
||||
* KHR extensions
|
||||
*------------------------------------------------------------------------------*/
|
||||
|
||||
typedef enum {
|
||||
|
||||
#ifndef VG_KHR_iterative_average_blur
|
||||
VG_MAX_AVERAGE_BLUR_DIMENSION_KHR = 0x116B,
|
||||
VG_AVERAGE_BLUR_DIMENSION_RESOLUTION_KHR = 0x116C,
|
||||
VG_MAX_AVERAGE_BLUR_ITERATIONS_KHR = 0x116D,
|
||||
#endif
|
||||
|
||||
VG_PARAM_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGParamTypeKHR;
|
||||
|
||||
#ifndef VG_KHR_EGL_image
|
||||
#define VG_KHR_EGL_image 1
|
||||
/* VGEGLImageKHR is an opaque handle to an EGLImage */
|
||||
typedef void* VGeglImageKHR;
|
||||
|
||||
#ifdef VG_VGEXT_PROTOTYPES
|
||||
VG_API_CALL VGImage VG_API_ENTRY vgCreateEGLImageTargetKHR(VGeglImageKHR image);
|
||||
#endif
|
||||
typedef VGImage (VG_API_ENTRYP PFNVGCREATEEGLIMAGETARGETKHRPROC) (VGeglImageKHR image);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef VG_KHR_iterative_average_blur
|
||||
#define VG_KHR_iterative_average_blur 1
|
||||
|
||||
#ifdef VG_VGEXT_PROTOTYPES
|
||||
VG_API_CALL void vgIterativeAverageBlurKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
|
||||
#endif
|
||||
typedef void (VG_API_ENTRYP PFNVGITERATIVEAVERAGEBLURKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef VG_KHR_advanced_blending
|
||||
#define VG_KHR_advanced_blending 1
|
||||
|
||||
typedef enum {
|
||||
VG_BLEND_OVERLAY_KHR = 0x2010,
|
||||
VG_BLEND_HARDLIGHT_KHR = 0x2011,
|
||||
VG_BLEND_SOFTLIGHT_SVG_KHR = 0x2012,
|
||||
VG_BLEND_SOFTLIGHT_KHR = 0x2013,
|
||||
VG_BLEND_COLORDODGE_KHR = 0x2014,
|
||||
VG_BLEND_COLORBURN_KHR = 0x2015,
|
||||
VG_BLEND_DIFFERENCE_KHR = 0x2016,
|
||||
VG_BLEND_SUBTRACT_KHR = 0x2017,
|
||||
VG_BLEND_INVERT_KHR = 0x2018,
|
||||
VG_BLEND_EXCLUSION_KHR = 0x2019,
|
||||
VG_BLEND_LINEARDODGE_KHR = 0x201a,
|
||||
VG_BLEND_LINEARBURN_KHR = 0x201b,
|
||||
VG_BLEND_VIVIDLIGHT_KHR = 0x201c,
|
||||
VG_BLEND_LINEARLIGHT_KHR = 0x201d,
|
||||
VG_BLEND_PINLIGHT_KHR = 0x201e,
|
||||
VG_BLEND_HARDMIX_KHR = 0x201f,
|
||||
VG_BLEND_CLEAR_KHR = 0x2020,
|
||||
VG_BLEND_DST_KHR = 0x2021,
|
||||
VG_BLEND_SRC_OUT_KHR = 0x2022,
|
||||
VG_BLEND_DST_OUT_KHR = 0x2023,
|
||||
VG_BLEND_SRC_ATOP_KHR = 0x2024,
|
||||
VG_BLEND_DST_ATOP_KHR = 0x2025,
|
||||
VG_BLEND_XOR_KHR = 0x2026,
|
||||
|
||||
VG_BLEND_MODE_KHR_FORCE_SIZE= VG_MAX_ENUM
|
||||
} VGBlendModeKHR;
|
||||
#endif
|
||||
|
||||
#ifndef VG_KHR_parametric_filter
|
||||
#define VG_KHR_parametric_filter 1
|
||||
|
||||
typedef enum {
|
||||
VG_PF_OBJECT_VISIBLE_FLAG_KHR = (1 << 0),
|
||||
VG_PF_KNOCKOUT_FLAG_KHR = (1 << 1),
|
||||
VG_PF_OUTER_FLAG_KHR = (1 << 2),
|
||||
VG_PF_INNER_FLAG_KHR = (1 << 3),
|
||||
|
||||
VG_PF_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPfTypeKHR;
|
||||
|
||||
typedef enum {
|
||||
VGU_IMAGE_IN_USE_ERROR = 0xF010,
|
||||
|
||||
VGU_ERROR_CODE_KHR_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGUErrorCodeKHR;
|
||||
|
||||
#ifdef VG_VGEXT_PROTOTYPES
|
||||
VG_API_CALL void VG_API_ENTRY vgParametricFilterKHR(VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguDropShadowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA) ;
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
|
||||
#endif
|
||||
typedef void (VG_API_ENTRYP PFNVGPARAMETRICFILTERKHRPROC) (VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
|
||||
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUDROPSHADOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
|
||||
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA);
|
||||
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
|
||||
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
|
||||
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------------
|
||||
* NDS extensions
|
||||
*------------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef VG_NDS_paint_generation
|
||||
#define VG_NDS_paint_generation 1
|
||||
|
||||
typedef enum {
|
||||
VG_PAINT_COLOR_RAMP_LINEAR_NDS = 0x1A10,
|
||||
VG_COLOR_MATRIX_NDS = 0x1A11,
|
||||
VG_PAINT_COLOR_TRANSFORM_LINEAR_NDS = 0x1A12,
|
||||
|
||||
VG_PAINT_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPaintParamTypeNds;
|
||||
|
||||
typedef enum {
|
||||
VG_DRAW_IMAGE_COLOR_MATRIX_NDS = 0x1F10,
|
||||
|
||||
VG_IMAGE_MODE_NDS_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGImageModeNds;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef VG_NDS_projective_geometry
|
||||
#define VG_NDS_projective_geometry 1
|
||||
|
||||
typedef enum {
|
||||
VG_CLIP_MODE_NDS = 0x1180,
|
||||
VG_CLIP_LINES_NDS = 0x1181,
|
||||
VG_MAX_CLIP_LINES_NDS = 0x1182,
|
||||
|
||||
VG_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGParamTypeNds;
|
||||
|
||||
typedef enum {
|
||||
VG_CLIPMODE_NONE_NDS = 0x3000,
|
||||
VG_CLIPMODE_CLIP_CLOSED_NDS = 0x3001,
|
||||
VG_CLIPMODE_CLIP_OPEN_NDS = 0x3002,
|
||||
VG_CLIPMODE_CULL_NDS = 0x3003,
|
||||
|
||||
VG_CLIPMODE_NDS_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGClipModeNds;
|
||||
|
||||
typedef enum {
|
||||
VG_RQUAD_TO_NDS = ( 13 << 1 ),
|
||||
VG_RCUBIC_TO_NDS = ( 14 << 1 ),
|
||||
|
||||
VG_PATH_SEGMENT_NDS_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathSegmentNds;
|
||||
|
||||
typedef enum {
|
||||
VG_RQUAD_TO_ABS_NDS = (VG_RQUAD_TO_NDS | VG_ABSOLUTE),
|
||||
VG_RQUAD_TO_REL_NDS = (VG_RQUAD_TO_NDS | VG_RELATIVE),
|
||||
VG_RCUBIC_TO_ABS_NDS = (VG_RCUBIC_TO_NDS | VG_ABSOLUTE),
|
||||
VG_RCUBIC_TO_REL_NDS = (VG_RCUBIC_TO_NDS | VG_RELATIVE),
|
||||
|
||||
VG_PATH_COMMAND_NDS_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathCommandNds;
|
||||
|
||||
#ifdef VG_VGEXT_PROTOTYPES
|
||||
VG_API_CALL void VG_API_ENTRY vgProjectiveMatrixNDS(VGboolean enable) ;
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguTransformClipLineNDS(const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
|
||||
#endif
|
||||
typedef void (VG_API_ENTRYP PFNVGPROJECTIVEMATRIXNDSPROC) (VGboolean enable) ;
|
||||
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUTRANSFORMCLIPLINENDSPROC) (const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* _VGEXT_H */
|
92
include/VG/vgplatform.h
Normal file
92
include/VG/vgplatform.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*
|
||||
* VG platform specific header Reference Implementation
|
||||
* ----------------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and /or associated documentation files
|
||||
* (the "Materials "), to deal in the Materials without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Materials,
|
||||
* and to permit persons to whom the Materials are 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 Materials.
|
||||
*
|
||||
* THE MATERIALS ARE 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 MATERIALS OR
|
||||
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*
|
||||
*//**
|
||||
* \file
|
||||
* \brief VG platform specific header
|
||||
*//*-------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _VGPLATFORM_H
|
||||
#define _VGPLATFORM_H
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef VG_API_CALL
|
||||
#if defined(OPENVG_STATIC_LIBRARY)
|
||||
# define VG_API_CALL
|
||||
#else
|
||||
# define VG_API_CALL KHRONOS_APICALL
|
||||
#endif /* defined OPENVG_STATIC_LIBRARY */
|
||||
#endif /* ifndef VG_API_CALL */
|
||||
|
||||
#ifndef VGU_API_CALL
|
||||
#if defined(OPENVG_STATIC_LIBRARY)
|
||||
# define VGU_API_CALL
|
||||
#else
|
||||
# define VGU_API_CALL KHRONOS_APICALL
|
||||
#endif /* defined OPENVG_STATIC_LIBRARY */
|
||||
#endif /* ifndef VGU_API_CALL */
|
||||
|
||||
|
||||
#ifndef VG_API_ENTRY
|
||||
#define VG_API_ENTRY
|
||||
#endif
|
||||
|
||||
#ifndef VG_API_EXIT
|
||||
#define VG_API_EXIT
|
||||
#endif
|
||||
|
||||
#ifndef VGU_API_ENTRY
|
||||
#define VGU_API_ENTRY
|
||||
#endif
|
||||
|
||||
#ifndef VGU_API_EXIT
|
||||
#define VGU_API_EXIT
|
||||
#endif
|
||||
|
||||
typedef float VGfloat;
|
||||
typedef signed char VGbyte;
|
||||
typedef unsigned char VGubyte;
|
||||
typedef signed short VGshort;
|
||||
typedef signed int VGint;
|
||||
typedef unsigned int VGuint;
|
||||
typedef unsigned int VGbitfield;
|
||||
|
||||
#ifndef VG_VGEXT_PROTOTYPES
|
||||
#define VG_VGEXT_PROTOTYPES
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* _VGPLATFORM_H */
|
131
include/VG/vgu.h
Normal file
131
include/VG/vgu.h
Normal file
@@ -0,0 +1,131 @@
|
||||
/* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*
|
||||
* VGU 1.1 Reference Implementation
|
||||
* -------------------------------------
|
||||
*
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and /or associated documentation files
|
||||
* (the "Materials "), to deal in the Materials without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Materials,
|
||||
* and to permit persons to whom the Materials are 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 Materials.
|
||||
*
|
||||
* THE MATERIALS ARE 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 MATERIALS OR
|
||||
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*
|
||||
*//**
|
||||
* \file
|
||||
* \brief VGU 1.1 API.
|
||||
*//*-------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _VGU_H
|
||||
#define _VGU_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <VG/openvg.h>
|
||||
|
||||
#define VGU_VERSION_1_0 1
|
||||
#define VGU_VERSION_1_1 2
|
||||
|
||||
#ifndef VGU_API_CALL
|
||||
# error VGU_API_CALL must be defined
|
||||
#endif
|
||||
|
||||
#ifndef VGU_API_ENTRY
|
||||
# error VGU_API_ENTRY must be defined
|
||||
#endif
|
||||
|
||||
#ifndef VGU_API_EXIT
|
||||
# error VGU_API_EXIT must be defined
|
||||
#endif
|
||||
|
||||
|
||||
typedef enum {
|
||||
VGU_NO_ERROR = 0,
|
||||
VGU_BAD_HANDLE_ERROR = 0xF000,
|
||||
VGU_ILLEGAL_ARGUMENT_ERROR = 0xF001,
|
||||
VGU_OUT_OF_MEMORY_ERROR = 0xF002,
|
||||
VGU_PATH_CAPABILITY_ERROR = 0xF003,
|
||||
VGU_BAD_WARP_ERROR = 0xF004,
|
||||
|
||||
VGU_ERROR_CODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGUErrorCode;
|
||||
|
||||
typedef enum {
|
||||
VGU_ARC_OPEN = 0xF100,
|
||||
VGU_ARC_CHORD = 0xF101,
|
||||
VGU_ARC_PIE = 0xF102,
|
||||
|
||||
VGU_ARC_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGUArcType;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguLine(VGPath path,
|
||||
VGfloat x0, VGfloat y0,
|
||||
VGfloat x1, VGfloat y1) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguPolygon(VGPath path,
|
||||
const VGfloat * points, VGint count,
|
||||
VGboolean closed) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRect(VGPath path,
|
||||
VGfloat x, VGfloat y,
|
||||
VGfloat width, VGfloat height) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRoundRect(VGPath path,
|
||||
VGfloat x, VGfloat y,
|
||||
VGfloat width, VGfloat height,
|
||||
VGfloat arcWidth, VGfloat arcHeight) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguEllipse(VGPath path,
|
||||
VGfloat cx, VGfloat cy,
|
||||
VGfloat width, VGfloat height) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguArc(VGPath path,
|
||||
VGfloat x, VGfloat y,
|
||||
VGfloat width, VGfloat height,
|
||||
VGfloat startAngle, VGfloat angleExtent,
|
||||
VGUArcType arcType) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToSquare(VGfloat sx0, VGfloat sy0,
|
||||
VGfloat sx1, VGfloat sy1,
|
||||
VGfloat sx2, VGfloat sy2,
|
||||
VGfloat sx3, VGfloat sy3,
|
||||
VGfloat * matrix) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpSquareToQuad(VGfloat dx0, VGfloat dy0,
|
||||
VGfloat dx1, VGfloat dy1,
|
||||
VGfloat dx2, VGfloat dy2,
|
||||
VGfloat dx3, VGfloat dy3,
|
||||
VGfloat * matrix) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToQuad(VGfloat dx0, VGfloat dy0,
|
||||
VGfloat dx1, VGfloat dy1,
|
||||
VGfloat dx2, VGfloat dy2,
|
||||
VGfloat dx3, VGfloat dy3,
|
||||
VGfloat sx0, VGfloat sy0,
|
||||
VGfloat sx1, VGfloat sy1,
|
||||
VGfloat sx2, VGfloat sy2,
|
||||
VGfloat sx3, VGfloat sy3,
|
||||
VGfloat * matrix) VGU_API_EXIT;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef _VGU_H */
|
@@ -25,8 +25,6 @@
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include "no_extern_c.h"
|
||||
|
||||
#ifndef _C99_COMPAT_H_
|
||||
#define _C99_COMPAT_H_
|
||||
|
||||
@@ -35,11 +33,6 @@
|
||||
* MSVC hacks.
|
||||
*/
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
# if _MSC_VER < 1500
|
||||
# error "Microsoft Visual Studio 2008 or higher required"
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Visual Studio 2012 will complain if we define the `inline` keyword, but
|
||||
* actually it only supports the keyword on C++.
|
||||
@@ -123,7 +116,11 @@
|
||||
# elif defined(__GNUC__)
|
||||
# define __func__ __FUNCTION__
|
||||
# elif defined(_MSC_VER)
|
||||
# define __func__ __FUNCTION__
|
||||
# if _MSC_VER >= 1300
|
||||
# define __func__ __FUNCTION__
|
||||
# else
|
||||
# define __func__ "<unknown>"
|
||||
# endif
|
||||
# else
|
||||
# define __func__ "<unknown>"
|
||||
# endif
|
||||
|
@@ -1,215 +0,0 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2007-2015 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, 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 VMWARE 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
/**
|
||||
* Wrapper for math.h which makes sure we have definitions of all the c99
|
||||
* functions.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _C99_MATH_H_
|
||||
#define _C99_MATH_H_
|
||||
|
||||
#include <math.h>
|
||||
#include "c99_compat.h"
|
||||
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
/* This is to ensure that we get M_PI, etc. definitions */
|
||||
#if !defined(_USE_MATH_DEFINES)
|
||||
#error _USE_MATH_DEFINES define required when building with MSVC
|
||||
#endif
|
||||
|
||||
#if _MSC_VER < 1800
|
||||
#define isfinite(x) _finite((double)(x))
|
||||
#define isnan(x) _isnan((double)(x))
|
||||
#endif /* _MSC_VER < 1800 */
|
||||
|
||||
#if _MSC_VER < 1800
|
||||
static inline double log2( double x )
|
||||
{
|
||||
const double invln2 = 1.442695041;
|
||||
return log( x ) * invln2;
|
||||
}
|
||||
|
||||
static inline double
|
||||
round(double x)
|
||||
{
|
||||
return x >= 0.0 ? floor(x + 0.5) : ceil(x - 0.5);
|
||||
}
|
||||
|
||||
static inline float
|
||||
roundf(float x)
|
||||
{
|
||||
return x >= 0.0f ? floorf(x + 0.5f) : ceilf(x - 0.5f);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef INFINITY
|
||||
#include <float.h> // DBL_MAX
|
||||
#define INFINITY (DBL_MAX + DBL_MAX)
|
||||
#endif
|
||||
|
||||
#ifndef NAN
|
||||
#define NAN (INFINITY - INFINITY)
|
||||
#endif
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
|
||||
#if (defined(_MSC_VER) && _MSC_VER < 1800) || \
|
||||
(!defined(_MSC_VER) && \
|
||||
__STDC_VERSION__ < 199901L && \
|
||||
(!defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 600) && \
|
||||
!defined(__cplusplus))
|
||||
|
||||
static inline long int
|
||||
lrint(double d)
|
||||
{
|
||||
long int rounded = (long int)(d + 0.5);
|
||||
|
||||
if (d - floor(d) == 0.5) {
|
||||
if (rounded % 2 != 0)
|
||||
rounded += (d > 0) ? -1 : 1;
|
||||
}
|
||||
|
||||
return rounded;
|
||||
}
|
||||
|
||||
static inline long int
|
||||
lrintf(float f)
|
||||
{
|
||||
long int rounded = (long int)(f + 0.5f);
|
||||
|
||||
if (f - floorf(f) == 0.5f) {
|
||||
if (rounded % 2 != 0)
|
||||
rounded += (f > 0) ? -1 : 1;
|
||||
}
|
||||
|
||||
return rounded;
|
||||
}
|
||||
|
||||
static inline long long int
|
||||
llrint(double d)
|
||||
{
|
||||
long long int rounded = (long long int)(d + 0.5);
|
||||
|
||||
if (d - floor(d) == 0.5) {
|
||||
if (rounded % 2 != 0)
|
||||
rounded += (d > 0) ? -1 : 1;
|
||||
}
|
||||
|
||||
return rounded;
|
||||
}
|
||||
|
||||
static inline long long int
|
||||
llrintf(float f)
|
||||
{
|
||||
long long int rounded = (long long int)(f + 0.5f);
|
||||
|
||||
if (f - floorf(f) == 0.5f) {
|
||||
if (rounded % 2 != 0)
|
||||
rounded += (f > 0) ? -1 : 1;
|
||||
}
|
||||
|
||||
return rounded;
|
||||
}
|
||||
|
||||
#endif /* C99 */
|
||||
|
||||
|
||||
/*
|
||||
* signbit() is a macro on Linux. Not available on Windows.
|
||||
*/
|
||||
#ifndef signbit
|
||||
#define signbit(x) ((x) < 0.0f)
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI (3.14159265358979323846)
|
||||
#endif
|
||||
|
||||
#ifndef M_E
|
||||
#define M_E (2.7182818284590452354)
|
||||
#endif
|
||||
|
||||
#ifndef M_LOG2E
|
||||
#define M_LOG2E (1.4426950408889634074)
|
||||
#endif
|
||||
|
||||
#ifndef FLT_MAX_EXP
|
||||
#define FLT_MAX_EXP 128
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(fpclassify)
|
||||
/* ISO C99 says that fpclassify is a macro. Assume that any implementation
|
||||
* of fpclassify, whether it's in a C99 compiler or not, will be a macro.
|
||||
*/
|
||||
#elif defined(__cplusplus)
|
||||
/* For C++, fpclassify() should be defined in <cmath> */
|
||||
#elif defined(_MSC_VER)
|
||||
/* Not required on VS2013 and above. Oddly, the fpclassify() function
|
||||
* doesn't exist in such a form on MSVC. This is an implementation using
|
||||
* slightly different lower-level Windows functions.
|
||||
*/
|
||||
#include <float.h>
|
||||
|
||||
static inline enum {FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL}
|
||||
fpclassify(double x)
|
||||
{
|
||||
switch(_fpclass(x)) {
|
||||
case _FPCLASS_SNAN: /* signaling NaN */
|
||||
case _FPCLASS_QNAN: /* quiet NaN */
|
||||
return FP_NAN;
|
||||
case _FPCLASS_NINF: /* negative infinity */
|
||||
case _FPCLASS_PINF: /* positive infinity */
|
||||
return FP_INFINITE;
|
||||
case _FPCLASS_NN: /* negative normal */
|
||||
case _FPCLASS_PN: /* positive normal */
|
||||
return FP_NORMAL;
|
||||
case _FPCLASS_ND: /* negative denormalized */
|
||||
case _FPCLASS_PD: /* positive denormalized */
|
||||
return FP_SUBNORMAL;
|
||||
case _FPCLASS_NZ: /* negative zero */
|
||||
case _FPCLASS_PZ: /* positive zero */
|
||||
return FP_ZERO;
|
||||
default:
|
||||
/* Should never get here; but if we do, this will guarantee
|
||||
* that the pattern is not treated like a number.
|
||||
*/
|
||||
return FP_NAN;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#error "Need to include or define an fpclassify function"
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* #define _C99_MATH_H_ */
|
@@ -1,48 +0,0 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2014 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
|
||||
* 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* Including system's headers inside `extern "C" { ... }` is not safe, as system
|
||||
* headers may have C++ code in them, and C++ code inside extern "C"
|
||||
* leads to syntatically incorrect code.
|
||||
*
|
||||
* This is because putting code inside extern "C" won't make __cplusplus define
|
||||
* go away, that is, the system header being included thinks is free to use C++
|
||||
* as it sees fits.
|
||||
*
|
||||
* Including non-system headers inside extern "C" is not safe either, because
|
||||
* non-system headers end up including system headers, hence fall in the above
|
||||
* case too.
|
||||
*
|
||||
* Conclusion, includes inside extern "C" is simply not portable.
|
||||
*
|
||||
*
|
||||
* This header helps surface these issues.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
template<class T> class _IncludeInsideExternCNotPortable;
|
||||
#endif
|
@@ -11,5 +11,5 @@ CHIPSET(0x27AE, I945_GME, "Intel(R) 945GME")
|
||||
CHIPSET(0x29B2, Q35_G, "Intel(R) Q35")
|
||||
CHIPSET(0x29C2, G33_G, "Intel(R) G33")
|
||||
CHIPSET(0x29D2, Q33_G, "Intel(R) Q33")
|
||||
CHIPSET(0xA011, PNV_GM, "Intel(R) Pineview M")
|
||||
CHIPSET(0xA001, PNV_G, "Intel(R) Pineview")
|
||||
CHIPSET(0xA011, IGD_GM, "Intel(R) IGD")
|
||||
CHIPSET(0xA001, IGD_G, "Intel(R) IGD")
|
||||
|
137
scons/gallium.py
137
scons/gallium.py
@@ -35,7 +35,7 @@ import os
|
||||
import os.path
|
||||
import re
|
||||
import subprocess
|
||||
import platform as host_platform
|
||||
import platform as _platform
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
@@ -87,25 +87,6 @@ def createInstallMethods(env):
|
||||
env.AddMethod(install_shared_library, 'InstallSharedLibrary')
|
||||
|
||||
|
||||
def msvc2013_compat(env):
|
||||
if env['gcc']:
|
||||
env.Append(CCFLAGS = [
|
||||
'-Werror=vla',
|
||||
'-Werror=pointer-arith',
|
||||
])
|
||||
|
||||
def msvc2008_compat(env):
|
||||
msvc2013_compat(env)
|
||||
if env['gcc']:
|
||||
env.Append(CFLAGS = [
|
||||
'-Werror=declaration-after-statement',
|
||||
])
|
||||
|
||||
def createMSVCCompatMethods(env):
|
||||
env.AddMethod(msvc2013_compat, 'MSVC2013Compat')
|
||||
env.AddMethod(msvc2008_compat, 'MSVC2008Compat')
|
||||
|
||||
|
||||
def num_jobs():
|
||||
try:
|
||||
return int(os.environ['NUMBER_OF_PROCESSORS'])
|
||||
@@ -147,17 +128,6 @@ def check_cc(env, cc, expr, cpp_opt = '-E'):
|
||||
return result
|
||||
|
||||
|
||||
def check_prog(env, prog):
|
||||
"""Check whether this program exists."""
|
||||
|
||||
sys.stdout.write('Checking for %s ... ' % prog)
|
||||
|
||||
result = env.Detect(prog)
|
||||
|
||||
sys.stdout.write(' %s\n' % ['no', 'yes'][int(bool(result))])
|
||||
return result
|
||||
|
||||
|
||||
def generate(env):
|
||||
"""Common environment generation code"""
|
||||
|
||||
@@ -197,7 +167,7 @@ def generate(env):
|
||||
env['gcc'] = 0
|
||||
env['clang'] = 0
|
||||
env['msvc'] = 0
|
||||
if host_platform.system() == 'Windows':
|
||||
if _platform.system() == 'Windows':
|
||||
env['msvc'] = check_cc(env, 'MSVC', 'defined(_MSC_VER)', '/E')
|
||||
if not env['msvc']:
|
||||
env['gcc'] = check_cc(env, 'GCC', 'defined(__GNUC__) && !defined(__clang__)')
|
||||
@@ -221,10 +191,10 @@ def generate(env):
|
||||
|
||||
# Determine whether we are cross compiling; in particular, whether we need
|
||||
# to compile code generators with a different compiler as the target code.
|
||||
hosthost_platform = host_platform.system().lower()
|
||||
if hosthost_platform.startswith('cygwin'):
|
||||
hosthost_platform = 'cygwin'
|
||||
host_machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', host_platform.machine()))
|
||||
host_platform = _platform.system().lower()
|
||||
if host_platform.startswith('cygwin'):
|
||||
host_platform = 'cygwin'
|
||||
host_machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', _platform.machine()))
|
||||
host_machine = {
|
||||
'x86': 'x86',
|
||||
'i386': 'x86',
|
||||
@@ -235,7 +205,7 @@ def generate(env):
|
||||
'AMD64': 'x86_64',
|
||||
'x86_64': 'x86_64',
|
||||
}.get(host_machine, 'generic')
|
||||
env['crosscompile'] = platform != hosthost_platform
|
||||
env['crosscompile'] = platform != host_platform
|
||||
if machine == 'x86_64' and host_machine != 'x86_64':
|
||||
env['crosscompile'] = True
|
||||
env['hostonly'] = False
|
||||
@@ -313,7 +283,6 @@ def generate(env):
|
||||
'_SVID_SOURCE',
|
||||
'_BSD_SOURCE',
|
||||
'_GNU_SOURCE',
|
||||
'_DEFAULT_SOURCE',
|
||||
'HAVE_PTHREAD',
|
||||
'HAVE_POSIX_MEMALIGN',
|
||||
]
|
||||
@@ -362,7 +331,6 @@ def generate(env):
|
||||
'_SCL_SECURE_NO_WARNINGS',
|
||||
'_SCL_SECURE_NO_DEPRECATE',
|
||||
'_ALLOW_KEYWORD_MACROS',
|
||||
'_HAS_EXCEPTIONS=0', # Tell C++ STL to not use exceptions
|
||||
]
|
||||
if env['build'] in ('debug', 'checked'):
|
||||
cppdefines += ['_DEBUG']
|
||||
@@ -374,26 +342,6 @@ def generate(env):
|
||||
print 'warning: Floating-point textures enabled.'
|
||||
print 'warning: Please consult docs/patents.txt with your lawyer before building Mesa.'
|
||||
cppdefines += ['TEXTURE_FLOAT_ENABLED']
|
||||
if gcc_compat:
|
||||
ccversion = env['CCVERSION']
|
||||
cppdefines += [
|
||||
'HAVE___BUILTIN_EXPECT',
|
||||
'HAVE___BUILTIN_FFS',
|
||||
'HAVE___BUILTIN_FFSLL',
|
||||
'HAVE_FUNC_ATTRIBUTE_FLATTEN',
|
||||
'HAVE_FUNC_ATTRIBUTE_UNUSED',
|
||||
# GCC 3.0
|
||||
'HAVE_FUNC_ATTRIBUTE_FORMAT',
|
||||
'HAVE_FUNC_ATTRIBUTE_PACKED',
|
||||
# GCC 3.4
|
||||
'HAVE___BUILTIN_CTZ',
|
||||
'HAVE___BUILTIN_POPCOUNT',
|
||||
'HAVE___BUILTIN_POPCOUNTLL',
|
||||
'HAVE___BUILTIN_CLZ',
|
||||
'HAVE___BUILTIN_CLZLL',
|
||||
]
|
||||
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.5'):
|
||||
cppdefines += ['HAVE___BUILTIN_UNREACHABLE']
|
||||
env.Append(CPPDEFINES = cppdefines)
|
||||
|
||||
# C compiler options
|
||||
@@ -429,7 +377,8 @@ def generate(env):
|
||||
'-m32',
|
||||
#'-march=pentium4',
|
||||
]
|
||||
if platform != 'haiku':
|
||||
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2') \
|
||||
and platform != 'haiku':
|
||||
# NOTE: We need to ensure stack is realigned given that we
|
||||
# produce shared objects, and have no control over the stack
|
||||
# alignment policy of the application. Therefore we need
|
||||
@@ -470,6 +419,13 @@ def generate(env):
|
||||
'-Wmissing-prototypes',
|
||||
'-std=gnu99',
|
||||
]
|
||||
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
|
||||
ccflags += [
|
||||
'-Wpointer-arith',
|
||||
]
|
||||
cflags += [
|
||||
'-Wdeclaration-after-statement',
|
||||
]
|
||||
if icc:
|
||||
cflags += [
|
||||
'-std=gnu99',
|
||||
@@ -506,13 +462,8 @@ def generate(env):
|
||||
]
|
||||
ccflags += [
|
||||
'/W3', # warning level
|
||||
'/wd4018', # signed/unsigned mismatch
|
||||
'/wd4056', # overflow in floating-point constant arithmetic
|
||||
'/wd4244', # conversion from 'type1' to 'type2', possible loss of data
|
||||
'/wd4267', # 'var' : conversion from 'size_t' to 'type', possible loss of data
|
||||
'/wd4305', # truncation from 'type1' to 'type2'
|
||||
'/wd4351', # new behavior: elements of array 'array' will be default initialized
|
||||
'/wd4756', # overflow in constant arithmetic
|
||||
'/wd4800', # forcing value to bool 'true' or 'false' (performance warning)
|
||||
'/wd4996', # disable deprecated POSIX name warnings
|
||||
]
|
||||
@@ -549,7 +500,6 @@ def generate(env):
|
||||
env.Append(CCFLAGS = [
|
||||
'/analyze',
|
||||
#'/analyze:log', '${TARGET.base}.xml',
|
||||
'/wd28251', # Inconsistent annotation for function
|
||||
])
|
||||
if env['clang']:
|
||||
# scan-build will produce more comprehensive output
|
||||
@@ -634,46 +584,39 @@ def generate(env):
|
||||
env.Append(CCFLAGS = ['-fopenmp'])
|
||||
env.Append(LIBS = ['gomp'])
|
||||
|
||||
if gcc_compat:
|
||||
ccversion = env['CCVERSION']
|
||||
cppdefines += [
|
||||
'HAVE___BUILTIN_EXPECT',
|
||||
'HAVE___BUILTIN_FFS',
|
||||
'HAVE___BUILTIN_FFSLL',
|
||||
'HAVE_FUNC_ATTRIBUTE_FLATTEN',
|
||||
]
|
||||
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('3'):
|
||||
cppdefines += [
|
||||
'HAVE_FUNC_ATTRIBUTE_FORMAT',
|
||||
'HAVE_FUNC_ATTRIBUTE_PACKED',
|
||||
]
|
||||
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('3.4'):
|
||||
cppdefines += [
|
||||
'HAVE___BUILTIN_CTZ',
|
||||
'HAVE___BUILTIN_POPCOUNT',
|
||||
'HAVE___BUILTIN_POPCOUNTLL',
|
||||
'HAVE___BUILTIN_CLZ',
|
||||
'HAVE___BUILTIN_CLZLL',
|
||||
]
|
||||
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.5'):
|
||||
cppdefines += ['HAVE___BUILTIN_UNREACHABLE']
|
||||
|
||||
# Load tools
|
||||
env.Tool('lex')
|
||||
if env['msvc']:
|
||||
env.Append(LEXFLAGS = [
|
||||
# Force flex to use const keyword in prototypes, as relies on
|
||||
# __cplusplus or __STDC__ macro to determine whether it's safe to
|
||||
# use const keyword, but MSVC never defines __STDC__ unless we
|
||||
# disable all MSVC extensions.
|
||||
'-DYY_USE_CONST=',
|
||||
])
|
||||
# Flex relies on __STDC_VERSION__>=199901L to decide when to include
|
||||
# C99 inttypes.h. We always have inttypes.h available with MSVC
|
||||
# (either the one bundled with MSVC 2013, or the one we bundle
|
||||
# ourselves), but we can't just define __STDC_VERSION__ without
|
||||
# breaking stuff, as MSVC doesn't fully support C99. There's also no
|
||||
# way to premptively include stdint.
|
||||
env.Append(CCFLAGS = ['-FIinttypes.h'])
|
||||
if host_platform.system() == 'Windows':
|
||||
# Prefer winflexbison binaries, as not only they are easier to install
|
||||
# (no additional dependencies), but also better Windows support.
|
||||
if check_prog(env, 'win_flex'):
|
||||
env["LEX"] = 'win_flex'
|
||||
env.Append(LEXFLAGS = [
|
||||
# windows compatibility (uses <io.h> instead of <unistd.h> and
|
||||
# _isatty, _fileno functions)
|
||||
'--wincompat'
|
||||
])
|
||||
|
||||
env.Tool('yacc')
|
||||
if host_platform.system() == 'Windows':
|
||||
if check_prog(env, 'win_bison'):
|
||||
env["YACC"] = 'win_bison'
|
||||
|
||||
if env['llvm']:
|
||||
env.Tool('llvm')
|
||||
|
||||
# Custom builders and methods
|
||||
env.Tool('custom')
|
||||
createInstallMethods(env)
|
||||
createMSVCCompatMethods(env)
|
||||
|
||||
env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage', 'xfixes', 'glproto >= 1.4.13'])
|
||||
env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx >= 1.8.1', 'xcb-dri2 >= 1.8'])
|
||||
|
@@ -132,11 +132,6 @@ def generate(env):
|
||||
# Some of the LLVM C headers use the inline keyword without
|
||||
# defining it.
|
||||
env.Append(CPPDEFINES = [('inline', '__inline')])
|
||||
# Match some of the warning options from llvm/cmake/modules/HandleLLVMOptions.cmake
|
||||
env.AppendUnique(CXXFLAGS = [
|
||||
'/wd4355', # 'this' : used in base member initializer list
|
||||
'/wd4624', # 'derived class' : destructor could not be generated because a base class destructor is inaccessible
|
||||
])
|
||||
if env['build'] in ('debug', 'checked'):
|
||||
# LLVM libraries are static, build with /MT, and they
|
||||
# automatically link agains LIBCMT. When we're doing a
|
||||
|
@@ -58,9 +58,6 @@ EXTRA_DIST = \
|
||||
egl/docs \
|
||||
getopt hgl SConscript
|
||||
|
||||
AM_CFLAGS = $(VISIBILITY_CFLAGS)
|
||||
AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/include/ \
|
||||
-I$(top_srcdir)/src/mapi/ \
|
||||
|
@@ -12,8 +12,7 @@ if env['hostonly']:
|
||||
# compilation
|
||||
Return()
|
||||
|
||||
if env['platform'] != 'windows':
|
||||
SConscript('loader/SConscript')
|
||||
SConscript('loader/SConscript')
|
||||
|
||||
# When env['gles'] is set, the targets defined in mapi/glapi/SConscript are not
|
||||
# used. libgl-xlib and libgl-gdi adapt themselves to use the targets defined
|
||||
@@ -28,10 +27,12 @@ if env['platform'] in ['haiku']:
|
||||
|
||||
SConscript('mesa/SConscript')
|
||||
|
||||
SConscript('mapi/vgapi/SConscript')
|
||||
|
||||
if not env['embedded']:
|
||||
if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'haiku', 'windows'):
|
||||
SConscript('glx/SConscript')
|
||||
if env['platform'] not in ['darwin', 'haiku', 'sunos', 'windows']:
|
||||
if env['platform'] not in ['darwin', 'haiku', 'sunos']:
|
||||
if env['dri']:
|
||||
SConscript('egl/drivers/dri2/SConscript')
|
||||
SConscript('egl/main/SConscript')
|
||||
|
@@ -27,7 +27,6 @@
|
||||
|
||||
#define WL_HIDE_DEPRECATED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
@@ -525,14 +524,8 @@ dri2_setup_screen(_EGLDisplay *disp)
|
||||
|
||||
capabilities = dri2_dpy->image->getCapabilities(dri2_dpy->dri_screen);
|
||||
disp->Extensions.MESA_drm_image = (capabilities & __DRI_IMAGE_CAP_GLOBAL_NAMES) != 0;
|
||||
|
||||
if (dri2_dpy->image->base.version >= 11)
|
||||
disp->Extensions.MESA_image_dma_buf_export = EGL_TRUE;
|
||||
} else {
|
||||
} else
|
||||
disp->Extensions.MESA_drm_image = EGL_TRUE;
|
||||
if (dri2_dpy->image->base.version >= 11)
|
||||
disp->Extensions.MESA_image_dma_buf_export = EGL_TRUE;
|
||||
}
|
||||
|
||||
disp->Extensions.KHR_image_base = EGL_TRUE;
|
||||
disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
|
||||
@@ -1971,55 +1964,6 @@ dri2_export_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img,
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
dri2_export_dma_buf_image_query_mesa(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLImage *img,
|
||||
EGLint *fourcc, EGLint *nplanes,
|
||||
EGLuint64MESA *modifiers)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct dri2_egl_image *dri2_img = dri2_egl_image(img);
|
||||
|
||||
(void) drv;
|
||||
|
||||
|
||||
if (nplanes)
|
||||
dri2_dpy->image->queryImage(dri2_img->dri_image,
|
||||
__DRI_IMAGE_ATTRIB_NUM_PLANES, nplanes);
|
||||
if (fourcc)
|
||||
dri2_dpy->image->queryImage(dri2_img->dri_image,
|
||||
__DRI_IMAGE_ATTRIB_FOURCC, fourcc);
|
||||
|
||||
if (modifiers)
|
||||
*modifiers = 0;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
dri2_export_dma_buf_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img,
|
||||
int *fds, EGLint *strides, EGLint *offsets)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct dri2_egl_image *dri2_img = dri2_egl_image(img);
|
||||
|
||||
(void) drv;
|
||||
|
||||
/* rework later to provide multiple fds/strides/offsets */
|
||||
if (fds)
|
||||
dri2_dpy->image->queryImage(dri2_img->dri_image,
|
||||
__DRI_IMAGE_ATTRIB_FD, fds);
|
||||
|
||||
if (strides)
|
||||
dri2_dpy->image->queryImage(dri2_img->dri_image,
|
||||
__DRI_IMAGE_ATTRIB_STRIDE, strides);
|
||||
|
||||
if (offsets)
|
||||
offsets[0] = 0;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
@@ -2274,8 +2218,6 @@ _eglBuiltInDriverDRI2(const char *args)
|
||||
#ifdef HAVE_LIBDRM
|
||||
dri2_drv->base.API.CreateDRMImageMESA = dri2_create_drm_image_mesa;
|
||||
dri2_drv->base.API.ExportDRMImageMESA = dri2_export_drm_image_mesa;
|
||||
dri2_drv->base.API.ExportDMABUFImageQueryMESA = dri2_export_dma_buf_image_query_mesa;
|
||||
dri2_drv->base.API.ExportDMABUFImageMESA = dri2_export_dma_buf_image_mesa;
|
||||
#endif
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
dri2_drv->base.API.BindWaylandDisplayWL = dri2_bind_wayland_display_wl;
|
||||
|
@@ -28,8 +28,6 @@
|
||||
#ifndef EGL_DRI2_INCLUDED
|
||||
#define EGL_DRI2_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef HAVE_X11_PLATFORM
|
||||
#include <xcb/xcb.h>
|
||||
#include <xcb/dri2.h>
|
||||
|
@@ -25,7 +25,6 @@
|
||||
* Kristian Høgsberg <krh@bitplanet.net>
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
@@ -26,7 +26,6 @@
|
||||
* Benjamin Franzke <benjaminfranzke@googlemail.com>
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
@@ -26,7 +26,6 @@
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
@@ -24,7 +24,6 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern "C" {
|
||||
|
@@ -73,6 +73,8 @@ endif # MESA_BUILD_CLASSIC
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
|
||||
|
||||
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GALLIUM
|
||||
|
||||
gallium_DRIVERS :=
|
||||
|
||||
# swrast
|
||||
|
@@ -64,6 +64,10 @@ AM_CFLAGS += -DHAVE_DRM_PLATFORM
|
||||
libEGL_la_LIBADD += ../../gbm/libgbm.la
|
||||
endif
|
||||
|
||||
if HAVE_EGL_PLATFORM_FBDEV
|
||||
AM_CFLAGS += -DHAVE_FBDEV_PLATFORM
|
||||
endif
|
||||
|
||||
if HAVE_EGL_PLATFORM_NULL
|
||||
AM_CFLAGS += -DHAVE_NULL_PLATFORM
|
||||
endif
|
||||
|
@@ -22,8 +22,11 @@ LIBEGL_C_FILES := \
|
||||
eglimage.h \
|
||||
egllog.c \
|
||||
egllog.h \
|
||||
eglmisc.c \
|
||||
eglmisc.h \
|
||||
eglmode.c \
|
||||
eglmode.h \
|
||||
eglmutex.h \
|
||||
eglscreen.c \
|
||||
eglscreen.h \
|
||||
eglstring.c \
|
||||
|
@@ -7,10 +7,18 @@ Import('*')
|
||||
env = env.Clone()
|
||||
|
||||
env.Append(CPPDEFINES = [
|
||||
'_EGL_BUILT_IN_DRIVER_GALLIUM',
|
||||
'_EGL_DRIVER_SEARCH_DIR=\\"\\"',
|
||||
])
|
||||
|
||||
if env['platform'] == 'haiku':
|
||||
if env['platform'] == 'windows':
|
||||
env.Append(CPPDEFINES = [
|
||||
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WINDOWS',
|
||||
'_EGL_OS_WINDOWS',
|
||||
'_EGL_GET_CORE_ADDRESSES',
|
||||
'KHRONOS_DLL_EXPORTS',
|
||||
])
|
||||
elif env['platform'] == 'haiku':
|
||||
env.Append(CPPDEFINES = [
|
||||
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_HAIKU',
|
||||
'_EGL_OS_UNIX',
|
||||
@@ -30,9 +38,6 @@ else:
|
||||
egl_dri2,
|
||||
libloader,
|
||||
])
|
||||
# Disallow undefined symbols
|
||||
if env['platform'] != 'darwin':
|
||||
env.Append(SHLINKFLAGS = ['-Wl,-z,defs'])
|
||||
|
||||
env.Append(CPPPATH = [
|
||||
'#/include',
|
||||
@@ -42,11 +47,9 @@ env.Append(CPPPATH = [
|
||||
# parse Makefile.sources
|
||||
egl_sources = env.ParseSourceList('Makefile.sources', 'LIBEGL_C_FILES')
|
||||
|
||||
egl = env.SharedLibrary(
|
||||
target = 'EGL',
|
||||
egl = env.ConvenienceLibrary(
|
||||
target = 'egl',
|
||||
source = egl_sources,
|
||||
)
|
||||
|
||||
egl = env.InstallSharedLibrary(egl, version=(1, 0, 0))
|
||||
|
||||
env.Alias('egl', egl)
|
||||
Export('egl')
|
||||
|
@@ -86,9 +86,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "c99_compat.h"
|
||||
#include "c11/threads.h"
|
||||
#include "eglcompiler.h"
|
||||
|
||||
#include "eglglobals.h"
|
||||
#include "eglcontext.h"
|
||||
@@ -102,7 +99,6 @@
|
||||
#include "eglmode.h"
|
||||
#include "eglimage.h"
|
||||
#include "eglsync.h"
|
||||
#include "eglstring.h"
|
||||
|
||||
|
||||
/**
|
||||
@@ -116,7 +112,7 @@
|
||||
_eglUnlockDisplay(disp); \
|
||||
/* EGL error codes are non-zero */ \
|
||||
if (err) \
|
||||
_eglError(err, __func__); \
|
||||
_eglError(err, __FUNCTION__); \
|
||||
return ret; \
|
||||
} while (0)
|
||||
|
||||
@@ -134,14 +130,14 @@
|
||||
|
||||
#define _EGL_CHECK_DISPLAY(disp, ret, drv) \
|
||||
do { \
|
||||
drv = _eglCheckDisplay(disp, __func__); \
|
||||
drv = _eglCheckDisplay(disp, __FUNCTION__); \
|
||||
if (!drv) \
|
||||
RETURN_EGL_ERROR(disp, 0, ret); \
|
||||
} while (0)
|
||||
|
||||
#define _EGL_CHECK_OBJECT(disp, type, obj, ret, drv) \
|
||||
do { \
|
||||
drv = _eglCheck ## type(disp, obj, __func__); \
|
||||
drv = _eglCheck ## type(disp, obj, __FUNCTION__); \
|
||||
if (!drv) \
|
||||
RETURN_EGL_ERROR(disp, 0, ret); \
|
||||
} while (0)
|
||||
@@ -165,7 +161,7 @@
|
||||
_EGL_CHECK_OBJECT(disp, Sync, s, ret, drv)
|
||||
|
||||
|
||||
static inline _EGLDriver *
|
||||
static INLINE _EGLDriver *
|
||||
_eglCheckDisplay(_EGLDisplay *disp, const char *msg)
|
||||
{
|
||||
if (!disp) {
|
||||
@@ -180,7 +176,7 @@ _eglCheckDisplay(_EGLDisplay *disp, const char *msg)
|
||||
}
|
||||
|
||||
|
||||
static inline _EGLDriver *
|
||||
static INLINE _EGLDriver *
|
||||
_eglCheckSurface(_EGLDisplay *disp, _EGLSurface *surf, const char *msg)
|
||||
{
|
||||
_EGLDriver *drv = _eglCheckDisplay(disp, msg);
|
||||
@@ -194,7 +190,7 @@ _eglCheckSurface(_EGLDisplay *disp, _EGLSurface *surf, const char *msg)
|
||||
}
|
||||
|
||||
|
||||
static inline _EGLDriver *
|
||||
static INLINE _EGLDriver *
|
||||
_eglCheckContext(_EGLDisplay *disp, _EGLContext *context, const char *msg)
|
||||
{
|
||||
_EGLDriver *drv = _eglCheckDisplay(disp, msg);
|
||||
@@ -208,7 +204,7 @@ _eglCheckContext(_EGLDisplay *disp, _EGLContext *context, const char *msg)
|
||||
}
|
||||
|
||||
|
||||
static inline _EGLDriver *
|
||||
static INLINE _EGLDriver *
|
||||
_eglCheckConfig(_EGLDisplay *disp, _EGLConfig *conf, const char *msg)
|
||||
{
|
||||
_EGLDriver *drv = _eglCheckDisplay(disp, msg);
|
||||
@@ -222,7 +218,7 @@ _eglCheckConfig(_EGLDisplay *disp, _EGLConfig *conf, const char *msg)
|
||||
}
|
||||
|
||||
|
||||
static inline _EGLDriver *
|
||||
static INLINE _EGLDriver *
|
||||
_eglCheckSync(_EGLDisplay *disp, _EGLSync *s, const char *msg)
|
||||
{
|
||||
_EGLDriver *drv = _eglCheckDisplay(disp, msg);
|
||||
@@ -239,7 +235,7 @@ _eglCheckSync(_EGLDisplay *disp, _EGLSync *s, const char *msg)
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
|
||||
|
||||
static inline _EGLDriver *
|
||||
static INLINE _EGLDriver *
|
||||
_eglCheckScreen(_EGLDisplay *disp, _EGLScreen *scrn, const char *msg)
|
||||
{
|
||||
_EGLDriver *drv = _eglCheckDisplay(disp, msg);
|
||||
@@ -253,7 +249,7 @@ _eglCheckScreen(_EGLDisplay *disp, _EGLScreen *scrn, const char *msg)
|
||||
}
|
||||
|
||||
|
||||
static inline _EGLDriver *
|
||||
static INLINE _EGLDriver *
|
||||
_eglCheckMode(_EGLDisplay *disp, _EGLMode *m, const char *msg)
|
||||
{
|
||||
_EGLDriver *drv = _eglCheckDisplay(disp, msg);
|
||||
@@ -273,12 +269,12 @@ _eglCheckMode(_EGLDisplay *disp, _EGLMode *m, const char *msg)
|
||||
/**
|
||||
* Lookup and lock a display.
|
||||
*/
|
||||
static inline _EGLDisplay *
|
||||
static INLINE _EGLDisplay *
|
||||
_eglLockDisplay(EGLDisplay display)
|
||||
{
|
||||
_EGLDisplay *dpy = _eglLookupDisplay(display);
|
||||
if (dpy)
|
||||
mtx_lock(&dpy->Mutex);
|
||||
_eglLockMutex(&dpy->Mutex);
|
||||
return dpy;
|
||||
}
|
||||
|
||||
@@ -286,10 +282,10 @@ _eglLockDisplay(EGLDisplay display)
|
||||
/**
|
||||
* Unlock a display.
|
||||
*/
|
||||
static inline void
|
||||
static INLINE void
|
||||
_eglUnlockDisplay(_EGLDisplay *dpy)
|
||||
{
|
||||
mtx_unlock(&dpy->Mutex);
|
||||
_eglUnlockMutex(&dpy->Mutex);
|
||||
}
|
||||
|
||||
|
||||
@@ -343,113 +339,6 @@ eglGetPlatformDisplayEXT(EGLenum platform, void *native_display,
|
||||
return _eglGetDisplayHandle(dpy);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy the extension into the string and update the string pointer.
|
||||
*/
|
||||
static EGLint
|
||||
_eglAppendExtension(char **str, const char *ext)
|
||||
{
|
||||
char *s = *str;
|
||||
size_t len = strlen(ext);
|
||||
|
||||
if (s) {
|
||||
memcpy(s, ext, len);
|
||||
s[len++] = ' ';
|
||||
s[len] = '\0';
|
||||
|
||||
*str += len;
|
||||
}
|
||||
else {
|
||||
len++;
|
||||
}
|
||||
|
||||
return (EGLint) len;
|
||||
}
|
||||
|
||||
/**
|
||||
* Examine the individual extension enable/disable flags and recompute
|
||||
* the driver's Extensions string.
|
||||
*/
|
||||
static void
|
||||
_eglCreateExtensionsString(_EGLDisplay *dpy)
|
||||
{
|
||||
#define _EGL_CHECK_EXTENSION(ext) \
|
||||
do { \
|
||||
if (dpy->Extensions.ext) { \
|
||||
_eglAppendExtension(&exts, "EGL_" #ext); \
|
||||
assert(exts <= dpy->ExtensionsString + _EGL_MAX_EXTENSIONS_LEN); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
char *exts = dpy->ExtensionsString;
|
||||
|
||||
_EGL_CHECK_EXTENSION(MESA_screen_surface);
|
||||
_EGL_CHECK_EXTENSION(MESA_copy_context);
|
||||
_EGL_CHECK_EXTENSION(MESA_drm_display);
|
||||
_EGL_CHECK_EXTENSION(MESA_drm_image);
|
||||
_EGL_CHECK_EXTENSION(MESA_configless_context);
|
||||
|
||||
_EGL_CHECK_EXTENSION(WL_bind_wayland_display);
|
||||
_EGL_CHECK_EXTENSION(WL_create_wayland_buffer_from_image);
|
||||
|
||||
_EGL_CHECK_EXTENSION(KHR_image_base);
|
||||
_EGL_CHECK_EXTENSION(KHR_image_pixmap);
|
||||
if (dpy->Extensions.KHR_image_base && dpy->Extensions.KHR_image_pixmap)
|
||||
_eglAppendExtension(&exts, "EGL_KHR_image");
|
||||
|
||||
_EGL_CHECK_EXTENSION(KHR_vg_parent_image);
|
||||
_EGL_CHECK_EXTENSION(KHR_get_all_proc_addresses);
|
||||
_EGL_CHECK_EXTENSION(KHR_gl_texture_2D_image);
|
||||
_EGL_CHECK_EXTENSION(KHR_gl_texture_cubemap_image);
|
||||
_EGL_CHECK_EXTENSION(KHR_gl_texture_3D_image);
|
||||
_EGL_CHECK_EXTENSION(KHR_gl_renderbuffer_image);
|
||||
|
||||
_EGL_CHECK_EXTENSION(KHR_reusable_sync);
|
||||
_EGL_CHECK_EXTENSION(KHR_fence_sync);
|
||||
|
||||
_EGL_CHECK_EXTENSION(KHR_surfaceless_context);
|
||||
_EGL_CHECK_EXTENSION(KHR_create_context);
|
||||
|
||||
_EGL_CHECK_EXTENSION(NOK_swap_region);
|
||||
_EGL_CHECK_EXTENSION(NOK_texture_from_pixmap);
|
||||
|
||||
_EGL_CHECK_EXTENSION(ANDROID_image_native_buffer);
|
||||
|
||||
_EGL_CHECK_EXTENSION(CHROMIUM_sync_control);
|
||||
|
||||
_EGL_CHECK_EXTENSION(EXT_create_context_robustness);
|
||||
_EGL_CHECK_EXTENSION(EXT_buffer_age);
|
||||
_EGL_CHECK_EXTENSION(EXT_swap_buffers_with_damage);
|
||||
_EGL_CHECK_EXTENSION(EXT_image_dma_buf_import);
|
||||
|
||||
_EGL_CHECK_EXTENSION(NV_post_sub_buffer);
|
||||
|
||||
_EGL_CHECK_EXTENSION(MESA_image_dma_buf_export);
|
||||
#undef _EGL_CHECK_EXTENSION
|
||||
}
|
||||
|
||||
static void
|
||||
_eglCreateAPIsString(_EGLDisplay *dpy)
|
||||
{
|
||||
if (dpy->ClientAPIs & EGL_OPENGL_BIT)
|
||||
strcat(dpy->ClientAPIsString, "OpenGL ");
|
||||
|
||||
if (dpy->ClientAPIs & EGL_OPENGL_ES_BIT)
|
||||
strcat(dpy->ClientAPIsString, "OpenGL_ES ");
|
||||
|
||||
if (dpy->ClientAPIs & EGL_OPENGL_ES2_BIT)
|
||||
strcat(dpy->ClientAPIsString, "OpenGL_ES2 ");
|
||||
|
||||
if (dpy->ClientAPIs & EGL_OPENGL_ES3_BIT_KHR)
|
||||
strcat(dpy->ClientAPIsString, "OpenGL_ES3 ");
|
||||
|
||||
if (dpy->ClientAPIs & EGL_OPENVG_BIT)
|
||||
strcat(dpy->ClientAPIsString, "OpenVG ");
|
||||
|
||||
assert(strlen(dpy->ClientAPIsString) < sizeof(dpy->ClientAPIsString));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This is typically the second EGL function that an application calls.
|
||||
* Here we load/initialize the actual hardware driver.
|
||||
@@ -485,12 +374,6 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
|
||||
* EGL_KHR_get_all_proc_addresses also.
|
||||
*/
|
||||
disp->Extensions.KHR_get_all_proc_addresses = EGL_TRUE;
|
||||
|
||||
_eglCreateExtensionsString(disp);
|
||||
_eglCreateAPIsString(disp);
|
||||
_eglsnprintf(disp->VersionString, sizeof(disp->VersionString),
|
||||
"%d.%d (%s)", disp->VersionMajor, disp->VersionMinor,
|
||||
disp->Driver->Name);
|
||||
}
|
||||
|
||||
/* Update applications version of major and minor if not NULL */
|
||||
@@ -516,7 +399,6 @@ eglTerminate(EGLDisplay dpy)
|
||||
|
||||
drv->API.Terminate(drv, disp);
|
||||
/* do not reset disp->Driver */
|
||||
disp->ClientAPIsString[0] = 0;
|
||||
disp->Initialized = EGL_FALSE;
|
||||
}
|
||||
|
||||
@@ -529,6 +411,7 @@ eglQueryString(EGLDisplay dpy, EGLint name)
|
||||
{
|
||||
_EGLDisplay *disp;
|
||||
_EGLDriver *drv;
|
||||
const char *ret;
|
||||
|
||||
if (dpy == EGL_NO_DISPLAY && name == EGL_EXTENSIONS) {
|
||||
RETURN_EGL_SUCCESS(NULL, _eglGlobal.ClientExtensionString);
|
||||
@@ -536,19 +419,9 @@ eglQueryString(EGLDisplay dpy, EGLint name)
|
||||
|
||||
disp = _eglLockDisplay(dpy);
|
||||
_EGL_CHECK_DISPLAY(disp, NULL, drv);
|
||||
ret = drv->API.QueryString(drv, disp, name);
|
||||
|
||||
switch (name) {
|
||||
case EGL_VENDOR:
|
||||
RETURN_EGL_SUCCESS(disp, _EGL_VENDOR_STRING);
|
||||
case EGL_VERSION:
|
||||
RETURN_EGL_SUCCESS(disp, disp->VersionString);
|
||||
case EGL_EXTENSIONS:
|
||||
RETURN_EGL_SUCCESS(disp, disp->ExtensionsString);
|
||||
case EGL_CLIENT_APIS:
|
||||
RETURN_EGL_SUCCESS(disp, disp->ClientAPIsString);
|
||||
default:
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, NULL);
|
||||
}
|
||||
RETURN_EGL_EVAL(disp, ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -1022,7 +895,7 @@ eglWaitClient(void)
|
||||
RETURN_EGL_SUCCESS(NULL, EGL_TRUE);
|
||||
|
||||
disp = ctx->Resource.Display;
|
||||
mtx_lock(&disp->Mutex);
|
||||
_eglLockMutex(&disp->Mutex);
|
||||
|
||||
/* let bad current context imply bad current surface */
|
||||
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
|
||||
@@ -1068,7 +941,7 @@ eglWaitNative(EGLint engine)
|
||||
RETURN_EGL_SUCCESS(NULL, EGL_TRUE);
|
||||
|
||||
disp = ctx->Resource.Display;
|
||||
mtx_lock(&disp->Mutex);
|
||||
_eglLockMutex(&disp->Mutex);
|
||||
|
||||
/* let bad current context imply bad current surface */
|
||||
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
|
||||
@@ -1241,10 +1114,6 @@ eglGetProcAddress(const char *procname)
|
||||
{ "eglCreatePlatformWindowSurfaceEXT", (_EGLProc) eglCreatePlatformWindowSurfaceEXT },
|
||||
{ "eglCreatePlatformPixmapSurfaceEXT", (_EGLProc) eglCreatePlatformPixmapSurfaceEXT },
|
||||
{ "eglGetSyncValuesCHROMIUM", (_EGLProc) eglGetSyncValuesCHROMIUM },
|
||||
#ifdef EGL_MESA_drm_buf_image_export
|
||||
{ "eglExportDMABUFImageQueryMESA", (_EGLProc) eglExportDMABUFImageQueryMESA },
|
||||
{ "eglExportDMABUFImageMESA", (_EGLProc) eglExportDMABUFImageMESA },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
EGLint i;
|
||||
@@ -1587,10 +1456,10 @@ eglReleaseThread(void)
|
||||
|
||||
t->CurrentAPIIndex = i;
|
||||
|
||||
mtx_lock(&disp->Mutex);
|
||||
_eglLockMutex(&disp->Mutex);
|
||||
drv = disp->Driver;
|
||||
(void) drv->API.MakeCurrent(drv, disp, NULL, NULL, NULL);
|
||||
mtx_unlock(&disp->Mutex);
|
||||
_eglUnlockMutex(&disp->Mutex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1932,47 +1801,3 @@ eglGetSyncValuesCHROMIUM(EGLDisplay display, EGLSurface surface,
|
||||
|
||||
RETURN_EGL_EVAL(disp, ret);
|
||||
}
|
||||
|
||||
#ifdef EGL_MESA_image_dma_buf_export
|
||||
EGLBoolean EGLAPIENTRY
|
||||
eglExportDMABUFImageQueryMESA(EGLDisplay dpy, EGLImageKHR image,
|
||||
EGLint *fourcc, EGLint *nplanes,
|
||||
EGLuint64MESA *modifiers)
|
||||
{
|
||||
_EGLDisplay *disp = _eglLockDisplay(dpy);
|
||||
_EGLImage *img = _eglLookupImage(image, disp);
|
||||
_EGLDriver *drv;
|
||||
EGLBoolean ret;
|
||||
|
||||
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
|
||||
assert(disp->Extensions.MESA_image_dma_buf_export);
|
||||
|
||||
if (!img)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
|
||||
|
||||
ret = drv->API.ExportDMABUFImageQueryMESA(drv, disp, img, fourcc, nplanes,
|
||||
modifiers);
|
||||
|
||||
RETURN_EGL_EVAL(disp, ret);
|
||||
}
|
||||
|
||||
EGLBoolean EGLAPIENTRY
|
||||
eglExportDMABUFImageMESA(EGLDisplay dpy, EGLImageKHR image,
|
||||
int *fds, EGLint *strides, EGLint *offsets)
|
||||
{
|
||||
_EGLDisplay *disp = _eglLockDisplay(dpy);
|
||||
_EGLImage *img = _eglLookupImage(image, disp);
|
||||
_EGLDriver *drv;
|
||||
EGLBoolean ret;
|
||||
|
||||
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
|
||||
assert(disp->Extensions.MESA_image_dma_buf_export);
|
||||
|
||||
if (!img)
|
||||
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
|
||||
|
||||
ret = drv->API.ExportDMABUFImageMESA(drv, disp, img, fds, strides, offsets);
|
||||
|
||||
RETURN_EGL_EVAL(disp, ret);
|
||||
}
|
||||
#endif
|
||||
|
@@ -71,6 +71,7 @@ typedef EGLBoolean (*SwapBuffers_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurfa
|
||||
typedef EGLBoolean (*CopyBuffers_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface, void *native_pixmap_target);
|
||||
|
||||
/* misc funcs */
|
||||
typedef const char *(*QueryString_t)(_EGLDriver *drv, _EGLDisplay *dpy, EGLint name);
|
||||
typedef EGLBoolean (*WaitClient_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx);
|
||||
typedef EGLBoolean (*WaitNative_t)(_EGLDriver *drv, _EGLDisplay *dpy, EGLint engine);
|
||||
|
||||
@@ -140,11 +141,6 @@ typedef EGLBoolean (*SwapBuffersWithDamageEXT_t) (_EGLDriver *drv, _EGLDisplay *
|
||||
|
||||
typedef EGLBoolean (*GetSyncValuesCHROMIUM_t) (_EGLDisplay *dpy, _EGLSurface *surface, EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc);
|
||||
|
||||
#ifdef EGL_MESA_image_dma_buf_export
|
||||
typedef EGLBoolean (*ExportDMABUFImageQueryMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img, EGLint *fourcc, EGLint *stride, EGLuint64MESA *modifiers);
|
||||
typedef EGLBoolean (*ExportDMABUFImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img, EGLint *fds, EGLint *strides, EGLint *offsets);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The API dispatcher jumps through these functions
|
||||
*/
|
||||
@@ -174,6 +170,7 @@ struct _egl_api
|
||||
SwapBuffers_t SwapBuffers;
|
||||
CopyBuffers_t CopyBuffers;
|
||||
|
||||
QueryString_t QueryString;
|
||||
WaitClient_t WaitClient;
|
||||
WaitNative_t WaitNative;
|
||||
GetProcAddress_t GetProcAddress;
|
||||
@@ -231,11 +228,6 @@ struct _egl_api
|
||||
|
||||
QueryBufferAge_t QueryBufferAge;
|
||||
GetSyncValuesCHROMIUM_t GetSyncValuesCHROMIUM;
|
||||
|
||||
#ifdef EGL_MESA_image_dma_buf_export
|
||||
ExportDMABUFImageQueryMESA_t ExportDMABUFImageQueryMESA;
|
||||
ExportDMABUFImageMESA_t ExportDMABUFImageMESA;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* EGLAPI_INCLUDED */
|
||||
|
@@ -29,7 +29,6 @@
|
||||
#ifndef EGLARRAY_INCLUDED
|
||||
#define EGLARRAY_INCLUDED
|
||||
|
||||
#include "c99_compat.h"
|
||||
|
||||
#include "egltypedefs.h"
|
||||
|
||||
@@ -76,7 +75,7 @@ _eglFlattenArray(_EGLArray *array, void *buffer, EGLint elem_size, EGLint size,
|
||||
_EGLArrayForEach flatten);
|
||||
|
||||
|
||||
static inline EGLint
|
||||
static INLINE EGLint
|
||||
_eglGetArraySize(_EGLArray *array)
|
||||
{
|
||||
return (array) ? array->Size : 0;
|
||||
|
@@ -30,6 +30,66 @@
|
||||
#ifndef EGLCOMPILER_INCLUDED
|
||||
#define EGLCOMPILER_INCLUDED
|
||||
|
||||
|
||||
#include "c99_compat.h" /* inline, __func__, etc. */
|
||||
|
||||
|
||||
/**
|
||||
* Get standard integer types
|
||||
*/
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
|
||||
(defined(_MSC_VER) && _MSC_VER >= 1600)
|
||||
# include <stdint.h>
|
||||
#elif defined(_MSC_VER)
|
||||
typedef __int8 int8_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef __int16 int16_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
|
||||
# if defined(_WIN64)
|
||||
typedef __int64 intptr_t;
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
# else
|
||||
typedef __int32 intptr_t;
|
||||
typedef unsigned __int32 uintptr_t;
|
||||
# endif
|
||||
|
||||
# define INT64_C(__val) __val##i64
|
||||
# define UINT64_C(__val) __val##ui64
|
||||
#else
|
||||
/* hope the best instead of adding a bunch of ifdef's */
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* XXX: Use standard `inline` keyword instead */
|
||||
#ifndef INLINE
|
||||
# define INLINE inline
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Function visibility
|
||||
*/
|
||||
#ifndef PUBLIC
|
||||
# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
|
||||
# define PUBLIC __attribute__((visibility("default")))
|
||||
# elif defined(_MSC_VER)
|
||||
# define PUBLIC __declspec(dllexport)
|
||||
# else
|
||||
# define PUBLIC
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* XXX: Use standard `__func__` instead */
|
||||
#ifndef __FUNCTION__
|
||||
# define __FUNCTION__ __func__
|
||||
#endif
|
||||
|
||||
#define STATIC_ASSERT(COND) \
|
||||
do { \
|
||||
(void) sizeof(char [1 - 2*!(COND)]); \
|
||||
|
@@ -36,8 +36,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include "c99_compat.h"
|
||||
|
||||
#include "eglconfig.h"
|
||||
#include "egldisplay.h"
|
||||
#include "eglcurrent.h"
|
||||
@@ -483,7 +481,7 @@ _eglMatchConfig(const _EGLConfig *conf, const _EGLConfig *criteria)
|
||||
return matched;
|
||||
}
|
||||
|
||||
static inline EGLBoolean
|
||||
static INLINE EGLBoolean
|
||||
_eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
|
||||
{
|
||||
if (_eglOffsetOfConfig(attr) < 0)
|
||||
@@ -653,7 +651,7 @@ _eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
|
||||
}
|
||||
|
||||
|
||||
static inline
|
||||
static INLINE
|
||||
void _eglSwapConfigs(const _EGLConfig **conf1, const _EGLConfig **conf2)
|
||||
{
|
||||
const _EGLConfig *tmp = *conf1;
|
||||
|
@@ -34,8 +34,6 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
#include "c99_compat.h"
|
||||
|
||||
#include "egltypedefs.h"
|
||||
|
||||
|
||||
@@ -88,7 +86,7 @@ struct _egl_config
|
||||
/**
|
||||
* Map an EGL attribute enum to the offset of the member in _EGLConfig.
|
||||
*/
|
||||
static inline EGLint
|
||||
static INLINE EGLint
|
||||
_eglOffsetOfConfig(EGLint attr)
|
||||
{
|
||||
switch (attr) {
|
||||
@@ -143,7 +141,7 @@ _eglOffsetOfConfig(EGLint attr)
|
||||
* in the attribute enums. The separation is to catch application errors.
|
||||
* Drivers should never set a key that is an invalid attribute.
|
||||
*/
|
||||
static inline void
|
||||
static INLINE void
|
||||
_eglSetConfigKey(_EGLConfig *conf, EGLint key, EGLint val)
|
||||
{
|
||||
EGLint offset = _eglOffsetOfConfig(key);
|
||||
@@ -155,7 +153,7 @@ _eglSetConfigKey(_EGLConfig *conf, EGLint key, EGLint val)
|
||||
/**
|
||||
* Return the value for a given key.
|
||||
*/
|
||||
static inline EGLint
|
||||
static INLINE EGLint
|
||||
_eglGetConfigKey(const _EGLConfig *conf, EGLint key)
|
||||
{
|
||||
EGLint offset = _eglOffsetOfConfig(key);
|
||||
@@ -179,7 +177,7 @@ _eglLookupConfig(EGLConfig config, _EGLDisplay *dpy);
|
||||
/**
|
||||
* Return the handle of a linked config.
|
||||
*/
|
||||
static inline EGLConfig
|
||||
static INLINE EGLConfig
|
||||
_eglGetConfigHandle(_EGLConfig *conf)
|
||||
{
|
||||
return (EGLConfig) conf;
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#ifndef EGLCONTEXT_INCLUDED
|
||||
#define EGLCONTEXT_INCLUDED
|
||||
|
||||
#include "c99_compat.h"
|
||||
|
||||
#include "egltypedefs.h"
|
||||
#include "egldisplay.h"
|
||||
@@ -82,7 +81,7 @@ _eglBindContext(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read,
|
||||
/**
|
||||
* Increment reference count for the context.
|
||||
*/
|
||||
static inline _EGLContext *
|
||||
static INLINE _EGLContext *
|
||||
_eglGetContext(_EGLContext *ctx)
|
||||
{
|
||||
if (ctx)
|
||||
@@ -94,7 +93,7 @@ _eglGetContext(_EGLContext *ctx)
|
||||
/**
|
||||
* Decrement reference count for the context.
|
||||
*/
|
||||
static inline EGLBoolean
|
||||
static INLINE EGLBoolean
|
||||
_eglPutContext(_EGLContext *ctx)
|
||||
{
|
||||
return (ctx) ? _eglPutResource(&ctx->Resource) : EGL_FALSE;
|
||||
@@ -105,7 +104,7 @@ _eglPutContext(_EGLContext *ctx)
|
||||
* Link a context to its display and return the handle of the link.
|
||||
* The handle can be passed to client directly.
|
||||
*/
|
||||
static inline EGLContext
|
||||
static INLINE EGLContext
|
||||
_eglLinkContext(_EGLContext *ctx)
|
||||
{
|
||||
_eglLinkResource(&ctx->Resource, _EGL_RESOURCE_CONTEXT);
|
||||
@@ -117,7 +116,7 @@ _eglLinkContext(_EGLContext *ctx)
|
||||
* Unlink a linked context from its display.
|
||||
* Accessing an unlinked context should generate EGL_BAD_CONTEXT error.
|
||||
*/
|
||||
static inline void
|
||||
static INLINE void
|
||||
_eglUnlinkContext(_EGLContext *ctx)
|
||||
{
|
||||
_eglUnlinkResource(&ctx->Resource, _EGL_RESOURCE_CONTEXT);
|
||||
@@ -128,7 +127,7 @@ _eglUnlinkContext(_EGLContext *ctx)
|
||||
* Lookup a handle to find the linked context.
|
||||
* Return NULL if the handle has no corresponding linked context.
|
||||
*/
|
||||
static inline _EGLContext *
|
||||
static INLINE _EGLContext *
|
||||
_eglLookupContext(EGLContext context, _EGLDisplay *dpy)
|
||||
{
|
||||
_EGLContext *ctx = (_EGLContext *) context;
|
||||
@@ -141,7 +140,7 @@ _eglLookupContext(EGLContext context, _EGLDisplay *dpy)
|
||||
/**
|
||||
* Return the handle of a linked context, or EGL_NO_CONTEXT.
|
||||
*/
|
||||
static inline EGLContext
|
||||
static INLINE EGLContext
|
||||
_eglGetContextHandle(_EGLContext *ctx)
|
||||
{
|
||||
_EGLResource *res = (_EGLResource *) ctx;
|
||||
|
@@ -28,10 +28,8 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "c99_compat.h"
|
||||
#include "c11/threads.h"
|
||||
|
||||
#include "egllog.h"
|
||||
#include "eglmutex.h"
|
||||
#include "eglcurrent.h"
|
||||
#include "eglglobals.h"
|
||||
|
||||
@@ -42,9 +40,14 @@
|
||||
|
||||
/* a fallback thread info to guarantee that every thread always has one */
|
||||
static _EGLThreadInfo dummy_thread = _EGL_THREAD_INFO_INITIALIZER;
|
||||
static mtx_t _egl_TSDMutex = _MTX_INITIALIZER_NP;
|
||||
|
||||
|
||||
#if HAVE_PTHREAD
|
||||
#include <pthread.h>
|
||||
|
||||
static _EGLMutex _egl_TSDMutex = _EGL_MUTEX_INITIALIZER;
|
||||
static EGLBoolean _egl_TSDInitialized;
|
||||
static tss_t _egl_TSD;
|
||||
static pthread_key_t _egl_TSD;
|
||||
static void (*_egl_FreeTSD)(_EGLThreadInfo *);
|
||||
|
||||
#ifdef GLX_USE_TLS
|
||||
@@ -52,46 +55,46 @@ static __thread const _EGLThreadInfo *_egl_TLS
|
||||
__attribute__ ((tls_model("initial-exec")));
|
||||
#endif
|
||||
|
||||
static inline void _eglSetTSD(const _EGLThreadInfo *t)
|
||||
static INLINE void _eglSetTSD(const _EGLThreadInfo *t)
|
||||
{
|
||||
tss_set(_egl_TSD, (void *) t);
|
||||
pthread_setspecific(_egl_TSD, (const void *) t);
|
||||
#ifdef GLX_USE_TLS
|
||||
_egl_TLS = t;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline _EGLThreadInfo *_eglGetTSD(void)
|
||||
static INLINE _EGLThreadInfo *_eglGetTSD(void)
|
||||
{
|
||||
#ifdef GLX_USE_TLS
|
||||
return (_EGLThreadInfo *) _egl_TLS;
|
||||
#else
|
||||
return (_EGLThreadInfo *) tss_get(_egl_TSD);
|
||||
return (_EGLThreadInfo *) pthread_getspecific(_egl_TSD);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void _eglFiniTSD(void)
|
||||
static INLINE void _eglFiniTSD(void)
|
||||
{
|
||||
mtx_lock(&_egl_TSDMutex);
|
||||
_eglLockMutex(&_egl_TSDMutex);
|
||||
if (_egl_TSDInitialized) {
|
||||
_EGLThreadInfo *t = _eglGetTSD();
|
||||
|
||||
_egl_TSDInitialized = EGL_FALSE;
|
||||
if (t && _egl_FreeTSD)
|
||||
_egl_FreeTSD((void *) t);
|
||||
tss_delete(_egl_TSD);
|
||||
pthread_key_delete(_egl_TSD);
|
||||
}
|
||||
mtx_unlock(&_egl_TSDMutex);
|
||||
_eglUnlockMutex(&_egl_TSDMutex);
|
||||
}
|
||||
|
||||
static inline EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
|
||||
static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
|
||||
{
|
||||
if (!_egl_TSDInitialized) {
|
||||
mtx_lock(&_egl_TSDMutex);
|
||||
_eglLockMutex(&_egl_TSDMutex);
|
||||
|
||||
/* check again after acquiring lock */
|
||||
if (!_egl_TSDInitialized) {
|
||||
if (tss_create(&_egl_TSD, (void (*)(void *)) dtor) != thrd_success) {
|
||||
mtx_unlock(&_egl_TSDMutex);
|
||||
if (pthread_key_create(&_egl_TSD, (void (*)(void *)) dtor) != 0) {
|
||||
_eglUnlockMutex(&_egl_TSDMutex);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
_egl_FreeTSD = dtor;
|
||||
@@ -99,12 +102,44 @@ static inline EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
|
||||
_egl_TSDInitialized = EGL_TRUE;
|
||||
}
|
||||
|
||||
mtx_unlock(&_egl_TSDMutex);
|
||||
_eglUnlockMutex(&_egl_TSDMutex);
|
||||
}
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
#else /* HAVE_PTHREAD */
|
||||
static const _EGLThreadInfo *_egl_TSD;
|
||||
static void (*_egl_FreeTSD)(_EGLThreadInfo *);
|
||||
|
||||
static INLINE void _eglSetTSD(const _EGLThreadInfo *t)
|
||||
{
|
||||
_egl_TSD = t;
|
||||
}
|
||||
|
||||
static INLINE _EGLThreadInfo *_eglGetTSD(void)
|
||||
{
|
||||
return (_EGLThreadInfo *) _egl_TSD;
|
||||
}
|
||||
|
||||
static INLINE void _eglFiniTSD(void)
|
||||
{
|
||||
if (_egl_FreeTSD && _egl_TSD)
|
||||
_egl_FreeTSD((_EGLThreadInfo *) _egl_TSD);
|
||||
}
|
||||
|
||||
static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
|
||||
{
|
||||
if (!_egl_FreeTSD && dtor) {
|
||||
_egl_FreeTSD = dtor;
|
||||
_eglAddAtExitCall(_eglFiniTSD);
|
||||
}
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
#endif /* !HAVE_PTHREAD */
|
||||
|
||||
|
||||
static void
|
||||
_eglInitThreadInfo(_EGLThreadInfo *t)
|
||||
{
|
||||
@@ -144,7 +179,7 @@ _eglDestroyThreadInfo(_EGLThreadInfo *t)
|
||||
/**
|
||||
* Make sure TSD is initialized and return current value.
|
||||
*/
|
||||
static inline _EGLThreadInfo *
|
||||
static INLINE _EGLThreadInfo *
|
||||
_eglCheckedGetTSD(void)
|
||||
{
|
||||
if (_eglInitTSD(&_eglDestroyThreadInfo) != EGL_TRUE) {
|
||||
|
@@ -29,7 +29,6 @@
|
||||
#ifndef EGLCURRENT_INCLUDED
|
||||
#define EGLCURRENT_INCLUDED
|
||||
|
||||
#include "c99_compat.h"
|
||||
|
||||
#include "egltypedefs.h"
|
||||
|
||||
@@ -62,7 +61,7 @@ struct _egl_thread_info
|
||||
/**
|
||||
* Return true if a client API enum is recognized.
|
||||
*/
|
||||
static inline EGLBoolean
|
||||
static INLINE EGLBoolean
|
||||
_eglIsApiValid(EGLenum api)
|
||||
{
|
||||
return (api >= _EGL_API_FIRST_API && api <= _EGL_API_LAST_API);
|
||||
@@ -73,7 +72,7 @@ _eglIsApiValid(EGLenum api)
|
||||
* Convert a client API enum to an index, for use by thread info.
|
||||
* The client API enum is assumed to be valid.
|
||||
*/
|
||||
static inline EGLint
|
||||
static INLINE EGLint
|
||||
_eglConvertApiToIndex(EGLenum api)
|
||||
{
|
||||
return api - _EGL_API_FIRST_API;
|
||||
@@ -84,7 +83,7 @@ _eglConvertApiToIndex(EGLenum api)
|
||||
* Convert an index, used by thread info, to a client API enum.
|
||||
* The index is assumed to be valid.
|
||||
*/
|
||||
static inline EGLenum
|
||||
static INLINE EGLenum
|
||||
_eglConvertApiFromIndex(EGLint idx)
|
||||
{
|
||||
return _EGL_API_FIRST_API + idx;
|
||||
|
@@ -35,14 +35,13 @@
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "c11/threads.h"
|
||||
|
||||
#include "eglcontext.h"
|
||||
#include "eglcurrent.h"
|
||||
#include "eglsurface.h"
|
||||
#include "egldisplay.h"
|
||||
#include "egldriver.h"
|
||||
#include "eglglobals.h"
|
||||
#include "eglmutex.h"
|
||||
#include "egllog.h"
|
||||
|
||||
/* Includes for _eglNativePlatformDetectNativeDisplay */
|
||||
@@ -56,6 +55,11 @@
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
#include <gbm.h>
|
||||
#endif
|
||||
#ifdef HAVE_FBDEV_PLATFORM
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
@@ -69,6 +73,7 @@ static const struct {
|
||||
{ _EGL_PLATFORM_X11, "x11" },
|
||||
{ _EGL_PLATFORM_WAYLAND, "wayland" },
|
||||
{ _EGL_PLATFORM_DRM, "drm" },
|
||||
{ _EGL_PLATFORM_FBDEV, "fbdev" },
|
||||
{ _EGL_PLATFORM_NULL, "null" },
|
||||
{ _EGL_PLATFORM_ANDROID, "android" },
|
||||
{ _EGL_PLATFORM_HAIKU, "haiku" }
|
||||
@@ -138,9 +143,19 @@ _eglPointerIsDereferencable(void *p)
|
||||
static _EGLPlatformType
|
||||
_eglNativePlatformDetectNativeDisplay(void *nativeDisplay)
|
||||
{
|
||||
#ifdef HAVE_FBDEV_PLATFORM
|
||||
struct stat buf;
|
||||
#endif
|
||||
|
||||
if (nativeDisplay == EGL_DEFAULT_DISPLAY)
|
||||
return _EGL_INVALID_PLATFORM;
|
||||
|
||||
#ifdef HAVE_FBDEV_PLATFORM
|
||||
/* fbdev is the only platform that can be a file descriptor. */
|
||||
if (fstat((intptr_t) nativeDisplay, &buf) == 0 && S_ISCHR(buf.st_mode))
|
||||
return _EGL_PLATFORM_FBDEV;
|
||||
#endif
|
||||
|
||||
if (_eglPointerIsDereferencable(nativeDisplay)) {
|
||||
void *first_pointer = *(void **) nativeDisplay;
|
||||
|
||||
@@ -245,7 +260,7 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy)
|
||||
if (plat == _EGL_INVALID_PLATFORM)
|
||||
return NULL;
|
||||
|
||||
mtx_lock(_eglGlobal.Mutex);
|
||||
_eglLockMutex(_eglGlobal.Mutex);
|
||||
|
||||
/* search the display list first */
|
||||
dpy = _eglGlobal.DisplayList;
|
||||
@@ -259,7 +274,7 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy)
|
||||
if (!dpy) {
|
||||
dpy = calloc(1, sizeof(_EGLDisplay));
|
||||
if (dpy) {
|
||||
mtx_init(&dpy->Mutex, mtx_plain);
|
||||
_eglInitMutex(&dpy->Mutex);
|
||||
dpy->Platform = plat;
|
||||
dpy->PlatformDisplay = plat_dpy;
|
||||
|
||||
@@ -269,7 +284,7 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy)
|
||||
}
|
||||
}
|
||||
|
||||
mtx_unlock(_eglGlobal.Mutex);
|
||||
_eglUnlockMutex(_eglGlobal.Mutex);
|
||||
|
||||
return dpy;
|
||||
}
|
||||
@@ -329,14 +344,14 @@ _eglCheckDisplayHandle(EGLDisplay dpy)
|
||||
{
|
||||
_EGLDisplay *cur;
|
||||
|
||||
mtx_lock(_eglGlobal.Mutex);
|
||||
_eglLockMutex(_eglGlobal.Mutex);
|
||||
cur = _eglGlobal.DisplayList;
|
||||
while (cur) {
|
||||
if (cur == (_EGLDisplay *) dpy)
|
||||
break;
|
||||
cur = cur->Next;
|
||||
}
|
||||
mtx_unlock(_eglGlobal.Mutex);
|
||||
_eglUnlockMutex(_eglGlobal.Mutex);
|
||||
return (cur != NULL);
|
||||
}
|
||||
|
||||
|
@@ -31,11 +31,10 @@
|
||||
#ifndef EGLDISPLAY_INCLUDED
|
||||
#define EGLDISPLAY_INCLUDED
|
||||
|
||||
#include "c99_compat.h"
|
||||
#include "c11/threads.h"
|
||||
|
||||
#include "egltypedefs.h"
|
||||
#include "egldefines.h"
|
||||
#include "eglmutex.h"
|
||||
#include "eglarray.h"
|
||||
|
||||
|
||||
@@ -44,6 +43,7 @@ enum _egl_platform_type {
|
||||
_EGL_PLATFORM_X11,
|
||||
_EGL_PLATFORM_WAYLAND,
|
||||
_EGL_PLATFORM_DRM,
|
||||
_EGL_PLATFORM_FBDEV,
|
||||
_EGL_PLATFORM_NULL,
|
||||
_EGL_PLATFORM_ANDROID,
|
||||
_EGL_PLATFORM_HAIKU,
|
||||
@@ -123,8 +123,6 @@ struct _egl_extensions
|
||||
EGLBoolean EXT_buffer_age;
|
||||
EGLBoolean EXT_swap_buffers_with_damage;
|
||||
EGLBoolean EXT_image_dma_buf_import;
|
||||
|
||||
EGLBoolean MESA_image_dma_buf_export;
|
||||
};
|
||||
|
||||
|
||||
@@ -133,7 +131,7 @@ struct _egl_display
|
||||
/* used to link displays */
|
||||
_EGLDisplay *Next;
|
||||
|
||||
mtx_t Mutex;
|
||||
_EGLMutex Mutex;
|
||||
|
||||
_EGLPlatformType Platform; /**< The type of the platform display */
|
||||
void *PlatformDisplay; /**< A pointer to the platform display */
|
||||
@@ -155,8 +153,8 @@ struct _egl_display
|
||||
_EGLExtensions Extensions; /**< Extensions supported */
|
||||
|
||||
/* these fields are derived from above */
|
||||
char VersionString[100]; /**< EGL_VERSION */
|
||||
char ClientAPIsString[100]; /**< EGL_CLIENT_APIS */
|
||||
char VersionString[1000]; /**< EGL_VERSION */
|
||||
char ClientAPIsString[1000]; /**< EGL_CLIENT_APIS */
|
||||
char ExtensionsString[_EGL_MAX_EXTENSIONS_LEN]; /**< EGL_EXTENSIONS */
|
||||
|
||||
_EGLArray *Screens;
|
||||
@@ -199,7 +197,7 @@ _eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy);
|
||||
* Lookup a handle to find the linked display.
|
||||
* Return NULL if the handle has no corresponding linked display.
|
||||
*/
|
||||
static inline _EGLDisplay *
|
||||
static INLINE _EGLDisplay *
|
||||
_eglLookupDisplay(EGLDisplay display)
|
||||
{
|
||||
_EGLDisplay *dpy = (_EGLDisplay *) display;
|
||||
@@ -212,7 +210,7 @@ _eglLookupDisplay(EGLDisplay display)
|
||||
/**
|
||||
* Return the handle of a linked display, or EGL_NO_DISPLAY.
|
||||
*/
|
||||
static inline EGLDisplay
|
||||
static INLINE EGLDisplay
|
||||
_eglGetDisplayHandle(_EGLDisplay *dpy)
|
||||
{
|
||||
return (EGLDisplay) ((dpy) ? dpy : EGL_NO_DISPLAY);
|
||||
@@ -242,7 +240,7 @@ _eglUnlinkResource(_EGLResource *res, _EGLResourceType type);
|
||||
/**
|
||||
* Return true if the resource is linked.
|
||||
*/
|
||||
static inline EGLBoolean
|
||||
static INLINE EGLBoolean
|
||||
_eglIsResourceLinked(_EGLResource *res)
|
||||
{
|
||||
return res->IsLinked;
|
||||
|
@@ -37,13 +37,13 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "c11/threads.h"
|
||||
|
||||
#include "eglstring.h"
|
||||
#include "egldefines.h"
|
||||
#include "egldisplay.h"
|
||||
#include "egldriver.h"
|
||||
#include "egllog.h"
|
||||
#include "eglmutex.h"
|
||||
|
||||
#if defined(_EGL_OS_UNIX)
|
||||
#include <dlfcn.h>
|
||||
@@ -63,13 +63,16 @@ typedef struct _egl_module {
|
||||
_EGLDriver *Driver;
|
||||
} _EGLModule;
|
||||
|
||||
static mtx_t _eglModuleMutex = _MTX_INITIALIZER_NP;
|
||||
static _EGLMutex _eglModuleMutex = _EGL_MUTEX_INITIALIZER;
|
||||
static _EGLArray *_eglModules;
|
||||
|
||||
const struct {
|
||||
const char *name;
|
||||
_EGLMain_t main;
|
||||
} _eglBuiltInDrivers[] = {
|
||||
#ifdef _EGL_BUILT_IN_DRIVER_GALLIUM
|
||||
{ "egl_gallium", _eglBuiltInDriverGALLIUM },
|
||||
#endif
|
||||
#ifdef _EGL_BUILT_IN_DRIVER_DRI2
|
||||
{ "egl_dri2", _eglBuiltInDriverDRI2 },
|
||||
#endif
|
||||
@@ -616,7 +619,7 @@ _eglMatchDriver(_EGLDisplay *dpy, EGLBoolean test_only)
|
||||
|
||||
assert(!dpy->Initialized);
|
||||
|
||||
mtx_lock(&_eglModuleMutex);
|
||||
_eglLockMutex(&_eglModuleMutex);
|
||||
|
||||
/* set options */
|
||||
dpy->Options.TestOnly = test_only;
|
||||
@@ -628,7 +631,7 @@ _eglMatchDriver(_EGLDisplay *dpy, EGLBoolean test_only)
|
||||
best_drv = _eglMatchAndInitialize(dpy);
|
||||
}
|
||||
|
||||
mtx_unlock(&_eglModuleMutex);
|
||||
_eglUnlockMutex(&_eglModuleMutex);
|
||||
|
||||
if (best_drv) {
|
||||
_eglLog(_EGL_DEBUG, "the best driver is %s%s",
|
||||
|
@@ -32,8 +32,6 @@
|
||||
#define EGLDRIVER_INCLUDED
|
||||
|
||||
|
||||
#include "c99_compat.h"
|
||||
|
||||
#include "egltypedefs.h"
|
||||
#include "eglapi.h"
|
||||
#include <stddef.h>
|
||||
@@ -45,7 +43,7 @@
|
||||
* semicolon when used.
|
||||
*/
|
||||
#define _EGL_DRIVER_TYPECAST(drvtype, egltype, code) \
|
||||
static inline struct drvtype *drvtype(const egltype *obj) \
|
||||
static INLINE struct drvtype *drvtype(const egltype *obj) \
|
||||
{ return (struct drvtype *) code; }
|
||||
|
||||
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "eglconfig.h"
|
||||
#include "eglcontext.h"
|
||||
#include "eglsurface.h"
|
||||
#include "eglmisc.h"
|
||||
#include "eglscreen.h"
|
||||
#include "eglmode.h"
|
||||
#include "eglsync.h"
|
||||
@@ -84,6 +85,7 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
|
||||
drv->API.WaitClient = (WaitClient_t) _eglReturnFalse;
|
||||
drv->API.WaitNative = (WaitNative_t) _eglReturnFalse;
|
||||
drv->API.GetProcAddress = (GetProcAddress_t) _eglReturnFalse;
|
||||
drv->API.QueryString = _eglQueryString;
|
||||
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
drv->API.CopyContextMESA = (CopyContextMESA_t) _eglReturnFalse;
|
||||
@@ -118,9 +120,4 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
|
||||
#ifdef EGL_NOK_swap_region
|
||||
drv->API.SwapBuffersRegionNOK = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef EGL_MESA_dma_buf_image_export
|
||||
drv->API.ExportDMABUFImageQueryMESA = NULL;
|
||||
drv->API.ExportDMABUFImageMESA = NULL;
|
||||
#endif
|
||||
}
|
||||
|
@@ -30,14 +30,13 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include "c11/threads.h"
|
||||
|
||||
#include "eglglobals.h"
|
||||
#include "egldisplay.h"
|
||||
#include "egldriver.h"
|
||||
#include "eglmutex.h"
|
||||
|
||||
|
||||
static mtx_t _eglGlobalMutex = _MTX_INITIALIZER_NP;
|
||||
static _EGLMutex _eglGlobalMutex = _EGL_MUTEX_INITIALIZER;
|
||||
|
||||
struct _egl_global _eglGlobal =
|
||||
{
|
||||
@@ -85,7 +84,7 @@ _eglAddAtExitCall(void (*func)(void))
|
||||
if (func) {
|
||||
static EGLBoolean registered = EGL_FALSE;
|
||||
|
||||
mtx_lock(_eglGlobal.Mutex);
|
||||
_eglLockMutex(_eglGlobal.Mutex);
|
||||
|
||||
if (!registered) {
|
||||
atexit(_eglAtExit);
|
||||
@@ -95,6 +94,6 @@ _eglAddAtExitCall(void (*func)(void))
|
||||
assert(_eglGlobal.NumAtExitCalls < ARRAY_SIZE(_eglGlobal.AtExitCalls));
|
||||
_eglGlobal.AtExitCalls[_eglGlobal.NumAtExitCalls++] = func;
|
||||
|
||||
mtx_unlock(_eglGlobal.Mutex);
|
||||
_eglUnlockMutex(_eglGlobal.Mutex);
|
||||
}
|
||||
}
|
||||
|
@@ -32,9 +32,9 @@
|
||||
#define EGLGLOBALS_INCLUDED
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "c11/threads.h"
|
||||
|
||||
#include "egltypedefs.h"
|
||||
#include "eglmutex.h"
|
||||
|
||||
|
||||
/**
|
||||
@@ -42,7 +42,7 @@
|
||||
*/
|
||||
struct _egl_global
|
||||
{
|
||||
mtx_t *Mutex;
|
||||
_EGLMutex *Mutex;
|
||||
|
||||
/* the list of all displays */
|
||||
_EGLDisplay *DisplayList;
|
||||
|
@@ -30,7 +30,6 @@
|
||||
#ifndef EGLIMAGE_INCLUDED
|
||||
#define EGLIMAGE_INCLUDED
|
||||
|
||||
#include "c99_compat.h"
|
||||
|
||||
#include "egltypedefs.h"
|
||||
#include "egldisplay.h"
|
||||
@@ -93,7 +92,7 @@ _eglInitImage(_EGLImage *img, _EGLDisplay *dpy);
|
||||
/**
|
||||
* Increment reference count for the image.
|
||||
*/
|
||||
static inline _EGLImage *
|
||||
static INLINE _EGLImage *
|
||||
_eglGetImage(_EGLImage *img)
|
||||
{
|
||||
if (img)
|
||||
@@ -105,7 +104,7 @@ _eglGetImage(_EGLImage *img)
|
||||
/**
|
||||
* Decrement reference count for the image.
|
||||
*/
|
||||
static inline EGLBoolean
|
||||
static INLINE EGLBoolean
|
||||
_eglPutImage(_EGLImage *img)
|
||||
{
|
||||
return (img) ? _eglPutResource(&img->Resource) : EGL_FALSE;
|
||||
@@ -116,7 +115,7 @@ _eglPutImage(_EGLImage *img)
|
||||
* Link an image to its display and return the handle of the link.
|
||||
* The handle can be passed to client directly.
|
||||
*/
|
||||
static inline EGLImageKHR
|
||||
static INLINE EGLImageKHR
|
||||
_eglLinkImage(_EGLImage *img)
|
||||
{
|
||||
_eglLinkResource(&img->Resource, _EGL_RESOURCE_IMAGE);
|
||||
@@ -128,7 +127,7 @@ _eglLinkImage(_EGLImage *img)
|
||||
* Unlink a linked image from its display.
|
||||
* Accessing an unlinked image should generate EGL_BAD_PARAMETER error.
|
||||
*/
|
||||
static inline void
|
||||
static INLINE void
|
||||
_eglUnlinkImage(_EGLImage *img)
|
||||
{
|
||||
_eglUnlinkResource(&img->Resource, _EGL_RESOURCE_IMAGE);
|
||||
@@ -139,7 +138,7 @@ _eglUnlinkImage(_EGLImage *img)
|
||||
* Lookup a handle to find the linked image.
|
||||
* Return NULL if the handle has no corresponding linked image.
|
||||
*/
|
||||
static inline _EGLImage *
|
||||
static INLINE _EGLImage *
|
||||
_eglLookupImage(EGLImageKHR image, _EGLDisplay *dpy)
|
||||
{
|
||||
_EGLImage *img = (_EGLImage *) image;
|
||||
@@ -152,7 +151,7 @@ _eglLookupImage(EGLImageKHR image, _EGLDisplay *dpy)
|
||||
/**
|
||||
* Return the handle of a linked image, or EGL_NO_IMAGE_KHR.
|
||||
*/
|
||||
static inline EGLImageKHR
|
||||
static INLINE EGLImageKHR
|
||||
_eglGetImageHandle(_EGLImage *img)
|
||||
{
|
||||
_EGLResource *res = (_EGLResource *) img;
|
||||
|
@@ -38,24 +38,24 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "c11/threads.h"
|
||||
|
||||
#include "egllog.h"
|
||||
#include "eglstring.h"
|
||||
#include "eglmutex.h"
|
||||
|
||||
#define MAXSTRING 1000
|
||||
#define FALLBACK_LOG_LEVEL _EGL_WARNING
|
||||
|
||||
|
||||
static struct {
|
||||
mtx_t mutex;
|
||||
_EGLMutex mutex;
|
||||
|
||||
EGLBoolean initialized;
|
||||
EGLint level;
|
||||
_EGLLogProc logger;
|
||||
EGLint num_messages;
|
||||
} logging = {
|
||||
_MTX_INITIALIZER_NP,
|
||||
_EGL_MUTEX_INITIALIZER,
|
||||
EGL_FALSE,
|
||||
FALLBACK_LOG_LEVEL,
|
||||
NULL,
|
||||
@@ -82,7 +82,7 @@ _eglSetLogProc(_EGLLogProc logger)
|
||||
{
|
||||
EGLint num_messages = 0;
|
||||
|
||||
mtx_lock(&logging.mutex);
|
||||
_eglLockMutex(&logging.mutex);
|
||||
|
||||
if (logging.logger != logger) {
|
||||
logging.logger = logger;
|
||||
@@ -91,7 +91,7 @@ _eglSetLogProc(_EGLLogProc logger)
|
||||
logging.num_messages = 0;
|
||||
}
|
||||
|
||||
mtx_unlock(&logging.mutex);
|
||||
_eglUnlockMutex(&logging.mutex);
|
||||
|
||||
if (num_messages)
|
||||
_eglLog(_EGL_DEBUG,
|
||||
@@ -111,9 +111,9 @@ _eglSetLogLevel(EGLint level)
|
||||
case _EGL_WARNING:
|
||||
case _EGL_INFO:
|
||||
case _EGL_DEBUG:
|
||||
mtx_lock(&logging.mutex);
|
||||
_eglLockMutex(&logging.mutex);
|
||||
logging.level = level;
|
||||
mtx_unlock(&logging.mutex);
|
||||
_eglUnlockMutex(&logging.mutex);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -188,7 +188,7 @@ _eglLog(EGLint level, const char *fmtStr, ...)
|
||||
if (level > logging.level || level < 0)
|
||||
return;
|
||||
|
||||
mtx_lock(&logging.mutex);
|
||||
_eglLockMutex(&logging.mutex);
|
||||
|
||||
if (logging.logger) {
|
||||
va_start(args, fmtStr);
|
||||
@@ -201,7 +201,7 @@ _eglLog(EGLint level, const char *fmtStr, ...)
|
||||
logging.num_messages++;
|
||||
}
|
||||
|
||||
mtx_unlock(&logging.mutex);
|
||||
_eglUnlockMutex(&logging.mutex);
|
||||
|
||||
if (level == _EGL_FATAL)
|
||||
exit(1); /* or abort()? */
|
||||
|
183
src/egl/main/eglmisc.c
Normal file
183
src/egl/main/eglmisc.c
Normal file
@@ -0,0 +1,183 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 VMware, Inc.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, 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, 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Small/misc EGL functions
|
||||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "eglcurrent.h"
|
||||
#include "eglmisc.h"
|
||||
#include "egldisplay.h"
|
||||
#include "egldriver.h"
|
||||
#include "eglstring.h"
|
||||
|
||||
|
||||
/**
|
||||
* Copy the extension into the string and update the string pointer.
|
||||
*/
|
||||
static EGLint
|
||||
_eglAppendExtension(char **str, const char *ext)
|
||||
{
|
||||
char *s = *str;
|
||||
size_t len = strlen(ext);
|
||||
|
||||
if (s) {
|
||||
memcpy(s, ext, len);
|
||||
s[len++] = ' ';
|
||||
s[len] = '\0';
|
||||
|
||||
*str += len;
|
||||
}
|
||||
else {
|
||||
len++;
|
||||
}
|
||||
|
||||
return (EGLint) len;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Examine the individual extension enable/disable flags and recompute
|
||||
* the driver's Extensions string.
|
||||
*/
|
||||
static void
|
||||
_eglUpdateExtensionsString(_EGLDisplay *dpy)
|
||||
{
|
||||
#define _EGL_CHECK_EXTENSION(ext) \
|
||||
do { \
|
||||
if (dpy->Extensions.ext) { \
|
||||
_eglAppendExtension(&exts, "EGL_" #ext); \
|
||||
assert(exts <= dpy->ExtensionsString + _EGL_MAX_EXTENSIONS_LEN); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
char *exts = dpy->ExtensionsString;
|
||||
|
||||
if (exts[0])
|
||||
return;
|
||||
|
||||
_EGL_CHECK_EXTENSION(MESA_screen_surface);
|
||||
_EGL_CHECK_EXTENSION(MESA_copy_context);
|
||||
_EGL_CHECK_EXTENSION(MESA_drm_display);
|
||||
_EGL_CHECK_EXTENSION(MESA_drm_image);
|
||||
_EGL_CHECK_EXTENSION(MESA_configless_context);
|
||||
|
||||
_EGL_CHECK_EXTENSION(WL_bind_wayland_display);
|
||||
_EGL_CHECK_EXTENSION(WL_create_wayland_buffer_from_image);
|
||||
|
||||
_EGL_CHECK_EXTENSION(KHR_image_base);
|
||||
_EGL_CHECK_EXTENSION(KHR_image_pixmap);
|
||||
if (dpy->Extensions.KHR_image_base && dpy->Extensions.KHR_image_pixmap)
|
||||
_eglAppendExtension(&exts, "EGL_KHR_image");
|
||||
|
||||
_EGL_CHECK_EXTENSION(KHR_vg_parent_image);
|
||||
_EGL_CHECK_EXTENSION(KHR_get_all_proc_addresses);
|
||||
_EGL_CHECK_EXTENSION(KHR_gl_texture_2D_image);
|
||||
_EGL_CHECK_EXTENSION(KHR_gl_texture_cubemap_image);
|
||||
_EGL_CHECK_EXTENSION(KHR_gl_texture_3D_image);
|
||||
_EGL_CHECK_EXTENSION(KHR_gl_renderbuffer_image);
|
||||
|
||||
_EGL_CHECK_EXTENSION(KHR_reusable_sync);
|
||||
_EGL_CHECK_EXTENSION(KHR_fence_sync);
|
||||
|
||||
_EGL_CHECK_EXTENSION(KHR_surfaceless_context);
|
||||
_EGL_CHECK_EXTENSION(KHR_create_context);
|
||||
|
||||
_EGL_CHECK_EXTENSION(NOK_swap_region);
|
||||
_EGL_CHECK_EXTENSION(NOK_texture_from_pixmap);
|
||||
|
||||
_EGL_CHECK_EXTENSION(ANDROID_image_native_buffer);
|
||||
|
||||
_EGL_CHECK_EXTENSION(CHROMIUM_sync_control);
|
||||
|
||||
_EGL_CHECK_EXTENSION(EXT_create_context_robustness);
|
||||
_EGL_CHECK_EXTENSION(EXT_buffer_age);
|
||||
_EGL_CHECK_EXTENSION(EXT_swap_buffers_with_damage);
|
||||
_EGL_CHECK_EXTENSION(EXT_image_dma_buf_import);
|
||||
|
||||
_EGL_CHECK_EXTENSION(NV_post_sub_buffer);
|
||||
#undef _EGL_CHECK_EXTENSION
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
_eglUpdateAPIsString(_EGLDisplay *dpy)
|
||||
{
|
||||
char *apis = dpy->ClientAPIsString;
|
||||
|
||||
if (apis[0] || !dpy->ClientAPIs)
|
||||
return;
|
||||
|
||||
if (dpy->ClientAPIs & EGL_OPENGL_BIT)
|
||||
strcat(apis, "OpenGL ");
|
||||
|
||||
if (dpy->ClientAPIs & EGL_OPENGL_ES_BIT)
|
||||
strcat(apis, "OpenGL_ES ");
|
||||
|
||||
if (dpy->ClientAPIs & EGL_OPENGL_ES2_BIT)
|
||||
strcat(apis, "OpenGL_ES2 ");
|
||||
|
||||
if (dpy->ClientAPIs & EGL_OPENGL_ES3_BIT_KHR)
|
||||
strcat(apis, "OpenGL_ES3 ");
|
||||
|
||||
if (dpy->ClientAPIs & EGL_OPENVG_BIT)
|
||||
strcat(apis, "OpenVG ");
|
||||
|
||||
assert(strlen(apis) < sizeof(dpy->ClientAPIsString));
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
_eglQueryString(_EGLDriver *drv, _EGLDisplay *dpy, EGLint name)
|
||||
{
|
||||
(void) drv;
|
||||
|
||||
switch (name) {
|
||||
case EGL_VENDOR:
|
||||
return _EGL_VENDOR_STRING;
|
||||
case EGL_VERSION:
|
||||
_eglsnprintf(dpy->VersionString, sizeof(dpy->VersionString),
|
||||
"%d.%d (%s)", dpy->VersionMajor, dpy->VersionMinor,
|
||||
dpy->Driver->Name);
|
||||
return dpy->VersionString;
|
||||
case EGL_EXTENSIONS:
|
||||
_eglUpdateExtensionsString(dpy);
|
||||
return dpy->ExtensionsString;
|
||||
case EGL_CLIENT_APIS:
|
||||
_eglUpdateAPIsString(dpy);
|
||||
return dpy->ClientAPIsString;
|
||||
default:
|
||||
_eglError(EGL_BAD_PARAMETER, "eglQueryString");
|
||||
return NULL;
|
||||
}
|
||||
}
|
42
src/egl/main/eglmisc.h
Normal file
42
src/egl/main/eglmisc.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 VMware, Inc.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, 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, 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLMISC_INCLUDED
|
||||
#define EGLMISC_INCLUDED
|
||||
|
||||
|
||||
#include "egltypedefs.h"
|
||||
|
||||
|
||||
extern const char *
|
||||
_eglQueryString(_EGLDriver *drv, _EGLDisplay *dpy, EGLint name);
|
||||
|
||||
|
||||
#endif /* EGLMISC_INCLUDED */
|
64
src/egl/main/eglmutex.h
Normal file
64
src/egl/main/eglmutex.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009 Chia-I Wu <olvaffe@gmail.com>
|
||||
* 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 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLMUTEX_INCLUDED
|
||||
#define EGLMUTEX_INCLUDED
|
||||
|
||||
#include "eglcompiler.h"
|
||||
|
||||
#include "c11/threads.h"
|
||||
|
||||
typedef mtx_t _EGLMutex;
|
||||
|
||||
static INLINE void _eglInitMutex(_EGLMutex *m)
|
||||
{
|
||||
mtx_init(m, mtx_plain);
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
_eglDestroyMutex(_EGLMutex *m)
|
||||
{
|
||||
mtx_destroy(m);
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
_eglLockMutex(_EGLMutex *m)
|
||||
{
|
||||
mtx_lock(m);
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
_eglUnlockMutex(_EGLMutex *m)
|
||||
{
|
||||
mtx_unlock(m);
|
||||
}
|
||||
|
||||
#define _EGL_MUTEX_INITIALIZER _MTX_INITIALIZER_NP
|
||||
|
||||
|
||||
#endif /* EGLMUTEX_INCLUDED */
|
@@ -44,20 +44,20 @@
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "c11/threads.h"
|
||||
|
||||
#include "egldisplay.h"
|
||||
#include "eglcurrent.h"
|
||||
#include "eglmode.h"
|
||||
#include "eglsurface.h"
|
||||
#include "eglscreen.h"
|
||||
#include "eglmutex.h"
|
||||
|
||||
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
|
||||
|
||||
/* ugh, no atomic op? */
|
||||
static mtx_t _eglNextScreenHandleMutex = _MTX_INITIALIZER_NP;
|
||||
static _EGLMutex _eglNextScreenHandleMutex = _EGL_MUTEX_INITIALIZER;
|
||||
static EGLScreenMESA _eglNextScreenHandle = 1;
|
||||
|
||||
|
||||
@@ -70,10 +70,10 @@ _eglAllocScreenHandle(void)
|
||||
{
|
||||
EGLScreenMESA s;
|
||||
|
||||
mtx_lock(&_eglNextScreenHandleMutex);
|
||||
_eglLockMutex(&_eglNextScreenHandleMutex);
|
||||
s = _eglNextScreenHandle;
|
||||
_eglNextScreenHandle += _EGL_SCREEN_MAX_MODES;
|
||||
mtx_unlock(&_eglNextScreenHandleMutex);
|
||||
_eglUnlockMutex(&_eglNextScreenHandleMutex);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#ifndef EGLSCREEN_INCLUDED
|
||||
#define EGLSCREEN_INCLUDED
|
||||
|
||||
#include "c99_compat.h"
|
||||
|
||||
#include "egltypedefs.h"
|
||||
|
||||
@@ -83,7 +82,7 @@ _eglLookupScreen(EGLScreenMESA screen, _EGLDisplay *dpy);
|
||||
/**
|
||||
* Return the handle of a linked screen.
|
||||
*/
|
||||
static inline EGLScreenMESA
|
||||
static INLINE EGLScreenMESA
|
||||
_eglGetScreenHandle(_EGLScreen *screen)
|
||||
{
|
||||
return (screen) ? screen->Handle : (EGLScreenMESA) 0;
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#ifndef EGLSURFACE_INCLUDED
|
||||
#define EGLSURFACE_INCLUDED
|
||||
|
||||
#include "c99_compat.h"
|
||||
|
||||
#include "egltypedefs.h"
|
||||
#include "egldisplay.h"
|
||||
@@ -106,7 +105,7 @@ _eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint in
|
||||
/**
|
||||
* Increment reference count for the surface.
|
||||
*/
|
||||
static inline _EGLSurface *
|
||||
static INLINE _EGLSurface *
|
||||
_eglGetSurface(_EGLSurface *surf)
|
||||
{
|
||||
if (surf)
|
||||
@@ -118,7 +117,7 @@ _eglGetSurface(_EGLSurface *surf)
|
||||
/**
|
||||
* Decrement reference count for the surface.
|
||||
*/
|
||||
static inline EGLBoolean
|
||||
static INLINE EGLBoolean
|
||||
_eglPutSurface(_EGLSurface *surf)
|
||||
{
|
||||
return (surf) ? _eglPutResource(&surf->Resource) : EGL_FALSE;
|
||||
@@ -129,7 +128,7 @@ _eglPutSurface(_EGLSurface *surf)
|
||||
* Link a surface to its display and return the handle of the link.
|
||||
* The handle can be passed to client directly.
|
||||
*/
|
||||
static inline EGLSurface
|
||||
static INLINE EGLSurface
|
||||
_eglLinkSurface(_EGLSurface *surf)
|
||||
{
|
||||
_eglLinkResource(&surf->Resource, _EGL_RESOURCE_SURFACE);
|
||||
@@ -141,7 +140,7 @@ _eglLinkSurface(_EGLSurface *surf)
|
||||
* Unlink a linked surface from its display.
|
||||
* Accessing an unlinked surface should generate EGL_BAD_SURFACE error.
|
||||
*/
|
||||
static inline void
|
||||
static INLINE void
|
||||
_eglUnlinkSurface(_EGLSurface *surf)
|
||||
{
|
||||
_eglUnlinkResource(&surf->Resource, _EGL_RESOURCE_SURFACE);
|
||||
@@ -152,7 +151,7 @@ _eglUnlinkSurface(_EGLSurface *surf)
|
||||
* Lookup a handle to find the linked surface.
|
||||
* Return NULL if the handle has no corresponding linked surface.
|
||||
*/
|
||||
static inline _EGLSurface *
|
||||
static INLINE _EGLSurface *
|
||||
_eglLookupSurface(EGLSurface surface, _EGLDisplay *dpy)
|
||||
{
|
||||
_EGLSurface *surf = (_EGLSurface *) surface;
|
||||
@@ -165,7 +164,7 @@ _eglLookupSurface(EGLSurface surface, _EGLDisplay *dpy)
|
||||
/**
|
||||
* Return the handle of a linked surface, or EGL_NO_SURFACE.
|
||||
*/
|
||||
static inline EGLSurface
|
||||
static INLINE EGLSurface
|
||||
_eglGetSurfaceHandle(_EGLSurface *surf)
|
||||
{
|
||||
_EGLResource *res = (_EGLResource *) surf;
|
||||
|
@@ -30,8 +30,6 @@
|
||||
#define EGLSYNC_INCLUDED
|
||||
|
||||
|
||||
#include "c99_compat.h"
|
||||
|
||||
#include "egltypedefs.h"
|
||||
#include "egldisplay.h"
|
||||
|
||||
@@ -63,7 +61,7 @@ _eglGetSyncAttribKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
|
||||
/**
|
||||
* Increment reference count for the sync.
|
||||
*/
|
||||
static inline _EGLSync *
|
||||
static INLINE _EGLSync *
|
||||
_eglGetSync(_EGLSync *sync)
|
||||
{
|
||||
if (sync)
|
||||
@@ -75,7 +73,7 @@ _eglGetSync(_EGLSync *sync)
|
||||
/**
|
||||
* Decrement reference count for the sync.
|
||||
*/
|
||||
static inline EGLBoolean
|
||||
static INLINE EGLBoolean
|
||||
_eglPutSync(_EGLSync *sync)
|
||||
{
|
||||
return (sync) ? _eglPutResource(&sync->Resource) : EGL_FALSE;
|
||||
@@ -86,7 +84,7 @@ _eglPutSync(_EGLSync *sync)
|
||||
* Link a sync to its display and return the handle of the link.
|
||||
* The handle can be passed to client directly.
|
||||
*/
|
||||
static inline EGLSyncKHR
|
||||
static INLINE EGLSyncKHR
|
||||
_eglLinkSync(_EGLSync *sync)
|
||||
{
|
||||
_eglLinkResource(&sync->Resource, _EGL_RESOURCE_SYNC);
|
||||
@@ -97,7 +95,7 @@ _eglLinkSync(_EGLSync *sync)
|
||||
/**
|
||||
* Unlink a linked sync from its display.
|
||||
*/
|
||||
static inline void
|
||||
static INLINE void
|
||||
_eglUnlinkSync(_EGLSync *sync)
|
||||
{
|
||||
_eglUnlinkResource(&sync->Resource, _EGL_RESOURCE_SYNC);
|
||||
@@ -108,7 +106,7 @@ _eglUnlinkSync(_EGLSync *sync)
|
||||
* Lookup a handle to find the linked sync.
|
||||
* Return NULL if the handle has no corresponding linked sync.
|
||||
*/
|
||||
static inline _EGLSync *
|
||||
static INLINE _EGLSync *
|
||||
_eglLookupSync(EGLSyncKHR handle, _EGLDisplay *dpy)
|
||||
{
|
||||
_EGLSync *sync = (_EGLSync *) handle;
|
||||
@@ -121,7 +119,7 @@ _eglLookupSync(EGLSyncKHR handle, _EGLDisplay *dpy)
|
||||
/**
|
||||
* Return the handle of a linked sync, or EGL_NO_SYNC_KHR.
|
||||
*/
|
||||
static inline EGLSyncKHR
|
||||
static INLINE EGLSyncKHR
|
||||
_eglGetSyncHandle(_EGLSync *sync)
|
||||
{
|
||||
_EGLResource *res = (_EGLResource *) sync;
|
||||
|
@@ -79,5 +79,10 @@ ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),)
|
||||
SUBDIRS += winsys/svga/drm drivers/svga
|
||||
endif
|
||||
|
||||
#
|
||||
# Gallium state trackers and their users (targets)
|
||||
#
|
||||
SUBDIRS += state_trackers/egl targets/egl-static
|
||||
|
||||
mkfiles := $(patsubst %,$(GALLIUM_TOP)/%/Android.mk,$(SUBDIRS))
|
||||
include $(mkfiles)
|
||||
|
@@ -11,6 +11,8 @@ SUBDIRS += auxiliary
|
||||
##
|
||||
|
||||
SUBDIRS += \
|
||||
drivers/galahad \
|
||||
drivers/identity \
|
||||
drivers/noop \
|
||||
drivers/trace \
|
||||
drivers/rbug
|
||||
@@ -95,6 +97,14 @@ if HAVE_DRI2
|
||||
SUBDIRS += winsys/sw/kms-dri
|
||||
endif
|
||||
|
||||
if HAVE_EGL_PLATFORM_FBDEV
|
||||
SUBDIRS += winsys/sw/fbdev
|
||||
endif
|
||||
|
||||
if HAVE_EGL_PLATFORM_WAYLAND
|
||||
SUBDIRS += winsys/sw/wayland
|
||||
endif
|
||||
|
||||
SUBDIRS += winsys/sw/wrapper
|
||||
|
||||
##
|
||||
@@ -105,6 +115,10 @@ EXTRA_DIST = \
|
||||
docs \
|
||||
README.portability \
|
||||
SConscript \
|
||||
state_trackers/egl \
|
||||
state_trackers/gbm \
|
||||
targets/egl-static \
|
||||
targets/gbm \
|
||||
winsys/sw/gdi \
|
||||
winsys/sw/hgl
|
||||
|
||||
@@ -125,6 +139,11 @@ if HAVE_DRICOMMON
|
||||
SUBDIRS += state_trackers/dri targets/dri
|
||||
endif
|
||||
|
||||
## the egl target depends on vega
|
||||
if HAVE_OPENVG
|
||||
SUBDIRS += state_trackers/vega
|
||||
endif
|
||||
|
||||
if HAVE_X11_DRIVER
|
||||
SUBDIRS += state_trackers/glx/xlib targets/libgl-xlib
|
||||
endif
|
||||
|
@@ -12,6 +12,8 @@ SConscript('auxiliary/SConscript')
|
||||
|
||||
# These are common and work across all platforms
|
||||
SConscript([
|
||||
'drivers/galahad/SConscript',
|
||||
'drivers/identity/SConscript',
|
||||
'drivers/llvmpipe/SConscript',
|
||||
'drivers/rbug/SConscript',
|
||||
'drivers/softpipe/SConscript',
|
||||
@@ -60,6 +62,13 @@ SConscript([
|
||||
])
|
||||
|
||||
if not env['embedded']:
|
||||
SConscript('state_trackers/vega/SConscript')
|
||||
if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'sunos'):
|
||||
SConscript([
|
||||
'state_trackers/egl/SConscript',
|
||||
'targets/egl-static/SConscript',
|
||||
])
|
||||
|
||||
if env['x11']:
|
||||
SConscript([
|
||||
'state_trackers/glx/xlib/SConscript',
|
||||
|
@@ -10,19 +10,14 @@ include $(top_srcdir)/src/gallium/Automake.inc
|
||||
noinst_LTLIBRARIES = libgallium.la
|
||||
|
||||
AM_CFLAGS = \
|
||||
-I$(top_builddir)/src/glsl/nir \
|
||||
-I$(top_srcdir)/src/gallium/auxiliary/util \
|
||||
$(GALLIUM_CFLAGS) \
|
||||
$(VISIBILITY_CFLAGS) \
|
||||
$(MSVC2008_COMPAT_CXXFLAGS)
|
||||
$(VISIBILITY_CFLAGS)
|
||||
|
||||
AM_CXXFLAGS = \
|
||||
$(VISIBILITY_CXXFLAGS) \
|
||||
$(MSVC2008_COMPAT_CXXFLAGS)
|
||||
AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
|
||||
|
||||
libgallium_la_SOURCES = \
|
||||
$(C_SOURCES) \
|
||||
$(NIR_SOURCES) \
|
||||
$(GENERATED_SOURCES)
|
||||
|
||||
if HAVE_MESA_LLVM
|
||||
|
@@ -208,12 +208,12 @@ C_SOURCES := \
|
||||
util/u_dump_state.c \
|
||||
util/u_dynarray.h \
|
||||
util/u_fifo.h \
|
||||
util/u_format_bptc.c \
|
||||
util/u_format_bptc.h \
|
||||
util/u_format.c \
|
||||
util/u_format.h \
|
||||
util/u_format_etc.c \
|
||||
util/u_format_etc.h \
|
||||
util/u_format_fake.c \
|
||||
util/u_format_fake.h \
|
||||
util/u_format.h \
|
||||
util/u_format_latc.c \
|
||||
util/u_format_latc.h \
|
||||
util/u_format_other.c \
|
||||
@@ -251,6 +251,8 @@ C_SOURCES := \
|
||||
util/u_keymap.h \
|
||||
util/u_linear.c \
|
||||
util/u_linear.h \
|
||||
util/u_linkage.c \
|
||||
util/u_linkage.h \
|
||||
util/u_math.c \
|
||||
util/u_math.h \
|
||||
util/u_memory.h \
|
||||
@@ -302,10 +304,6 @@ C_SOURCES := \
|
||||
util/u_vbuf.h \
|
||||
util/u_video.h
|
||||
|
||||
NIR_SOURCES := \
|
||||
nir/tgsi_to_nir.c \
|
||||
nir/tgsi_to_nir.h
|
||||
|
||||
VL_SOURCES := \
|
||||
vl/vl_compositor.c \
|
||||
vl/vl_compositor.h \
|
||||
|
@@ -8,10 +8,6 @@ env.Append(CPPPATH = [
|
||||
'util',
|
||||
])
|
||||
|
||||
env = env.Clone()
|
||||
|
||||
env.MSVC2008Compat()
|
||||
|
||||
env.CodeGenerate(
|
||||
target = 'indices/u_indices_gen.c',
|
||||
script = 'indices/u_indices_gen.py',
|
||||
|
@@ -562,11 +562,6 @@ draw_llvm_create_variant(struct draw_llvm *llvm,
|
||||
|
||||
memcpy(&variant->key, key, shader->variant_key_size);
|
||||
|
||||
if (gallivm_debug & (GALLIVM_DEBUG_TGSI | GALLIVM_DEBUG_IR)) {
|
||||
tgsi_dump(llvm->draw->vs.vertex_shader->state.tokens, 0);
|
||||
draw_llvm_dump_variant_key(&variant->key);
|
||||
}
|
||||
|
||||
vertex_header = create_jit_vertex_header(variant->gallivm, num_inputs);
|
||||
|
||||
variant->vertex_header_ptr_type = LLVMPointerType(vertex_header, 0);
|
||||
@@ -611,6 +606,11 @@ generate_vs(struct draw_llvm_variant *variant,
|
||||
LLVMValueRef num_consts_ptr =
|
||||
draw_jit_context_num_vs_constants(variant->gallivm, context_ptr);
|
||||
|
||||
if (gallivm_debug & (GALLIVM_DEBUG_TGSI | GALLIVM_DEBUG_IR)) {
|
||||
tgsi_dump(tokens, 0);
|
||||
draw_llvm_dump_variant_key(&variant->key);
|
||||
}
|
||||
|
||||
lp_build_tgsi_soa(variant->gallivm,
|
||||
tokens,
|
||||
vs_type,
|
||||
@@ -620,7 +620,6 @@ generate_vs(struct draw_llvm_variant *variant,
|
||||
system_values,
|
||||
inputs,
|
||||
outputs,
|
||||
context_ptr,
|
||||
draw_sampler,
|
||||
&llvm->draw->vs.vertex_shader->info,
|
||||
NULL);
|
||||
@@ -1631,7 +1630,9 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
|
||||
LLVMBuildStore(builder, lp_build_zero(gallivm, lp_int_type(vs_type)), clipmask_bool_ptr);
|
||||
|
||||
/* code generated texture sampling */
|
||||
sampler = draw_llvm_sampler_soa_create(draw_llvm_variant_key_samplers(key));
|
||||
sampler = draw_llvm_sampler_soa_create(
|
||||
draw_llvm_variant_key_samplers(key),
|
||||
context_ptr);
|
||||
|
||||
if (elts) {
|
||||
start = zero;
|
||||
@@ -2162,7 +2163,8 @@ draw_gs_llvm_generate(struct draw_llvm *llvm,
|
||||
draw_gs_jit_context_num_constants(variant->gallivm, context_ptr);
|
||||
|
||||
/* code generated texture sampling */
|
||||
sampler = draw_llvm_sampler_soa_create(variant->key.samplers);
|
||||
sampler = draw_llvm_sampler_soa_create(variant->key.samplers,
|
||||
context_ptr);
|
||||
|
||||
mask_val = generate_mask_value(variant, gs_type);
|
||||
lp_build_mask_begin(&mask, gallivm, gs_type, mask_val);
|
||||
@@ -2185,7 +2187,6 @@ draw_gs_llvm_generate(struct draw_llvm *llvm,
|
||||
&system_values,
|
||||
NULL,
|
||||
outputs,
|
||||
context_ptr,
|
||||
sampler,
|
||||
&llvm->draw->gs.geometry_shader->info,
|
||||
(const struct lp_build_tgsi_gs_iface *)&gs_iface);
|
||||
|
@@ -526,7 +526,8 @@ void
|
||||
draw_gs_llvm_dump_variant_key(struct draw_gs_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 draw_sampler_static_state *static_state,
|
||||
LLVMValueRef context_ptr);
|
||||
|
||||
void
|
||||
draw_llvm_set_sampler_state(struct draw_context *draw, unsigned shader_stage);
|
||||
|
@@ -59,6 +59,8 @@ struct draw_llvm_sampler_dynamic_state
|
||||
struct lp_sampler_dynamic_state base;
|
||||
|
||||
const struct draw_sampler_static_state *static_state;
|
||||
|
||||
LLVMValueRef context_ptr;
|
||||
};
|
||||
|
||||
|
||||
@@ -84,13 +86,14 @@ struct draw_llvm_sampler_soa
|
||||
static LLVMValueRef
|
||||
draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
|
||||
struct gallivm_state *gallivm,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned texture_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;
|
||||
@@ -106,7 +109,7 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
|
||||
/* context[0].textures[unit].member */
|
||||
indices[3] = lp_build_const_int32(gallivm, member_index);
|
||||
|
||||
ptr = LLVMBuildGEP(builder, context_ptr, indices, Elements(indices), "");
|
||||
ptr = LLVMBuildGEP(builder, state->context_ptr, indices, Elements(indices), "");
|
||||
|
||||
if (emit_load)
|
||||
res = LLVMBuildLoad(builder, ptr, "");
|
||||
@@ -130,13 +133,14 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
|
||||
static LLVMValueRef
|
||||
draw_llvm_sampler_member(const struct lp_sampler_dynamic_state *base,
|
||||
struct gallivm_state *gallivm,
|
||||
LLVMValueRef context_ptr,
|
||||
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;
|
||||
@@ -152,7 +156,7 @@ draw_llvm_sampler_member(const struct lp_sampler_dynamic_state *base,
|
||||
/* context[0].samplers[unit].member */
|
||||
indices[3] = lp_build_const_int32(gallivm, member_index);
|
||||
|
||||
ptr = LLVMBuildGEP(builder, context_ptr, indices, Elements(indices), "");
|
||||
ptr = LLVMBuildGEP(builder, state->context_ptr, indices, Elements(indices), "");
|
||||
|
||||
if (emit_load)
|
||||
res = LLVMBuildLoad(builder, ptr, "");
|
||||
@@ -178,11 +182,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, \
|
||||
LLVMValueRef context_ptr, \
|
||||
unsigned texture_unit) \
|
||||
{ \
|
||||
return draw_llvm_texture_member(base, gallivm, context_ptr, \
|
||||
texture_unit, _index, #_name, _emit_load ); \
|
||||
return draw_llvm_texture_member(base, gallivm, texture_unit, _index, #_name, _emit_load ); \
|
||||
}
|
||||
|
||||
|
||||
@@ -201,11 +203,9 @@ DRAW_LLVM_TEXTURE_MEMBER(mip_offsets, DRAW_JIT_TEXTURE_MIP_OFFSETS, FALSE)
|
||||
static LLVMValueRef \
|
||||
draw_llvm_sampler_##_name( const struct lp_sampler_dynamic_state *base, \
|
||||
struct gallivm_state *gallivm, \
|
||||
LLVMValueRef context_ptr, \
|
||||
unsigned sampler_unit) \
|
||||
{ \
|
||||
return draw_llvm_sampler_member(base, gallivm, context_ptr, \
|
||||
sampler_unit, _index, #_name, _emit_load ); \
|
||||
return draw_llvm_sampler_member(base, gallivm, sampler_unit, _index, #_name, _emit_load ); \
|
||||
}
|
||||
|
||||
|
||||
@@ -229,19 +229,36 @@ draw_llvm_sampler_soa_destroy(struct lp_build_sampler_soa *sampler)
|
||||
static void
|
||||
draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
|
||||
struct gallivm_state *gallivm,
|
||||
const struct lp_sampler_params *params)
|
||||
struct lp_type type,
|
||||
boolean is_fetch,
|
||||
unsigned texture_index,
|
||||
unsigned sampler_index,
|
||||
const LLVMValueRef *coords,
|
||||
const LLVMValueRef *offsets,
|
||||
const struct lp_derivatives *derivs,
|
||||
LLVMValueRef lod_bias, /* optional */
|
||||
LLVMValueRef explicit_lod, /* optional */
|
||||
enum lp_sampler_lod_property lod_property,
|
||||
LLVMValueRef *texel)
|
||||
{
|
||||
struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
|
||||
unsigned texture_index = params->texture_index;
|
||||
unsigned sampler_index = params->sampler_index;
|
||||
|
||||
assert(texture_index < PIPE_MAX_SHADER_SAMPLER_VIEWS);
|
||||
assert(sampler_index < PIPE_MAX_SAMPLERS);
|
||||
|
||||
lp_build_sample_soa(&sampler->dynamic_state.static_state[texture_index].texture_state,
|
||||
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.base,
|
||||
gallivm, params);
|
||||
type,
|
||||
is_fetch,
|
||||
texture_index,
|
||||
sampler_index,
|
||||
coords,
|
||||
offsets,
|
||||
derivs,
|
||||
lod_bias, explicit_lod, lod_property,
|
||||
texel);
|
||||
}
|
||||
|
||||
|
||||
@@ -254,7 +271,6 @@ draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
|
||||
struct lp_type type,
|
||||
unsigned texture_unit,
|
||||
unsigned target,
|
||||
LLVMValueRef context_ptr,
|
||||
boolean is_sviewinfo,
|
||||
enum lp_sampler_lod_property lod_property,
|
||||
LLVMValueRef explicit_lod, /* optional */
|
||||
@@ -270,7 +286,6 @@ draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
|
||||
type,
|
||||
texture_unit,
|
||||
target,
|
||||
context_ptr,
|
||||
is_sviewinfo,
|
||||
lod_property,
|
||||
explicit_lod,
|
||||
@@ -278,7 +293,8 @@ draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
|
||||
}
|
||||
|
||||
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 draw_sampler_static_state *static_state,
|
||||
LLVMValueRef context_ptr)
|
||||
{
|
||||
struct draw_llvm_sampler_soa *sampler;
|
||||
|
||||
@@ -287,7 +303,7 @@ draw_llvm_sampler_soa_create(const struct draw_sampler_static_state *static_stat
|
||||
return NULL;
|
||||
|
||||
sampler->base.destroy = draw_llvm_sampler_soa_destroy;
|
||||
sampler->base.emit_tex_sample = draw_llvm_sampler_soa_emit_fetch_texel;
|
||||
sampler->base.emit_fetch_texel = draw_llvm_sampler_soa_emit_fetch_texel;
|
||||
sampler->base.emit_size_query = draw_llvm_sampler_soa_emit_size_query;
|
||||
sampler->dynamic_state.base.width = draw_llvm_texture_width;
|
||||
sampler->dynamic_state.base.height = draw_llvm_texture_height;
|
||||
@@ -303,6 +319,7 @@ draw_llvm_sampler_soa_create(const struct draw_sampler_static_state *static_stat
|
||||
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.static_state = static_state;
|
||||
sampler->dynamic_state.context_ptr = context_ptr;
|
||||
|
||||
return &sampler->base;
|
||||
}
|
||||
|
@@ -113,11 +113,8 @@ draw_pt_emit_prepare(struct pt_emit *emit,
|
||||
emit->translate = translate_cache_find(emit->cache, &hw_key);
|
||||
}
|
||||
|
||||
if (!vinfo->size)
|
||||
*max_vertices = 0;
|
||||
else
|
||||
*max_vertices = (draw->render->max_vertex_buffer_bytes /
|
||||
(vinfo->size * 4));
|
||||
*max_vertices = (draw->render->max_vertex_buffer_bytes /
|
||||
(vinfo->size * 4));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -271,38 +271,30 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
|
||||
static void
|
||||
llvm_middle_end_bind_parameters(struct draw_pt_middle_end *middle)
|
||||
{
|
||||
static const float fake_const_buf[4];
|
||||
struct llvm_middle_end *fpme = llvm_middle_end(middle);
|
||||
struct draw_context *draw = fpme->draw;
|
||||
struct draw_llvm *llvm = fpme->llvm;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < Elements(llvm->jit_context.vs_constants); ++i) {
|
||||
for (i = 0; i < Elements(fpme->llvm->jit_context.vs_constants); ++i) {
|
||||
int num_consts =
|
||||
draw->pt.user.vs_constants_size[i] / (sizeof(float) * 4);
|
||||
llvm->jit_context.vs_constants[i] = draw->pt.user.vs_constants[i];
|
||||
llvm->jit_context.num_vs_constants[i] = num_consts;
|
||||
if (num_consts == 0) {
|
||||
llvm->jit_context.vs_constants[i] = fake_const_buf;
|
||||
}
|
||||
fpme->llvm->jit_context.vs_constants[i] = draw->pt.user.vs_constants[i];
|
||||
fpme->llvm->jit_context.num_vs_constants[i] = num_consts;
|
||||
}
|
||||
for (i = 0; i < Elements(llvm->gs_jit_context.constants); ++i) {
|
||||
for (i = 0; i < Elements(fpme->llvm->gs_jit_context.constants); ++i) {
|
||||
int num_consts =
|
||||
draw->pt.user.gs_constants_size[i] / (sizeof(float) * 4);
|
||||
llvm->gs_jit_context.constants[i] = draw->pt.user.gs_constants[i];
|
||||
llvm->gs_jit_context.num_constants[i] = num_consts;
|
||||
if (num_consts == 0) {
|
||||
llvm->gs_jit_context.constants[i] = fake_const_buf;
|
||||
}
|
||||
fpme->llvm->gs_jit_context.constants[i] = draw->pt.user.gs_constants[i];
|
||||
fpme->llvm->gs_jit_context.num_constants[i] = num_consts;
|
||||
}
|
||||
|
||||
llvm->jit_context.planes =
|
||||
fpme->llvm->jit_context.planes =
|
||||
(float (*)[DRAW_TOTAL_CLIP_PLANES][4]) draw->pt.user.planes[0];
|
||||
llvm->gs_jit_context.planes =
|
||||
fpme->llvm->gs_jit_context.planes =
|
||||
(float (*)[DRAW_TOTAL_CLIP_PLANES][4]) draw->pt.user.planes[0];
|
||||
|
||||
llvm->jit_context.viewports = draw->viewports;
|
||||
llvm->gs_jit_context.viewports = draw->viewports;
|
||||
fpme->llvm->jit_context.viewports = draw->viewports;
|
||||
fpme->llvm->gs_jit_context.viewports = draw->viewports;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1831,8 +1831,6 @@ lp_build_round_altivec(struct lp_build_context *bld,
|
||||
assert(lp_check_value(type, a));
|
||||
assert(util_cpu_caps.has_altivec);
|
||||
|
||||
(void)type;
|
||||
|
||||
switch (mode) {
|
||||
case LP_BUILD_ROUND_NEAREST:
|
||||
intrinsic = "llvm.ppc.altivec.vrfin";
|
||||
@@ -2540,6 +2538,7 @@ LLVMValueRef
|
||||
lp_build_rsqrt(struct lp_build_context *bld,
|
||||
LLVMValueRef a)
|
||||
{
|
||||
LLVMBuilderRef builder = bld->gallivm->builder;
|
||||
const struct lp_type type = bld->type;
|
||||
|
||||
assert(lp_check_value(type, a));
|
||||
@@ -2565,9 +2564,16 @@ lp_build_rsqrt(struct lp_build_context *bld,
|
||||
* All numbers smaller than FLT_MIN will result in +infinity
|
||||
* (rsqrtps treats all denormals as zero).
|
||||
*/
|
||||
/*
|
||||
* Certain non-c99 compilers don't know INFINITY and might not support
|
||||
* hacks to evaluate it at compile time neither.
|
||||
*/
|
||||
const unsigned posinf_int = 0x7F800000;
|
||||
LLVMValueRef cmp;
|
||||
LLVMValueRef flt_min = lp_build_const_vec(bld->gallivm, type, FLT_MIN);
|
||||
LLVMValueRef inf = lp_build_const_vec(bld->gallivm, type, INFINITY);
|
||||
LLVMValueRef inf = lp_build_const_int_vec(bld->gallivm, type, posinf_int);
|
||||
|
||||
inf = LLVMBuildBitCast(builder, inf, lp_build_vec_type(bld->gallivm, type), "");
|
||||
|
||||
for (i = 0; i < num_iterations; ++i) {
|
||||
res = lp_build_rsqrt_refine(bld, a, res);
|
||||
|
@@ -182,8 +182,6 @@ lp_build_shl(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b)
|
||||
assert(lp_check_value(type, a));
|
||||
assert(lp_check_value(type, b));
|
||||
|
||||
(void)type;
|
||||
|
||||
res = LLVMBuildShl(builder, a, b, "");
|
||||
|
||||
return res;
|
||||
|
@@ -256,13 +256,8 @@ disassemble(const void* func, llvm::raw_ostream & Out)
|
||||
}
|
||||
|
||||
|
||||
#if HAVE_LLVM >= 0x0307
|
||||
OwningPtr<MCInstPrinter> Printer(
|
||||
T->createMCInstPrinter(llvm::Triple(Triple), AsmPrinterVariant, *AsmInfo, *MII, *MRI));
|
||||
#else
|
||||
OwningPtr<MCInstPrinter> Printer(
|
||||
T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI));
|
||||
#endif
|
||||
if (!Printer) {
|
||||
Out << "error: no instruction printer for target " << Triple.c_str() << "\n";
|
||||
Out.flush();
|
||||
@@ -281,6 +276,12 @@ disassemble(const void* func, llvm::raw_ostream & Out)
|
||||
#endif
|
||||
OwningPtr<TargetMachine> TM(T->createTargetMachine(Triple, sys::getHostCPUName(), "", options));
|
||||
|
||||
#if HAVE_LLVM >= 0x0306
|
||||
const TargetInstrInfo *TII = TM->getSubtargetImpl()->getInstrInfo();
|
||||
#else
|
||||
const TargetInstrInfo *TII = TM->getInstrInfo();
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Wrap the data in a MemoryObject
|
||||
*/
|
||||
@@ -327,11 +328,7 @@ disassemble(const void* func, llvm::raw_ostream & Out)
|
||||
/*
|
||||
* Print the instruction.
|
||||
*/
|
||||
#if HAVE_LLVM >= 0x0307
|
||||
Printer->printInst(&Inst, Out, "", *STI);
|
||||
#else
|
||||
Printer->printInst(&Inst, Out, "");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Advance.
|
||||
@@ -339,7 +336,7 @@ disassemble(const void* func, llvm::raw_ostream & Out)
|
||||
|
||||
pc += Size;
|
||||
|
||||
const MCInstrDesc &TID = MII->get(Inst.getOpcode());
|
||||
const MCInstrDesc &TID = TII->get(Inst.getOpcode());
|
||||
|
||||
/*
|
||||
* Keep track of forward jumps to a nearby address.
|
||||
@@ -402,23 +399,19 @@ disassemble(const void* func, llvm::raw_ostream & Out)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (pc >= extent) {
|
||||
Out << "disassembly larger than " << extent << "bytes, aborting\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Out << "\n";
|
||||
Out.flush();
|
||||
|
||||
/*
|
||||
* Print GDB command, useful to verify output.
|
||||
*/
|
||||
|
||||
if (0) {
|
||||
_debug_printf("disassemble %p %p\n", bytes, bytes + pc);
|
||||
}
|
||||
|
||||
Out << "\n";
|
||||
Out.flush();
|
||||
|
||||
return pc;
|
||||
}
|
||||
|
||||
|
@@ -113,11 +113,6 @@ create_pass_manager(struct gallivm_state *gallivm)
|
||||
gallivm->passmgr = LLVMCreateFunctionPassManagerForModule(gallivm->module);
|
||||
if (!gallivm->passmgr)
|
||||
return FALSE;
|
||||
/*
|
||||
* TODO: some per module pass manager with IPO passes might be helpful -
|
||||
* the generated texture functions may benefit from inlining if they are
|
||||
* simple, or constant propagation into them, etc.
|
||||
*/
|
||||
|
||||
// Old versions of LLVM get the DataLayout from the pass manager.
|
||||
LLVMAddTargetData(gallivm->target, gallivm->passmgr);
|
||||
@@ -514,7 +509,7 @@ void
|
||||
gallivm_compile_module(struct gallivm_state *gallivm)
|
||||
{
|
||||
LLVMValueRef func;
|
||||
int64_t time_begin = 0;
|
||||
int64_t time_begin;
|
||||
|
||||
assert(!gallivm->compiled);
|
||||
|
||||
@@ -561,37 +556,6 @@ gallivm_compile_module(struct gallivm_state *gallivm)
|
||||
assert(gallivm->engine);
|
||||
|
||||
++gallivm->compiled;
|
||||
|
||||
if (gallivm_debug & GALLIVM_DEBUG_ASM) {
|
||||
LLVMValueRef llvm_func = LLVMGetFirstFunction(gallivm->module);
|
||||
|
||||
while (llvm_func) {
|
||||
/*
|
||||
* Need to filter out functions which don't have an implementation,
|
||||
* such as the intrinsics. May not be sufficient in case of IPO?
|
||||
* LLVMGetPointerToGlobal() will abort otherwise.
|
||||
*/
|
||||
if (!LLVMIsDeclaration(llvm_func)) {
|
||||
void *func_code = LLVMGetPointerToGlobal(gallivm->engine, llvm_func);
|
||||
lp_disassemble(llvm_func, func_code);
|
||||
}
|
||||
llvm_func = LLVMGetNextFunction(llvm_func);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(PROFILE)
|
||||
{
|
||||
LLVMValueRef llvm_func = LLVMGetFirstFunction(gallivm->module);
|
||||
|
||||
while (llvm_func) {
|
||||
if (!LLVMIsDeclaration(llvm_func)) {
|
||||
void *func_code = LLVMGetPointerToGlobal(gallivm->engine, llvm_func);
|
||||
lp_profile(llvm_func, func_code);
|
||||
}
|
||||
llvm_func = LLVMGetNextFunction(llvm_func);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -610,5 +574,13 @@ gallivm_jit_function(struct gallivm_state *gallivm,
|
||||
assert(code);
|
||||
jit_func = pointer_to_func(code);
|
||||
|
||||
if (gallivm_debug & GALLIVM_DEBUG_ASM) {
|
||||
lp_disassemble(func, code);
|
||||
}
|
||||
|
||||
#if defined(PROFILE)
|
||||
lp_profile(func, code);
|
||||
#endif
|
||||
|
||||
return jit_func;
|
||||
}
|
||||
|
@@ -127,9 +127,6 @@ gallivm_get_shader_param(enum pipe_shader_cap param)
|
||||
case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED:
|
||||
return 1;
|
||||
case PIPE_SHADER_CAP_DOUBLES:
|
||||
case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
|
||||
case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED:
|
||||
case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED:
|
||||
return 0;
|
||||
}
|
||||
/* if we get here, we missed a shader cap above (and should have seen
|
||||
|
@@ -493,7 +493,7 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
|
||||
builder.setMCPU(MCPU);
|
||||
#endif
|
||||
|
||||
ShaderMemoryManager *MM = NULL;
|
||||
ShaderMemoryManager *MM;
|
||||
if (useMCJIT) {
|
||||
#if HAVE_LLVM > 0x0303
|
||||
BaseMemoryManager* JMM = reinterpret_cast<BaseMemoryManager*>(CMM);
|
||||
@@ -502,7 +502,6 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
|
||||
|
||||
#if HAVE_LLVM >= 0x0306
|
||||
builder.setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager>(MM));
|
||||
MM = NULL; // ownership taken by std::unique_ptr
|
||||
#else
|
||||
builder.setMCJITMemoryManager(MM);
|
||||
#endif
|
||||
|
@@ -221,7 +221,7 @@ lp_build_rho(struct lp_build_sample_context *bld,
|
||||
struct lp_build_context *coord_bld = &bld->coord_bld;
|
||||
struct lp_build_context *rho_bld = &bld->lodf_bld;
|
||||
const unsigned dims = bld->dims;
|
||||
LLVMValueRef ddx_ddy[2] = {NULL};
|
||||
LLVMValueRef ddx_ddy[2];
|
||||
LLVMBuilderRef builder = bld->gallivm->builder;
|
||||
LLVMTypeRef i32t = LLVMInt32TypeInContext(bld->gallivm->context);
|
||||
LLVMValueRef index0 = LLVMConstInt(i32t, 0, 0);
|
||||
@@ -246,8 +246,8 @@ lp_build_rho(struct lp_build_sample_context *bld,
|
||||
* the messy cube maps for now) when requested.
|
||||
*/
|
||||
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state, bld->gallivm,
|
||||
bld->context_ptr, texture_unit);
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, texture_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, TRUE);
|
||||
float_size = lp_build_int_to_float(float_size_bld, int_size);
|
||||
@@ -714,7 +714,6 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
|
||||
|
||||
{
|
||||
LLVMBuilderRef builder = bld->gallivm->builder;
|
||||
struct lp_sampler_dynamic_state *dynamic_state = bld->dynamic_state;
|
||||
struct lp_build_context *lodf_bld = &bld->lodf_bld;
|
||||
LLVMValueRef lod;
|
||||
|
||||
@@ -745,8 +744,8 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
|
||||
* This is hit during mipmap generation.
|
||||
*/
|
||||
LLVMValueRef min_lod =
|
||||
dynamic_state->min_lod(dynamic_state, bld->gallivm,
|
||||
bld->context_ptr, sampler_unit);
|
||||
bld->dynamic_state->min_lod(bld->dynamic_state,
|
||||
bld->gallivm, sampler_unit);
|
||||
|
||||
lod = lp_build_broadcast_scalar(lodf_bld, min_lod);
|
||||
}
|
||||
@@ -836,8 +835,8 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
|
||||
/* add sampler lod bias */
|
||||
if (bld->static_sampler_state->lod_bias_non_zero) {
|
||||
LLVMValueRef sampler_lod_bias =
|
||||
dynamic_state->lod_bias(dynamic_state, bld->gallivm,
|
||||
bld->context_ptr, sampler_unit);
|
||||
bld->dynamic_state->lod_bias(bld->dynamic_state,
|
||||
bld->gallivm, sampler_unit);
|
||||
sampler_lod_bias = lp_build_broadcast_scalar(lodf_bld,
|
||||
sampler_lod_bias);
|
||||
lod = LLVMBuildFAdd(builder, lod, sampler_lod_bias, "sampler_lod_bias");
|
||||
@@ -846,16 +845,16 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
|
||||
/* clamp lod */
|
||||
if (bld->static_sampler_state->apply_max_lod) {
|
||||
LLVMValueRef max_lod =
|
||||
dynamic_state->max_lod(dynamic_state, bld->gallivm,
|
||||
bld->context_ptr, sampler_unit);
|
||||
bld->dynamic_state->max_lod(bld->dynamic_state,
|
||||
bld->gallivm, sampler_unit);
|
||||
max_lod = lp_build_broadcast_scalar(lodf_bld, max_lod);
|
||||
|
||||
lod = lp_build_min(lodf_bld, lod, max_lod);
|
||||
}
|
||||
if (bld->static_sampler_state->apply_min_lod) {
|
||||
LLVMValueRef min_lod =
|
||||
dynamic_state->min_lod(dynamic_state, bld->gallivm,
|
||||
bld->context_ptr, sampler_unit);
|
||||
bld->dynamic_state->min_lod(bld->dynamic_state,
|
||||
bld->gallivm, sampler_unit);
|
||||
min_lod = lp_build_broadcast_scalar(lodf_bld, min_lod);
|
||||
|
||||
lod = lp_build_max(lodf_bld, lod, min_lod);
|
||||
@@ -902,13 +901,12 @@ lp_build_nearest_mip_level(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef *out_of_bounds)
|
||||
{
|
||||
struct lp_build_context *leveli_bld = &bld->leveli_bld;
|
||||
struct lp_sampler_dynamic_state *dynamic_state = bld->dynamic_state;
|
||||
LLVMValueRef first_level, last_level, level;
|
||||
|
||||
first_level = dynamic_state->first_level(dynamic_state, bld->gallivm,
|
||||
bld->context_ptr, texture_unit);
|
||||
last_level = dynamic_state->last_level(dynamic_state, bld->gallivm,
|
||||
bld->context_ptr, texture_unit);
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, texture_unit);
|
||||
last_level = bld->dynamic_state->last_level(bld->dynamic_state,
|
||||
bld->gallivm, texture_unit);
|
||||
first_level = lp_build_broadcast_scalar(leveli_bld, first_level);
|
||||
last_level = lp_build_broadcast_scalar(leveli_bld, last_level);
|
||||
|
||||
@@ -958,7 +956,6 @@ lp_build_linear_mip_levels(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef *level1_out)
|
||||
{
|
||||
LLVMBuilderRef builder = bld->gallivm->builder;
|
||||
struct lp_sampler_dynamic_state *dynamic_state = bld->dynamic_state;
|
||||
struct lp_build_context *leveli_bld = &bld->leveli_bld;
|
||||
struct lp_build_context *levelf_bld = &bld->levelf_bld;
|
||||
LLVMValueRef first_level, last_level;
|
||||
@@ -967,10 +964,10 @@ lp_build_linear_mip_levels(struct lp_build_sample_context *bld,
|
||||
|
||||
assert(bld->num_lods == bld->num_mips);
|
||||
|
||||
first_level = dynamic_state->first_level(dynamic_state, bld->gallivm,
|
||||
bld->context_ptr, texture_unit);
|
||||
last_level = dynamic_state->last_level(dynamic_state, bld->gallivm,
|
||||
bld->context_ptr, texture_unit);
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, texture_unit);
|
||||
last_level = bld->dynamic_state->last_level(bld->dynamic_state,
|
||||
bld->gallivm, texture_unit);
|
||||
first_level = lp_build_broadcast_scalar(leveli_bld, first_level);
|
||||
last_level = lp_build_broadcast_scalar(leveli_bld, last_level);
|
||||
|
||||
|
@@ -68,45 +68,6 @@ enum lp_sampler_lod_property {
|
||||
};
|
||||
|
||||
|
||||
enum lp_sampler_lod_control {
|
||||
LP_SAMPLER_LOD_IMPLICIT,
|
||||
LP_SAMPLER_LOD_BIAS,
|
||||
LP_SAMPLER_LOD_EXPLICIT,
|
||||
LP_SAMPLER_LOD_DERIVATIVES,
|
||||
};
|
||||
|
||||
|
||||
enum lp_sampler_op_type {
|
||||
LP_SAMPLER_OP_TEXTURE,
|
||||
LP_SAMPLER_OP_FETCH,
|
||||
LP_SAMPLER_OP_GATHER
|
||||
};
|
||||
|
||||
|
||||
#define LP_SAMPLER_SHADOW (1 << 0)
|
||||
#define LP_SAMPLER_OFFSETS (1 << 1)
|
||||
#define LP_SAMPLER_OP_TYPE_SHIFT 2
|
||||
#define LP_SAMPLER_OP_TYPE_MASK (3 << 2)
|
||||
#define LP_SAMPLER_LOD_CONTROL_SHIFT 4
|
||||
#define LP_SAMPLER_LOD_CONTROL_MASK (3 << 4)
|
||||
#define LP_SAMPLER_LOD_PROPERTY_SHIFT 6
|
||||
#define LP_SAMPLER_LOD_PROPERTY_MASK (3 << 6)
|
||||
|
||||
struct lp_sampler_params
|
||||
{
|
||||
struct lp_type type;
|
||||
unsigned texture_index;
|
||||
unsigned sampler_index;
|
||||
unsigned sample_key;
|
||||
LLVMValueRef context_ptr;
|
||||
const LLVMValueRef *coords;
|
||||
const LLVMValueRef *offsets;
|
||||
LLVMValueRef lod;
|
||||
const struct lp_derivatives *derivs;
|
||||
LLVMValueRef *texel;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Texture static state.
|
||||
*
|
||||
@@ -177,96 +138,79 @@ struct lp_sampler_dynamic_state
|
||||
|
||||
/** Obtain the base texture width (or number of elements) (returns int32) */
|
||||
LLVMValueRef
|
||||
(*width)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned texture_unit);
|
||||
(*width)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
|
||||
/** Obtain the base texture height (returns int32) */
|
||||
LLVMValueRef
|
||||
(*height)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned texture_unit);
|
||||
(*height)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
|
||||
/** Obtain the base texture depth (or array size) (returns int32) */
|
||||
LLVMValueRef
|
||||
(*depth)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned texture_unit);
|
||||
(*depth)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
|
||||
/** Obtain the first mipmap level (base level) (returns int32) */
|
||||
LLVMValueRef
|
||||
(*first_level)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned texture_unit);
|
||||
(*first_level)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_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,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned texture_unit);
|
||||
(*last_level)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_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,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned texture_unit);
|
||||
(*row_stride)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
|
||||
/** Obtain stride in bytes between image slices (returns int32) */
|
||||
LLVMValueRef
|
||||
(*img_stride)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned texture_unit);
|
||||
(*img_stride)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
|
||||
/** Obtain pointer to base of texture */
|
||||
LLVMValueRef
|
||||
(*base_ptr)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned texture_unit);
|
||||
(*base_ptr)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
|
||||
/** Obtain pointer to array of mipmap offsets */
|
||||
LLVMValueRef
|
||||
(*mip_offsets)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned texture_unit);
|
||||
(*mip_offsets)( const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
unsigned texture_unit);
|
||||
|
||||
/* These are callbacks for sampler state */
|
||||
|
||||
/** Obtain texture min lod (returns float) */
|
||||
LLVMValueRef
|
||||
(*min_lod)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned sampler_unit);
|
||||
struct gallivm_state *gallivm, unsigned sampler_unit);
|
||||
|
||||
/** Obtain texture max lod (returns float) */
|
||||
LLVMValueRef
|
||||
(*max_lod)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned sampler_unit);
|
||||
struct gallivm_state *gallivm, unsigned sampler_unit);
|
||||
|
||||
/** Obtain texture lod bias (returns float) */
|
||||
LLVMValueRef
|
||||
(*lod_bias)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned sampler_unit);
|
||||
struct gallivm_state *gallivm, unsigned sampler_unit);
|
||||
|
||||
/** Obtain texture border color (returns ptr to float[4]) */
|
||||
LLVMValueRef
|
||||
(*border_color)(const struct lp_sampler_dynamic_state *state,
|
||||
struct gallivm_state *gallivm,
|
||||
LLVMValueRef context_ptr,
|
||||
unsigned sampler_unit);
|
||||
struct gallivm_state *gallivm, unsigned sampler_unit);
|
||||
};
|
||||
|
||||
|
||||
@@ -361,8 +305,6 @@ struct lp_build_sample_context
|
||||
LLVMValueRef int_size;
|
||||
|
||||
LLVMValueRef border_color_clamped;
|
||||
|
||||
LLVMValueRef context_ptr;
|
||||
};
|
||||
|
||||
|
||||
@@ -570,11 +512,21 @@ lp_build_sample_offset(struct lp_build_context *bld,
|
||||
|
||||
|
||||
void
|
||||
lp_build_sample_soa(const struct lp_static_texture_state *static_texture_state,
|
||||
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,
|
||||
struct gallivm_state *gallivm,
|
||||
const struct lp_sampler_params *params);
|
||||
struct lp_type fp_type,
|
||||
boolean is_fetch,
|
||||
unsigned texture_index,
|
||||
unsigned sampler_index,
|
||||
const LLVMValueRef *coords,
|
||||
const LLVMValueRef *offsets,
|
||||
const struct lp_derivatives *derivs,
|
||||
LLVMValueRef lod_bias,
|
||||
LLVMValueRef explicit_lod,
|
||||
enum lp_sampler_lod_property lod_property,
|
||||
LLVMValueRef texel_out[4]);
|
||||
|
||||
|
||||
void
|
||||
@@ -593,7 +545,6 @@ lp_build_size_query_soa(struct gallivm_state *gallivm,
|
||||
struct lp_type int_type,
|
||||
unsigned texture_unit,
|
||||
unsigned target,
|
||||
LLVMValueRef context_ptr,
|
||||
boolean is_sviewinfo,
|
||||
enum lp_sampler_lod_property lod_property,
|
||||
LLVMValueRef explicit_lod,
|
||||
|
@@ -840,7 +840,6 @@ lp_build_masklerp2d(struct lp_build_context *bld,
|
||||
*/
|
||||
static void
|
||||
lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
boolean is_gather,
|
||||
LLVMValueRef size,
|
||||
LLVMValueRef linear_mask,
|
||||
LLVMValueRef row_stride_vec,
|
||||
@@ -854,7 +853,6 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
LLVMBuilderRef builder = bld->gallivm->builder;
|
||||
struct lp_build_context *ivec_bld = &bld->int_coord_bld;
|
||||
struct lp_build_context *coord_bld = &bld->coord_bld;
|
||||
struct lp_build_context *texel_bld = &bld->texel_bld;
|
||||
const unsigned dims = bld->dims;
|
||||
LLVMValueRef width_vec;
|
||||
LLVMValueRef height_vec;
|
||||
@@ -877,16 +875,7 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
seamless_cube_filter = (bld->static_texture_state->target == PIPE_TEXTURE_CUBE ||
|
||||
bld->static_texture_state->target == PIPE_TEXTURE_CUBE_ARRAY) &&
|
||||
bld->static_sampler_state->seamless_cube_map;
|
||||
/*
|
||||
* XXX I don't know how this is really supposed to work with gather. From GL
|
||||
* spec wording (not gather specific) it sounds like the 4th missing texel
|
||||
* should be an average of the other 3, hence for gather could return this.
|
||||
* This is however NOT how the code here works, which just fixes up the
|
||||
* weights used for filtering instead. And of course for gather there is
|
||||
* no filter to tweak...
|
||||
*/
|
||||
accurate_cube_corners = ACCURATE_CUBE_CORNERS && seamless_cube_filter &&
|
||||
!is_gather;
|
||||
accurate_cube_corners = ACCURATE_CUBE_CORNERS && seamless_cube_filter;
|
||||
|
||||
lp_build_extract_image_sizes(bld,
|
||||
&bld->int_size_bld,
|
||||
@@ -1171,11 +1160,10 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
data_ptr, mipoffsets, neighbors[0][1]);
|
||||
|
||||
if (dims == 1) {
|
||||
assert(!is_gather);
|
||||
if (bld->static_sampler_state->compare_mode == PIPE_TEX_COMPARE_NONE) {
|
||||
/* Interpolate two samples from 1D image to produce one color */
|
||||
for (chan = 0; chan < 4; chan++) {
|
||||
colors_out[chan] = lp_build_lerp(texel_bld, s_fpart,
|
||||
colors_out[chan] = lp_build_lerp(&bld->texel_bld, s_fpart,
|
||||
neighbors[0][0][chan],
|
||||
neighbors[0][1][chan],
|
||||
0);
|
||||
@@ -1186,7 +1174,7 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
cmpval0 = lp_build_sample_comparefunc(bld, coords[4], neighbors[0][0][0]);
|
||||
cmpval1 = lp_build_sample_comparefunc(bld, coords[4], neighbors[0][1][0]);
|
||||
/* simplified lerp, AND mask with weight and add */
|
||||
colors_out[0] = lp_build_masklerp(texel_bld, s_fpart,
|
||||
colors_out[0] = lp_build_masklerp(&bld->texel_bld, s_fpart,
|
||||
cmpval0, cmpval1);
|
||||
colors_out[1] = colors_out[2] = colors_out[3] = colors_out[0];
|
||||
}
|
||||
@@ -1313,38 +1301,15 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
}
|
||||
|
||||
if (bld->static_sampler_state->compare_mode == PIPE_TEX_COMPARE_NONE) {
|
||||
if (is_gather) {
|
||||
/*
|
||||
* Just assign the red channel (no component selection yet).
|
||||
* This is a bit hackish, we usually do the swizzle at the
|
||||
* end of sampling (much less values to swizzle), but this
|
||||
* obviously cannot work when using gather.
|
||||
*/
|
||||
unsigned chan_swiz = bld->static_texture_state->swizzle_r;
|
||||
colors0[0] = lp_build_swizzle_soa_channel(texel_bld,
|
||||
neighbors[1][0],
|
||||
chan_swiz);
|
||||
colors0[1] = lp_build_swizzle_soa_channel(texel_bld,
|
||||
neighbors[1][1],
|
||||
chan_swiz);
|
||||
colors0[2] = lp_build_swizzle_soa_channel(texel_bld,
|
||||
neighbors[0][1],
|
||||
chan_swiz);
|
||||
colors0[3] = lp_build_swizzle_soa_channel(texel_bld,
|
||||
neighbors[0][0],
|
||||
chan_swiz);
|
||||
}
|
||||
else {
|
||||
/* Bilinear interpolate the four samples from the 2D image / 3D slice */
|
||||
for (chan = 0; chan < 4; chan++) {
|
||||
colors0[chan] = lp_build_lerp_2d(texel_bld,
|
||||
s_fpart, t_fpart,
|
||||
neighbors[0][0][chan],
|
||||
neighbors[0][1][chan],
|
||||
neighbors[1][0][chan],
|
||||
neighbors[1][1][chan],
|
||||
0);
|
||||
}
|
||||
/* Bilinear interpolate the four samples from the 2D image / 3D slice */
|
||||
for (chan = 0; chan < 4; chan++) {
|
||||
colors0[chan] = lp_build_lerp_2d(&bld->texel_bld,
|
||||
s_fpart, t_fpart,
|
||||
neighbors[0][0][chan],
|
||||
neighbors[0][1][chan],
|
||||
neighbors[1][0][chan],
|
||||
neighbors[1][1][chan],
|
||||
0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -1353,34 +1318,9 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
cmpval01 = lp_build_sample_comparefunc(bld, coords[4], neighbors[0][1][0]);
|
||||
cmpval10 = lp_build_sample_comparefunc(bld, coords[4], neighbors[1][0][0]);
|
||||
cmpval11 = lp_build_sample_comparefunc(bld, coords[4], neighbors[1][1][0]);
|
||||
|
||||
if (is_gather) {
|
||||
/* more hacks for swizzling, should be X, ONE or ZERO... */
|
||||
unsigned chan_swiz = bld->static_texture_state->swizzle_r;
|
||||
if (chan_swiz <= PIPE_SWIZZLE_ALPHA) {
|
||||
colors0[0] = lp_build_select(texel_bld, cmpval10,
|
||||
texel_bld->one, texel_bld->zero);
|
||||
colors0[1] = lp_build_select(texel_bld, cmpval11,
|
||||
texel_bld->one, texel_bld->zero);
|
||||
colors0[2] = lp_build_select(texel_bld, cmpval01,
|
||||
texel_bld->one, texel_bld->zero);
|
||||
colors0[3] = lp_build_select(texel_bld, cmpval00,
|
||||
texel_bld->one, texel_bld->zero);
|
||||
}
|
||||
else if (chan_swiz == PIPE_SWIZZLE_ZERO) {
|
||||
colors0[0] = colors0[1] = colors0[2] = colors0[3] =
|
||||
texel_bld->zero;
|
||||
}
|
||||
else {
|
||||
colors0[0] = colors0[1] = colors0[2] = colors0[3] =
|
||||
texel_bld->one;
|
||||
}
|
||||
}
|
||||
else {
|
||||
colors0[0] = lp_build_masklerp2d(texel_bld, s_fpart, t_fpart,
|
||||
cmpval00, cmpval01, cmpval10, cmpval11);
|
||||
colors0[1] = colors0[2] = colors0[3] = colors0[0];
|
||||
}
|
||||
colors0[0] = lp_build_masklerp2d(&bld->texel_bld, s_fpart, t_fpart,
|
||||
cmpval00, cmpval01, cmpval10, cmpval11);
|
||||
colors0[1] = colors0[2] = colors0[3] = colors0[0];
|
||||
}
|
||||
|
||||
if (accurate_cube_corners) {
|
||||
@@ -1401,8 +1341,6 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef neighbors1[2][2][4];
|
||||
LLVMValueRef colors1[4];
|
||||
|
||||
assert(!is_gather);
|
||||
|
||||
/* get x0/x1/y0/y1 texels at z1 */
|
||||
lp_build_sample_texel_soa(bld,
|
||||
width_vec, height_vec, depth_vec,
|
||||
@@ -1428,7 +1366,7 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
if (bld->static_sampler_state->compare_mode == PIPE_TEX_COMPARE_NONE) {
|
||||
/* Bilinear interpolate the four samples from the second Z slice */
|
||||
for (chan = 0; chan < 4; chan++) {
|
||||
colors1[chan] = lp_build_lerp_2d(texel_bld,
|
||||
colors1[chan] = lp_build_lerp_2d(&bld->texel_bld,
|
||||
s_fpart, t_fpart,
|
||||
neighbors1[0][0][chan],
|
||||
neighbors1[0][1][chan],
|
||||
@@ -1438,7 +1376,7 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
}
|
||||
/* Linearly interpolate the two samples from the two 3D slices */
|
||||
for (chan = 0; chan < 4; chan++) {
|
||||
colors_out[chan] = lp_build_lerp(texel_bld,
|
||||
colors_out[chan] = lp_build_lerp(&bld->texel_bld,
|
||||
r_fpart,
|
||||
colors0[chan], colors1[chan],
|
||||
0);
|
||||
@@ -1450,13 +1388,13 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
|
||||
cmpval01 = lp_build_sample_comparefunc(bld, coords[4], neighbors[0][1][0]);
|
||||
cmpval10 = lp_build_sample_comparefunc(bld, coords[4], neighbors[1][0][0]);
|
||||
cmpval11 = lp_build_sample_comparefunc(bld, coords[4], neighbors[1][1][0]);
|
||||
colors1[0] = lp_build_masklerp2d(texel_bld, s_fpart, t_fpart,
|
||||
colors1[0] = lp_build_masklerp2d(&bld->texel_bld, s_fpart, t_fpart,
|
||||
cmpval00, cmpval01, cmpval10, cmpval11);
|
||||
/* Linearly interpolate the two samples from the two 3D slices */
|
||||
colors_out[0] = lp_build_lerp(texel_bld,
|
||||
r_fpart,
|
||||
colors0[0], colors1[0],
|
||||
0);
|
||||
colors_out[0] = lp_build_lerp(&bld->texel_bld,
|
||||
r_fpart,
|
||||
colors0[0], colors1[0],
|
||||
0);
|
||||
colors_out[1] = colors_out[2] = colors_out[3] = colors_out[0];
|
||||
}
|
||||
}
|
||||
@@ -1480,7 +1418,6 @@ static void
|
||||
lp_build_sample_mipmap(struct lp_build_sample_context *bld,
|
||||
unsigned img_filter,
|
||||
unsigned mip_filter,
|
||||
boolean is_gather,
|
||||
LLVMValueRef *coords,
|
||||
const LLVMValueRef *offsets,
|
||||
LLVMValueRef ilevel0,
|
||||
@@ -1522,7 +1459,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, is_gather, size0, NULL,
|
||||
lp_build_sample_image_linear(bld, size0, NULL,
|
||||
row_stride0_vec, img_stride0_vec,
|
||||
data_ptr0, mipoff0, coords, offsets,
|
||||
colors0);
|
||||
@@ -1583,7 +1520,7 @@ lp_build_sample_mipmap(struct lp_build_sample_context *bld,
|
||||
colors1);
|
||||
}
|
||||
else {
|
||||
lp_build_sample_image_linear(bld, FALSE, size1, NULL,
|
||||
lp_build_sample_image_linear(bld, size1, NULL,
|
||||
row_stride1_vec, img_stride1_vec,
|
||||
data_ptr1, mipoff1, coords, offsets,
|
||||
colors1);
|
||||
@@ -1657,7 +1594,7 @@ lp_build_sample_mipmap_both(struct lp_build_sample_context *bld,
|
||||
mipoff0 = lp_build_get_mip_offsets(bld, ilevel0);
|
||||
}
|
||||
|
||||
lp_build_sample_image_linear(bld, FALSE, size0, linear_mask,
|
||||
lp_build_sample_image_linear(bld, size0, linear_mask,
|
||||
row_stride0_vec, img_stride0_vec,
|
||||
data_ptr0, mipoff0, coords, offsets,
|
||||
colors0);
|
||||
@@ -1701,7 +1638,7 @@ lp_build_sample_mipmap_both(struct lp_build_sample_context *bld,
|
||||
mipoff1 = lp_build_get_mip_offsets(bld, ilevel1);
|
||||
}
|
||||
|
||||
lp_build_sample_image_linear(bld, FALSE, size1, linear_mask,
|
||||
lp_build_sample_image_linear(bld, size1, linear_mask,
|
||||
row_stride1_vec, img_stride1_vec,
|
||||
data_ptr1, mipoff1, coords, offsets,
|
||||
colors1);
|
||||
@@ -1741,8 +1678,8 @@ lp_build_layer_coord(struct lp_build_sample_context *bld,
|
||||
LLVMValueRef num_layers;
|
||||
struct lp_build_context *int_coord_bld = &bld->int_coord_bld;
|
||||
|
||||
num_layers = bld->dynamic_state->depth(bld->dynamic_state, bld->gallivm,
|
||||
bld->context_ptr, texture_unit);
|
||||
num_layers = bld->dynamic_state->depth(bld->dynamic_state,
|
||||
bld->gallivm, texture_unit);
|
||||
|
||||
if (out_of_bounds) {
|
||||
LLVMValueRef out1, out;
|
||||
@@ -1878,8 +1815,7 @@ lp_build_sample_common(struct lp_build_sample_context *bld,
|
||||
case PIPE_TEX_MIPFILTER_NONE:
|
||||
/* always use mip level 0 */
|
||||
first_level = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, bld->context_ptr,
|
||||
texture_index);
|
||||
bld->gallivm, texture_index);
|
||||
first_level = lp_build_broadcast_scalar(&bld->leveli_bld, first_level);
|
||||
*ilevel0 = first_level;
|
||||
break;
|
||||
@@ -1904,8 +1840,8 @@ lp_build_clamp_border_color(struct lp_build_sample_context *bld,
|
||||
struct gallivm_state *gallivm = bld->gallivm;
|
||||
LLVMBuilderRef builder = gallivm->builder;
|
||||
LLVMValueRef border_color_ptr =
|
||||
bld->dynamic_state->border_color(bld->dynamic_state, gallivm,
|
||||
bld->context_ptr, sampler_unit);
|
||||
bld->dynamic_state->border_color(bld->dynamic_state,
|
||||
gallivm, sampler_unit);
|
||||
LLVMValueRef border_color;
|
||||
const struct util_format_description *format_desc = bld->format_desc;
|
||||
struct lp_type vec4_type = bld->texel_type;
|
||||
@@ -2124,7 +2060,6 @@ lp_build_clamp_border_color(struct lp_build_sample_context *bld,
|
||||
static void
|
||||
lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
unsigned sampler_unit,
|
||||
boolean is_gather,
|
||||
LLVMValueRef *coords,
|
||||
const LLVMValueRef *offsets,
|
||||
LLVMValueRef lod_positive,
|
||||
@@ -2169,7 +2104,6 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
if (min_filter == mag_filter) {
|
||||
/* no need to distinguish between minification and magnification */
|
||||
lp_build_sample_mipmap(bld, min_filter, mip_filter,
|
||||
is_gather,
|
||||
coords, offsets,
|
||||
ilevel0, ilevel1, lod_fpart,
|
||||
texels);
|
||||
@@ -2191,7 +2125,7 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
lp_build_if(&if_ctx, bld->gallivm, lod_positive);
|
||||
{
|
||||
/* Use the minification filter */
|
||||
lp_build_sample_mipmap(bld, min_filter, mip_filter, FALSE,
|
||||
lp_build_sample_mipmap(bld, min_filter, mip_filter,
|
||||
coords, offsets,
|
||||
ilevel0, ilevel1, lod_fpart,
|
||||
texels);
|
||||
@@ -2200,7 +2134,6 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
{
|
||||
/* Use the magnification filter */
|
||||
lp_build_sample_mipmap(bld, mag_filter, PIPE_TEX_MIPFILTER_NONE,
|
||||
FALSE,
|
||||
coords, offsets,
|
||||
ilevel0, NULL, NULL,
|
||||
texels);
|
||||
@@ -2253,7 +2186,7 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
|
||||
* All pixels require just nearest filtering, which is way
|
||||
* cheaper than linear, hence do a separate path for that.
|
||||
*/
|
||||
lp_build_sample_mipmap(bld, PIPE_TEX_FILTER_NEAREST, FALSE,
|
||||
lp_build_sample_mipmap(bld, PIPE_TEX_FILTER_NEAREST,
|
||||
mip_filter_for_nearest,
|
||||
coords, offsets,
|
||||
ilevel0, ilevel1, lod_fpart,
|
||||
@@ -2313,8 +2246,8 @@ lp_build_fetch_texel(struct lp_build_sample_context *bld,
|
||||
else {
|
||||
assert(bld->num_mips == 1);
|
||||
if (bld->static_texture_state->target != PIPE_BUFFER) {
|
||||
ilevel = bld->dynamic_state->first_level(bld->dynamic_state, bld->gallivm,
|
||||
bld->context_ptr, texture_unit);
|
||||
ilevel = bld->dynamic_state->first_level(bld->dynamic_state,
|
||||
bld->gallivm, texture_unit);
|
||||
}
|
||||
else {
|
||||
ilevel = lp_build_const_int32(bld->gallivm, 0);
|
||||
@@ -2423,28 +2356,29 @@ lp_build_sample_nop(struct gallivm_state *gallivm,
|
||||
|
||||
|
||||
/**
|
||||
* Build the actual texture sampling code.
|
||||
* Build texture sampling code.
|
||||
* 'texel' will return a vector of four LLVMValueRefs corresponding to
|
||||
* R, G, B, A.
|
||||
* \param type vector float type to use for coords, etc.
|
||||
* \param sample_key
|
||||
* \param is_fetch if this is a texel fetch instruction.
|
||||
* \param derivs partial derivatives of (s,t,r,q) with respect to x and y
|
||||
*/
|
||||
static void
|
||||
lp_build_sample_soa_code(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_state,
|
||||
struct lp_type type,
|
||||
unsigned sample_key,
|
||||
unsigned texture_index,
|
||||
unsigned sampler_index,
|
||||
LLVMValueRef context_ptr,
|
||||
const LLVMValueRef *coords,
|
||||
const LLVMValueRef *offsets,
|
||||
const struct lp_derivatives *derivs, /* optional */
|
||||
LLVMValueRef lod, /* optional */
|
||||
LLVMValueRef texel_out[4])
|
||||
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_state,
|
||||
struct lp_type type,
|
||||
boolean is_fetch,
|
||||
unsigned texture_index,
|
||||
unsigned sampler_index,
|
||||
const LLVMValueRef *coords,
|
||||
const LLVMValueRef *offsets,
|
||||
const struct lp_derivatives *derivs, /* optional */
|
||||
LLVMValueRef lod_bias, /* optional */
|
||||
LLVMValueRef explicit_lod, /* optional */
|
||||
enum lp_sampler_lod_property lod_property,
|
||||
LLVMValueRef texel_out[4])
|
||||
{
|
||||
unsigned target = static_texture_state->target;
|
||||
unsigned dims = texture_dims(target);
|
||||
@@ -2455,46 +2389,12 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
LLVMTypeRef i32t = LLVMInt32TypeInContext(gallivm->context);
|
||||
LLVMBuilderRef builder = gallivm->builder;
|
||||
LLVMValueRef tex_width, newcoords[5];
|
||||
enum lp_sampler_lod_property lod_property;
|
||||
enum lp_sampler_lod_control lod_control;
|
||||
enum lp_sampler_op_type op_type;
|
||||
LLVMValueRef lod_bias = NULL;
|
||||
LLVMValueRef explicit_lod = NULL;
|
||||
boolean op_is_tex;
|
||||
|
||||
if (0) {
|
||||
enum pipe_format fmt = static_texture_state->format;
|
||||
debug_printf("Sample from %s\n", util_format_name(fmt));
|
||||
}
|
||||
|
||||
lod_property = (sample_key & LP_SAMPLER_LOD_PROPERTY_MASK) >>
|
||||
LP_SAMPLER_LOD_PROPERTY_SHIFT;
|
||||
lod_control = (sample_key & LP_SAMPLER_LOD_CONTROL_MASK) >>
|
||||
LP_SAMPLER_LOD_CONTROL_SHIFT;
|
||||
op_type = (sample_key & LP_SAMPLER_OP_TYPE_MASK) >>
|
||||
LP_SAMPLER_OP_TYPE_SHIFT;
|
||||
|
||||
op_is_tex = op_type == LP_SAMPLER_OP_TEXTURE;
|
||||
|
||||
if (lod_control == LP_SAMPLER_LOD_BIAS) {
|
||||
lod_bias = lod;
|
||||
assert(lod);
|
||||
assert(derivs == NULL);
|
||||
}
|
||||
else if (lod_control == LP_SAMPLER_LOD_EXPLICIT) {
|
||||
explicit_lod = lod;
|
||||
assert(lod);
|
||||
assert(derivs == NULL);
|
||||
}
|
||||
else if (lod_control == LP_SAMPLER_LOD_DERIVATIVES) {
|
||||
assert(derivs);
|
||||
assert(lod == NULL);
|
||||
}
|
||||
else {
|
||||
assert(derivs == NULL);
|
||||
assert(lod == NULL);
|
||||
}
|
||||
|
||||
if (static_texture_state->format == PIPE_FORMAT_NONE) {
|
||||
/*
|
||||
* If there's nothing bound, format is NONE, and we must return
|
||||
@@ -2513,7 +2413,6 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
/* Setup our build context */
|
||||
memset(&bld, 0, sizeof bld);
|
||||
bld.gallivm = gallivm;
|
||||
bld.context_ptr = context_ptr;
|
||||
bld.static_sampler_state = &derived_sampler_state;
|
||||
bld.static_texture_state = static_texture_state;
|
||||
bld.dynamic_state = dynamic_state;
|
||||
@@ -2554,16 +2453,6 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
} else {
|
||||
derived_sampler_state.min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
|
||||
}
|
||||
if (op_type == LP_SAMPLER_OP_GATHER) {
|
||||
/*
|
||||
* gather4 is exactly like GL_LINEAR filtering but in the end skipping
|
||||
* the actual filtering. Using mostly the same paths, so cube face
|
||||
* selection, coord wrapping etc. all naturally uses the same code.
|
||||
*/
|
||||
derived_sampler_state.min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
|
||||
derived_sampler_state.min_img_filter = PIPE_TEX_FILTER_LINEAR;
|
||||
derived_sampler_state.mag_img_filter = PIPE_TEX_FILTER_LINEAR;
|
||||
}
|
||||
mip_filter = derived_sampler_state.min_mip_filter;
|
||||
|
||||
if (0) {
|
||||
@@ -2615,7 +2504,7 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
(gallivm_debug & GALLIVM_DEBUG_NO_RHO_APPROX) &&
|
||||
(static_texture_state->target == PIPE_TEXTURE_CUBE ||
|
||||
static_texture_state->target == PIPE_TEXTURE_CUBE_ARRAY) &&
|
||||
(op_is_tex && mip_filter != PIPE_TEX_MIPFILTER_NONE)) {
|
||||
(!is_fetch && mip_filter != PIPE_TEX_MIPFILTER_NONE)) {
|
||||
/*
|
||||
* special case for using per-pixel lod even for implicit lod,
|
||||
* which is generally never required (ok by APIs) except to please
|
||||
@@ -2629,23 +2518,23 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
}
|
||||
else if (lod_property == LP_SAMPLER_LOD_PER_ELEMENT ||
|
||||
(explicit_lod || lod_bias || derivs)) {
|
||||
if ((!op_is_tex && target != PIPE_BUFFER) ||
|
||||
(op_is_tex && mip_filter != PIPE_TEX_MIPFILTER_NONE)) {
|
||||
if ((is_fetch && target != PIPE_BUFFER) ||
|
||||
(!is_fetch && mip_filter != PIPE_TEX_MIPFILTER_NONE)) {
|
||||
bld.num_mips = type.length;
|
||||
bld.num_lods = type.length;
|
||||
}
|
||||
else if (op_is_tex && min_img_filter != mag_img_filter) {
|
||||
else if (!is_fetch && min_img_filter != mag_img_filter) {
|
||||
bld.num_mips = 1;
|
||||
bld.num_lods = type.length;
|
||||
}
|
||||
}
|
||||
/* TODO: for true scalar_lod should only use 1 lod value */
|
||||
else if ((!op_is_tex && explicit_lod && target != PIPE_BUFFER) ||
|
||||
(op_is_tex && mip_filter != PIPE_TEX_MIPFILTER_NONE)) {
|
||||
else if ((is_fetch && explicit_lod && target != PIPE_BUFFER) ||
|
||||
(!is_fetch && mip_filter != PIPE_TEX_MIPFILTER_NONE)) {
|
||||
bld.num_mips = num_quads;
|
||||
bld.num_lods = num_quads;
|
||||
}
|
||||
else if (op_is_tex && min_img_filter != mag_img_filter) {
|
||||
else if (!is_fetch && min_img_filter != mag_img_filter) {
|
||||
bld.num_mips = 1;
|
||||
bld.num_lods = num_quads;
|
||||
}
|
||||
@@ -2689,16 +2578,11 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
lp_build_context_init(&bld.lodi_bld, gallivm, bld.lodi_type);
|
||||
|
||||
/* Get the dynamic state */
|
||||
tex_width = dynamic_state->width(dynamic_state, gallivm,
|
||||
context_ptr, texture_index);
|
||||
bld.row_stride_array = dynamic_state->row_stride(dynamic_state, gallivm,
|
||||
context_ptr, texture_index);
|
||||
bld.img_stride_array = dynamic_state->img_stride(dynamic_state, gallivm,
|
||||
context_ptr, texture_index);
|
||||
bld.base_ptr = dynamic_state->base_ptr(dynamic_state, gallivm,
|
||||
context_ptr, texture_index);
|
||||
bld.mip_offsets = dynamic_state->mip_offsets(dynamic_state, gallivm,
|
||||
context_ptr, texture_index);
|
||||
tex_width = dynamic_state->width(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);
|
||||
/* Note that mip_offsets is an array[level] of offsets to texture images */
|
||||
|
||||
/* width, height, depth as single int vector */
|
||||
@@ -2707,22 +2591,17 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
}
|
||||
else {
|
||||
bld.int_size = LLVMBuildInsertElement(builder, bld.int_size_in_bld.undef,
|
||||
tex_width,
|
||||
LLVMConstInt(i32t, 0, 0), "");
|
||||
tex_width, LLVMConstInt(i32t, 0, 0), "");
|
||||
if (dims >= 2) {
|
||||
LLVMValueRef tex_height =
|
||||
dynamic_state->height(dynamic_state, gallivm,
|
||||
context_ptr, texture_index);
|
||||
dynamic_state->height(dynamic_state, gallivm, texture_index);
|
||||
bld.int_size = LLVMBuildInsertElement(builder, bld.int_size,
|
||||
tex_height,
|
||||
LLVMConstInt(i32t, 1, 0), "");
|
||||
tex_height, LLVMConstInt(i32t, 1, 0), "");
|
||||
if (dims >= 3) {
|
||||
LLVMValueRef tex_depth =
|
||||
dynamic_state->depth(dynamic_state, gallivm, context_ptr,
|
||||
texture_index);
|
||||
dynamic_state->depth(dynamic_state, gallivm, texture_index);
|
||||
bld.int_size = LLVMBuildInsertElement(builder, bld.int_size,
|
||||
tex_depth,
|
||||
LLVMConstInt(i32t, 2, 0), "");
|
||||
tex_depth, LLVMConstInt(i32t, 2, 0), "");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2739,9 +2618,9 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
texel_out);
|
||||
}
|
||||
|
||||
else if (op_type == LP_SAMPLER_OP_FETCH) {
|
||||
else if (is_fetch) {
|
||||
lp_build_fetch_texel(&bld, texture_index, newcoords,
|
||||
lod, offsets,
|
||||
explicit_lod, offsets,
|
||||
texel_out);
|
||||
}
|
||||
|
||||
@@ -2749,7 +2628,6 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
LLVMValueRef lod_fpart = NULL, lod_positive = NULL;
|
||||
LLVMValueRef ilevel0 = NULL, ilevel1 = NULL;
|
||||
boolean use_aos = util_format_fits_8unorm(bld.format_desc) &&
|
||||
op_is_tex &&
|
||||
/* not sure this is strictly needed or simply impossible */
|
||||
derived_sampler_state.compare_mode == PIPE_TEX_COMPARE_NONE &&
|
||||
lp_is_simple_wrap_mode(derived_sampler_state.wrap_s);
|
||||
@@ -2820,7 +2698,6 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
|
||||
else {
|
||||
lp_build_sample_general(&bld, sampler_index,
|
||||
op_type == LP_SAMPLER_OP_GATHER,
|
||||
newcoords, offsets,
|
||||
lod_positive, lod_fpart,
|
||||
ilevel0, ilevel1,
|
||||
@@ -2840,7 +2717,6 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
/* Setup our build context */
|
||||
memset(&bld4, 0, sizeof bld4);
|
||||
bld4.gallivm = bld.gallivm;
|
||||
bld4.context_ptr = bld.context_ptr;
|
||||
bld4.static_texture_state = bld.static_texture_state;
|
||||
bld4.static_sampler_state = bld.static_sampler_state;
|
||||
bld4.dynamic_state = bld.dynamic_state;
|
||||
@@ -2869,18 +2745,18 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
(gallivm_debug & GALLIVM_DEBUG_NO_RHO_APPROX) &&
|
||||
(static_texture_state->target == PIPE_TEXTURE_CUBE ||
|
||||
static_texture_state->target == PIPE_TEXTURE_CUBE_ARRAY) &&
|
||||
(op_is_tex && mip_filter != PIPE_TEX_MIPFILTER_NONE)) {
|
||||
(!is_fetch && mip_filter != PIPE_TEX_MIPFILTER_NONE)) {
|
||||
bld4.num_mips = type4.length;
|
||||
bld4.num_lods = type4.length;
|
||||
}
|
||||
if (lod_property == LP_SAMPLER_LOD_PER_ELEMENT &&
|
||||
(explicit_lod || lod_bias || derivs)) {
|
||||
if ((!op_is_tex && target != PIPE_BUFFER) ||
|
||||
(op_is_tex && mip_filter != PIPE_TEX_MIPFILTER_NONE)) {
|
||||
if ((is_fetch && target != PIPE_BUFFER) ||
|
||||
(!is_fetch && mip_filter != PIPE_TEX_MIPFILTER_NONE)) {
|
||||
bld4.num_mips = type4.length;
|
||||
bld4.num_lods = type4.length;
|
||||
}
|
||||
else if (op_is_tex && min_img_filter != mag_img_filter) {
|
||||
else if (!is_fetch && min_img_filter != mag_img_filter) {
|
||||
bld4.num_mips = 1;
|
||||
bld4.num_lods = type4.length;
|
||||
}
|
||||
@@ -2967,7 +2843,6 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
newcoords4[4] = lp_build_extract_range(gallivm, newcoords[4], 4*i, 4);
|
||||
|
||||
lp_build_sample_general(&bld4, sampler_index,
|
||||
op_type == LP_SAMPLER_OP_GATHER,
|
||||
newcoords4, offsets4,
|
||||
lod_positive4, lod_fpart4,
|
||||
ilevel04, ilevel14,
|
||||
@@ -2984,7 +2859,7 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
}
|
||||
}
|
||||
|
||||
if (target != PIPE_BUFFER && op_type != LP_SAMPLER_OP_GATHER) {
|
||||
if (target != PIPE_BUFFER) {
|
||||
apply_sampler_swizzle(&bld, texel_out);
|
||||
}
|
||||
|
||||
@@ -3001,366 +2876,6 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define USE_TEX_FUNC_CALL 1
|
||||
|
||||
#define LP_MAX_TEX_FUNC_ARGS 32
|
||||
|
||||
static inline void
|
||||
get_target_info(enum pipe_texture_target target,
|
||||
unsigned *num_coords, unsigned *num_derivs,
|
||||
unsigned *num_offsets, unsigned *layer)
|
||||
{
|
||||
unsigned dims = texture_dims(target);
|
||||
*num_coords = dims;
|
||||
*num_offsets = dims;
|
||||
*num_derivs = (target == PIPE_TEXTURE_CUBE ||
|
||||
target == PIPE_TEXTURE_CUBE_ARRAY) ? 3 : dims;
|
||||
*layer = has_layer_coord(target) ? 2: 0;
|
||||
if (target == PIPE_TEXTURE_CUBE_ARRAY) {
|
||||
/*
|
||||
* dims doesn't include r coord for cubes - this is handled
|
||||
* by layer instead, but need to fix up for cube arrays...
|
||||
*/
|
||||
*layer = 3;
|
||||
*num_coords = 3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate the function body for a texture sampling function.
|
||||
*/
|
||||
static void
|
||||
lp_build_sample_gen_func(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_state,
|
||||
struct lp_type type,
|
||||
unsigned texture_index,
|
||||
unsigned sampler_index,
|
||||
LLVMValueRef function,
|
||||
unsigned num_args,
|
||||
unsigned sample_key)
|
||||
{
|
||||
LLVMBuilderRef old_builder;
|
||||
LLVMBasicBlockRef block;
|
||||
LLVMValueRef coords[5];
|
||||
LLVMValueRef offsets[3] = { NULL };
|
||||
LLVMValueRef lod = NULL;
|
||||
LLVMValueRef context_ptr;
|
||||
LLVMValueRef texel_out[4];
|
||||
struct lp_derivatives derivs;
|
||||
struct lp_derivatives *deriv_ptr = NULL;
|
||||
unsigned num_param = 0;
|
||||
unsigned i, num_coords, num_derivs, num_offsets, layer;
|
||||
enum lp_sampler_lod_control lod_control;
|
||||
|
||||
lod_control = (sample_key & LP_SAMPLER_LOD_CONTROL_MASK) >>
|
||||
LP_SAMPLER_LOD_CONTROL_SHIFT;
|
||||
|
||||
get_target_info(static_texture_state->target,
|
||||
&num_coords, &num_derivs, &num_offsets, &layer);
|
||||
|
||||
/* "unpack" arguments */
|
||||
context_ptr = LLVMGetParam(function, num_param++);
|
||||
for (i = 0; i < num_coords; i++) {
|
||||
coords[i] = LLVMGetParam(function, num_param++);
|
||||
}
|
||||
for (i = num_coords; i < 5; i++) {
|
||||
/* This is rather unfortunate... */
|
||||
coords[i] = lp_build_undef(gallivm, type);
|
||||
}
|
||||
if (layer) {
|
||||
coords[layer] = LLVMGetParam(function, num_param++);
|
||||
}
|
||||
if (sample_key & LP_SAMPLER_SHADOW) {
|
||||
coords[4] = LLVMGetParam(function, num_param++);
|
||||
}
|
||||
if (sample_key & LP_SAMPLER_OFFSETS) {
|
||||
for (i = 0; i < num_offsets; i++) {
|
||||
offsets[i] = LLVMGetParam(function, num_param++);
|
||||
}
|
||||
}
|
||||
if (lod_control == LP_SAMPLER_LOD_BIAS ||
|
||||
lod_control == LP_SAMPLER_LOD_EXPLICIT) {
|
||||
lod = LLVMGetParam(function, num_param++);
|
||||
}
|
||||
else if (lod_control == LP_SAMPLER_LOD_DERIVATIVES) {
|
||||
for (i = 0; i < num_derivs; i++) {
|
||||
derivs.ddx[i] = LLVMGetParam(function, num_param++);
|
||||
derivs.ddy[i] = LLVMGetParam(function, num_param++);
|
||||
}
|
||||
deriv_ptr = &derivs;
|
||||
}
|
||||
|
||||
assert(num_args == num_param);
|
||||
|
||||
/*
|
||||
* Function body
|
||||
*/
|
||||
|
||||
old_builder = gallivm->builder;
|
||||
block = LLVMAppendBasicBlockInContext(gallivm->context, function, "entry");
|
||||
gallivm->builder = LLVMCreateBuilderInContext(gallivm->context);
|
||||
LLVMPositionBuilderAtEnd(gallivm->builder, block);
|
||||
|
||||
lp_build_sample_soa_code(gallivm,
|
||||
static_texture_state,
|
||||
static_sampler_state,
|
||||
dynamic_state,
|
||||
type,
|
||||
sample_key,
|
||||
texture_index,
|
||||
sampler_index,
|
||||
context_ptr,
|
||||
coords,
|
||||
offsets,
|
||||
deriv_ptr,
|
||||
lod,
|
||||
texel_out);
|
||||
|
||||
LLVMBuildAggregateRet(gallivm->builder, texel_out, 4);
|
||||
|
||||
LLVMDisposeBuilder(gallivm->builder);
|
||||
gallivm->builder = old_builder;
|
||||
|
||||
gallivm_verify_function(gallivm, function);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Call the matching function for texture sampling.
|
||||
* If there's no match, generate a new one.
|
||||
*/
|
||||
static void
|
||||
lp_build_sample_soa_func(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_state,
|
||||
const struct lp_sampler_params *params)
|
||||
{
|
||||
LLVMBuilderRef builder = gallivm->builder;
|
||||
LLVMModuleRef module = LLVMGetGlobalParent(LLVMGetBasicBlockParent(
|
||||
LLVMGetInsertBlock(builder)));
|
||||
LLVMValueRef function, inst;
|
||||
LLVMValueRef args[LP_MAX_TEX_FUNC_ARGS];
|
||||
LLVMBasicBlockRef bb;
|
||||
LLVMValueRef tex_ret;
|
||||
unsigned num_args = 0;
|
||||
char func_name[64];
|
||||
unsigned i, num_coords, num_derivs, num_offsets, layer;
|
||||
unsigned texture_index = params->texture_index;
|
||||
unsigned sampler_index = params->sampler_index;
|
||||
unsigned sample_key = params->sample_key;
|
||||
const LLVMValueRef *coords = params->coords;
|
||||
const LLVMValueRef *offsets = params->offsets;
|
||||
const struct lp_derivatives *derivs = params->derivs;
|
||||
enum lp_sampler_lod_control lod_control;
|
||||
|
||||
lod_control = (sample_key & LP_SAMPLER_LOD_CONTROL_MASK) >>
|
||||
LP_SAMPLER_LOD_CONTROL_SHIFT;
|
||||
|
||||
get_target_info(static_texture_state->target,
|
||||
&num_coords, &num_derivs, &num_offsets, &layer);
|
||||
|
||||
/*
|
||||
* texture function matches are found by name.
|
||||
* Thus the name has to include both the texture and sampler unit
|
||||
* (which covers all static state) plus the actual texture function
|
||||
* (including things like offsets, shadow coord, lod control).
|
||||
* Additionally lod_property has to be included too.
|
||||
*/
|
||||
|
||||
util_snprintf(func_name, sizeof(func_name), "texfunc_res_%d_sam_%d_%x",
|
||||
texture_index, sampler_index, sample_key);
|
||||
|
||||
function = LLVMGetNamedFunction(module, func_name);
|
||||
|
||||
if(!function) {
|
||||
LLVMTypeRef arg_types[LP_MAX_TEX_FUNC_ARGS];
|
||||
LLVMTypeRef ret_type;
|
||||
LLVMTypeRef function_type;
|
||||
LLVMTypeRef val_type[4];
|
||||
unsigned num_param = 0;
|
||||
|
||||
/*
|
||||
* Generate the function prototype.
|
||||
*/
|
||||
|
||||
arg_types[num_param++] = LLVMTypeOf(params->context_ptr);
|
||||
for (i = 0; i < num_coords; i++) {
|
||||
arg_types[num_param++] = LLVMTypeOf(coords[0]);
|
||||
assert(LLVMTypeOf(coords[0]) == LLVMTypeOf(coords[i]));
|
||||
}
|
||||
if (layer) {
|
||||
arg_types[num_param++] = LLVMTypeOf(coords[layer]);
|
||||
assert(LLVMTypeOf(coords[0]) == LLVMTypeOf(coords[layer]));
|
||||
}
|
||||
if (sample_key & LP_SAMPLER_SHADOW) {
|
||||
arg_types[num_param++] = LLVMTypeOf(coords[0]);
|
||||
}
|
||||
if (sample_key & LP_SAMPLER_OFFSETS) {
|
||||
for (i = 0; i < num_offsets; i++) {
|
||||
arg_types[num_param++] = LLVMTypeOf(offsets[0]);
|
||||
assert(LLVMTypeOf(offsets[0]) == LLVMTypeOf(offsets[i]));
|
||||
}
|
||||
}
|
||||
if (lod_control == LP_SAMPLER_LOD_BIAS ||
|
||||
lod_control == LP_SAMPLER_LOD_EXPLICIT) {
|
||||
arg_types[num_param++] = LLVMTypeOf(params->lod);
|
||||
}
|
||||
else if (lod_control == LP_SAMPLER_LOD_DERIVATIVES) {
|
||||
for (i = 0; i < num_derivs; i++) {
|
||||
arg_types[num_param++] = LLVMTypeOf(derivs->ddx[i]);
|
||||
arg_types[num_param++] = LLVMTypeOf(derivs->ddy[i]);
|
||||
assert(LLVMTypeOf(derivs->ddx[0]) == LLVMTypeOf(derivs->ddx[i]));
|
||||
assert(LLVMTypeOf(derivs->ddy[0]) == LLVMTypeOf(derivs->ddy[i]));
|
||||
}
|
||||
}
|
||||
|
||||
val_type[0] = val_type[1] = val_type[2] = val_type[3] =
|
||||
lp_build_vec_type(gallivm, params->type);
|
||||
ret_type = LLVMStructTypeInContext(gallivm->context, val_type, 4, 0);
|
||||
function_type = LLVMFunctionType(ret_type, arg_types, num_param, 0);
|
||||
function = LLVMAddFunction(module, func_name, function_type);
|
||||
|
||||
for (i = 0; i < num_param; ++i) {
|
||||
if(LLVMGetTypeKind(arg_types[i]) == LLVMPointerTypeKind) {
|
||||
LLVMAddAttribute(LLVMGetParam(function, i), LLVMNoAliasAttribute);
|
||||
}
|
||||
}
|
||||
|
||||
LLVMSetFunctionCallConv(function, LLVMFastCallConv);
|
||||
LLVMSetLinkage(function, LLVMPrivateLinkage);
|
||||
|
||||
lp_build_sample_gen_func(gallivm,
|
||||
static_texture_state,
|
||||
static_sampler_state,
|
||||
dynamic_state,
|
||||
params->type,
|
||||
texture_index,
|
||||
sampler_index,
|
||||
function,
|
||||
num_param,
|
||||
sample_key);
|
||||
}
|
||||
|
||||
num_args = 0;
|
||||
args[num_args++] = params->context_ptr;
|
||||
for (i = 0; i < num_coords; i++) {
|
||||
args[num_args++] = coords[i];
|
||||
}
|
||||
if (layer) {
|
||||
args[num_args++] = coords[layer];
|
||||
}
|
||||
if (sample_key & LP_SAMPLER_SHADOW) {
|
||||
args[num_args++] = coords[4];
|
||||
}
|
||||
if (sample_key & LP_SAMPLER_OFFSETS) {
|
||||
for (i = 0; i < num_offsets; i++) {
|
||||
args[num_args++] = offsets[i];
|
||||
}
|
||||
}
|
||||
if (lod_control == LP_SAMPLER_LOD_BIAS ||
|
||||
lod_control == LP_SAMPLER_LOD_EXPLICIT) {
|
||||
args[num_args++] = params->lod;
|
||||
}
|
||||
else if (lod_control == LP_SAMPLER_LOD_DERIVATIVES) {
|
||||
for (i = 0; i < num_derivs; i++) {
|
||||
args[num_args++] = derivs->ddx[i];
|
||||
args[num_args++] = derivs->ddy[i];
|
||||
}
|
||||
}
|
||||
|
||||
assert(num_args <= LP_MAX_TEX_FUNC_ARGS);
|
||||
|
||||
tex_ret = LLVMBuildCall(builder, function, args, num_args, "");
|
||||
bb = LLVMGetInsertBlock(builder);
|
||||
inst = LLVMGetLastInstruction(bb);
|
||||
LLVMSetInstructionCallConv(inst, LLVMFastCallConv);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
params->texel[i] = LLVMBuildExtractValue(gallivm->builder, tex_ret, i, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build texture sampling code.
|
||||
* Either via a function call or inline it directly.
|
||||
*/
|
||||
void
|
||||
lp_build_sample_soa(const struct lp_static_texture_state *static_texture_state,
|
||||
const struct lp_static_sampler_state *static_sampler_state,
|
||||
struct lp_sampler_dynamic_state *dynamic_state,
|
||||
struct gallivm_state *gallivm,
|
||||
const struct lp_sampler_params *params)
|
||||
{
|
||||
boolean use_tex_func = FALSE;
|
||||
|
||||
/*
|
||||
* Do not use a function call if the sampling is "simple enough".
|
||||
* We define this by
|
||||
* a) format
|
||||
* b) no mips (either one level only or no mip filter)
|
||||
* No mips will definitely make the code smaller, though
|
||||
* the format requirement is a bit iffy - there's some (SoA) formats
|
||||
* which definitely generate less code. This does happen to catch
|
||||
* some important cases though which are hurt quite a bit by using
|
||||
* a call (though not really because of the call overhead but because
|
||||
* they are reusing the same texture unit with some of the same
|
||||
* parameters).
|
||||
* Ideally we'd let llvm recognize this stuff by doing IPO passes.
|
||||
*/
|
||||
|
||||
if (USE_TEX_FUNC_CALL) {
|
||||
const struct util_format_description *format_desc;
|
||||
boolean simple_format;
|
||||
boolean simple_tex;
|
||||
enum lp_sampler_op_type op_type;
|
||||
format_desc = util_format_description(static_texture_state->format);
|
||||
simple_format = !format_desc ||
|
||||
(util_format_is_rgba8_variant(format_desc) &&
|
||||
format_desc->colorspace == UTIL_FORMAT_COLORSPACE_RGB);
|
||||
|
||||
op_type = (params->sample_key & LP_SAMPLER_OP_TYPE_MASK) >>
|
||||
LP_SAMPLER_OP_TYPE_SHIFT;
|
||||
simple_tex =
|
||||
op_type != LP_SAMPLER_OP_TEXTURE ||
|
||||
((static_sampler_state->min_mip_filter == PIPE_TEX_MIPFILTER_NONE ||
|
||||
static_texture_state->level_zero_only == TRUE) &&
|
||||
static_sampler_state->min_img_filter == static_sampler_state->mag_img_filter);
|
||||
|
||||
use_tex_func = format_desc && !(simple_format && simple_tex);
|
||||
}
|
||||
|
||||
if (use_tex_func) {
|
||||
lp_build_sample_soa_func(gallivm,
|
||||
static_texture_state,
|
||||
static_sampler_state,
|
||||
dynamic_state,
|
||||
params);
|
||||
}
|
||||
else {
|
||||
lp_build_sample_soa_code(gallivm,
|
||||
static_texture_state,
|
||||
static_sampler_state,
|
||||
dynamic_state,
|
||||
params->type,
|
||||
params->sample_key,
|
||||
params->texture_index,
|
||||
params->sampler_index,
|
||||
params->context_ptr,
|
||||
params->coords,
|
||||
params->offsets,
|
||||
params->derivs,
|
||||
params->lod,
|
||||
params->texel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
lp_build_size_query_soa(struct gallivm_state *gallivm,
|
||||
const struct lp_static_texture_state *static_state,
|
||||
@@ -3368,7 +2883,6 @@ lp_build_size_query_soa(struct gallivm_state *gallivm,
|
||||
struct lp_type int_type,
|
||||
unsigned texture_unit,
|
||||
unsigned target,
|
||||
LLVMValueRef context_ptr,
|
||||
boolean is_sviewinfo,
|
||||
enum lp_sampler_lod_property lod_property,
|
||||
LLVMValueRef explicit_lod,
|
||||
@@ -3440,10 +2954,8 @@ lp_build_size_query_soa(struct gallivm_state *gallivm,
|
||||
|
||||
if (explicit_lod) {
|
||||
/* FIXME: this needs to honor per-element lod */
|
||||
lod = LLVMBuildExtractElement(gallivm->builder, explicit_lod,
|
||||
lp_build_const_int32(gallivm, 0), "");
|
||||
first_level = dynamic_state->first_level(dynamic_state, gallivm,
|
||||
context_ptr, texture_unit);
|
||||
lod = LLVMBuildExtractElement(gallivm->builder, explicit_lod, lp_build_const_int32(gallivm, 0), "");
|
||||
first_level = dynamic_state->first_level(dynamic_state, gallivm, texture_unit);
|
||||
level = LLVMBuildAdd(gallivm->builder, lod, first_level, "level");
|
||||
lod = lp_build_broadcast_scalar(&bld_int_vec4, level);
|
||||
} else {
|
||||
@@ -3453,29 +2965,25 @@ lp_build_size_query_soa(struct gallivm_state *gallivm,
|
||||
size = bld_int_vec4.undef;
|
||||
|
||||
size = LLVMBuildInsertElement(gallivm->builder, size,
|
||||
dynamic_state->width(dynamic_state, gallivm,
|
||||
context_ptr, texture_unit),
|
||||
dynamic_state->width(dynamic_state, gallivm, texture_unit),
|
||||
lp_build_const_int32(gallivm, 0), "");
|
||||
|
||||
if (dims >= 2) {
|
||||
size = LLVMBuildInsertElement(gallivm->builder, size,
|
||||
dynamic_state->height(dynamic_state, gallivm,
|
||||
context_ptr, texture_unit),
|
||||
dynamic_state->height(dynamic_state, gallivm, texture_unit),
|
||||
lp_build_const_int32(gallivm, 1), "");
|
||||
}
|
||||
|
||||
if (dims >= 3) {
|
||||
size = LLVMBuildInsertElement(gallivm->builder, size,
|
||||
dynamic_state->depth(dynamic_state, gallivm,
|
||||
context_ptr, texture_unit),
|
||||
dynamic_state->depth(dynamic_state, gallivm, texture_unit),
|
||||
lp_build_const_int32(gallivm, 2), "");
|
||||
}
|
||||
|
||||
size = lp_build_minify(&bld_int_vec4, size, lod, TRUE);
|
||||
|
||||
if (has_array) {
|
||||
LLVMValueRef layers = dynamic_state->depth(dynamic_state, gallivm,
|
||||
context_ptr, texture_unit);
|
||||
LLVMValueRef layers = dynamic_state->depth(dynamic_state, gallivm, texture_unit);
|
||||
if (target == PIPE_TEXTURE_CUBE_ARRAY) {
|
||||
/*
|
||||
* It looks like GL wants number of cubes, d3d10.1 has it undefined?
|
||||
@@ -3500,8 +3008,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm,
|
||||
|
||||
/* everything is scalar for now */
|
||||
lp_build_context_init(&leveli_bld, gallivm, lp_type_int_vec(32, 32));
|
||||
last_level = dynamic_state->last_level(dynamic_state, gallivm,
|
||||
context_ptr, texture_unit);
|
||||
last_level = dynamic_state->last_level(dynamic_state, gallivm, texture_unit);
|
||||
|
||||
out = lp_build_cmp(&leveli_bld, PIPE_FUNC_LESS, level, first_level);
|
||||
out1 = lp_build_cmp(&leveli_bld, PIPE_FUNC_GREATER, level, last_level);
|
||||
@@ -3541,8 +3048,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm,
|
||||
else {
|
||||
LLVMValueRef last_level;
|
||||
|
||||
last_level = dynamic_state->last_level(dynamic_state, gallivm,
|
||||
context_ptr, texture_unit);
|
||||
last_level = dynamic_state->last_level(dynamic_state, gallivm, texture_unit);
|
||||
num_levels = lp_build_sub(&bld_int_scalar, last_level, first_level);
|
||||
num_levels = lp_build_add(&bld_int_scalar, num_levels, bld_int_scalar.one);
|
||||
}
|
||||
|
@@ -182,9 +182,19 @@ struct lp_build_sampler_soa
|
||||
(*destroy)( struct lp_build_sampler_soa *sampler );
|
||||
|
||||
void
|
||||
(*emit_tex_sample)(const struct lp_build_sampler_soa *sampler,
|
||||
struct gallivm_state *gallivm,
|
||||
const struct lp_sampler_params *params);
|
||||
(*emit_fetch_texel)( const struct lp_build_sampler_soa *sampler,
|
||||
struct gallivm_state *gallivm,
|
||||
struct lp_type type,
|
||||
boolean is_fetch,
|
||||
unsigned texture_index,
|
||||
unsigned sampler_index,
|
||||
const LLVMValueRef *coords,
|
||||
const LLVMValueRef *offsets,
|
||||
const struct lp_derivatives *derivs,
|
||||
LLVMValueRef lod_bias, /* optional */
|
||||
LLVMValueRef explicit_lod, /* optional */
|
||||
enum lp_sampler_lod_property,
|
||||
LLVMValueRef *texel);
|
||||
|
||||
void
|
||||
(*emit_size_query)( const struct lp_build_sampler_soa *sampler,
|
||||
@@ -192,7 +202,6 @@ struct lp_build_sampler_soa
|
||||
struct lp_type type,
|
||||
unsigned unit,
|
||||
unsigned target,
|
||||
LLVMValueRef context_ptr,
|
||||
boolean need_nr_mips,
|
||||
enum lp_sampler_lod_property,
|
||||
LLVMValueRef explicit_lod, /* optional */
|
||||
@@ -228,7 +237,6 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm,
|
||||
const struct lp_bld_tgsi_system_values *system_values,
|
||||
const LLVMValueRef (*inputs)[4],
|
||||
LLVMValueRef (*outputs)[4],
|
||||
LLVMValueRef context_ptr,
|
||||
struct lp_build_sampler_soa *sampler,
|
||||
const struct tgsi_shader_info *info,
|
||||
const struct lp_build_tgsi_gs_iface *gs_iface);
|
||||
@@ -441,7 +449,6 @@ struct lp_build_tgsi_soa_context
|
||||
LLVMValueRef consts_sizes[LP_MAX_TGSI_CONST_BUFFERS];
|
||||
const LLVMValueRef (*inputs)[TGSI_NUM_CHANNELS];
|
||||
LLVMValueRef (*outputs)[TGSI_NUM_CHANNELS];
|
||||
LLVMValueRef context_ptr;
|
||||
|
||||
const struct lp_build_sampler_soa *sampler;
|
||||
|
||||
|
@@ -944,38 +944,20 @@ gather_outputs(struct lp_build_tgsi_soa_context * bld)
|
||||
* with a little work.
|
||||
*/
|
||||
static LLVMValueRef
|
||||
build_gather(struct lp_build_tgsi_context *bld_base,
|
||||
build_gather(struct lp_build_context *bld,
|
||||
LLVMValueRef base_ptr,
|
||||
LLVMValueRef indexes,
|
||||
LLVMValueRef overflow_mask)
|
||||
LLVMValueRef *overflow_mask)
|
||||
{
|
||||
struct gallivm_state *gallivm = bld_base->base.gallivm;
|
||||
LLVMBuilderRef builder = gallivm->builder;
|
||||
struct lp_build_context *uint_bld = &bld_base->uint_bld;
|
||||
struct lp_build_context *bld = &bld_base->base;
|
||||
LLVMBuilderRef builder = bld->gallivm->builder;
|
||||
LLVMValueRef res = bld->undef;
|
||||
unsigned i;
|
||||
|
||||
/*
|
||||
* overflow_mask is a vector telling us which channels
|
||||
* in the vector overflowed. We use the overflow behavior for
|
||||
* constant buffers which is defined as:
|
||||
* Out of bounds access to constant buffer returns 0 in all
|
||||
* components. Out of bounds behavior is always with respect
|
||||
* to the size of the buffer bound at that slot.
|
||||
*/
|
||||
LLVMValueRef temp_ptr = NULL;
|
||||
|
||||
if (overflow_mask) {
|
||||
/*
|
||||
* We avoid per-element control flow here (also due to llvm going crazy,
|
||||
* though I suspect it's better anyway since overflow is likely rare).
|
||||
* Note that since we still fetch from buffers even if num_elements was
|
||||
* zero (in this case we'll fetch from index zero) the jit func callers
|
||||
* MUST provide valid fake constant buffers of size 4x32 (the values do
|
||||
* not matter), otherwise we'd still need (not per element though)
|
||||
* control flow.
|
||||
*/
|
||||
indexes = lp_build_select(uint_bld, overflow_mask, uint_bld->zero, indexes);
|
||||
temp_ptr = lp_build_alloca(
|
||||
bld->gallivm,
|
||||
lp_build_vec_type(bld->gallivm, bld->type), "");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -986,16 +968,53 @@ build_gather(struct lp_build_tgsi_context *bld_base,
|
||||
LLVMValueRef index = LLVMBuildExtractElement(builder,
|
||||
indexes, ii, "");
|
||||
LLVMValueRef scalar_ptr, scalar;
|
||||
LLVMValueRef overflow;
|
||||
struct lp_build_if_state if_ctx;
|
||||
|
||||
scalar_ptr = LLVMBuildGEP(builder, base_ptr,
|
||||
&index, 1, "gather_ptr");
|
||||
scalar = LLVMBuildLoad(builder, scalar_ptr, "");
|
||||
/*
|
||||
* overflow_mask is a boolean vector telling us which channels
|
||||
* in the vector overflowed. We use the overflow behavior for
|
||||
* constant buffers which is defined as:
|
||||
* Out of bounds access to constant buffer returns 0 in all
|
||||
* componenets. Out of bounds behavior is always with respect
|
||||
* to the size of the buffer bound at that slot.
|
||||
*/
|
||||
if (overflow_mask) {
|
||||
overflow = LLVMBuildExtractElement(builder, *overflow_mask,
|
||||
ii, "");
|
||||
lp_build_if(&if_ctx, bld->gallivm, overflow);
|
||||
{
|
||||
LLVMValueRef val = LLVMBuildLoad(builder, temp_ptr, "");
|
||||
val = LLVMBuildInsertElement(
|
||||
builder, val,
|
||||
LLVMConstNull(LLVMFloatTypeInContext(bld->gallivm->context)),
|
||||
ii, "");
|
||||
LLVMBuildStore(builder, val, temp_ptr);
|
||||
}
|
||||
lp_build_else(&if_ctx);
|
||||
{
|
||||
LLVMValueRef val = LLVMBuildLoad(builder, temp_ptr, "");
|
||||
|
||||
res = LLVMBuildInsertElement(builder, res, scalar, ii, "");
|
||||
scalar_ptr = LLVMBuildGEP(builder, base_ptr,
|
||||
&index, 1, "gather_ptr");
|
||||
scalar = LLVMBuildLoad(builder, scalar_ptr, "");
|
||||
|
||||
val = LLVMBuildInsertElement(builder, val, scalar, ii, "");
|
||||
|
||||
LLVMBuildStore(builder, val, temp_ptr);
|
||||
}
|
||||
lp_build_endif(&if_ctx);
|
||||
} else {
|
||||
scalar_ptr = LLVMBuildGEP(builder, base_ptr,
|
||||
&index, 1, "gather_ptr");
|
||||
scalar = LLVMBuildLoad(builder, scalar_ptr, "");
|
||||
|
||||
res = LLVMBuildInsertElement(builder, res, scalar, ii, "");
|
||||
}
|
||||
}
|
||||
|
||||
if (overflow_mask) {
|
||||
res = lp_build_select(bld, overflow_mask, bld->zero, res);
|
||||
res = LLVMBuildLoad(builder, temp_ptr, "gather_val");
|
||||
}
|
||||
|
||||
return res;
|
||||
@@ -1228,15 +1247,17 @@ emit_fetch_constant(
|
||||
num_consts = lp_build_broadcast_scalar(uint_bld, num_consts);
|
||||
/* Construct a boolean vector telling us which channels
|
||||
* overflow the bound constant buffer */
|
||||
overflow_mask = lp_build_compare(gallivm, uint_bld->type, PIPE_FUNC_GEQUAL,
|
||||
indirect_index, num_consts);
|
||||
overflow_mask = LLVMBuildICmp(builder, LLVMIntUGE,
|
||||
indirect_index,
|
||||
num_consts, "");
|
||||
|
||||
/* index_vec = indirect_index * 4 + swizzle */
|
||||
index_vec = lp_build_shl_imm(uint_bld, indirect_index, 2);
|
||||
index_vec = lp_build_add(uint_bld, index_vec, swizzle_vec);
|
||||
|
||||
/* Gather values from the constant buffer */
|
||||
res = build_gather(bld_base, consts_ptr, index_vec, overflow_mask);
|
||||
res = build_gather(&bld_base->base, consts_ptr, index_vec,
|
||||
&overflow_mask);
|
||||
}
|
||||
else {
|
||||
LLVMValueRef index; /* index into the const buffer */
|
||||
@@ -1298,7 +1319,7 @@ emit_fetch_immediate(
|
||||
FALSE);
|
||||
|
||||
/* Gather values from the immediate register array */
|
||||
res = build_gather(bld_base, imms_array, index_vec, NULL);
|
||||
res = build_gather(&bld_base->base, imms_array, index_vec, NULL);
|
||||
} else {
|
||||
LLVMValueRef lindex = lp_build_const_int32(gallivm,
|
||||
reg->Register.Index * 4 + swizzle);
|
||||
@@ -1352,7 +1373,7 @@ emit_fetch_input(
|
||||
inputs_array = LLVMBuildBitCast(builder, bld->inputs_array, fptr_type, "");
|
||||
|
||||
/* Gather values from the input register array */
|
||||
res = build_gather(bld_base, inputs_array, index_vec, NULL);
|
||||
res = build_gather(&bld_base->base, inputs_array, index_vec, NULL);
|
||||
} else {
|
||||
if (bld->indirect_files & (1 << TGSI_FILE_INPUT)) {
|
||||
LLVMValueRef lindex = lp_build_const_int32(gallivm,
|
||||
@@ -1474,7 +1495,7 @@ emit_fetch_temporary(
|
||||
temps_array = LLVMBuildBitCast(builder, bld->temps_array, fptr_type, "");
|
||||
|
||||
/* Gather values from the temporary register array */
|
||||
res = build_gather(bld_base, temps_array, index_vec, NULL);
|
||||
res = build_gather(&bld_base->base, temps_array, index_vec, NULL);
|
||||
}
|
||||
else {
|
||||
LLVMValueRef temp_ptr;
|
||||
@@ -1940,23 +1961,19 @@ emit_tex( struct lp_build_tgsi_soa_context *bld,
|
||||
const struct tgsi_full_instruction *inst,
|
||||
enum lp_build_tex_modifier modifier,
|
||||
LLVMValueRef *texel,
|
||||
unsigned sampler_reg,
|
||||
enum lp_sampler_op_type sampler_op)
|
||||
unsigned sampler_reg)
|
||||
{
|
||||
unsigned unit = inst->Src[sampler_reg].Register.Index;
|
||||
LLVMValueRef lod_bias, explicit_lod;
|
||||
LLVMValueRef oow = NULL;
|
||||
LLVMValueRef lod = NULL;
|
||||
LLVMValueRef coords[5];
|
||||
LLVMValueRef offsets[3] = { NULL };
|
||||
struct lp_derivatives derivs;
|
||||
struct lp_sampler_params params;
|
||||
struct lp_derivatives *deriv_ptr = NULL;
|
||||
enum lp_sampler_lod_property lod_property = LP_SAMPLER_LOD_SCALAR;
|
||||
unsigned num_derivs, num_offsets, i;
|
||||
unsigned shadow_coord = 0;
|
||||
unsigned layer_coord = 0;
|
||||
unsigned sample_key = sampler_op << LP_SAMPLER_OP_TYPE_SHIFT;
|
||||
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
|
||||
if (!bld->sampler) {
|
||||
_debug_printf("warning: found texture instruction but no sampler generator supplied\n");
|
||||
@@ -2036,6 +2053,7 @@ emit_tex( struct lp_build_tgsi_soa_context *bld,
|
||||
/* Note lod and especially projected are illegal in a LOT of cases */
|
||||
if (modifier == LP_BLD_TEX_MODIFIER_LOD_BIAS ||
|
||||
modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_LOD) {
|
||||
LLVMValueRef lod;
|
||||
if (inst->Texture.Texture == TGSI_TEXTURE_SHADOWCUBE ||
|
||||
inst->Texture.Texture == TGSI_TEXTURE_CUBE_ARRAY) {
|
||||
/* note that shadow cube array with bias/explicit lod does not exist */
|
||||
@@ -2045,13 +2063,19 @@ emit_tex( struct lp_build_tgsi_soa_context *bld,
|
||||
lod = lp_build_emit_fetch(&bld->bld_base, inst, 0, 3);
|
||||
}
|
||||
if (modifier == LP_BLD_TEX_MODIFIER_LOD_BIAS) {
|
||||
sample_key |= LP_SAMPLER_LOD_BIAS << LP_SAMPLER_LOD_CONTROL_SHIFT;
|
||||
lod_bias = lod;
|
||||
explicit_lod = NULL;
|
||||
}
|
||||
else if (modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_LOD) {
|
||||
sample_key |= LP_SAMPLER_LOD_EXPLICIT << LP_SAMPLER_LOD_CONTROL_SHIFT;
|
||||
lod_bias = NULL;
|
||||
explicit_lod = lod;
|
||||
}
|
||||
lod_property = lp_build_lod_property(&bld->bld_base, inst, 0);
|
||||
}
|
||||
else {
|
||||
lod_bias = NULL;
|
||||
explicit_lod = NULL;
|
||||
}
|
||||
|
||||
if (modifier == LP_BLD_TEX_MODIFIER_PROJECTED) {
|
||||
oow = lp_build_emit_fetch(&bld->bld_base, inst, 0, 3);
|
||||
@@ -2080,7 +2104,6 @@ emit_tex( struct lp_build_tgsi_soa_context *bld,
|
||||
}
|
||||
/* Shadow coord occupies always 5th slot. */
|
||||
if (shadow_coord) {
|
||||
sample_key |= LP_SAMPLER_SHADOW;
|
||||
if (shadow_coord == 4) {
|
||||
coords[4] = lp_build_emit_fetch(&bld->bld_base, inst, 1, 0);
|
||||
}
|
||||
@@ -2093,12 +2116,11 @@ emit_tex( struct lp_build_tgsi_soa_context *bld,
|
||||
|
||||
if (modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_DERIV) {
|
||||
unsigned dim;
|
||||
sample_key |= LP_SAMPLER_LOD_DERIVATIVES << LP_SAMPLER_LOD_CONTROL_SHIFT;
|
||||
for (dim = 0; dim < num_derivs; ++dim) {
|
||||
derivs.ddx[dim] = lp_build_emit_fetch(&bld->bld_base, inst, 1, dim);
|
||||
derivs.ddy[dim] = lp_build_emit_fetch(&bld->bld_base, inst, 2, dim);
|
||||
}
|
||||
params.derivs = &derivs;
|
||||
deriv_ptr = &derivs;
|
||||
/*
|
||||
* could also check all src regs if constant but I doubt such
|
||||
* cases exist in practice.
|
||||
@@ -2115,30 +2137,25 @@ emit_tex( struct lp_build_tgsi_soa_context *bld,
|
||||
lod_property = LP_SAMPLER_LOD_PER_ELEMENT;
|
||||
}
|
||||
}
|
||||
sample_key |= lod_property << LP_SAMPLER_LOD_PROPERTY_SHIFT;
|
||||
|
||||
/* we don't handle the 4 offset version of tg4 */
|
||||
/* some advanced gather instructions (txgo) would require 4 offsets */
|
||||
if (inst->Texture.NumOffsets == 1) {
|
||||
unsigned dim;
|
||||
sample_key |= LP_SAMPLER_OFFSETS;
|
||||
for (dim = 0; dim < num_offsets; dim++) {
|
||||
offsets[dim] = lp_build_emit_fetch_texoffset(&bld->bld_base, inst, 0, dim);
|
||||
}
|
||||
}
|
||||
|
||||
params.type = bld->bld_base.base.type;
|
||||
params.sample_key = sample_key;
|
||||
params.texture_index = unit;
|
||||
params.sampler_index = unit;
|
||||
params.context_ptr = bld->context_ptr;
|
||||
params.coords = coords;
|
||||
params.offsets = offsets;
|
||||
params.lod = lod;
|
||||
params.texel = texel;
|
||||
|
||||
bld->sampler->emit_tex_sample(bld->sampler,
|
||||
bld->bld_base.base.gallivm,
|
||||
¶ms);
|
||||
bld->sampler->emit_fetch_texel(bld->sampler,
|
||||
bld->bld_base.base.gallivm,
|
||||
bld->bld_base.base.type,
|
||||
FALSE,
|
||||
unit, unit,
|
||||
coords,
|
||||
offsets,
|
||||
deriv_ptr,
|
||||
lod_bias, explicit_lod, lod_property,
|
||||
texel);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2150,18 +2167,15 @@ emit_sample(struct lp_build_tgsi_soa_context *bld,
|
||||
{
|
||||
struct gallivm_state *gallivm = bld->bld_base.base.gallivm;
|
||||
unsigned texture_unit, sampler_unit;
|
||||
LLVMValueRef lod = NULL;
|
||||
LLVMValueRef lod_bias, explicit_lod;
|
||||
LLVMValueRef coords[5];
|
||||
LLVMValueRef offsets[3] = { NULL };
|
||||
struct lp_derivatives derivs;
|
||||
struct lp_sampler_params params;
|
||||
struct lp_derivatives *deriv_ptr = NULL;
|
||||
enum lp_sampler_lod_property lod_property = LP_SAMPLER_LOD_SCALAR;
|
||||
|
||||
unsigned num_offsets, num_derivs, i;
|
||||
unsigned layer_coord = 0;
|
||||
unsigned sample_key = LP_SAMPLER_OP_TEXTURE << LP_SAMPLER_OP_TYPE_SHIFT;
|
||||
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
|
||||
if (!bld->sampler) {
|
||||
_debug_printf("warning: found texture instruction but no sampler generator supplied\n");
|
||||
@@ -2223,19 +2237,25 @@ emit_sample(struct lp_build_tgsi_soa_context *bld,
|
||||
|
||||
if (modifier == LP_BLD_TEX_MODIFIER_LOD_BIAS ||
|
||||
modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_LOD) {
|
||||
lod = lp_build_emit_fetch(&bld->bld_base, inst, 3, 0);
|
||||
LLVMValueRef lod = lp_build_emit_fetch(&bld->bld_base, inst, 3, 0);
|
||||
if (modifier == LP_BLD_TEX_MODIFIER_LOD_BIAS) {
|
||||
sample_key |= LP_SAMPLER_LOD_BIAS << LP_SAMPLER_LOD_CONTROL_SHIFT;
|
||||
lod_bias = lod;
|
||||
explicit_lod = NULL;
|
||||
}
|
||||
else if (modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_LOD) {
|
||||
sample_key |= LP_SAMPLER_LOD_EXPLICIT << LP_SAMPLER_LOD_CONTROL_SHIFT;
|
||||
lod_bias = NULL;
|
||||
explicit_lod = lod;
|
||||
}
|
||||
lod_property = lp_build_lod_property(&bld->bld_base, inst, 0);
|
||||
}
|
||||
else if (modifier == LP_BLD_TEX_MODIFIER_LOD_ZERO) {
|
||||
lod_bias = NULL;
|
||||
/* XXX might be better to explicitly pass the level zero information */
|
||||
sample_key |= LP_SAMPLER_LOD_EXPLICIT << LP_SAMPLER_LOD_CONTROL_SHIFT;
|
||||
lod = lp_build_const_vec(gallivm, bld->bld_base.base.type, 0.0F);
|
||||
explicit_lod = lp_build_const_vec(gallivm, bld->bld_base.base.type, 0.0F);
|
||||
}
|
||||
else {
|
||||
lod_bias = NULL;
|
||||
explicit_lod = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_derivs; i++) {
|
||||
@@ -2254,18 +2274,16 @@ emit_sample(struct lp_build_tgsi_soa_context *bld,
|
||||
}
|
||||
/* Shadow coord occupies always 5th slot. */
|
||||
if (compare) {
|
||||
sample_key |= LP_SAMPLER_SHADOW;
|
||||
coords[4] = lp_build_emit_fetch(&bld->bld_base, inst, 3, 0);
|
||||
}
|
||||
|
||||
if (modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_DERIV) {
|
||||
unsigned dim;
|
||||
sample_key |= LP_SAMPLER_LOD_DERIVATIVES << LP_SAMPLER_LOD_CONTROL_SHIFT;
|
||||
for (dim = 0; dim < num_derivs; ++dim) {
|
||||
derivs.ddx[dim] = lp_build_emit_fetch(&bld->bld_base, inst, 3, dim);
|
||||
derivs.ddy[dim] = lp_build_emit_fetch(&bld->bld_base, inst, 4, dim);
|
||||
}
|
||||
params.derivs = &derivs;
|
||||
deriv_ptr = &derivs;
|
||||
/*
|
||||
* could also check all src regs if constant but I doubt such
|
||||
* cases exist in practice.
|
||||
@@ -2286,26 +2304,21 @@ emit_sample(struct lp_build_tgsi_soa_context *bld,
|
||||
/* some advanced gather instructions (txgo) would require 4 offsets */
|
||||
if (inst->Texture.NumOffsets == 1) {
|
||||
unsigned dim;
|
||||
sample_key |= LP_SAMPLER_OFFSETS;
|
||||
for (dim = 0; dim < num_offsets; dim++) {
|
||||
offsets[dim] = lp_build_emit_fetch_texoffset(&bld->bld_base, inst, 0, dim);
|
||||
}
|
||||
}
|
||||
sample_key |= lod_property << LP_SAMPLER_LOD_PROPERTY_SHIFT;
|
||||
|
||||
params.type = bld->bld_base.base.type;
|
||||
params.sample_key = sample_key;
|
||||
params.texture_index = texture_unit;
|
||||
params.sampler_index = sampler_unit;
|
||||
params.context_ptr = bld->context_ptr;
|
||||
params.coords = coords;
|
||||
params.offsets = offsets;
|
||||
params.lod = lod;
|
||||
params.texel = texel;
|
||||
|
||||
bld->sampler->emit_tex_sample(bld->sampler,
|
||||
bld->bld_base.base.gallivm,
|
||||
¶ms);
|
||||
bld->sampler->emit_fetch_texel(bld->sampler,
|
||||
bld->bld_base.base.gallivm,
|
||||
bld->bld_base.base.type,
|
||||
FALSE,
|
||||
texture_unit, sampler_unit,
|
||||
coords,
|
||||
offsets,
|
||||
deriv_ptr,
|
||||
lod_bias, explicit_lod, lod_property,
|
||||
texel);
|
||||
|
||||
if (inst->Src[1].Register.SwizzleX != PIPE_SWIZZLE_RED ||
|
||||
inst->Src[1].Register.SwizzleY != PIPE_SWIZZLE_GREEN ||
|
||||
@@ -2332,13 +2345,9 @@ emit_fetch_texels( struct lp_build_tgsi_soa_context *bld,
|
||||
LLVMValueRef explicit_lod = NULL;
|
||||
LLVMValueRef coords[5];
|
||||
LLVMValueRef offsets[3] = { NULL };
|
||||
struct lp_sampler_params params;
|
||||
enum lp_sampler_lod_property lod_property = LP_SAMPLER_LOD_SCALAR;
|
||||
unsigned dims, i;
|
||||
unsigned layer_coord = 0;
|
||||
unsigned sample_key = LP_SAMPLER_OP_FETCH << LP_SAMPLER_OP_TYPE_SHIFT;
|
||||
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
|
||||
if (!bld->sampler) {
|
||||
_debug_printf("warning: found texture instruction but no sampler generator supplied\n");
|
||||
@@ -2388,7 +2397,6 @@ emit_fetch_texels( struct lp_build_tgsi_soa_context *bld,
|
||||
if (target != TGSI_TEXTURE_BUFFER &&
|
||||
target != TGSI_TEXTURE_2D_MSAA &&
|
||||
target != TGSI_TEXTURE_2D_ARRAY_MSAA) {
|
||||
sample_key |= LP_SAMPLER_LOD_EXPLICIT << LP_SAMPLER_LOD_CONTROL_SHIFT;
|
||||
explicit_lod = lp_build_emit_fetch(&bld->bld_base, inst, 0, 3);
|
||||
lod_property = lp_build_lod_property(&bld->bld_base, inst, 0);
|
||||
}
|
||||
@@ -2406,27 +2414,21 @@ emit_fetch_texels( struct lp_build_tgsi_soa_context *bld,
|
||||
|
||||
if (inst->Texture.NumOffsets == 1) {
|
||||
unsigned dim;
|
||||
sample_key |= LP_SAMPLER_OFFSETS;
|
||||
for (dim = 0; dim < dims; dim++) {
|
||||
offsets[dim] = lp_build_emit_fetch_texoffset(&bld->bld_base, inst, 0, dim);
|
||||
}
|
||||
}
|
||||
sample_key |= lod_property << LP_SAMPLER_LOD_PROPERTY_SHIFT;
|
||||
|
||||
params.type = bld->bld_base.base.type;
|
||||
params.sample_key = sample_key;
|
||||
params.texture_index = unit;
|
||||
params.sampler_index = unit;
|
||||
params.context_ptr = bld->context_ptr;
|
||||
params.coords = coords;
|
||||
params.offsets = offsets;
|
||||
params.derivs = NULL;
|
||||
params.lod = explicit_lod;
|
||||
params.texel = texel;
|
||||
|
||||
bld->sampler->emit_tex_sample(bld->sampler,
|
||||
bld->bld_base.base.gallivm,
|
||||
¶ms);
|
||||
bld->sampler->emit_fetch_texel(bld->sampler,
|
||||
bld->bld_base.base.gallivm,
|
||||
bld->bld_base.base.type,
|
||||
TRUE,
|
||||
unit, unit,
|
||||
coords,
|
||||
offsets,
|
||||
NULL,
|
||||
NULL, explicit_lod, lod_property,
|
||||
texel);
|
||||
|
||||
if (is_samplei &&
|
||||
(inst->Src[1].Register.SwizzleX != PIPE_SWIZZLE_RED ||
|
||||
@@ -2496,7 +2498,6 @@ emit_size_query( struct lp_build_tgsi_soa_context *bld,
|
||||
bld->bld_base.base.gallivm,
|
||||
bld->bld_base.int_bld.type,
|
||||
unit, pipe_target,
|
||||
bld->context_ptr,
|
||||
TRUE,
|
||||
lod_property,
|
||||
explicit_lod,
|
||||
@@ -2952,7 +2953,7 @@ tex_emit(
|
||||
struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);
|
||||
|
||||
emit_tex(bld, emit_data->inst, LP_BLD_TEX_MODIFIER_NONE,
|
||||
emit_data->output, 1, LP_SAMPLER_OP_TEXTURE);
|
||||
emit_data->output, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2964,7 +2965,7 @@ tex2_emit(
|
||||
struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);
|
||||
|
||||
emit_tex(bld, emit_data->inst, LP_BLD_TEX_MODIFIER_NONE,
|
||||
emit_data->output, 2, LP_SAMPLER_OP_TEXTURE);
|
||||
emit_data->output, 2);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2976,7 +2977,7 @@ txb_emit(
|
||||
struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);
|
||||
|
||||
emit_tex(bld, emit_data->inst, LP_BLD_TEX_MODIFIER_LOD_BIAS,
|
||||
emit_data->output, 1, LP_SAMPLER_OP_TEXTURE);
|
||||
emit_data->output, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2988,7 +2989,7 @@ txb2_emit(
|
||||
struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);
|
||||
|
||||
emit_tex(bld, emit_data->inst, LP_BLD_TEX_MODIFIER_LOD_BIAS,
|
||||
emit_data->output, 2, LP_SAMPLER_OP_TEXTURE);
|
||||
emit_data->output, 2);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3000,7 +3001,7 @@ txd_emit(
|
||||
struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);
|
||||
|
||||
emit_tex(bld, emit_data->inst, LP_BLD_TEX_MODIFIER_EXPLICIT_DERIV,
|
||||
emit_data->output, 3, LP_SAMPLER_OP_TEXTURE);
|
||||
emit_data->output, 3);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3012,7 +3013,7 @@ txl_emit(
|
||||
struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);
|
||||
|
||||
emit_tex(bld, emit_data->inst, LP_BLD_TEX_MODIFIER_EXPLICIT_LOD,
|
||||
emit_data->output, 1, LP_SAMPLER_OP_TEXTURE);
|
||||
emit_data->output, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3024,7 +3025,7 @@ txl2_emit(
|
||||
struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);
|
||||
|
||||
emit_tex(bld, emit_data->inst, LP_BLD_TEX_MODIFIER_EXPLICIT_LOD,
|
||||
emit_data->output, 2, LP_SAMPLER_OP_TEXTURE);
|
||||
emit_data->output, 2);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3036,19 +3037,7 @@ txp_emit(
|
||||
struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);
|
||||
|
||||
emit_tex(bld, emit_data->inst, LP_BLD_TEX_MODIFIER_PROJECTED,
|
||||
emit_data->output, 1, LP_SAMPLER_OP_TEXTURE);
|
||||
}
|
||||
|
||||
static void
|
||||
tg4_emit(
|
||||
const struct lp_build_tgsi_action * action,
|
||||
struct lp_build_tgsi_context * bld_base,
|
||||
struct lp_build_emit_data * emit_data)
|
||||
{
|
||||
struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);
|
||||
|
||||
emit_tex(bld, emit_data->inst, LP_BLD_TEX_MODIFIER_NONE,
|
||||
emit_data->output, 2, LP_SAMPLER_OP_GATHER);
|
||||
emit_data->output, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3667,7 +3656,6 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm,
|
||||
const struct lp_bld_tgsi_system_values *system_values,
|
||||
const LLVMValueRef (*inputs)[TGSI_NUM_CHANNELS],
|
||||
LLVMValueRef (*outputs)[TGSI_NUM_CHANNELS],
|
||||
LLVMValueRef context_ptr,
|
||||
struct lp_build_sampler_soa *sampler,
|
||||
const struct tgsi_shader_info *info,
|
||||
const struct lp_build_tgsi_gs_iface *gs_iface)
|
||||
@@ -3696,7 +3684,6 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm,
|
||||
bld.sampler = sampler;
|
||||
bld.bld_base.info = info;
|
||||
bld.indirect_files = info->indirect_files;
|
||||
bld.context_ptr = context_ptr;
|
||||
|
||||
/*
|
||||
* If the number of temporaries is rather large then we just
|
||||
@@ -3767,7 +3754,6 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm,
|
||||
bld.bld_base.op_actions[TGSI_OPCODE_TEX2].emit = tex2_emit;
|
||||
bld.bld_base.op_actions[TGSI_OPCODE_TXB2].emit = txb2_emit;
|
||||
bld.bld_base.op_actions[TGSI_OPCODE_TXL2].emit = txl2_emit;
|
||||
bld.bld_base.op_actions[TGSI_OPCODE_TG4].emit = tg4_emit;
|
||||
/* DX10 sampling ops */
|
||||
bld.bld_base.op_actions[TGSI_OPCODE_SAMPLE].emit = sample_emit;
|
||||
bld.bld_base.op_actions[TGSI_OPCODE_SAMPLE_B].emit = sample_b_emit;
|
||||
|
@@ -157,8 +157,7 @@ hud_pipe_query_install(struct hud_pane *pane, struct pipe_context *pipe,
|
||||
if (!gr)
|
||||
return;
|
||||
|
||||
strncpy(gr->name, name, sizeof(gr->name));
|
||||
gr->name[sizeof(gr->name) - 1] = '\0';
|
||||
strcpy(gr->name, name);
|
||||
gr->query_data = CALLOC_STRUCT(query_info);
|
||||
if (!gr->query_data) {
|
||||
FREE(gr);
|
||||
|
@@ -27,22 +27,18 @@
|
||||
|
||||
static void translate_memcpy_ushort( const void *in,
|
||||
unsigned start,
|
||||
unsigned in_nr,
|
||||
unsigned out_nr,
|
||||
unsigned restart_index,
|
||||
unsigned nr,
|
||||
void *out )
|
||||
{
|
||||
memcpy(out, &((short *)in)[start], out_nr*sizeof(short));
|
||||
memcpy(out, &((short *)in)[start], nr*sizeof(short));
|
||||
}
|
||||
|
||||
static void translate_memcpy_uint( const void *in,
|
||||
unsigned start,
|
||||
unsigned in_nr,
|
||||
unsigned out_nr,
|
||||
unsigned restart_index,
|
||||
unsigned nr,
|
||||
void *out )
|
||||
{
|
||||
memcpy(out, &((int *)in)[start], out_nr*sizeof(int));
|
||||
memcpy(out, &((int *)in)[start], nr*sizeof(int));
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +58,6 @@ static void translate_memcpy_uint( const void *in,
|
||||
* \param nr number of incoming vertices
|
||||
* \param in_pv incoming provoking vertex convention (PV_FIRST or PV_LAST)
|
||||
* \param out_pv desired provoking vertex convention (PV_FIRST or PV_LAST)
|
||||
* \param prim_restart whether primitive restart is disable or enabled
|
||||
* \param out_prim returns new PIPE_PRIM_x we'll translate to
|
||||
* \param out_index_size returns bytes per new index value (2 or 4)
|
||||
* \param out_nr returns number of new vertices
|
||||
@@ -74,7 +69,6 @@ int u_index_translator( unsigned hw_mask,
|
||||
unsigned nr,
|
||||
unsigned in_pv,
|
||||
unsigned out_pv,
|
||||
unsigned prim_restart,
|
||||
unsigned *out_prim,
|
||||
unsigned *out_index_size,
|
||||
unsigned *out_nr,
|
||||
@@ -112,68 +106,68 @@ int u_index_translator( unsigned hw_mask,
|
||||
else {
|
||||
switch (prim) {
|
||||
case PIPE_PRIM_POINTS:
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim_restart][prim];
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
|
||||
*out_prim = PIPE_PRIM_POINTS;
|
||||
*out_nr = nr;
|
||||
break;
|
||||
|
||||
case PIPE_PRIM_LINES:
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim_restart][prim];
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
|
||||
*out_prim = PIPE_PRIM_LINES;
|
||||
*out_nr = nr;
|
||||
break;
|
||||
|
||||
case PIPE_PRIM_LINE_STRIP:
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim_restart][prim];
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
|
||||
*out_prim = PIPE_PRIM_LINES;
|
||||
*out_nr = (nr - 1) * 2;
|
||||
break;
|
||||
|
||||
case PIPE_PRIM_LINE_LOOP:
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim_restart][prim];
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
|
||||
*out_prim = PIPE_PRIM_LINES;
|
||||
*out_nr = nr * 2;
|
||||
break;
|
||||
|
||||
case PIPE_PRIM_TRIANGLES:
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim_restart][prim];
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
|
||||
*out_prim = PIPE_PRIM_TRIANGLES;
|
||||
*out_nr = nr;
|
||||
break;
|
||||
|
||||
case PIPE_PRIM_TRIANGLE_STRIP:
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim_restart][prim];
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
|
||||
*out_prim = PIPE_PRIM_TRIANGLES;
|
||||
*out_nr = (nr - 2) * 3;
|
||||
break;
|
||||
|
||||
case PIPE_PRIM_TRIANGLE_FAN:
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim_restart][prim];
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
|
||||
*out_prim = PIPE_PRIM_TRIANGLES;
|
||||
*out_nr = (nr - 2) * 3;
|
||||
break;
|
||||
|
||||
case PIPE_PRIM_QUADS:
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim_restart][prim];
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
|
||||
*out_prim = PIPE_PRIM_TRIANGLES;
|
||||
*out_nr = (nr / 4) * 6;
|
||||
break;
|
||||
|
||||
case PIPE_PRIM_QUAD_STRIP:
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim_restart][prim];
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
|
||||
*out_prim = PIPE_PRIM_TRIANGLES;
|
||||
*out_nr = (nr - 2) * 3;
|
||||
break;
|
||||
|
||||
case PIPE_PRIM_POLYGON:
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim_restart][prim];
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
|
||||
*out_prim = PIPE_PRIM_TRIANGLES;
|
||||
*out_nr = (nr - 2) * 3;
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim_restart][prim];
|
||||
*out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
|
||||
*out_prim = PIPE_PRIM_POINTS;
|
||||
*out_nr = nr;
|
||||
return U_TRANSLATE_ERROR;
|
||||
|
@@ -31,10 +31,6 @@
|
||||
#define PV_LAST 1
|
||||
#define PV_COUNT 2
|
||||
|
||||
/* primitive restart disable/enable flags */
|
||||
#define PR_DISABLE 0
|
||||
#define PR_ENABLE 1
|
||||
#define PR_COUNT 2
|
||||
/**
|
||||
* Index translator function (for glDrawElements() case)
|
||||
*
|
||||
@@ -46,9 +42,7 @@
|
||||
*/
|
||||
typedef void (*u_translate_func)( const void *in,
|
||||
unsigned start,
|
||||
unsigned in_nr,
|
||||
unsigned out_nr,
|
||||
unsigned restart_index,
|
||||
unsigned nr,
|
||||
void *out );
|
||||
|
||||
/**
|
||||
@@ -83,7 +77,6 @@ int u_index_translator( unsigned hw_mask,
|
||||
unsigned nr,
|
||||
unsigned in_pv, /* API */
|
||||
unsigned out_pv, /* hardware */
|
||||
unsigned prim_restart,
|
||||
unsigned *out_prim,
|
||||
unsigned *out_index_size,
|
||||
unsigned *out_nr,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user