Compare commits
56 Commits
mesa-21.2.
...
mesa-17.1.
Author | SHA1 | Date | |
---|---|---|---|
|
72e52fa7c8 | ||
|
6ca6d53e1c | ||
|
5f88ebaf5c | ||
|
f068a360cd | ||
|
e7cafd09ba | ||
|
f76068b879 | ||
|
ef6da453f0 | ||
|
5b4bff2ddb | ||
|
667cb4bc9e | ||
|
3f0b544745 | ||
|
27d4beb2e1 | ||
|
5e8e015db3 | ||
|
135615caa0 | ||
|
2acd78cfab | ||
|
642228ceaf | ||
|
12e7ec2c05 | ||
|
f2d91f2065 | ||
|
9a97d9081d | ||
|
a720963140 | ||
|
3f0740e87c | ||
|
2609ac2b5a | ||
|
3597829605 | ||
|
505e7cd232 | ||
|
791f0fb429 | ||
|
f1fe2b30b1 | ||
|
ee36cbe219 | ||
|
2cd07c39cc | ||
|
76f046add3 | ||
|
328afc7e86 | ||
|
77345993ec | ||
|
f2673a0f40 | ||
|
b38423210e | ||
|
ba6fd491a1 | ||
|
36f6fc59cb | ||
|
2bf79cb2f1 | ||
|
fb6379697b | ||
|
0948e113d2 | ||
|
f61c453cfc | ||
|
612fc14aab | ||
|
8aa9aa6a5f | ||
|
10ff4b49dc | ||
|
3d40db7892 | ||
|
99da9dfd95 | ||
|
fcbb263f8c | ||
|
29fa5b6e1c | ||
|
4e7e903bb3 | ||
|
26949e872b | ||
|
2cc119c35a | ||
|
6abdbd8b10 | ||
|
24c05c57e4 | ||
|
7ae90b4f65 | ||
|
0f2ac6ded8 | ||
|
bea2c4b88f | ||
|
ed846b4c78 | ||
|
8c69adf9a9 | ||
|
47dd2544e1 |
347
.travis.yml
347
.travis.yml
@@ -1,24 +1,11 @@
|
||||
language: c
|
||||
|
||||
sudo: required
|
||||
sudo: false
|
||||
dist: trusty
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.ccache
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libdrm-dev
|
||||
- x11proto-xf86vidmode-dev
|
||||
- libexpat1-dev
|
||||
- libxcb-dri2-0-dev
|
||||
- libx11-xcb-dev
|
||||
# LLVM packaging is broken and misses these dependencies
|
||||
- libedit-dev
|
||||
- libelf-dev
|
||||
- scons
|
||||
apt: true
|
||||
ccache: true
|
||||
|
||||
env:
|
||||
global:
|
||||
@@ -32,17 +19,260 @@ env:
|
||||
- XCBPROTO_VERSION=xcb-proto-1.11
|
||||
- LIBXCB_VERSION=libxcb-1.11
|
||||
- LIBXSHMFENCE_VERSION=libxshmfence-1.2
|
||||
- LLVM_VERSION=3.9
|
||||
- LLVM_PACKAGE="llvm-${LLVM_VERSION} llvm-${LLVM_VERSION}-dev"
|
||||
- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
|
||||
- LIBTXC_DXTN_VERSION=libtxc_dxtn-1.0.1
|
||||
- LIBVDPAU_VERSION=libvdpau-1.1
|
||||
- LIBVA_VERSION=libva-1.6.2
|
||||
- LIBWAYLAND_VERSION=wayland-1.11.1
|
||||
- PKG_CONFIG_PATH=$HOME/prefix/lib/pkgconfig
|
||||
- MAKEFLAGS=-j2
|
||||
matrix:
|
||||
- BUILD=make
|
||||
- BUILD=scons
|
||||
- LD_LIBRARY_PATH="$HOME/prefix/lib:$LD_LIBRARY_PATH"
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- env:
|
||||
- LABEL="make loaders/classic DRI"
|
||||
- BUILD=make
|
||||
- MAKEFLAGS="-j4"
|
||||
- MAKE_CHECK_COMMAND="make check"
|
||||
- DRI_LOADERS="--enable-glx --enable-gbm --enable-egl --with-platforms=x11,drm,surfaceless,wayland --enable-osmesa"
|
||||
- DRI_DRIVERS="i915,i965,radeon,r200,swrast,nouveau"
|
||||
- GALLIUM_ST="--enable-dri --disable-opencl --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx --disable-gallium-osmesa"
|
||||
- GALLIUM_DRIVERS=""
|
||||
- VULKAN_DRIVERS=""
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- xz-utils
|
||||
- x11proto-xf86vidmode-dev
|
||||
- libexpat1-dev
|
||||
- libx11-xcb-dev
|
||||
- env:
|
||||
# NOTE: Building SWR is 2x (yes two) times slower than all the other
|
||||
# gallium drivers combined.
|
||||
# Start this early so that it doesn't hunder the run time.
|
||||
- LABEL="make Gallium Drivers SWR"
|
||||
- BUILD=make
|
||||
- MAKEFLAGS="-j4"
|
||||
- MAKE_CHECK_COMMAND="true"
|
||||
- LLVM_VERSION=3.9
|
||||
- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
|
||||
- OVERRIDE_CC="gcc-5"
|
||||
- OVERRIDE_CXX="g++-5"
|
||||
- DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
|
||||
- DRI_DRIVERS=""
|
||||
- GALLIUM_ST="--enable-dri --disable-opencl --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx --disable-gallium-osmesa"
|
||||
- GALLIUM_DRIVERS="swr"
|
||||
- VULKAN_DRIVERS=""
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-3.9
|
||||
packages:
|
||||
# LLVM packaging is broken and misses these dependencies
|
||||
- libedit-dev
|
||||
# From sources above
|
||||
- g++-5
|
||||
- llvm-3.9-dev
|
||||
# Common
|
||||
- xz-utils
|
||||
- x11proto-xf86vidmode-dev
|
||||
- libexpat1-dev
|
||||
- libx11-xcb-dev
|
||||
- libelf-dev
|
||||
- env:
|
||||
- LABEL="make Gallium Drivers Other"
|
||||
- BUILD=make
|
||||
- MAKEFLAGS="-j4"
|
||||
- MAKE_CHECK_COMMAND="true"
|
||||
- LLVM_VERSION=3.9
|
||||
- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
|
||||
- DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
|
||||
- DRI_DRIVERS=""
|
||||
- GALLIUM_ST="--enable-dri --disable-opencl --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx --disable-gallium-osmesa"
|
||||
- GALLIUM_DRIVERS="i915,nouveau,r300,r600,radeonsi,freedreno,svga,swrast,vc4,virgl,etnaviv,imx"
|
||||
- VULKAN_DRIVERS=""
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- llvm-toolchain-trusty-3.9
|
||||
packages:
|
||||
# LLVM packaging is broken and misses these dependencies
|
||||
- libedit-dev
|
||||
# From sources above
|
||||
- llvm-3.9-dev
|
||||
# Common
|
||||
- xz-utils
|
||||
- x11proto-xf86vidmode-dev
|
||||
- libexpat1-dev
|
||||
- libx11-xcb-dev
|
||||
- libelf-dev
|
||||
- env:
|
||||
# NOTE: Analogous to SWR above, building Clover is quite slow.
|
||||
- LABEL="make Gallium ST Clover"
|
||||
- BUILD=make
|
||||
- MAKEFLAGS="-j4"
|
||||
- MAKE_CHECK_COMMAND="true"
|
||||
- LLVM_VERSION=3.6
|
||||
- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
|
||||
- OVERRIDE_CC=gcc-4.7
|
||||
- OVERRIDE_CXX=g++-4.7
|
||||
- DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
|
||||
- DRI_DRIVERS=""
|
||||
- GALLIUM_ST="--disable-dri --enable-opencl --enable-opencl-icd --enable-llvm --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx --disable-gallium-osmesa"
|
||||
# i915 most likely doesn't work with OpenCL.
|
||||
# Regardless - we're doing a quick build test here.
|
||||
- GALLIUM_DRIVERS="i915"
|
||||
- VULKAN_DRIVERS=""
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- llvm-toolchain-trusty-3.6
|
||||
packages:
|
||||
- libclc-dev
|
||||
# LLVM packaging is broken and misses these dependencies
|
||||
- libedit-dev
|
||||
- g++-4.7
|
||||
# From sources above
|
||||
- llvm-3.6-dev
|
||||
- clang-3.6
|
||||
- libclang-3.6-dev
|
||||
# Common
|
||||
- xz-utils
|
||||
- x11proto-xf86vidmode-dev
|
||||
- libexpat1-dev
|
||||
- libx11-xcb-dev
|
||||
- libelf-dev
|
||||
- env:
|
||||
- LABEL="make Gallium ST Other"
|
||||
- BUILD=make
|
||||
- MAKEFLAGS="-j4"
|
||||
- MAKE_CHECK_COMMAND="true"
|
||||
- DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
|
||||
- DRI_DRIVERS=""
|
||||
- GALLIUM_ST="--enable-dri --disable-opencl --enable-xa --enable-nine --enable-xvmc --enable-vdpau --enable-va --enable-omx --enable-gallium-osmesa"
|
||||
# We need swrast for osmesa and nine.
|
||||
# i915 most likely doesn't work with most ST.
|
||||
# Regardless - we're doing a quick build test here.
|
||||
- GALLIUM_DRIVERS="i915,swrast"
|
||||
- VULKAN_DRIVERS=""
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
# Nine requires gcc 4.6... which is the one we have right ?
|
||||
- libxvmc-dev
|
||||
# Build locally, for now.
|
||||
#- libvdpau-dev
|
||||
#- libva-dev
|
||||
- libomxil-bellagio-dev
|
||||
# LLVM packaging is broken and misses these dependencies
|
||||
- libedit-dev
|
||||
# Common
|
||||
- xz-utils
|
||||
- x11proto-xf86vidmode-dev
|
||||
- libexpat1-dev
|
||||
- libx11-xcb-dev
|
||||
- libelf-dev
|
||||
- env:
|
||||
- LABEL="make Vulkan"
|
||||
- BUILD=make
|
||||
- MAKEFLAGS="-j4"
|
||||
- MAKE_CHECK_COMMAND="make -C src/gtest check && make -C src/intel check"
|
||||
- LLVM_VERSION=3.9
|
||||
- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
|
||||
# XXX: we want to test the WSI, but those are enabled via the EGL toggles
|
||||
# XXX: Platform X11 dependencies are checked when --enable-glx is set
|
||||
- DRI_LOADERS="--enable-glx --disable-gbm --enable-egl --with-platforms=x11,wayland"
|
||||
- DRI_DRIVERS=""
|
||||
# XXX: enable DRI for EGL above
|
||||
- GALLIUM_ST="--enable-dri --disable-opencl --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx --disable-gallium-osmesa"
|
||||
- GALLIUM_DRIVERS=""
|
||||
- VULKAN_DRIVERS="intel,radeon"
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- llvm-toolchain-trusty-3.9
|
||||
packages:
|
||||
# LLVM packaging is broken and misses these dependencies
|
||||
- libedit-dev
|
||||
# From sources above
|
||||
- llvm-3.9-dev
|
||||
# Common
|
||||
- xz-utils
|
||||
- x11proto-xf86vidmode-dev
|
||||
- libexpat1-dev
|
||||
- libx11-xcb-dev
|
||||
- libelf-dev
|
||||
- env:
|
||||
- LABEL="scons"
|
||||
- BUILD=scons
|
||||
- SCONSFLAGS="-j4"
|
||||
# Explicitly disable.
|
||||
- SCONS_TARGET="llvm=0"
|
||||
# Keep it symmetrical to the make build.
|
||||
- SCONS_CHECK_COMMAND="scons llvm=0 check"
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- scons
|
||||
# Common
|
||||
- xz-utils
|
||||
- x11proto-xf86vidmode-dev
|
||||
- libexpat1-dev
|
||||
- libx11-xcb-dev
|
||||
- libelf-dev
|
||||
- env:
|
||||
- LABEL="scons LLVM"
|
||||
- BUILD=scons
|
||||
- SCONSFLAGS="-j4"
|
||||
- SCONS_TARGET="llvm=1"
|
||||
# Keep it symmetrical to the make build.
|
||||
- SCONS_CHECK_COMMAND="scons llvm=1 check"
|
||||
- LLVM_VERSION=3.3
|
||||
- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- scons
|
||||
# LLVM packaging is broken and misses these dependencies
|
||||
- libedit-dev
|
||||
- llvm-3.3-dev
|
||||
# Common
|
||||
- xz-utils
|
||||
- x11proto-xf86vidmode-dev
|
||||
- libexpat1-dev
|
||||
- libx11-xcb-dev
|
||||
- libelf-dev
|
||||
- env:
|
||||
- LABEL="scons SWR"
|
||||
- BUILD=scons
|
||||
- SCONSFLAGS="-j4"
|
||||
- SCONS_TARGET="swr=1"
|
||||
- LLVM_VERSION=3.9
|
||||
- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
|
||||
# Keep it symmetrical to the make build. There's no actual SWR, yet.
|
||||
- SCONS_CHECK_COMMAND="true"
|
||||
- OVERRIDE_CC="gcc-5"
|
||||
- OVERRIDE_CXX="g++-5"
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-3.9
|
||||
packages:
|
||||
- scons
|
||||
# LLVM packaging is broken and misses these dependencies
|
||||
- libedit-dev
|
||||
# From sources above
|
||||
- g++-5
|
||||
- llvm-3.9-dev
|
||||
# Common
|
||||
- xz-utils
|
||||
- x11proto-xf86vidmode-dev
|
||||
- libexpat1-dev
|
||||
- libx11-xcb-dev
|
||||
- libelf-dev
|
||||
|
||||
install:
|
||||
- export PATH="/usr/lib/ccache:$PATH"
|
||||
- pip install --user mako
|
||||
|
||||
# Since libdrm gets updated in configure.ac regularly, try to pick up the
|
||||
@@ -90,25 +320,64 @@ install:
|
||||
- tar -jxvf $LIBXSHMFENCE_VERSION.tar.bz2
|
||||
- (cd $LIBXSHMFENCE_VERSION && ./configure --prefix=$HOME/prefix && make install)
|
||||
|
||||
# Install LLVM directly via apt-get (not Travis-CI's apt addon)
|
||||
# See https://github.com/travis-ci/apt-source-whitelist/pull/205#issuecomment-216054237
|
||||
# libtxc-dxtn uses the patented S3 Texture Compression
|
||||
# algorithm. Therefore, we don't want to use this library but it is
|
||||
# still possible through setting the USE_TXC_DXTN variable to yes in
|
||||
# the travis web UI.
|
||||
#
|
||||
# According to Wikipedia, the patent expires on October 2, 2017:
|
||||
# https://en.wikipedia.org/wiki/S3_Texture_Compression#Patent
|
||||
- if test "x$USE_TXC_DXTN" = xyes; then
|
||||
wget https://people.freedesktop.org/~cbrill/libtxc_dxtn/$LIBTXC_DXTN_VERSION.tar.bz2;
|
||||
tar -jxvf $LIBTXC_DXTN_VERSION.tar.bz2;
|
||||
(cd $LIBTXC_DXTN_VERSION && ./configure --prefix=$HOME/prefix && make install);
|
||||
fi
|
||||
|
||||
- wget -nv -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
- sudo apt-add-repository -y 'deb http://llvm.org/apt/trusty llvm-toolchain-trusty-3.9 main'
|
||||
- sudo apt-add-repository -y 'deb http://llvm.org/apt/trusty llvm-toolchain-trusty main'
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq -y $LLVM_PACKAGE
|
||||
- wget http://people.freedesktop.org/~aplattner/vdpau/$LIBVDPAU_VERSION.tar.bz2
|
||||
- tar -jxvf $LIBVDPAU_VERSION.tar.bz2
|
||||
- (cd $LIBVDPAU_VERSION && ./configure --prefix=$HOME/prefix && make install)
|
||||
|
||||
- wget http://www.freedesktop.org/software/vaapi/releases/libva/$LIBVA_VERSION.tar.bz2
|
||||
- tar -jxvf $LIBVA_VERSION.tar.bz2
|
||||
- (cd $LIBVA_VERSION && ./configure --prefix=$HOME/prefix --disable-wayland --disable-dummy-driver && make install)
|
||||
|
||||
- wget http://wayland.freedesktop.org/releases/$LIBWAYLAND_VERSION.tar.xz
|
||||
- tar -axvf $LIBWAYLAND_VERSION.tar.xz
|
||||
- (cd $LIBWAYLAND_VERSION && ./configure --prefix=$HOME/prefix --enable-libraries --without-host-scanner --disable-documentation --disable-dtd-validation && make install)
|
||||
|
||||
# Generate the header since one is missing on the Travis instance
|
||||
- mkdir -p linux
|
||||
- printf "%s\n" \
|
||||
"#ifndef _LINUX_MEMFD_H" \
|
||||
"#define _LINUX_MEMFD_H" \
|
||||
"" \
|
||||
"#define __NR_memfd_create 319" \
|
||||
"#define SYS_memfd_create __NR_memfd_create" \
|
||||
"" \
|
||||
"#define MFD_CLOEXEC 0x0001U" \
|
||||
"#define MFD_ALLOW_SEALING 0x0002U" \
|
||||
"" \
|
||||
"#endif /* _LINUX_MEMFD_H */" > linux/memfd.h
|
||||
|
||||
script:
|
||||
- if test "x$BUILD" = xmake; then
|
||||
test -n "$OVERRIDE_CC" && export CC="$OVERRIDE_CC";
|
||||
test -n "$OVERRIDE_CXX" && export CXX="$OVERRIDE_CXX";
|
||||
export CC="$CC -isystem`pwd`";
|
||||
|
||||
./autogen.sh --enable-debug
|
||||
--with-platforms=x11,drm
|
||||
--with-dri-drivers=i915,i965,radeon,r200,swrast,nouveau
|
||||
--with-gallium-drivers=i915,nouveau,r300,r600,radeonsi,freedreno,svga,swrast,vc4,virgl,etnaviv,imx
|
||||
--with-vulkan-drivers=radeon
|
||||
$DRI_LOADERS
|
||||
--with-dri-drivers=$DRI_DRIVERS
|
||||
$GALLIUM_ST
|
||||
--with-gallium-drivers=$GALLIUM_DRIVERS
|
||||
--with-vulkan-drivers=$VULKAN_DRIVERS
|
||||
--disable-llvm-shared-libs
|
||||
;
|
||||
make && make check;
|
||||
elif test x$BUILD = xscons; then
|
||||
scons llvm=1 && scons llvm=1 check;
|
||||
&&
|
||||
make && eval $MAKE_CHECK_COMMAND;
|
||||
fi
|
||||
|
||||
- if test "x$BUILD" = xscons; then
|
||||
test -n "$OVERRIDE_CC" && export CC="$OVERRIDE_CC";
|
||||
test -n "$OVERRIDE_CXX" && export CXX="$OVERRIDE_CXX";
|
||||
scons $SCONS_TARGET && eval $SCONS_CHECK_COMMAND;
|
||||
fi
|
||||
|
13
configure.ac
13
configure.ac
@@ -724,7 +724,7 @@ dnl Arch/platform-specific settings
|
||||
dnl
|
||||
AC_ARG_ENABLE([asm],
|
||||
[AS_HELP_STRING([--disable-asm],
|
||||
[disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
|
||||
[disable assembly usage @<:@default=enabled on supported platforms@:>@])],
|
||||
[enable_asm="$enableval"],
|
||||
[enable_asm=yes]
|
||||
)
|
||||
@@ -1367,7 +1367,7 @@ if test "x$enable_libglvnd" = xyes ; then
|
||||
esac
|
||||
|
||||
PKG_CHECK_MODULES([GLVND], libglvnd >= 0.2.0)
|
||||
PKG_CHECK_VAR(LIBGLVND_DATADIR, libglvnd, datadir)
|
||||
LIBGLVND_DATADIR=`$PKG_CONFIG --variable=datadir libglvnd`
|
||||
AC_SUBST([LIBGLVND_DATADIR])
|
||||
|
||||
DEFINES="${DEFINES} -DUSE_LIBGLVND=1"
|
||||
@@ -2146,12 +2146,11 @@ dnl DEPRECATED: EGL Platforms configuration
|
||||
dnl
|
||||
AC_ARG_WITH([egl-platforms],
|
||||
[AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
|
||||
[DEPRECATED: use --with-plaforms instead@<:@default=auto@:>@])],
|
||||
[DEPRECATED: use --with-platforms instead@<:@default=auto@:>@])],
|
||||
[with_egl_platforms="$withval"],
|
||||
[with_egl_platforms=auto])
|
||||
|
||||
if test "x$with_egl_platforms" = xauto; then
|
||||
AC_MSG_WARN([--with-egl-platforms is deprecated. Use --with-plaforms instead.])
|
||||
if test "x$enable_egl" = xyes; then
|
||||
if test "x$enable_gbm" = xyes; then
|
||||
with_egl_platforms="x11,drm"
|
||||
@@ -2161,6 +2160,8 @@ if test "x$with_egl_platforms" = xauto; then
|
||||
else
|
||||
with_egl_platforms=""
|
||||
fi
|
||||
else
|
||||
AC_MSG_WARN([--with-egl-platforms is deprecated. Use --with-platforms instead.])
|
||||
fi
|
||||
|
||||
dnl
|
||||
@@ -2465,7 +2466,9 @@ if test -n "$with_gallium_drivers"; then
|
||||
xvirgl)
|
||||
HAVE_GALLIUM_VIRGL=yes
|
||||
require_libdrm "virgl"
|
||||
require_basic_egl "virgl"
|
||||
if test "x$enable_egl" = xyes; then
|
||||
require_basic_egl "virgl"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Unknown Gallium driver: $driver])
|
||||
|
@@ -64,13 +64,13 @@ static const struct pipe_loader_ops pipe_loader_drm_ops;
|
||||
|
||||
#ifdef GALLIUM_STATIC_TARGETS
|
||||
static const struct drm_conf_ret throttle_ret = {
|
||||
DRM_CONF_INT,
|
||||
{2},
|
||||
.type = DRM_CONF_INT,
|
||||
.val.val_int = 2,
|
||||
};
|
||||
|
||||
static const struct drm_conf_ret share_fd_ret = {
|
||||
DRM_CONF_BOOL,
|
||||
{true},
|
||||
.type = DRM_CONF_BOOL,
|
||||
.val.val_bool = true,
|
||||
};
|
||||
|
||||
static inline const struct drm_conf_ret *
|
||||
|
@@ -112,7 +112,7 @@ fd_context_destroy(struct pipe_context *pctx)
|
||||
|
||||
DBG("");
|
||||
|
||||
if (ctx->screen->reorder)
|
||||
if (ctx->screen->reorder && util_queue_is_initialized(&ctx->flush_queue))
|
||||
util_queue_destroy(&ctx->flush_queue);
|
||||
|
||||
fd_batch_reference(&ctx->batch, NULL); /* unref current batch */
|
||||
|
@@ -765,7 +765,7 @@ static void si_set_shader_image(struct si_context *ctx,
|
||||
static const unsigned char swizzle[4] = { 0, 1, 2, 3 };
|
||||
struct r600_texture *tex = (struct r600_texture *)res;
|
||||
unsigned level = view->u.tex.level;
|
||||
unsigned width, height, depth;
|
||||
unsigned width, height, depth, hw_level;
|
||||
bool uses_dcc = vi_dcc_enabled(tex, level);
|
||||
|
||||
assert(!tex->is_depth);
|
||||
@@ -794,20 +794,31 @@ static void si_set_shader_image(struct si_context *ctx,
|
||||
p_atomic_read(&tex->framebuffers_bound))
|
||||
ctx->need_check_render_feedback = true;
|
||||
|
||||
/* Always force the base level to the selected level.
|
||||
*
|
||||
* This is required for 3D textures, where otherwise
|
||||
* selecting a single slice for non-layered bindings
|
||||
* fails. It doesn't hurt the other targets.
|
||||
*/
|
||||
width = u_minify(res->b.b.width0, level);
|
||||
height = u_minify(res->b.b.height0, level);
|
||||
depth = u_minify(res->b.b.depth0, level);
|
||||
if (ctx->b.chip_class >= GFX9) {
|
||||
/* Always set the base address. The swizzle modes don't
|
||||
* allow setting mipmap level offsets as the base.
|
||||
*/
|
||||
width = res->b.b.width0;
|
||||
height = res->b.b.height0;
|
||||
depth = res->b.b.depth0;
|
||||
hw_level = level;
|
||||
} else {
|
||||
/* Always force the base level to the selected level.
|
||||
*
|
||||
* This is required for 3D textures, where otherwise
|
||||
* selecting a single slice for non-layered bindings
|
||||
* fails. It doesn't hurt the other targets.
|
||||
*/
|
||||
width = u_minify(res->b.b.width0, level);
|
||||
height = u_minify(res->b.b.height0, level);
|
||||
depth = u_minify(res->b.b.depth0, level);
|
||||
hw_level = 0;
|
||||
}
|
||||
|
||||
si_make_texture_descriptor(screen, tex,
|
||||
false, res->b.b.target,
|
||||
view->format, swizzle,
|
||||
0, 0,
|
||||
hw_level, hw_level,
|
||||
view->u.tex.first_layer,
|
||||
view->u.tex.last_layer,
|
||||
width, height, depth,
|
||||
|
@@ -3400,7 +3400,7 @@ image_fetch_rsrc(
|
||||
static LLVMValueRef image_fetch_coords(
|
||||
struct lp_build_tgsi_context *bld_base,
|
||||
const struct tgsi_full_instruction *inst,
|
||||
unsigned src)
|
||||
unsigned src, LLVMValueRef desc)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context(bld_base);
|
||||
struct gallivm_state *gallivm = &ctx->gallivm;
|
||||
@@ -3417,14 +3417,30 @@ static LLVMValueRef image_fetch_coords(
|
||||
coords[chan] = tmp;
|
||||
}
|
||||
|
||||
/* 1D textures are allocated and used as 2D on GFX9. */
|
||||
if (ctx->screen->b.chip_class >= GFX9) {
|
||||
/* 1D textures are allocated and used as 2D on GFX9. */
|
||||
if (target == TGSI_TEXTURE_1D) {
|
||||
coords[1] = ctx->i32_0;
|
||||
num_coords++;
|
||||
} else if (target == TGSI_TEXTURE_1D_ARRAY) {
|
||||
coords[2] = coords[1];
|
||||
coords[1] = ctx->i32_0;
|
||||
num_coords++;
|
||||
} else if (target == TGSI_TEXTURE_2D) {
|
||||
/* The hw can't bind a slice of a 3D image as a 2D
|
||||
* image, because it ignores BASE_ARRAY if the target
|
||||
* is 3D. The workaround is to read BASE_ARRAY and set
|
||||
* it as the 3rd address operand for all 2D images.
|
||||
*/
|
||||
LLVMValueRef first_layer, const5, mask;
|
||||
|
||||
const5 = LLVMConstInt(ctx->i32, 5, 0);
|
||||
mask = LLVMConstInt(ctx->i32, S_008F24_BASE_ARRAY(~0), 0);
|
||||
first_layer = LLVMBuildExtractElement(builder, desc, const5, "");
|
||||
first_layer = LLVMBuildAnd(builder, first_layer, mask, "");
|
||||
|
||||
coords[2] = first_layer;
|
||||
num_coords++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3539,7 +3555,7 @@ static void load_fetch_args(
|
||||
LLVMValueRef coords;
|
||||
|
||||
image_fetch_rsrc(bld_base, &inst->Src[0], false, target, &rsrc);
|
||||
coords = image_fetch_coords(bld_base, inst, 1);
|
||||
coords = image_fetch_coords(bld_base, inst, 1, rsrc);
|
||||
|
||||
if (target == TGSI_TEXTURE_BUFFER) {
|
||||
buffer_append_args(ctx, emit_data, rsrc, coords,
|
||||
@@ -3814,16 +3830,15 @@ static void store_fetch_args(
|
||||
*/
|
||||
bool force_glc = ctx->screen->b.chip_class == SI;
|
||||
|
||||
coords = image_fetch_coords(bld_base, inst, 0);
|
||||
image_fetch_rsrc(bld_base, &memory, true, target, &rsrc);
|
||||
coords = image_fetch_coords(bld_base, inst, 0, rsrc);
|
||||
|
||||
if (target == TGSI_TEXTURE_BUFFER) {
|
||||
image_fetch_rsrc(bld_base, &memory, true, target, &rsrc);
|
||||
buffer_append_args(ctx, emit_data, rsrc, coords,
|
||||
ctx->i32_0, false, force_glc);
|
||||
} else {
|
||||
emit_data->args[1] = coords;
|
||||
image_fetch_rsrc(bld_base, &memory, true, target,
|
||||
&emit_data->args[2]);
|
||||
emit_data->args[2] = rsrc;
|
||||
emit_data->args[3] = LLVMConstInt(ctx->i32, 15, 0); /* dmask */
|
||||
emit_data->arg_count = 4;
|
||||
|
||||
@@ -4027,7 +4042,7 @@ static void atomic_fetch_args(
|
||||
LLVMValueRef coords;
|
||||
|
||||
image_fetch_rsrc(bld_base, &inst->Src[0], true, target, &rsrc);
|
||||
coords = image_fetch_coords(bld_base, inst, 1);
|
||||
coords = image_fetch_coords(bld_base, inst, 1, rsrc);
|
||||
|
||||
if (target == TGSI_TEXTURE_BUFFER) {
|
||||
buffer_append_args(ctx, emit_data, rsrc, coords,
|
||||
|
@@ -2976,7 +2976,40 @@ si_make_buffer_descriptor(struct si_screen *screen, struct r600_resource *buf,
|
||||
num_records = size / stride;
|
||||
num_records = MIN2(num_records, (buf->b.b.width0 - offset) / stride);
|
||||
|
||||
if (screen->b.chip_class == VI)
|
||||
/* The NUM_RECORDS field has a different meaning depending on the chip,
|
||||
* instruction type, STRIDE, and SWIZZLE_ENABLE.
|
||||
*
|
||||
* SI-CIK:
|
||||
* - If STRIDE == 0, it's in byte units.
|
||||
* - If STRIDE != 0, it's in units of STRIDE, used with inst.IDXEN.
|
||||
*
|
||||
* VI:
|
||||
* - For SMEM and STRIDE == 0, it's in byte units.
|
||||
* - For SMEM and STRIDE != 0, it's in units of STRIDE.
|
||||
* - For VMEM and STRIDE == 0 or SWIZZLE_ENABLE == 0, it's in byte units.
|
||||
* - For VMEM and STRIDE != 0 and SWIZZLE_ENABLE == 1, it's in units of STRIDE.
|
||||
* NOTE: There is incompatibility between VMEM and SMEM opcodes due to SWIZZLE_-
|
||||
* ENABLE. The workaround is to set STRIDE = 0 if SWIZZLE_ENABLE == 0 when
|
||||
* using SMEM. This can be done in the shader by clearing STRIDE with s_and.
|
||||
* That way the same descriptor can be used by both SMEM and VMEM.
|
||||
*
|
||||
* GFX9:
|
||||
* - For SMEM and STRIDE == 0, it's in byte units.
|
||||
* - For SMEM and STRIDE != 0, it's in units of STRIDE.
|
||||
* - For VMEM and inst.IDXEN == 0 or STRIDE == 0, it's in byte units.
|
||||
* - For VMEM and inst.IDXEN == 1 and STRIDE != 0, it's in units of STRIDE.
|
||||
*/
|
||||
if (screen->b.chip_class >= GFX9)
|
||||
/* When vindex == 0, LLVM sets IDXEN = 0, thus changing units
|
||||
* from STRIDE to bytes. This works around it by setting
|
||||
* NUM_RECORDS to at least the size of one element, so that
|
||||
* the first element is readable when IDXEN == 0.
|
||||
*
|
||||
* TODO: Fix this in LLVM, but do we need a new intrinsic where
|
||||
* IDXEN is enforced?
|
||||
*/
|
||||
num_records = num_records ? MAX2(num_records, stride) : 0;
|
||||
else if (screen->b.chip_class == VI)
|
||||
num_records *= stride;
|
||||
|
||||
state[4] = 0;
|
||||
@@ -3156,7 +3189,8 @@ si_make_texture_descriptor(struct si_screen *screen,
|
||||
if (!sampler &&
|
||||
(res->target == PIPE_TEXTURE_CUBE ||
|
||||
res->target == PIPE_TEXTURE_CUBE_ARRAY ||
|
||||
res->target == PIPE_TEXTURE_3D)) {
|
||||
(screen->b.chip_class <= VI &&
|
||||
res->target == PIPE_TEXTURE_3D))) {
|
||||
/* For the purpose of shader images, treat cube maps and 3D
|
||||
* textures as 2D arrays. For 3D textures, the address
|
||||
* calculations for mipmaps are different, so we rely on the
|
||||
|
@@ -291,7 +291,8 @@ si_get_init_multi_vgt_param(struct si_screen *sscreen,
|
||||
/* Needed for 028B6C_DISTRIBUTION_MODE != 0 */
|
||||
if (sscreen->has_distributed_tess) {
|
||||
if (key->u.uses_gs) {
|
||||
partial_es_wave = true;
|
||||
if (sscreen->b.chip_class <= VI)
|
||||
partial_es_wave = true;
|
||||
|
||||
/* GPU hang workaround. */
|
||||
if (sscreen->b.family == CHIP_TONGA ||
|
||||
@@ -371,7 +372,7 @@ si_get_init_multi_vgt_param(struct si_screen *sscreen,
|
||||
}
|
||||
|
||||
/* If SWITCH_ON_EOI is set, PARTIAL_ES_WAVE must be set too. */
|
||||
if (ia_switch_on_eoi)
|
||||
if (sscreen->b.chip_class <= VI && ia_switch_on_eoi)
|
||||
partial_es_wave = true;
|
||||
|
||||
return S_028AA8_SWITCH_ON_EOP(ia_switch_on_eop) |
|
||||
@@ -379,7 +380,8 @@ si_get_init_multi_vgt_param(struct si_screen *sscreen,
|
||||
S_028AA8_PARTIAL_VS_WAVE_ON(partial_vs_wave) |
|
||||
S_028AA8_PARTIAL_ES_WAVE_ON(partial_es_wave) |
|
||||
S_028AA8_WD_SWITCH_ON_EOP(sscreen->b.chip_class >= CIK ? wd_switch_on_eop : 0) |
|
||||
S_028AA8_MAX_PRIMGRP_IN_WAVE(sscreen->b.chip_class >= VI ?
|
||||
/* The following field was moved to VGT_SHADER_STAGES_EN in GFX9. */
|
||||
S_028AA8_MAX_PRIMGRP_IN_WAVE(sscreen->b.chip_class == VI ?
|
||||
max_primgroup_in_wave : 0) |
|
||||
S_030960_EN_INST_OPT_BASIC(sscreen->b.chip_class >= GFX9) |
|
||||
S_030960_EN_INST_OPT_ADV(sscreen->b.chip_class >= GFX9);
|
||||
|
@@ -2115,7 +2115,10 @@ static bool si_update_gs_ring_buffers(struct si_context *sctx)
|
||||
unsigned num_se = sctx->screen->b.info.max_se;
|
||||
unsigned wave_size = 64;
|
||||
unsigned max_gs_waves = 32 * num_se; /* max 32 per SE on GCN */
|
||||
unsigned gs_vertex_reuse = 16 * num_se; /* GS_VERTEX_REUSE register (per SE) */
|
||||
/* On SI-CI, the value comes from VGT_GS_VERTEX_REUSE = 16.
|
||||
* On VI+, the value comes from VGT_VERTEX_REUSE_BLOCK_CNTL = 30 (+2).
|
||||
*/
|
||||
unsigned gs_vertex_reuse = (sctx->b.chip_class >= VI ? 32 : 16) * num_se;
|
||||
unsigned alignment = 256 * num_se;
|
||||
/* The maximum size is 63.999 MB per SE. */
|
||||
unsigned max_size = ((unsigned)(63.999 * 1024 * 1024) & ~255) * num_se;
|
||||
@@ -2542,6 +2545,9 @@ static void si_update_vgt_shader_config(struct si_context *sctx)
|
||||
S_028B54_VS_EN(V_028B54_VS_STAGE_COPY_SHADER);
|
||||
}
|
||||
|
||||
if (sctx->b.chip_class >= GFX9)
|
||||
stages |= S_028B54_MAX_PRIMGRP_IN_WAVE(2);
|
||||
|
||||
si_pm4_set_reg(*pm4, R_028B54_VGT_SHADER_STAGES_EN, stages);
|
||||
}
|
||||
si_pm4_bind_state(sctx, vgt_shader_config, *pm4);
|
||||
|
@@ -49,7 +49,7 @@ namespace clover {
|
||||
build_module_library(const ::llvm::Module &mod,
|
||||
enum module::section::type section_type);
|
||||
|
||||
std::unique_ptr<::llvm::Module>
|
||||
std::unique_ptr< ::llvm::Module>
|
||||
parse_module_library(const module &m, ::llvm::LLVMContext &ctx,
|
||||
std::string &r_log);
|
||||
|
||||
|
@@ -94,7 +94,7 @@ clover::llvm::build_module_library(const ::llvm::Module &mod,
|
||||
return m;
|
||||
}
|
||||
|
||||
std::unique_ptr<::llvm::Module>
|
||||
std::unique_ptr< ::llvm::Module>
|
||||
clover::llvm::parse_module_library(const module &m, ::llvm::LLVMContext &ctx,
|
||||
std::string &r_log) {
|
||||
auto mod = ::llvm::parseBitcodeFile(::llvm::MemoryBufferRef(
|
||||
@@ -104,5 +104,5 @@ clover::llvm::parse_module_library(const module &m, ::llvm::LLVMContext &ctx,
|
||||
fail(r_log, error(CL_INVALID_PROGRAM), s);
|
||||
});
|
||||
|
||||
return std::unique_ptr<::llvm::Module>(std::move(*mod));
|
||||
return std::unique_ptr< ::llvm::Module>(std::move(*mod));
|
||||
}
|
||||
|
@@ -121,12 +121,12 @@ namespace {
|
||||
} else {
|
||||
// Other types.
|
||||
const auto actual_type =
|
||||
isa<::llvm::PointerType>(arg_type) && arg.hasByValAttr() ?
|
||||
cast<::llvm::PointerType>(arg_type)->getElementType() : arg_type;
|
||||
isa< ::llvm::PointerType>(arg_type) && arg.hasByValAttr() ?
|
||||
cast< ::llvm::PointerType>(arg_type)->getElementType() : arg_type;
|
||||
|
||||
if (actual_type->isPointerTy()) {
|
||||
const unsigned address_space =
|
||||
cast<::llvm::PointerType>(actual_type)->getAddressSpace();
|
||||
cast< ::llvm::PointerType>(actual_type)->getAddressSpace();
|
||||
|
||||
if (address_space == address_spaces[clang::LangAS::opencl_local
|
||||
- compat::lang_as_offset]) {
|
||||
|
@@ -156,7 +156,7 @@ clover::llvm::print_module_native(const ::llvm::Module &mod,
|
||||
const target &target) {
|
||||
std::string log;
|
||||
try {
|
||||
std::unique_ptr<::llvm::Module> cmod { CloneModule(&mod) };
|
||||
std::unique_ptr< ::llvm::Module> cmod { CloneModule(&mod) };
|
||||
return as_string(emit_code(*cmod, target,
|
||||
TargetMachine::CGFT_AssemblyFile, log));
|
||||
} catch (...) {
|
||||
|
@@ -132,18 +132,18 @@ namespace clover {
|
||||
#endif
|
||||
}
|
||||
|
||||
inline std::unique_ptr<::llvm::Linker>
|
||||
inline std::unique_ptr< ::llvm::Linker>
|
||||
create_linker(::llvm::Module &mod) {
|
||||
#if HAVE_LLVM >= 0x0308
|
||||
return std::unique_ptr<::llvm::Linker>(new ::llvm::Linker(mod));
|
||||
return std::unique_ptr< ::llvm::Linker>(new ::llvm::Linker(mod));
|
||||
#else
|
||||
return std::unique_ptr<::llvm::Linker>(new ::llvm::Linker(&mod));
|
||||
return std::unique_ptr< ::llvm::Linker>(new ::llvm::Linker(&mod));
|
||||
#endif
|
||||
}
|
||||
|
||||
inline bool
|
||||
link_in_module(::llvm::Linker &linker,
|
||||
std::unique_ptr<::llvm::Module> mod) {
|
||||
std::unique_ptr< ::llvm::Module> mod) {
|
||||
#if HAVE_LLVM >= 0x0308
|
||||
return linker.linkInModule(std::move(mod));
|
||||
#else
|
||||
|
@@ -51,7 +51,7 @@ namespace clover {
|
||||
is_kernel_node_for(const ::llvm::Function &f) {
|
||||
return [&](const ::llvm::MDNode *n) {
|
||||
using ::llvm::mdconst::dyn_extract;
|
||||
return &f == dyn_extract<::llvm::Function>(n->getOperand(0));
|
||||
return &f == dyn_extract< ::llvm::Function>(n->getOperand(0));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace clover {
|
||||
#endif
|
||||
}
|
||||
|
||||
inline iterator_range<::llvm::MDNode::op_iterator>
|
||||
inline iterator_range< ::llvm::MDNode::op_iterator>
|
||||
get_kernel_metadata_operands(const ::llvm::Function &f,
|
||||
const std::string &name) {
|
||||
#if HAVE_LLVM >= 0x0309
|
||||
@@ -79,11 +79,11 @@ namespace clover {
|
||||
const auto kernel_node = find(is_kernel_node_for(f),
|
||||
get_kernel_nodes(*f.getParent()));
|
||||
|
||||
const auto data_node = cast<::llvm::MDNode>(
|
||||
const auto data_node = cast< ::llvm::MDNode>(
|
||||
find([&](const ::llvm::MDOperand &op) {
|
||||
if (auto m = dyn_cast<::llvm::MDNode>(op))
|
||||
if (auto m = dyn_cast< ::llvm::MDNode>(op))
|
||||
if (m->getNumOperands())
|
||||
if (auto m_name = dyn_cast<::llvm::MDString>(
|
||||
if (auto m_name = dyn_cast< ::llvm::MDString>(
|
||||
m->getOperand(0).get()))
|
||||
return m_name->getString() == name;
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace clover {
|
||||
get_argument_metadata(const ::llvm::Function &f,
|
||||
const ::llvm::Argument &arg,
|
||||
const std::string &name) {
|
||||
return ::llvm::cast<::llvm::MDString>(
|
||||
return ::llvm::cast< ::llvm::MDString>(
|
||||
detail::get_kernel_metadata_operands(f, name)[arg.getArgNo()])
|
||||
->getString();
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ static const struct drm_conf_ret throttle_ret = {
|
||||
|
||||
static const struct drm_conf_ret share_fd_ret = {
|
||||
.type = DRM_CONF_BOOL,
|
||||
.val.val_int = true,
|
||||
.val.val_bool = true,
|
||||
};
|
||||
|
||||
static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
|
||||
|
@@ -24,7 +24,7 @@ static const struct drm_conf_ret throttle_ret = {
|
||||
|
||||
static const struct drm_conf_ret share_fd_ret = {
|
||||
.type = DRM_CONF_BOOL,
|
||||
.val.val_int = true,
|
||||
.val.val_bool = true,
|
||||
};
|
||||
|
||||
static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
|
||||
|
@@ -24,7 +24,7 @@ static const struct drm_conf_ret throttle_ret = {
|
||||
|
||||
static const struct drm_conf_ret share_fd_ret = {
|
||||
.type = DRM_CONF_BOOL,
|
||||
.val.val_int = true,
|
||||
.val.val_bool = true,
|
||||
};
|
||||
|
||||
static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
|
||||
|
@@ -20,7 +20,7 @@ static const struct drm_conf_ret throttle_ret = {
|
||||
|
||||
static const struct drm_conf_ret share_fd_ret = {
|
||||
.type = DRM_CONF_BOOL,
|
||||
.val.val_int = true,
|
||||
.val.val_bool = true,
|
||||
};
|
||||
|
||||
static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
|
||||
|
@@ -20,7 +20,7 @@ static const struct drm_conf_ret throttle_ret = {
|
||||
|
||||
static const struct drm_conf_ret share_fd_ret = {
|
||||
.type = DRM_CONF_BOOL,
|
||||
.val.val_int = true,
|
||||
.val.val_bool = true,
|
||||
};
|
||||
|
||||
static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
|
||||
|
@@ -26,7 +26,7 @@ static const struct drm_conf_ret throttle_ret = {
|
||||
|
||||
static const struct drm_conf_ret share_fd_ret = {
|
||||
.type = DRM_CONF_BOOL,
|
||||
.val.val_int = true,
|
||||
.val.val_bool = true,
|
||||
};
|
||||
|
||||
static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
|
||||
|
@@ -30,7 +30,7 @@ static const struct drm_conf_ret throttle_ret = {
|
||||
|
||||
static const struct drm_conf_ret share_fd_ret = {
|
||||
.type = DRM_CONF_BOOL,
|
||||
.val.val_int = true,
|
||||
.val.val_bool = true,
|
||||
};
|
||||
|
||||
static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
|
||||
|
@@ -200,7 +200,7 @@ dri_sw_displaytarget_display(struct sw_winsys *ws,
|
||||
|
||||
if (box) {
|
||||
void *data;
|
||||
data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize;
|
||||
data = (char *)dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize;
|
||||
dri_sw_ws->lf->put_image2(dri_drawable, data,
|
||||
box->x, box->y, box->width, box->height, dri_sw_dt->stride);
|
||||
} else {
|
||||
|
@@ -822,12 +822,11 @@ fs_visitor::choose_spill_reg(struct ra_graph *g)
|
||||
foreach_block_and_inst(block, fs_inst, inst, cfg) {
|
||||
for (unsigned int i = 0; i < inst->sources; i++) {
|
||||
if (inst->src[i].file == VGRF)
|
||||
spill_costs[inst->src[i].nr] += block_scale;
|
||||
spill_costs[inst->src[i].nr] += regs_read(inst, i) * block_scale;
|
||||
}
|
||||
|
||||
if (inst->dst.file == VGRF)
|
||||
spill_costs[inst->dst.nr] += DIV_ROUND_UP(inst->size_written, REG_SIZE)
|
||||
* block_scale;
|
||||
spill_costs[inst->dst.nr] += regs_written(inst) * block_scale;
|
||||
|
||||
switch (inst->opcode) {
|
||||
|
||||
|
@@ -1071,6 +1071,13 @@ vec4_instruction::can_reswizzle(const struct gen_device_info *devinfo,
|
||||
if (devinfo->gen == 6 && is_math() && swizzle != BRW_SWIZZLE_XYZW)
|
||||
return false;
|
||||
|
||||
/* We can't swizzle implicit accumulator access. We'd have to
|
||||
* reswizzle the producer of the accumulator value in addition
|
||||
* to the consumer (i.e. both MUL and MACH). Just skip this.
|
||||
*/
|
||||
if (reads_accumulator_implicitly())
|
||||
return false;
|
||||
|
||||
if (!can_do_writemask(devinfo) && dst_writemask != WRITEMASK_XYZW)
|
||||
return false;
|
||||
|
||||
|
@@ -993,6 +993,25 @@ anv_scratch_pool_alloc(struct anv_device *device, struct anv_scratch_pool *pool,
|
||||
|
||||
anv_bo_init_new(&bo->bo, device, size);
|
||||
|
||||
/* Even though the Scratch base pointers in 3DSTATE_*S are 64 bits, they
|
||||
* are still relative to the general state base address. When we emit
|
||||
* STATE_BASE_ADDRESS, we set general state base address to 0 and the size
|
||||
* to the maximum (1 page under 4GB). This allows us to just place the
|
||||
* scratch buffers anywhere we wish in the bottom 32 bits of address space
|
||||
* and just set the scratch base pointer in 3DSTATE_*S using a relocation.
|
||||
* However, in order to do so, we need to ensure that the kernel does not
|
||||
* place the scratch BO above the 32-bit boundary.
|
||||
*
|
||||
* NOTE: Technically, it can't go "anywhere" because the top page is off
|
||||
* limits. However, when EXEC_OBJECT_SUPPORTS_48B_ADDRESS is set, the
|
||||
* kernel allocates space using
|
||||
*
|
||||
* end = min_t(u64, end, (1ULL << 32) - I915_GTT_PAGE_SIZE);
|
||||
*
|
||||
* so nothing will ever touch the top page.
|
||||
*/
|
||||
bo->bo.flags &= ~EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
|
||||
|
||||
/* Set the exists last because it may be read by other threads */
|
||||
__sync_synchronize();
|
||||
bo->exists = true;
|
||||
|
@@ -1265,7 +1265,7 @@ anv_cmd_buffer_execbuf(struct anv_device *device,
|
||||
cmd_buffer->last_ss_pool_center);
|
||||
VkResult result =
|
||||
anv_execbuf_add_bo(&execbuf, &ss_pool->bo, &cmd_buffer->surface_relocs,
|
||||
&cmd_buffer->pool->alloc);
|
||||
&device->alloc);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
@@ -1278,7 +1278,7 @@ anv_cmd_buffer_execbuf(struct anv_device *device,
|
||||
cmd_buffer->last_ss_pool_center);
|
||||
|
||||
result = anv_execbuf_add_bo(&execbuf, &(*bbo)->bo, &(*bbo)->relocs,
|
||||
&cmd_buffer->pool->alloc);
|
||||
&device->alloc);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
}
|
||||
@@ -1387,7 +1387,7 @@ anv_cmd_buffer_execbuf(struct anv_device *device,
|
||||
|
||||
result = anv_device_execbuf(device, &execbuf.execbuf, execbuf.bos);
|
||||
|
||||
anv_execbuf_finish(&execbuf, &cmd_buffer->pool->alloc);
|
||||
anv_execbuf_finish(&execbuf, &device->alloc);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@@ -701,10 +701,10 @@ void anv_CmdUpdateBuffer(
|
||||
struct anv_state tmp_data =
|
||||
anv_cmd_buffer_alloc_dynamic_state(cmd_buffer, copy_size, 64);
|
||||
|
||||
anv_state_flush(cmd_buffer->device, tmp_data);
|
||||
|
||||
memcpy(tmp_data.map, pData, copy_size);
|
||||
|
||||
anv_state_flush(cmd_buffer->device, tmp_data);
|
||||
|
||||
int bs = 16;
|
||||
bs = gcd_pow2_u64(bs, dstOffset);
|
||||
bs = gcd_pow2_u64(bs, copy_size);
|
||||
@@ -1398,7 +1398,6 @@ ccs_resolve_attachment(struct anv_cmd_buffer *cmd_buffer,
|
||||
* still hot in the cache.
|
||||
*/
|
||||
bool found_draw = false;
|
||||
bool self_dep = false;
|
||||
enum anv_subpass_usage usage = 0;
|
||||
for (uint32_t s = subpass_idx + 1; s < pass->subpass_count; s++) {
|
||||
usage |= pass->attachments[att].subpass_usage[s];
|
||||
@@ -1408,8 +1407,6 @@ ccs_resolve_attachment(struct anv_cmd_buffer *cmd_buffer,
|
||||
* wait to resolve until then.
|
||||
*/
|
||||
found_draw = true;
|
||||
if (pass->attachments[att].subpass_usage[s] & ANV_SUBPASS_USAGE_INPUT)
|
||||
self_dep = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1468,14 +1465,6 @@ ccs_resolve_attachment(struct anv_cmd_buffer *cmd_buffer,
|
||||
* binding this surface to Sampler."
|
||||
*/
|
||||
resolve_op = BLORP_FAST_CLEAR_OP_RESOLVE_PARTIAL;
|
||||
} else if (cmd_buffer->device->info.gen == 8 && self_dep &&
|
||||
att_state->input_aux_usage == ISL_AUX_USAGE_CCS_D) {
|
||||
/* On Broadwell we still need to do resolves when there is a
|
||||
* self-dependency because HW could not see fast-clears and works
|
||||
* on the render cache as if there was regular non-fast-clear surface.
|
||||
* To avoid any inconsistency, we force the resolve.
|
||||
*/
|
||||
resolve_op = BLORP_FAST_CLEAR_OP_RESOLVE_FULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -291,27 +291,21 @@ color_attachment_compute_aux_usage(struct anv_device *device,
|
||||
att_state->input_aux_usage = ISL_AUX_USAGE_CCS_E;
|
||||
} else if (att_state->fast_clear) {
|
||||
att_state->aux_usage = ISL_AUX_USAGE_CCS_D;
|
||||
if (GEN_GEN >= 9 &&
|
||||
!isl_format_supports_ccs_e(&device->info, iview->isl.format)) {
|
||||
/* From the Sky Lake PRM, RENDER_SURFACE_STATE::AuxiliarySurfaceMode:
|
||||
*
|
||||
* "If Number of Multisamples is MULTISAMPLECOUNT_1, AUX_CCS_D
|
||||
* setting is only allowed if Surface Format supported for Fast
|
||||
* Clear. In addition, if the surface is bound to the sampling
|
||||
* engine, Surface Format must be supported for Render Target
|
||||
* Compression for surfaces bound to the sampling engine."
|
||||
*
|
||||
* In other words, we can't sample from a fast-cleared image if it
|
||||
* doesn't also support color compression.
|
||||
*/
|
||||
att_state->input_aux_usage = ISL_AUX_USAGE_NONE;
|
||||
} else if (GEN_GEN >= 8) {
|
||||
/* Broadwell/Skylake can sample from fast-cleared images */
|
||||
/* From the Sky Lake PRM, RENDER_SURFACE_STATE::AuxiliarySurfaceMode:
|
||||
*
|
||||
* "If Number of Multisamples is MULTISAMPLECOUNT_1, AUX_CCS_D
|
||||
* setting is only allowed if Surface Format supported for Fast
|
||||
* Clear. In addition, if the surface is bound to the sampling
|
||||
* engine, Surface Format must be supported for Render Target
|
||||
* Compression for surfaces bound to the sampling engine."
|
||||
*
|
||||
* In other words, we can only sample from a fast-cleared image if it
|
||||
* also supports color compression.
|
||||
*/
|
||||
if (isl_format_supports_ccs_e(&device->info, iview->isl.format))
|
||||
att_state->input_aux_usage = ISL_AUX_USAGE_CCS_D;
|
||||
} else {
|
||||
/* Ivy Bridge and Haswell cannot */
|
||||
else
|
||||
att_state->input_aux_usage = ISL_AUX_USAGE_NONE;
|
||||
}
|
||||
} else {
|
||||
att_state->aux_usage = ISL_AUX_USAGE_NONE;
|
||||
att_state->input_aux_usage = ISL_AUX_USAGE_NONE;
|
||||
|
@@ -10219,7 +10219,7 @@
|
||||
</category>
|
||||
|
||||
<category name="GL_EXT_multi_draw_arrays" number="148">
|
||||
<function name="MultiDrawArraysEXT" es1="1.0" es2="2.0" alias="MultiDrawArrays">
|
||||
<function name="MultiDrawArraysEXT" es1="1.0" es2="2.0" exec="dynamic" alias="MultiDrawArrays">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="first" type="const GLint *"/>
|
||||
<param name="count" type="const GLsizei *"/>
|
||||
|
@@ -96,6 +96,7 @@ endif
|
||||
|
||||
AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
|
||||
AM_CFLAGS = \
|
||||
$(VDPAU_CFLAGS) \
|
||||
$(LLVM_CFLAGS) \
|
||||
$(VISIBILITY_CFLAGS) \
|
||||
$(MSVC2013_COMPAT_CFLAGS)
|
||||
|
@@ -816,25 +816,10 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
|
||||
"glDrawRangeElements");
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
validate_draw_arrays(struct gl_context *ctx, const char *func,
|
||||
GLenum mode, GLsizei count, GLsizei numInstances)
|
||||
need_xfb_remaining_prims_check(const struct gl_context *ctx)
|
||||
{
|
||||
struct gl_transform_feedback_object *xfb_obj
|
||||
= ctx->TransformFeedback.CurrentObject;
|
||||
FLUSH_CURRENT(ctx, 0);
|
||||
|
||||
if (count < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "%s(count)", func);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!_mesa_valid_prim_mode(ctx, mode, func))
|
||||
return false;
|
||||
|
||||
if (!check_valid_to_render(ctx, func))
|
||||
return false;
|
||||
|
||||
/* From the GLES3 specification, section 2.14.2 (Transform Feedback
|
||||
* Primitive Capture):
|
||||
*
|
||||
@@ -862,10 +847,33 @@ validate_draw_arrays(struct gl_context *ctx, const char *func,
|
||||
* is removed and replaced with the GL behavior (primitives are not
|
||||
* written and the corresponding counter is not updated)..."
|
||||
*/
|
||||
if (_mesa_is_gles3(ctx) && _mesa_is_xfb_active_and_unpaused(ctx) &&
|
||||
!_mesa_has_OES_geometry_shader(ctx) &&
|
||||
!_mesa_has_OES_tessellation_shader(ctx)) {
|
||||
size_t prim_count = vbo_count_tessellated_primitives(mode, count, 1);
|
||||
return _mesa_is_gles3(ctx) && _mesa_is_xfb_active_and_unpaused(ctx) &&
|
||||
!_mesa_has_OES_geometry_shader(ctx) &&
|
||||
!_mesa_has_OES_tessellation_shader(ctx);
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
validate_draw_arrays(struct gl_context *ctx, const char *func,
|
||||
GLenum mode, GLsizei count, GLsizei numInstances)
|
||||
{
|
||||
FLUSH_CURRENT(ctx, 0);
|
||||
|
||||
if (count < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "%s(count)", func);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!_mesa_valid_prim_mode(ctx, mode, func))
|
||||
return false;
|
||||
|
||||
if (!check_valid_to_render(ctx, func))
|
||||
return false;
|
||||
|
||||
if (need_xfb_remaining_prims_check(ctx)) {
|
||||
struct gl_transform_feedback_object *xfb_obj
|
||||
= ctx->TransformFeedback.CurrentObject;
|
||||
size_t prim_count = vbo_count_tessellated_primitives(mode, count, numInstances);
|
||||
if (xfb_obj->GlesRemainingPrims < prim_count) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"%s(exceeds transform feedback size)", func);
|
||||
@@ -913,6 +921,60 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called to error check the function parameters.
|
||||
*
|
||||
* Note that glMultiDrawArrays is not part of GLES, so there's limited scope
|
||||
* for sharing code with the validation of glDrawArrays.
|
||||
*/
|
||||
bool
|
||||
_mesa_validate_MultiDrawArrays(struct gl_context *ctx, GLenum mode,
|
||||
const GLsizei *count, GLsizei primcount)
|
||||
{
|
||||
int i;
|
||||
|
||||
FLUSH_CURRENT(ctx, 0);
|
||||
|
||||
if (!_mesa_valid_prim_mode(ctx, mode, "glMultiDrawArrays"))
|
||||
return false;
|
||||
|
||||
if (!check_valid_to_render(ctx, "glMultiDrawArrays"))
|
||||
return false;
|
||||
|
||||
if (primcount < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glMultiDrawArrays(primcount=%d)",
|
||||
primcount);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (i = 0; i < primcount; ++i) {
|
||||
if (count[i] < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glMultiDrawArrays(count[%d]=%d)",
|
||||
i, count[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (need_xfb_remaining_prims_check(ctx)) {
|
||||
struct gl_transform_feedback_object *xfb_obj
|
||||
= ctx->TransformFeedback.CurrentObject;
|
||||
size_t xfb_prim_count = 0;
|
||||
|
||||
for (i = 0; i < primcount; ++i)
|
||||
xfb_prim_count += vbo_count_tessellated_primitives(mode, count[i], 1);
|
||||
|
||||
if (xfb_obj->GlesRemainingPrims < xfb_prim_count) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glMultiDrawArrays(exceeds transform feedback size)");
|
||||
return false;
|
||||
}
|
||||
xfb_obj->GlesRemainingPrims -= xfb_prim_count;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
GLboolean
|
||||
_mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
|
||||
GLenum mode, GLsizei count, GLenum type,
|
||||
|
@@ -48,6 +48,10 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name);
|
||||
extern GLboolean
|
||||
_mesa_validate_DrawArrays(struct gl_context *ctx, GLenum mode, GLsizei count);
|
||||
|
||||
extern bool
|
||||
_mesa_validate_MultiDrawArrays(struct gl_context *ctx, GLenum mode,
|
||||
const GLsizei *count, GLsizei primcount);
|
||||
|
||||
extern GLboolean
|
||||
_mesa_validate_DrawElements(struct gl_context *ctx,
|
||||
GLenum mode, GLsizei count, GLenum type,
|
||||
|
@@ -265,7 +265,7 @@ _mesa_glthread_finish(struct gl_context *ctx)
|
||||
* dri interface entrypoints), in which case we don't need to actually
|
||||
* synchronize against ourself.
|
||||
*/
|
||||
if (pthread_self() == glthread->thread)
|
||||
if (pthread_equal(pthread_self(), glthread->thread))
|
||||
return;
|
||||
|
||||
pthread_mutex_lock(&glthread->mutex);
|
||||
|
@@ -945,6 +945,8 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values,
|
||||
*/
|
||||
if (uni->type->is_sampler()) {
|
||||
bool flushed = false;
|
||||
shProg->SamplersValidated = GL_TRUE;
|
||||
|
||||
for (int i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||
struct gl_linked_shader *const sh = shProg->_LinkedShaders[i];
|
||||
|
||||
|
@@ -67,11 +67,15 @@ void
|
||||
_mesa_update_shader_textures_used(struct gl_shader_program *shProg,
|
||||
struct gl_program *prog)
|
||||
{
|
||||
GLbitfield mask = prog->SamplersUsed;
|
||||
gl_shader_stage prog_stage =
|
||||
_mesa_program_enum_to_shader_stage(prog->Target);
|
||||
struct gl_linked_shader *shader = shProg->_LinkedShaders[prog_stage];
|
||||
|
||||
assert(shader);
|
||||
|
||||
memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed));
|
||||
|
||||
shProg->SamplersValidated = GL_TRUE;
|
||||
|
||||
GLbitfield mask = prog->SamplersUsed;
|
||||
while (mask) {
|
||||
const int s = u_bit_scan(&mask);
|
||||
GLuint unit = prog->SamplerUnits[s];
|
||||
@@ -87,8 +91,20 @@ _mesa_update_shader_textures_used(struct gl_shader_program *shProg,
|
||||
* types pointing to the same texture image unit within a program
|
||||
* object."
|
||||
*/
|
||||
if (prog->TexturesUsed[unit] & ~(1 << tgt))
|
||||
shProg->SamplersValidated = GL_FALSE;
|
||||
unsigned stages_mask = shProg->data->linked_stages;
|
||||
while (stages_mask) {
|
||||
const int stage = u_bit_scan(&stages_mask);
|
||||
|
||||
/* Skip validation if we are yet to update textures used in this
|
||||
* stage.
|
||||
*/
|
||||
if (prog_stage < stage)
|
||||
break;
|
||||
|
||||
struct gl_program *glprog = shProg->_LinkedShaders[stage]->Program;
|
||||
if (glprog->TexturesUsed[unit] & ~(1 << tgt))
|
||||
shProg->SamplersValidated = GL_FALSE;
|
||||
}
|
||||
|
||||
prog->TexturesUsed[unit] |= (1 << tgt);
|
||||
}
|
||||
|
@@ -1539,24 +1539,6 @@ _mesa_UnlockArraysEXT( void )
|
||||
}
|
||||
|
||||
|
||||
/* GL_EXT_multi_draw_arrays */
|
||||
void GLAPIENTRY
|
||||
_mesa_MultiDrawArrays( GLenum mode, const GLint *first,
|
||||
const GLsizei *count, GLsizei primcount )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLint i;
|
||||
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
|
||||
for (i = 0; i < primcount; i++) {
|
||||
if (count[i] > 0) {
|
||||
CALL_DrawArrays(ctx->CurrentClientDispatch, (mode, first[i], count[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* GL_IBM_multimode_draw_arrays */
|
||||
void GLAPIENTRY
|
||||
_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,
|
||||
|
@@ -3117,6 +3117,11 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
}
|
||||
|
||||
if (prog->data->LinkStatus) {
|
||||
/* Reset sampler validated to true, validation happens via the
|
||||
* LinkShader call below.
|
||||
*/
|
||||
prog->SamplersValidated = GL_TRUE;
|
||||
|
||||
if (!ctx->Driver.LinkShader(ctx, prog)) {
|
||||
prog->data->LinkStatus = linking_failure;
|
||||
}
|
||||
|
@@ -85,7 +85,8 @@ static inline struct st_framebuffer *
|
||||
st_ws_framebuffer(struct gl_framebuffer *fb)
|
||||
{
|
||||
/* FBO cannot be casted. See st_new_framebuffer */
|
||||
if (fb && _mesa_is_winsys_fbo(fb))
|
||||
if (fb && _mesa_is_winsys_fbo(fb) &&
|
||||
fb != _mesa_get_incomplete_framebuffer())
|
||||
return (struct st_framebuffer *) fb;
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -282,6 +282,8 @@ st_indirect_draw_vbo(struct gl_context *ctx,
|
||||
assert(ctx->NewState == 0x0);
|
||||
assert(stride);
|
||||
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
/* Validate state. */
|
||||
if ((st->dirty | ctx->NewDriverState) & ST_PIPELINE_RENDER_STATE_MASK ||
|
||||
st->gfx_shaders_may_be_dirty) {
|
||||
|
@@ -844,13 +844,14 @@ st_manager_flush_frontbuffer(struct st_context *st)
|
||||
struct st_framebuffer *stfb = st_ws_framebuffer(st->ctx->DrawBuffer);
|
||||
struct st_renderbuffer *strb = NULL;
|
||||
|
||||
assert(st->ctx->DrawBuffer != _mesa_get_incomplete_framebuffer());
|
||||
|
||||
if (stfb)
|
||||
strb = st_renderbuffer(stfb->Base.Attachment[BUFFER_FRONT_LEFT].Renderbuffer);
|
||||
if (!strb)
|
||||
return;
|
||||
|
||||
/* never a dummy fb */
|
||||
assert(&stfb->Base != _mesa_get_incomplete_framebuffer());
|
||||
stfb->iface->flush_front(&st->iface, stfb->iface, ST_ATTACHMENT_FRONT_LEFT);
|
||||
}
|
||||
|
||||
|
@@ -404,7 +404,8 @@ vbo_bind_arrays(struct gl_context *ctx)
|
||||
*/
|
||||
static void
|
||||
vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
|
||||
GLsizei count, GLuint numInstances, GLuint baseInstance)
|
||||
GLsizei count, GLuint numInstances, GLuint baseInstance,
|
||||
GLuint drawID)
|
||||
{
|
||||
struct vbo_context *vbo = vbo_context(ctx);
|
||||
struct _mesa_prim prim[2];
|
||||
@@ -420,6 +421,7 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
|
||||
prim[0].mode = mode;
|
||||
prim[0].num_instances = numInstances;
|
||||
prim[0].base_instance = baseInstance;
|
||||
prim[0].draw_id = drawID;
|
||||
prim[0].is_indirect = 0;
|
||||
prim[0].start = start;
|
||||
prim[0].count = count;
|
||||
@@ -572,7 +574,7 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
|
||||
if (0)
|
||||
check_draw_arrays_data(ctx, start, count);
|
||||
|
||||
vbo_draw_arrays(ctx, mode, start, count, 1, 0);
|
||||
vbo_draw_arrays(ctx, mode, start, count, 1, 0, 0);
|
||||
|
||||
if (0)
|
||||
print_draw_arrays(ctx, mode, start, count);
|
||||
@@ -600,7 +602,7 @@ vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
|
||||
if (0)
|
||||
check_draw_arrays_data(ctx, start, count);
|
||||
|
||||
vbo_draw_arrays(ctx, mode, start, count, numInstances, 0);
|
||||
vbo_draw_arrays(ctx, mode, start, count, numInstances, 0, 0);
|
||||
|
||||
if (0)
|
||||
print_draw_arrays(ctx, mode, start, count);
|
||||
@@ -630,13 +632,52 @@ vbo_exec_DrawArraysInstancedBaseInstance(GLenum mode, GLint first,
|
||||
if (0)
|
||||
check_draw_arrays_data(ctx, first, count);
|
||||
|
||||
vbo_draw_arrays(ctx, mode, first, count, numInstances, baseInstance);
|
||||
vbo_draw_arrays(ctx, mode, first, count, numInstances, baseInstance, 0);
|
||||
|
||||
if (0)
|
||||
print_draw_arrays(ctx, mode, first, count);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called from glMultiDrawArrays when in immediate mode.
|
||||
*/
|
||||
static void GLAPIENTRY
|
||||
vbo_exec_MultiDrawArrays(GLenum mode, const GLint *first,
|
||||
const GLsizei *count, GLsizei primcount)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLint i;
|
||||
|
||||
if (MESA_VERBOSE & VERBOSE_DRAW)
|
||||
_mesa_debug(ctx,
|
||||
"glMultiDrawArrays(%s, %p, %p, %d)\n",
|
||||
_mesa_enum_to_string(mode), first, count, primcount);
|
||||
|
||||
if (!_mesa_validate_MultiDrawArrays(ctx, mode, count, primcount))
|
||||
return;
|
||||
|
||||
for (i = 0; i < primcount; i++) {
|
||||
if (count[i] > 0) {
|
||||
if (0)
|
||||
check_draw_arrays_data(ctx, first[i], count[i]);
|
||||
|
||||
/* The GL_ARB_shader_draw_parameters spec adds the following after the
|
||||
* pseudo-code describing glMultiDrawArrays:
|
||||
*
|
||||
* "The index of the draw (<i> in the above pseudo-code) may be
|
||||
* read by a vertex shader as <gl_DrawIDARB>, as described in
|
||||
* Section 11.1.3.9."
|
||||
*/
|
||||
vbo_draw_arrays(ctx, mode, first[i], count[i], 1, 0, i);
|
||||
|
||||
if (0)
|
||||
print_draw_arrays(ctx, mode, first[i], count[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Map GL_ELEMENT_ARRAY_BUFFER and print contents.
|
||||
@@ -1230,7 +1271,7 @@ vbo_draw_transform_feedback(struct gl_context *ctx, GLenum mode,
|
||||
!_mesa_all_varyings_in_vbos(ctx->Array.VAO))) {
|
||||
GLsizei n =
|
||||
ctx->Driver.GetTransformFeedbackVertexCount(ctx, obj, stream);
|
||||
vbo_draw_arrays(ctx, mode, 0, n, numInstances, 0);
|
||||
vbo_draw_arrays(ctx, mode, 0, n, numInstances, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1641,6 +1682,7 @@ vbo_initialize_exec_dispatch(const struct gl_context *ctx,
|
||||
SET_DrawRangeElements(exec, vbo_exec_DrawRangeElements);
|
||||
}
|
||||
|
||||
SET_MultiDrawArrays(exec, vbo_exec_MultiDrawArrays);
|
||||
SET_MultiDrawElementsEXT(exec, vbo_exec_MultiDrawElements);
|
||||
|
||||
if (ctx->API == API_OPENGL_COMPAT) {
|
||||
|
@@ -1176,6 +1176,40 @@ _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei count)
|
||||
}
|
||||
|
||||
|
||||
static void GLAPIENTRY
|
||||
_save_OBE_MultiDrawArrays(GLenum mode, const GLint *first,
|
||||
const GLsizei *count, GLsizei primcount)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLint i;
|
||||
|
||||
if (!_mesa_is_valid_prim_mode(ctx, mode)) {
|
||||
_mesa_compile_error(ctx, GL_INVALID_ENUM, "glMultiDrawArrays(mode)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (primcount < 0) {
|
||||
_mesa_compile_error(ctx, GL_INVALID_VALUE,
|
||||
"glMultiDrawArrays(primcount<0)");
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < primcount; i++) {
|
||||
if (count[i] < 0) {
|
||||
_mesa_compile_error(ctx, GL_INVALID_VALUE,
|
||||
"glMultiDrawArrays(count[i]<0)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < primcount; i++) {
|
||||
if (count[i] > 0) {
|
||||
_save_OBE_DrawArrays(mode, first[i], count[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Could do better by copying the arrays and element list intact and
|
||||
* then emitting an indexed prim at runtime.
|
||||
*/
|
||||
@@ -1484,6 +1518,7 @@ vbo_initialize_save_dispatch(const struct gl_context *ctx,
|
||||
struct _glapi_table *exec)
|
||||
{
|
||||
SET_DrawArrays(exec, _save_OBE_DrawArrays);
|
||||
SET_MultiDrawArrays(exec, _save_OBE_MultiDrawArrays);
|
||||
SET_DrawElements(exec, _save_OBE_DrawElements);
|
||||
SET_DrawElementsBaseVertex(exec, _save_OBE_DrawElementsBaseVertex);
|
||||
SET_DrawRangeElements(exec, _save_OBE_DrawRangeElements);
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include <sys/file.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
@@ -47,7 +46,6 @@
|
||||
#include "util/mesa-sha1.h"
|
||||
#include "util/ralloc.h"
|
||||
#include "main/errors.h"
|
||||
#include "util/macros.h"
|
||||
|
||||
#include "disk_cache.h"
|
||||
|
||||
@@ -171,7 +169,6 @@ disk_cache_create(const char *gpu_name, const char *timestamp)
|
||||
uint64_t max_size;
|
||||
int fd = -1;
|
||||
struct stat sb;
|
||||
struct statvfs vfs = { 0 };
|
||||
size_t size;
|
||||
|
||||
/* If running as a users other than the real user disable cache */
|
||||
@@ -331,10 +328,9 @@ disk_cache_create(const char *gpu_name, const char *timestamp)
|
||||
}
|
||||
}
|
||||
|
||||
/* Default to 1GB or 10% of filesystem for maximum cache size. */
|
||||
/* Default to 1GB for maximum cache size. */
|
||||
if (max_size == 0) {
|
||||
statvfs(path, &vfs);
|
||||
max_size = MAX2(1024*1024*1024, vfs.f_blocks * vfs.f_bsize / 10);
|
||||
max_size = 1024*1024*1024;
|
||||
}
|
||||
|
||||
cache->max_size = max_size;
|
||||
@@ -532,7 +528,7 @@ unlink_lru_file_from_directory(const char *path)
|
||||
unlink(filename);
|
||||
free (filename);
|
||||
|
||||
return sb.st_size;
|
||||
return sb.st_blocks * 512;
|
||||
}
|
||||
|
||||
/* Is entry a directory with a two-character name, (and not the
|
||||
@@ -637,8 +633,8 @@ disk_cache_remove(struct disk_cache *cache, const cache_key key)
|
||||
unlink(filename);
|
||||
free(filename);
|
||||
|
||||
if (sb.st_size)
|
||||
p_atomic_add(cache->size, - (uint64_t)sb.st_size);
|
||||
if (sb.st_blocks)
|
||||
p_atomic_add(cache->size, - (uint64_t)sb.st_blocks * 512);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
@@ -880,8 +876,14 @@ cache_put(void *job, int thread_index)
|
||||
goto done;
|
||||
}
|
||||
|
||||
file_size += cf_data_size + dc_job->cache->driver_keys_blob_size;
|
||||
p_atomic_add(dc_job->cache->size, file_size);
|
||||
struct stat sb;
|
||||
if (stat(filename, &sb) == -1) {
|
||||
/* Something went wrong remove the file */
|
||||
unlink(filename);
|
||||
goto done;
|
||||
}
|
||||
|
||||
p_atomic_add(dc_job->cache->size, sb.st_blocks * 512);
|
||||
|
||||
done:
|
||||
if (fd_final != -1)
|
||||
|
@@ -298,9 +298,18 @@ util_queue_add_job(struct util_queue *queue,
|
||||
struct util_queue_job *ptr;
|
||||
|
||||
assert(fence->signalled);
|
||||
fence->signalled = false;
|
||||
|
||||
mtx_lock(&queue->lock);
|
||||
if (queue->kill_threads) {
|
||||
mtx_unlock(&queue->lock);
|
||||
/* well no good option here, but any leaks will be
|
||||
* short-lived as things are shutting down..
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
fence->signalled = false;
|
||||
|
||||
assert(queue->num_queued >= 0 && queue->num_queued <= queue->max_jobs);
|
||||
|
||||
/* if the queue is full, wait until there is space */
|
||||
|
Reference in New Issue
Block a user