Compare commits
2 Commits
mesa-11.2.
...
mesa-11.0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab94875352 | ||
|
|
f077632030 |
@@ -5,7 +5,6 @@
|
||||
(c-file-style . "stroustrup")
|
||||
(fill-column . 78)
|
||||
(eval . (progn
|
||||
(c-set-offset 'case-label '0)
|
||||
(c-set-offset 'innamespace '0)
|
||||
(c-set-offset 'inline-open '0)))
|
||||
)
|
||||
|
||||
101
.travis.yml
101
.travis.yml
@@ -1,101 +0,0 @@
|
||||
language: c
|
||||
|
||||
sudo: false
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.ccache
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libdrm-dev
|
||||
- libudev-dev
|
||||
- x11proto-xf86vidmode-dev
|
||||
- libexpat1-dev
|
||||
- libxcb-dri2-0-dev
|
||||
- libx11-xcb-dev
|
||||
- llvm-3.4-dev
|
||||
- scons
|
||||
|
||||
env:
|
||||
global:
|
||||
- XORG_RELEASES=http://xorg.freedesktop.org/releases/individual
|
||||
- XCB_RELEASES=http://xcb.freedesktop.org/dist
|
||||
- XORGMACROS_VERSION=util-macros-1.19.0
|
||||
- GLPROTO_VERSION=glproto-1.4.17
|
||||
- DRI2PROTO_VERSION=dri2proto-2.8
|
||||
- DRI3PROTO_VERSION=dri3proto-1.0
|
||||
- PRESENTPROTO_VERSION=presentproto-1.0
|
||||
- LIBPCIACCESS_VERSION=libpciaccess-0.13.4
|
||||
- LIBDRM_VERSION=libdrm-2.4.65
|
||||
- XCBPROTO_VERSION=xcb-proto-1.11
|
||||
- LIBXCB_VERSION=libxcb-1.11
|
||||
- LIBXSHMFENCE_VERSION=libxshmfence-1.2
|
||||
- PKG_CONFIG_PATH=$HOME/prefix/lib/pkgconfig
|
||||
matrix:
|
||||
- BUILD=make
|
||||
- BUILD=scons
|
||||
|
||||
install:
|
||||
- export PATH="/usr/lib/ccache:$PATH"
|
||||
- pip install --user mako
|
||||
|
||||
# Install dependencies where we require specific versions (or where
|
||||
# disallowed by Travis CI's package whitelisting).
|
||||
|
||||
- wget $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
|
||||
- tar -jxvf $XORGMACROS_VERSION.tar.bz2
|
||||
- (cd $XORGMACROS_VERSION && ./configure --prefix=$HOME/prefix && make install)
|
||||
|
||||
- wget $XORG_RELEASES/proto/$GLPROTO_VERSION.tar.bz2
|
||||
- tar -jxvf $GLPROTO_VERSION.tar.bz2
|
||||
- (cd $GLPROTO_VERSION && ./configure --prefix=$HOME/prefix && make install)
|
||||
|
||||
- wget $XORG_RELEASES/proto/$DRI2PROTO_VERSION.tar.bz2
|
||||
- tar -jxvf $DRI2PROTO_VERSION.tar.bz2
|
||||
- (cd $DRI2PROTO_VERSION && ./configure --prefix=$HOME/prefix && make install)
|
||||
|
||||
- wget $XORG_RELEASES/proto/$DRI3PROTO_VERSION.tar.bz2
|
||||
- tar -jxvf $DRI3PROTO_VERSION.tar.bz2
|
||||
- (cd $DRI3PROTO_VERSION && ./configure --prefix=$HOME/prefix && make install)
|
||||
|
||||
- wget $XORG_RELEASES/proto/$PRESENTPROTO_VERSION.tar.bz2
|
||||
- tar -jxvf $PRESENTPROTO_VERSION.tar.bz2
|
||||
- (cd $PRESENTPROTO_VERSION && ./configure --prefix=$HOME/prefix && make install)
|
||||
|
||||
- wget $XCB_RELEASES/$XCBPROTO_VERSION.tar.bz2
|
||||
- tar -jxvf $XCBPROTO_VERSION.tar.bz2
|
||||
- (cd $XCBPROTO_VERSION && ./configure --prefix=$HOME/prefix && make install)
|
||||
|
||||
- wget $XCB_RELEASES/$LIBXCB_VERSION.tar.bz2
|
||||
- tar -jxvf $LIBXCB_VERSION.tar.bz2
|
||||
- (cd $LIBXCB_VERSION && ./configure --prefix=$HOME/prefix && make install)
|
||||
|
||||
- wget $XORG_RELEASES/lib/$LIBPCIACCESS_VERSION.tar.bz2
|
||||
- tar -jxvf $LIBPCIACCESS_VERSION.tar.bz2
|
||||
- (cd $LIBPCIACCESS_VERSION && ./configure --prefix=$HOME/prefix && make install)
|
||||
|
||||
- wget http://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.bz2
|
||||
- tar -jxvf $LIBDRM_VERSION.tar.bz2
|
||||
- (cd $LIBDRM_VERSION && ./configure --prefix=$HOME/prefix && make install)
|
||||
|
||||
- wget $XORG_RELEASES/lib/$LIBXSHMFENCE_VERSION.tar.bz2
|
||||
- tar -jxvf $LIBXSHMFENCE_VERSION.tar.bz2
|
||||
- (cd $LIBXSHMFENCE_VERSION && ./configure --prefix=$HOME/prefix && make install)
|
||||
|
||||
# Disabled LLVM (and therefore r300 and r600) because the build fails
|
||||
# with "undefined reference to `clock_gettime'" and "undefined
|
||||
# reference to `setupterm'" in llvmpipe.
|
||||
script:
|
||||
- if test "x$BUILD" = xmake; then
|
||||
./autogen.sh --enable-debug
|
||||
--disable-gallium-llvm
|
||||
--with-egl-platforms=x11,drm
|
||||
--with-dri-drivers=i915,i965,radeon,r200,swrast,nouveau
|
||||
--with-gallium-drivers=svga,swrast,vc4,virgl
|
||||
;
|
||||
make && make check;
|
||||
elif test x$BUILD = xscons; then
|
||||
scons;
|
||||
fi
|
||||
@@ -21,8 +21,13 @@
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
|
||||
# use c99 compiler by default
|
||||
ifeq ($(LOCAL_CC),)
|
||||
ifeq ($(LOCAL_IS_HOST_MODULE),true)
|
||||
LOCAL_CFLAGS += -D_GNU_SOURCE
|
||||
LOCAL_CC := $(HOST_CC) -std=c99 -D_GNU_SOURCE
|
||||
else
|
||||
LOCAL_CC := $(TARGET_CC) -std=c99
|
||||
endif
|
||||
endif
|
||||
|
||||
LOCAL_C_INCLUDES += \
|
||||
@@ -32,14 +37,11 @@ LOCAL_C_INCLUDES += \
|
||||
MESA_VERSION := $(shell cat $(MESA_TOP)/VERSION)
|
||||
# define ANDROID_VERSION (e.g., 4.0.x => 0x0400)
|
||||
LOCAL_CFLAGS += \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-date-time \
|
||||
-DPACKAGE_VERSION=\"$(MESA_VERSION)\" \
|
||||
-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\" \
|
||||
-DANDROID_VERSION=0x0$(MESA_ANDROID_MAJOR_VERSION)0$(MESA_ANDROID_MINOR_VERSION)
|
||||
|
||||
LOCAL_CFLAGS += \
|
||||
-D__STDC_LIMIT_MACROS \
|
||||
-DHAVE___BUILTIN_EXPECT \
|
||||
-DHAVE___BUILTIN_FFS \
|
||||
-DHAVE___BUILTIN_FFSLL \
|
||||
@@ -57,10 +59,6 @@ LOCAL_CFLAGS += \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
# mesa requires at least c99 compiler
|
||||
LOCAL_CONLYFLAGS += \
|
||||
-std=c99
|
||||
|
||||
ifeq ($(strip $(MESA_ENABLE_ASM)),true)
|
||||
ifeq ($(TARGET_ARCH),x86)
|
||||
LOCAL_CFLAGS += \
|
||||
@@ -72,7 +70,7 @@ endif
|
||||
|
||||
ifeq ($(MESA_ENABLE_LLVM),true)
|
||||
LOCAL_CFLAGS += \
|
||||
-DHAVE_LLVM=0x0305 -DMESA_LLVM_VERSION_PATCH=2 \
|
||||
-DHAVE_LLVM=0x0305 -DLLVM_VERSION_PATCH=2 \
|
||||
-D__STDC_CONSTANT_MACROS \
|
||||
-D__STDC_FORMAT_MACROS \
|
||||
-D__STDC_LIMIT_MACROS
|
||||
@@ -89,6 +87,3 @@ LOCAL_CPPFLAGS += \
|
||||
ifeq ($(strip $(LOCAL_MODULE_TAGS)),)
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
endif
|
||||
|
||||
# Quiet down the build system and remove any .h files from the sources
|
||||
LOCAL_SRC_FILES := $(patsubst %.h, , $(LOCAL_SRC_FILES))
|
||||
|
||||
11
Android.mk
11
Android.mk
@@ -24,7 +24,7 @@
|
||||
# BOARD_GPU_DRIVERS should be defined. The valid values are
|
||||
#
|
||||
# classic drivers: i915 i965
|
||||
# gallium drivers: swrast freedreno i915g ilo nouveau r300g r600g radeonsi vc4 virgl vmwgfx
|
||||
# gallium drivers: swrast freedreno i915g ilo nouveau r300g r600g radeonsi vc4 vmwgfx
|
||||
#
|
||||
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
|
||||
# module will also be built. DRI modules will be loaded by libGLES_mesa.
|
||||
@@ -42,15 +42,11 @@ $(call local-intermediates-dir)
|
||||
endef
|
||||
endif
|
||||
|
||||
MESA_DRI_MODULE_REL_PATH := dri
|
||||
MESA_DRI_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/$(MESA_DRI_MODULE_REL_PATH)
|
||||
MESA_DRI_MODULE_UNSTRIPPED_PATH := $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/$(MESA_DRI_MODULE_REL_PATH)
|
||||
|
||||
MESA_COMMON_MK := $(MESA_TOP)/Android.common.mk
|
||||
MESA_PYTHON2 := python
|
||||
|
||||
classic_drivers := i915 i965
|
||||
gallium_drivers := swrast freedreno i915g ilo nouveau r300g r600g radeonsi vmwgfx vc4 virgl
|
||||
gallium_drivers := swrast freedreno i915g ilo nouveau r300g r600g radeonsi vmwgfx vc4
|
||||
|
||||
MESA_GPU_DRIVERS := $(strip $(BOARD_GPU_DRIVERS))
|
||||
|
||||
@@ -90,8 +86,7 @@ ifneq ($(strip $(MESA_GPU_DRIVERS)),)
|
||||
SUBDIRS := \
|
||||
src/loader \
|
||||
src/mapi \
|
||||
src/compiler \
|
||||
src/compiler/glsl \
|
||||
src/glsl \
|
||||
src/mesa \
|
||||
src/util \
|
||||
src/egl \
|
||||
|
||||
@@ -24,21 +24,17 @@ SUBDIRS = src
|
||||
AM_DISTCHECK_CONFIGURE_FLAGS = \
|
||||
--enable-dri3 \
|
||||
--enable-gallium-tests \
|
||||
--enable-gallium-osmesa \
|
||||
--enable-gbm \
|
||||
--enable-gles1 \
|
||||
--enable-gles2 \
|
||||
--enable-glx-tls \
|
||||
--enable-nine \
|
||||
--enable-opencl \
|
||||
--enable-va \
|
||||
--enable-vdpau \
|
||||
--enable-xa \
|
||||
--enable-xvmc \
|
||||
--disable-llvm-shared-libs \
|
||||
--with-egl-platforms=x11,wayland,drm,surfaceless \
|
||||
--with-egl-platforms=x11,wayland,drm \
|
||||
--with-dri-drivers=i915,i965,nouveau,radeon,r200,swrast \
|
||||
--with-gallium-drivers=i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast,vc4,virgl
|
||||
--with-gallium-drivers=i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
@@ -54,6 +50,7 @@ noinst_HEADERS = \
|
||||
include/c99_alloca.h \
|
||||
include/c99_compat.h \
|
||||
include/c99_math.h \
|
||||
include/c99 \
|
||||
include/c11 \
|
||||
include/D3D9 \
|
||||
include/HaikuGL \
|
||||
|
||||
73
appveyor.yml
73
appveyor.yml
@@ -1,73 +0,0 @@
|
||||
# http://www.appveyor.com/docs/appveyor-yml
|
||||
#
|
||||
# To setup AppVeyor for your own personal repositories do the following:
|
||||
# - Sign up
|
||||
# - Add a new project
|
||||
# - Select Git and fill in the Git clone URL
|
||||
# - Setup a Git hook as explained in
|
||||
# https://github.com/appveyor/webhooks#installing-git-hook
|
||||
# - Check 'Settings > General > Skip branches without appveyor.yml'
|
||||
# - Check 'Settings > General > Rolling builds'
|
||||
# - Setup the global or project notifications to your liking
|
||||
#
|
||||
# Note that kicking (or restarting) a build via the web UI will not work, as it
|
||||
# will fail to find appveyor.yml . The Git hook is the most practical way to
|
||||
# kick a build.
|
||||
#
|
||||
# See also:
|
||||
# - http://help.appveyor.com/discussions/problems/2209-node-grunt-build-specify-a-project-or-solution-file-the-directory-does-not-contain-a-project-or-solution-file
|
||||
# - http://help.appveyor.com/discussions/questions/1184-build-config-vs-appveyoryaml
|
||||
|
||||
version: '{build}'
|
||||
|
||||
branches:
|
||||
except:
|
||||
- /^travis.*$/
|
||||
|
||||
# Don't download the full Mesa history to speed up cloning. However the clone
|
||||
# depth must not be too small, otherwise builds might fail when lots of patches
|
||||
# are committed in succession, because the desired commit is not found on the
|
||||
# truncated history.
|
||||
#
|
||||
# See also:
|
||||
# - https://www.appveyor.com/blog/2014/06/04/shallow-clone-for-git-repositories
|
||||
clone_depth: 100
|
||||
|
||||
cache:
|
||||
- win_flex_bison-2.4.5.zip
|
||||
- llvm-3.3.1-msvc2013-mtd.7z
|
||||
|
||||
environment:
|
||||
WINFLEXBISON_ARCHIVE: win_flex_bison-2.4.5.zip
|
||||
LLVM_ARCHIVE: llvm-3.3.1-msvc2013-mtd.7z
|
||||
|
||||
install:
|
||||
# Check pip
|
||||
- python --version
|
||||
- python -m pip --version
|
||||
# Install Mako
|
||||
- python -m pip install --egg Mako
|
||||
# Install SCons
|
||||
- python -m pip install --egg scons==2.4.1
|
||||
- scons --version
|
||||
# Install flex/bison
|
||||
- if not exist "%WINFLEXBISON_ARCHIVE%" appveyor DownloadFile "http://downloads.sourceforge.net/project/winflexbison/%WINFLEXBISON_ARCHIVE%"
|
||||
- 7z x -y -owinflexbison\ "%WINFLEXBISON_ARCHIVE%" > nul
|
||||
- set Path=%CD%\winflexbison;%Path%
|
||||
- win_flex --version
|
||||
- win_bison --version
|
||||
# Download and extract LLVM
|
||||
- if not exist "%LLVM_ARCHIVE%" appveyor DownloadFile "https://people.freedesktop.org/~jrfonseca/llvm/%LLVM_ARCHIVE%"
|
||||
- 7z x -y "%LLVM_ARCHIVE%" > nul
|
||||
- mkdir llvm\bin
|
||||
- set LLVM=%CD%\llvm
|
||||
|
||||
build_script:
|
||||
- scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=12.0 llvm=1
|
||||
|
||||
|
||||
# It's possible to setup notification here, as described in
|
||||
# http://www.appveyor.com/docs/notifications#appveyor-yml-configuration , but
|
||||
# doing so would cause the notification settings to be replicated across all
|
||||
# repos, which is most likely undesired. So it's better to rely on the
|
||||
# Appveyor global/project notification settings.
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Script for generating a list of candidates which fix commits that have been
|
||||
# previously cherry-picked to a stable branch.
|
||||
#
|
||||
# Usage examples:
|
||||
#
|
||||
# $ bin/get-extra-pick-list.sh
|
||||
# $ bin/get-extra-pick-list.sh > picklist
|
||||
# $ bin/get-extra-pick-list.sh | tee picklist
|
||||
|
||||
# Use the last branchpoint as our limit for the search
|
||||
# XXX: there should be a better way for this
|
||||
latest_branchpoint=`git branch | grep \* | cut -c 3-`-branchpoint
|
||||
|
||||
# Grep for commits with "cherry picked from commit" in the commit message.
|
||||
git log --reverse --grep="cherry picked from commit" $latest_branchpoint..HEAD |\
|
||||
grep "cherry picked from commit" |\
|
||||
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' |\
|
||||
cut -c -8 |\
|
||||
while read sha
|
||||
do
|
||||
# Check if the original commit is referenced in master
|
||||
git log -n1 --pretty=oneline --grep=$sha $latest_branchpoint..origin/master |\
|
||||
cut -c -8 |\
|
||||
while read candidate
|
||||
do
|
||||
# Check if the potential fix, hasn't landed in branch yet.
|
||||
found=`git log -n1 --pretty=oneline --reverse --grep=$candidate $latest_branchpoint..HEAD |wc -l`
|
||||
if test $found = 0
|
||||
then
|
||||
echo Commit $candidate might need to be picked, as it references $sha
|
||||
fi
|
||||
done
|
||||
done
|
||||
431
configure.ac
431
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"),
|
||||
@@ -72,16 +71,16 @@ LIBDRM_REQUIRED=2.4.60
|
||||
LIBDRM_RADEON_REQUIRED=2.4.56
|
||||
LIBDRM_AMDGPU_REQUIRED=2.4.63
|
||||
LIBDRM_INTEL_REQUIRED=2.4.61
|
||||
LIBDRM_NVVIEUX_REQUIRED=2.4.66
|
||||
LIBDRM_NOUVEAU_REQUIRED=2.4.66
|
||||
LIBDRM_FREEDRENO_REQUIRED=2.4.67
|
||||
LIBDRM_NVVIEUX_REQUIRED=2.4.33
|
||||
LIBDRM_NOUVEAU_REQUIRED=2.4.62
|
||||
LIBDRM_FREEDRENO_REQUIRED=2.4.64
|
||||
DRI2PROTO_REQUIRED=2.6
|
||||
DRI3PROTO_REQUIRED=1.0
|
||||
PRESENTPROTO_REQUIRED=1.0
|
||||
LIBUDEV_REQUIRED=151
|
||||
GLPROTO_REQUIRED=1.4.14
|
||||
LIBOMXIL_BELLAGIO_REQUIRED=0.0
|
||||
LIBVA_REQUIRED=0.38.0
|
||||
LIBVA_REQUIRED=0.35.0
|
||||
VDPAU_REQUIRED=1.1
|
||||
WAYLAND_REQUIRED=1.2.0
|
||||
XCB_REQUIRED=1.9.3
|
||||
@@ -98,7 +97,7 @@ AC_PROG_CXX
|
||||
AM_PROG_CC_C_O
|
||||
AM_PROG_AS
|
||||
AX_CHECK_GNU_MAKE
|
||||
AC_CHECK_PROGS([PYTHON2], [python2.7 python2 python])
|
||||
AC_CHECK_PROGS([PYTHON2], [python2 python])
|
||||
AC_PROG_SED
|
||||
AC_PROG_MKDIR_P
|
||||
|
||||
@@ -107,8 +106,6 @@ AC_SYS_LARGEFILE
|
||||
LT_PREREQ([2.2])
|
||||
LT_INIT([disable-static])
|
||||
|
||||
AC_CHECK_PROG(RM, rm, [rm -f])
|
||||
|
||||
AX_PROG_BISON([],
|
||||
AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"],
|
||||
[AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])]))
|
||||
@@ -197,13 +194,6 @@ if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl We don't support building Mesa with Sun C compiler
|
||||
dnl https://bugs.freedesktop.org/show_bug.cgi?id=93189
|
||||
AC_CHECK_DECL([__SUNPRO_C], [SUNCC=yes], [SUNCC=no])
|
||||
if test "x$SUNCC" = xyes; then
|
||||
AC_MSG_ERROR([Building with Sun C compiler is not supported, use GCC instead.])
|
||||
fi
|
||||
|
||||
dnl Check for compiler builtins
|
||||
AX_GCC_BUILTIN([__builtin_bswap32])
|
||||
AX_GCC_BUILTIN([__builtin_bswap64])
|
||||
@@ -245,7 +235,7 @@ _SAVE_LDFLAGS="$LDFLAGS"
|
||||
_SAVE_CPPFLAGS="$CPPFLAGS"
|
||||
|
||||
dnl Compiler macros
|
||||
DEFINES="-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
|
||||
DEFINES="-D__STDC_LIMIT_MACROS"
|
||||
AC_SUBST([DEFINES])
|
||||
case "$host_os" in
|
||||
linux*|*-gnu*|gnu*)
|
||||
@@ -305,7 +295,8 @@ if test "x$GCC" = xyes; then
|
||||
|
||||
# Flags to help ensure that certain portions of the code -- and only those
|
||||
# portions -- can be built with MSVC:
|
||||
# - src/util, src/gallium/auxiliary, rc/gallium/drivers/llvmpipe, and
|
||||
# - 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
|
||||
@@ -322,6 +313,9 @@ if test "x$GCC" = xyes; then
|
||||
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"
|
||||
@@ -349,6 +343,8 @@ 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
|
||||
@@ -377,11 +373,10 @@ save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$SSE41_CFLAGS $CFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <smmintrin.h>
|
||||
int param;
|
||||
int main () {
|
||||
__m128i a = _mm_set1_epi32 (param), b = _mm_set1_epi32 (param + 1), c;
|
||||
__m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
|
||||
c = _mm_max_epu32(a, b);
|
||||
return _mm_cvtsi128_si32(c);
|
||||
return 0;
|
||||
}]])], SSE41_SUPPORTED=1)
|
||||
CFLAGS="$save_CFLAGS"
|
||||
if test "x$SSE41_SUPPORTED" = x1; then
|
||||
@@ -390,61 +385,6 @@ fi
|
||||
AM_CONDITIONAL([SSE41_SUPPORTED], [test x$SSE41_SUPPORTED = x1])
|
||||
AC_SUBST([SSE41_CFLAGS], $SSE41_CFLAGS)
|
||||
|
||||
dnl Check for Endianness
|
||||
AC_C_BIGENDIAN(
|
||||
little_endian=no,
|
||||
little_endian=yes,
|
||||
little_endian=no,
|
||||
little_endian=no
|
||||
)
|
||||
|
||||
dnl Check for POWER8 Architecture
|
||||
PWR8_CFLAGS="-mpower8-vector"
|
||||
have_pwr8_intrinsics=no
|
||||
AC_MSG_CHECKING(whether gcc supports -mpower8-vector)
|
||||
save_CFLAGS=$CFLAGS
|
||||
CFLAGS="$PWR8_CFLAGS $CFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8))
|
||||
#error "Need GCC >= 4.8 for sane POWER8 support"
|
||||
#endif
|
||||
#include <altivec.h>
|
||||
int main () {
|
||||
vector unsigned char r;
|
||||
vector unsigned int v = vec_splat_u32 (1);
|
||||
r = __builtin_vec_vgbbd ((vector unsigned char) v);
|
||||
return 0;
|
||||
}]])], have_pwr8_intrinsics=yes)
|
||||
CFLAGS=$save_CFLAGS
|
||||
|
||||
AC_ARG_ENABLE(pwr8,
|
||||
[AC_HELP_STRING([--disable-pwr8-inst],
|
||||
[disable POWER8-specific instructions])],
|
||||
[enable_pwr8=$enableval], [enable_pwr8=auto])
|
||||
|
||||
if test "x$enable_pwr8" = xno ; then
|
||||
have_pwr8_intrinsics=disabled
|
||||
fi
|
||||
|
||||
if test $have_pwr8_intrinsics = yes && test $little_endian = yes ; then
|
||||
DEFINES="$DEFINES -D_ARCH_PWR8"
|
||||
CXXFLAGS="$CXXFLAGS $PWR8_CFLAGS"
|
||||
CFLAGS="$CFLAGS $PWR8_CFLAGS"
|
||||
else
|
||||
PWR8_CFLAGS=
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT($have_pwr8_intrinsics)
|
||||
if test "x$enable_pwr8" = xyes && test $have_pwr8_intrinsics = no ; then
|
||||
AC_MSG_ERROR([POWER8 compiler support not detected])
|
||||
fi
|
||||
|
||||
if test $have_pwr8_intrinsics = yes && test $little_endian = no ; then
|
||||
AC_MSG_WARN([POWER8 optimization is enabled only on POWER8 Little-Endian])
|
||||
fi
|
||||
|
||||
AC_SUBST([PWR8_CFLAGS], $PWR8_CFLAGS)
|
||||
|
||||
dnl Can't have static and shared libraries, default to static if user
|
||||
dnl explicitly requested. If both disabled, set to static since shared
|
||||
dnl was explicitly requested.
|
||||
@@ -470,29 +410,8 @@ AC_ARG_ENABLE([debug],
|
||||
[enable_debug="$enableval"],
|
||||
[enable_debug=no]
|
||||
)
|
||||
|
||||
AC_ARG_ENABLE([profile],
|
||||
[AS_HELP_STRING([--enable-profile],
|
||||
[enable profiling of code @<:@default=disabled@:>@])],
|
||||
[enable_profile="$enableval"],
|
||||
[enable_profile=no]
|
||||
)
|
||||
|
||||
if test "x$enable_profile" = xyes; then
|
||||
DEFINES="$DEFINES -DPROFILE"
|
||||
if test "x$GCC" = xyes; then
|
||||
CFLAGS="$CFLAGS -fno-omit-frame-pointer"
|
||||
fi
|
||||
if test "x$GXX" = xyes; then
|
||||
CXXFLAGS="$CXXFLAGS -fno-omit-frame-pointer"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_debug" = xyes; then
|
||||
DEFINES="$DEFINES -DDEBUG"
|
||||
if test "x$enable_profile" = xyes; then
|
||||
AC_MSG_WARN([Debug and Profile are enabled at the same time])
|
||||
fi
|
||||
if test "x$GCC" = xyes; then
|
||||
if ! echo "$CFLAGS" | grep -q -e '-g'; then
|
||||
CFLAGS="$CFLAGS -g"
|
||||
@@ -613,32 +532,15 @@ AM_CONDITIONAL(HAVE_COMPAT_SYMLINKS, test "x$HAVE_COMPAT_SYMLINKS" = xyes)
|
||||
dnl
|
||||
dnl library names
|
||||
dnl
|
||||
dnl Unfortunately we need to do a few things that libtool can't help us with,
|
||||
dnl so we need some knowledge of shared library filenames:
|
||||
dnl
|
||||
dnl LIB_EXT is the extension used when creating symlinks for alternate
|
||||
dnl filenames for a shared library which will be dynamically loaded
|
||||
dnl
|
||||
dnl IMP_LIB_EXT is the extension used when checking for the presence of a
|
||||
dnl the file for a shared library we wish to link with
|
||||
dnl
|
||||
case "$host_os" in
|
||||
darwin* )
|
||||
LIB_EXT='dylib'
|
||||
IMP_LIB_EXT=$LIB_EXT
|
||||
;;
|
||||
LIB_EXT='dylib' ;;
|
||||
cygwin* )
|
||||
LIB_EXT='dll'
|
||||
IMP_LIB_EXT='dll.a'
|
||||
;;
|
||||
LIB_EXT='dll' ;;
|
||||
aix* )
|
||||
LIB_EXT='a'
|
||||
IMP_LIB_EXT=$LIB_EXT
|
||||
;;
|
||||
LIB_EXT='a' ;;
|
||||
* )
|
||||
LIB_EXT='so'
|
||||
IMP_LIB_EXT=$LIB_EXT
|
||||
;;
|
||||
LIB_EXT='so' ;;
|
||||
esac
|
||||
|
||||
AC_SUBST([LIB_EXT])
|
||||
@@ -845,11 +747,6 @@ linux*)
|
||||
dri3_default=no
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "x$enable_dri" = xno; then
|
||||
dri3_default=no
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE([dri3],
|
||||
[AS_HELP_STRING([--enable-dri3],
|
||||
[enable DRI3 @<:@default=auto@:>@])],
|
||||
@@ -949,7 +846,7 @@ GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
|
||||
AC_ARG_WITH([gallium-drivers],
|
||||
[AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
|
||||
[comma delimited Gallium drivers list, e.g.
|
||||
"i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast,vc4,virgl"
|
||||
"i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast,vc4"
|
||||
@<:@default=r300,r600,svga,swrast@:>@])],
|
||||
[with_gallium_drivers="$withval"],
|
||||
[with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
|
||||
@@ -1039,13 +936,8 @@ gnu*|cygwin*)
|
||||
dri_platform='drm' ;;
|
||||
esac
|
||||
|
||||
if test "x$enable_dri" = xyes -a "x$dri_platform" = xdrm -a "x$have_libdrm" = xyes; then
|
||||
have_drisw_kms='yes'
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(HAVE_DRICOMMON, test "x$enable_dri" = xyes )
|
||||
AM_CONDITIONAL(HAVE_DRISW, test "x$enable_dri" = xyes )
|
||||
AM_CONDITIONAL(HAVE_DRISW_KMS, test "x$have_drisw_kms" = xyes )
|
||||
AM_CONDITIONAL(HAVE_DRI2, test "x$enable_dri" = xyes -a "x$dri_platform" = xdrm -a "x$have_libdrm" = xyes )
|
||||
AM_CONDITIONAL(HAVE_DRI3, test "x$enable_dri3" = xyes -a "x$dri_platform" = xdrm -a "x$have_libdrm" = xyes )
|
||||
AM_CONDITIONAL(HAVE_APPLEDRI, test "x$enable_dri" = xyes -a "x$dri_platform" = xapple )
|
||||
@@ -1080,6 +972,10 @@ if test -n "$with_gallium_drivers" -a "x$enable_glx$enable_xlib_glx" = xyesyes;
|
||||
NEED_WINSYS_XLIB="yes"
|
||||
fi
|
||||
|
||||
if test "x$enable_dri" = xyes; then
|
||||
enable_gallium_loader="$enable_shared_pipe_drivers"
|
||||
fi
|
||||
|
||||
if test "x$enable_gallium_osmesa" = xyes; then
|
||||
if ! echo "$with_gallium_drivers" | grep -q 'swrast'; then
|
||||
AC_MSG_ERROR([gallium_osmesa requires the gallium swrast driver])
|
||||
@@ -1091,149 +987,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)
|
||||
|
||||
# Enable a define for SHA1
|
||||
if test "x$with_sha1" != "x"; then
|
||||
DEFINES="$DEFINES -DHAVE_SHA1"
|
||||
fi
|
||||
|
||||
# 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])
|
||||
|
||||
case "$host_os" in
|
||||
linux*)
|
||||
need_pci_id=yes ;;
|
||||
@@ -1310,8 +1063,7 @@ xyesno)
|
||||
|
||||
if test x"$enable_dri3" = xyes; then
|
||||
PKG_CHECK_EXISTS([xcb >= $XCB_REQUIRED], [], AC_MSG_ERROR([DRI3 requires xcb >= $XCB_REQUIRED]))
|
||||
dri3_modules="xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED"
|
||||
PKG_CHECK_MODULES([XCB_DRI3], [$dri3_modules])
|
||||
dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED"
|
||||
fi
|
||||
fi
|
||||
if test x"$dri_platform" = xapple ; then
|
||||
@@ -1398,16 +1150,6 @@ AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
|
||||
AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
|
||||
[DEFINES="${DEFINES} -DGLX_USE_TLS"])
|
||||
|
||||
dnl Read-only text section on x86 hardened platforms
|
||||
AC_ARG_ENABLE([glx-read-only-text],
|
||||
[AS_HELP_STRING([--enable-glx-read-only-text],
|
||||
[Disable writable .text section on x86 (decreases performance) @<:@default=disabled@:>@])],
|
||||
[enable_glx_read_only_text="$enableval"],
|
||||
[enable_glx_read_only_text=no])
|
||||
if test "x$enable_glx_read_only_text" = xyes; then
|
||||
DEFINES="$DEFINES -DGLX_X86_READONLY_TEXT"
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl More DRI setup
|
||||
dnl
|
||||
@@ -1652,12 +1394,6 @@ if test "x$enable_egl" = xyes; then
|
||||
if test "x$enable_shared_glapi" = xno; then
|
||||
AC_MSG_ERROR([egl_dri2 requires --enable-shared-glapi])
|
||||
fi
|
||||
if test "x$enable_dri3" = xyes; then
|
||||
HAVE_EGL_DRIVER_DRI3=1
|
||||
if test "x$enable_shared_glapi" = xno; then
|
||||
AC_MSG_ERROR([egl_dri3 requires --enable-shared-glapi])
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# Avoid building an "empty" libEGL. Drop/update this
|
||||
# when other backends (haiku?) come along.
|
||||
@@ -1669,8 +1405,6 @@ fi
|
||||
AM_CONDITIONAL(HAVE_EGL, test "x$enable_egl" = xyes)
|
||||
AC_SUBST([EGL_LIB_DEPS])
|
||||
|
||||
gallium_st="mesa"
|
||||
|
||||
dnl
|
||||
dnl XA configuration
|
||||
dnl
|
||||
@@ -1683,7 +1417,7 @@ if test "x$enable_xa" = xyes; then
|
||||
enabling XA.
|
||||
Example: ./configure --enable-xa --with-gallium-drivers=svga...])
|
||||
fi
|
||||
gallium_st="$gallium_st xa"
|
||||
enable_gallium_loader=$enable_shared_pipe_drivers
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_ST_XA, test "x$enable_xa" = xyes)
|
||||
|
||||
@@ -1728,25 +1462,25 @@ AM_CONDITIONAL(NEED_GALLIUM_VL_WINSYS, test "x$need_gallium_vl_winsys" = xyes)
|
||||
|
||||
if test "x$enable_xvmc" = xyes; then
|
||||
PKG_CHECK_MODULES([XVMC], [xvmc >= $XVMC_REQUIRED])
|
||||
gallium_st="$gallium_st xvmc"
|
||||
enable_gallium_loader=$enable_shared_pipe_drivers
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_ST_XVMC, test "x$enable_xvmc" = xyes)
|
||||
|
||||
if test "x$enable_vdpau" = xyes; then
|
||||
PKG_CHECK_MODULES([VDPAU], [vdpau >= $VDPAU_REQUIRED])
|
||||
gallium_st="$gallium_st vdpau"
|
||||
enable_gallium_loader=$enable_shared_pipe_drivers
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_ST_VDPAU, test "x$enable_vdpau" = xyes)
|
||||
|
||||
if test "x$enable_omx" = xyes; then
|
||||
PKG_CHECK_MODULES([OMX], [libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED])
|
||||
gallium_st="$gallium_st omx"
|
||||
enable_gallium_loader=$enable_shared_pipe_drivers
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_ST_OMX, test "x$enable_omx" = xyes)
|
||||
|
||||
if test "x$enable_va" = xyes; then
|
||||
PKG_CHECK_MODULES([VA], [libva >= $LIBVA_REQUIRED])
|
||||
gallium_st="$gallium_st va"
|
||||
enable_gallium_loader=$enable_shared_pipe_drivers
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_ST_VA, test "x$enable_va" = xyes)
|
||||
|
||||
@@ -1768,7 +1502,7 @@ if test "x$enable_nine" = xyes; then
|
||||
AC_MSG_WARN([using nine together with wine requires DRI3 enabled system])
|
||||
fi
|
||||
|
||||
gallium_st="$gallium_st nine"
|
||||
enable_gallium_loader=$enable_shared_pipe_drivers
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_ST_NINE, test "x$enable_nine" = xyes)
|
||||
|
||||
@@ -1783,15 +1517,7 @@ AC_ARG_WITH([clang-libdir],
|
||||
[CLANG_LIBDIR=''])
|
||||
|
||||
PKG_CHECK_EXISTS([libclc], [have_libclc=yes], [have_libclc=no])
|
||||
PKG_CHECK_MODULES([LIBELF], [libelf], [have_libelf=yes], [have_libelf=no])
|
||||
|
||||
if test "x$have_libelf" = xno; then
|
||||
LIBELF_LIBS=''
|
||||
LIBELF_CFLAGS=''
|
||||
AC_CHECK_LIB([elf], [elf_memory], [have_libelf=yes;LIBELF_LIBS=-lelf], [have_libelf=no])
|
||||
AC_SUBST([LIBELF_LIBS])
|
||||
AC_SUBST([LIBELF_CFLAGS])
|
||||
fi
|
||||
AC_CHECK_LIB([elf], [elf_memory], [have_libelf=yes;ELF_LIB=-lelf])
|
||||
|
||||
if test "x$enable_opencl" = xyes; then
|
||||
if test -z "$with_gallium_drivers"; then
|
||||
@@ -1814,7 +1540,8 @@ if test "x$enable_opencl" = xyes; then
|
||||
AC_SUBST([LIBCLC_LIBEXECDIR])
|
||||
fi
|
||||
|
||||
gallium_st="$gallium_st clover"
|
||||
# XXX: Use $enable_shared_pipe_drivers once converted to use static/shared pipe-drivers
|
||||
enable_gallium_loader=yes
|
||||
|
||||
if test "x$enable_opencl_icd" = xyes; then
|
||||
OPENCL_LIBNAME="MesaOpenCL"
|
||||
@@ -2094,6 +1821,10 @@ AC_SUBST([XVMC_LIB_INSTALL_DIR])
|
||||
dnl
|
||||
dnl Gallium Tests
|
||||
dnl
|
||||
if test "x$enable_gallium_tests" = xyes; then
|
||||
# XXX: Use $enable_shared_pipe_drivers once converted to use static/shared pipe-drivers
|
||||
enable_gallium_loader=yes
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_TESTS, test "x$enable_gallium_tests" = xyes)
|
||||
|
||||
dnl Directory for VDPAU libs
|
||||
@@ -2148,17 +1879,18 @@ gallium_require_llvm() {
|
||||
}
|
||||
|
||||
gallium_require_drm_loader() {
|
||||
if test "x$need_pci_id$have_pci_id" = xyesno; then
|
||||
AC_MSG_ERROR([Gallium drm loader requires libudev >= $LIBUDEV_REQUIRED or sysfs])
|
||||
if test "x$enable_gallium_loader" = xyes; then
|
||||
if test "x$need_pci_id$have_pci_id" = xyesno; then
|
||||
AC_MSG_ERROR([Gallium drm loader requires libudev >= $LIBUDEV_REQUIRED or sysfs])
|
||||
fi
|
||||
enable_gallium_drm_loader=yes
|
||||
fi
|
||||
if test "x$enable_va" = xyes && test "x$7" != x; then
|
||||
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $7"
|
||||
fi
|
||||
}
|
||||
|
||||
dnl This is for Glamor. Skip this if OpenGL is disabled.
|
||||
require_egl_drm() {
|
||||
if test "x$enable_opengl" = xno; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
case "$with_egl_platforms" in
|
||||
*drm*)
|
||||
;;
|
||||
@@ -2180,7 +1912,7 @@ radeon_llvm_check() {
|
||||
if test "x$enable_gallium_llvm" != "xyes"; then
|
||||
AC_MSG_ERROR([--enable-gallium-llvm is required when building $1])
|
||||
fi
|
||||
llvm_check_version_for "3" "6" "0" $1
|
||||
llvm_check_version_for "3" "4" "2" $1
|
||||
if test true && $LLVM_CONFIG --targets-built | grep -iqvw $amdgpu_llvm_target_name ; then
|
||||
AC_MSG_ERROR([LLVM $amdgpu_llvm_target_name not enabled in your LLVM build.])
|
||||
fi
|
||||
@@ -2268,16 +2000,11 @@ if test -n "$with_gallium_drivers"; then
|
||||
gallium_require_drm "vc4"
|
||||
gallium_require_drm_loader
|
||||
|
||||
PKG_CHECK_MODULES([SIMPENROSE], [simpenrose],
|
||||
[USE_VC4_SIMULATOR=yes;
|
||||
DEFINES="$DEFINES -DUSE_VC4_SIMULATOR"],
|
||||
[USE_VC4_SIMULATOR=no])
|
||||
;;
|
||||
xvirgl)
|
||||
HAVE_GALLIUM_VIRGL=yes
|
||||
gallium_require_drm "virgl"
|
||||
gallium_require_drm_loader
|
||||
require_egl_drm "virgl"
|
||||
case "$host_cpu" in
|
||||
i?86 | x86_64 | amd64)
|
||||
USE_VC4_SIMULATOR=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Unknown Gallium driver: $driver])
|
||||
@@ -2295,19 +2022,12 @@ dnl in LLVM_LIBS.
|
||||
|
||||
if test "x$MESA_LLVM" != x0; then
|
||||
|
||||
if ! $LLVM_CONFIG --libs ${LLVM_COMPONENTS} >/dev/null; then
|
||||
AC_MSG_ERROR([Calling ${LLVM_CONFIG} failed])
|
||||
fi
|
||||
LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
|
||||
|
||||
dnl llvm-config may not give the right answer when llvm is a built as a
|
||||
dnl single shared library, so we must work the library name out for
|
||||
dnl ourselves.
|
||||
dnl (See https://llvm.org/bugs/show_bug.cgi?id=6823)
|
||||
if test "x$enable_llvm_shared_libs" = xyes; then
|
||||
dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
|
||||
LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
|
||||
AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.$IMP_LIB_EXT"], [llvm_have_one_so=yes])
|
||||
AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.so"], [llvm_have_one_so=yes])
|
||||
|
||||
if test "x$llvm_have_one_so" = xyes; then
|
||||
dnl LLVM was built using auto*, so there is only one shared object.
|
||||
@@ -2315,7 +2035,7 @@ if test "x$MESA_LLVM" != x0; then
|
||||
else
|
||||
dnl If LLVM was built with CMake, there will be one shared object per
|
||||
dnl component.
|
||||
AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.$IMP_LIB_EXT"],
|
||||
AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.so"],
|
||||
[AC_MSG_ERROR([Could not find llvm shared libraries:
|
||||
Please make sure you have built llvm with the --enable-shared option
|
||||
and that your llvm libraries are installed in $LLVM_LIBDIR
|
||||
@@ -2353,18 +2073,25 @@ AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_VC4, test "x$HAVE_GALLIUM_VC4" = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_VIRGL, test "x$HAVE_GALLIUM_VIRGL" = xyes)
|
||||
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_STATIC_TARGETS, test "x$enable_shared_pipe_drivers" = xno)
|
||||
|
||||
if test "x$enable_dri" = xyes; then
|
||||
GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRI"
|
||||
fi
|
||||
# NOTE: anything using xcb or other client side libs ends up in separate
|
||||
# _CLIENT variables. The pipe loader is built in two variants,
|
||||
# one that is standalone and does not link any x client libs (for
|
||||
# use by XA tracker in particular, but could be used in any case
|
||||
# where communication with xserver is not desired).
|
||||
if test "x$enable_gallium_loader" = xyes; then
|
||||
if test "x$enable_dri" = xyes; then
|
||||
GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRI"
|
||||
fi
|
||||
|
||||
if test "x$have_drisw_kms" = xyes; then
|
||||
GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_KMS"
|
||||
if test "x$enable_gallium_drm_loader" = xyes; then
|
||||
GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM"
|
||||
fi
|
||||
|
||||
AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
|
||||
fi
|
||||
AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
|
||||
|
||||
AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
|
||||
AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
|
||||
@@ -2379,6 +2106,8 @@ AM_CONDITIONAL(NEED_RADEON_DRM_WINSYS, test "x$HAVE_GALLIUM_R300" = xyes -o \
|
||||
AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$NEED_WINSYS_XLIB" = xyes)
|
||||
AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
|
||||
AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
|
||||
AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
|
||||
AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
|
||||
AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
|
||||
AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
|
||||
AM_CONDITIONAL(USE_VC4_SIMULATOR, test x$USE_VC4_SIMULATOR = xyes)
|
||||
@@ -2386,6 +2115,8 @@ if test "x$USE_VC4_SIMULATOR" = xyes -a "x$HAVE_GALLIUM_ILO" = xyes; then
|
||||
AC_MSG_ERROR([VC4 simulator on x86 replaces i965 driver build, so ilo must be disabled.])
|
||||
fi
|
||||
|
||||
AC_SUBST([ELF_LIB])
|
||||
|
||||
AM_CONDITIONAL(HAVE_LIBDRM, test "x$have_libdrm" = xyes)
|
||||
AM_CONDITIONAL(HAVE_X11_DRIVER, test "x$enable_xlib_glx" = xyes)
|
||||
AM_CONDITIONAL(HAVE_OSMESA, test "x$enable_osmesa" = xyes)
|
||||
@@ -2438,7 +2169,6 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
|
||||
dnl Substitute the config
|
||||
AC_CONFIG_FILES([Makefile
|
||||
src/Makefile
|
||||
src/compiler/Makefile
|
||||
src/egl/Makefile
|
||||
src/egl/main/egl.pc
|
||||
src/egl/wayland/wayland-drm/Makefile
|
||||
@@ -2448,7 +2178,6 @@ AC_CONFIG_FILES([Makefile
|
||||
src/gallium/auxiliary/Makefile
|
||||
src/gallium/auxiliary/pipe-loader/Makefile
|
||||
src/gallium/drivers/freedreno/Makefile
|
||||
src/gallium/drivers/ddebug/Makefile
|
||||
src/gallium/drivers/i915/Makefile
|
||||
src/gallium/drivers/ilo/Makefile
|
||||
src/gallium/drivers/llvmpipe/Makefile
|
||||
@@ -2463,7 +2192,6 @@ AC_CONFIG_FILES([Makefile
|
||||
src/gallium/drivers/svga/Makefile
|
||||
src/gallium/drivers/trace/Makefile
|
||||
src/gallium/drivers/vc4/Makefile
|
||||
src/gallium/drivers/virgl/Makefile
|
||||
src/gallium/state_trackers/clover/Makefile
|
||||
src/gallium/state_trackers/dri/Makefile
|
||||
src/gallium/state_trackers/glx/xlib/Makefile
|
||||
@@ -2504,10 +2232,9 @@ AC_CONFIG_FILES([Makefile
|
||||
src/gallium/winsys/sw/wrapper/Makefile
|
||||
src/gallium/winsys/sw/xlib/Makefile
|
||||
src/gallium/winsys/vc4/drm/Makefile
|
||||
src/gallium/winsys/virgl/drm/Makefile
|
||||
src/gallium/winsys/virgl/vtest/Makefile
|
||||
src/gbm/Makefile
|
||||
src/gbm/main/gbm.pc
|
||||
src/glsl/Makefile
|
||||
src/glx/Makefile
|
||||
src/glx/apple/Makefile
|
||||
src/glx/tests/Makefile
|
||||
@@ -2598,9 +2325,6 @@ if test "$enable_egl" = yes; then
|
||||
if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then
|
||||
egl_drivers="$egl_drivers builtin:egl_dri2"
|
||||
fi
|
||||
if test "x$HAVE_EGL_DRIVER_DRI3" != "x"; then
|
||||
egl_drivers="$egl_drivers builtin:egl_dri3"
|
||||
fi
|
||||
|
||||
echo " EGL drivers: $egl_drivers"
|
||||
fi
|
||||
@@ -2616,18 +2340,11 @@ fi
|
||||
|
||||
echo ""
|
||||
if test -n "$with_gallium_drivers"; then
|
||||
echo " Gallium drivers: $gallium_drivers"
|
||||
echo " Gallium st: $gallium_st"
|
||||
echo " Gallium: yes"
|
||||
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 ""
|
||||
|
||||
119
docs/GL3.txt
119
docs/GL3.txt
@@ -92,50 +92,50 @@ GL 3.3, GLSL 3.30 --- all DONE: i965, nv50, nvc0, r600, radeonsi, llvmpipe, soft
|
||||
GL_ARB_vertex_type_2_10_10_10_rev DONE ()
|
||||
|
||||
|
||||
GL 4.0, GLSL 4.00 --- all DONE: nvc0, r600, radeonsi
|
||||
GL 4.0, GLSL 4.00 --- all DONE: nvc0, radeonsi
|
||||
|
||||
GL_ARB_draw_buffers_blend DONE (i965, nv50, llvmpipe, softpipe)
|
||||
GL_ARB_draw_indirect DONE (i965, llvmpipe, softpipe)
|
||||
GL_ARB_draw_buffers_blend DONE (i965, nv50, r600, llvmpipe, softpipe)
|
||||
GL_ARB_draw_indirect DONE (i965, r600, llvmpipe, softpipe)
|
||||
GL_ARB_gpu_shader5 DONE (i965)
|
||||
- 'precise' qualifier DONE
|
||||
- Dynamically uniform sampler array indices DONE (softpipe)
|
||||
- Dynamically uniform UBO array indices DONE ()
|
||||
- Dynamically uniform sampler array indices DONE (r600, softpipe)
|
||||
- Dynamically uniform UBO array indices DONE (r600)
|
||||
- Implicit signed -> unsigned conversions DONE
|
||||
- Fused multiply-add DONE ()
|
||||
- Packing/bitfield/conversion functions DONE (softpipe)
|
||||
- Enhanced textureGather DONE (softpipe)
|
||||
- Geometry shader instancing DONE (llvmpipe, softpipe)
|
||||
- Packing/bitfield/conversion functions DONE (r600, softpipe)
|
||||
- Enhanced textureGather DONE (r600, softpipe)
|
||||
- Geometry shader instancing DONE (r600, llvmpipe, softpipe)
|
||||
- Geometry shader multiple streams DONE ()
|
||||
- Enhanced per-sample shading DONE ()
|
||||
- Interpolation functions DONE ()
|
||||
- Enhanced per-sample shading DONE (r600)
|
||||
- Interpolation functions DONE (r600)
|
||||
- New overload resolution rules DONE
|
||||
GL_ARB_gpu_shader_fp64 DONE (llvmpipe, softpipe)
|
||||
GL_ARB_sample_shading DONE (i965, nv50)
|
||||
GL_ARB_shader_subroutine DONE (i965, nv50, llvmpipe, softpipe)
|
||||
GL_ARB_tessellation_shader DONE (i965)
|
||||
GL_ARB_texture_buffer_object_rgb32 DONE (i965, llvmpipe, softpipe)
|
||||
GL_ARB_texture_cube_map_array DONE (i965, nv50, llvmpipe, softpipe)
|
||||
GL_ARB_texture_gather DONE (i965, nv50, llvmpipe, softpipe)
|
||||
GL_ARB_texture_query_lod DONE (i965, nv50, softpipe)
|
||||
GL_ARB_transform_feedback2 DONE (i965, nv50, llvmpipe, softpipe)
|
||||
GL_ARB_transform_feedback3 DONE (i965, nv50, llvmpipe, softpipe)
|
||||
GL_ARB_sample_shading DONE (i965, nv50, r600)
|
||||
GL_ARB_shader_subroutine DONE (i965, nv50, r600, llvmpipe, softpipe)
|
||||
GL_ARB_tessellation_shader DONE ()
|
||||
GL_ARB_texture_buffer_object_rgb32 DONE (i965, r600, llvmpipe, softpipe)
|
||||
GL_ARB_texture_cube_map_array DONE (i965, nv50, r600, llvmpipe, softpipe)
|
||||
GL_ARB_texture_gather DONE (i965, nv50, r600, llvmpipe, softpipe)
|
||||
GL_ARB_texture_query_lod DONE (i965, nv50, r600)
|
||||
GL_ARB_transform_feedback2 DONE (i965, nv50, r600, llvmpipe, softpipe)
|
||||
GL_ARB_transform_feedback3 DONE (i965, nv50, r600, llvmpipe, softpipe)
|
||||
|
||||
|
||||
GL 4.1, GLSL 4.10 --- all DONE: nvc0, r600, radeonsi
|
||||
GL 4.1, GLSL 4.10 --- all DONE: nvc0, radeonsi
|
||||
|
||||
GL_ARB_ES2_compatibility DONE (i965, nv50, llvmpipe, softpipe)
|
||||
GL_ARB_ES2_compatibility DONE (i965, nv50, r600, llvmpipe, softpipe)
|
||||
GL_ARB_get_program_binary DONE (0 binary formats)
|
||||
GL_ARB_separate_shader_objects DONE (all drivers)
|
||||
GL_ARB_shader_precision DONE (all drivers that support GLSL 4.10)
|
||||
GL_ARB_vertex_attrib_64bit DONE (llvmpipe, softpipe)
|
||||
GL_ARB_viewport_array DONE (i965, nv50, llvmpipe, softpipe)
|
||||
GL_ARB_viewport_array DONE (i965, nv50, r600, llvmpipe)
|
||||
|
||||
|
||||
GL 4.2, GLSL 4.20:
|
||||
|
||||
GL_ARB_texture_compression_bptc DONE (i965, nvc0, r600, radeonsi)
|
||||
GL_ARB_compressed_texture_pixel_storage DONE (all drivers)
|
||||
GL_ARB_shader_atomic_counters DONE (i965, nvc0)
|
||||
GL_ARB_shader_atomic_counters DONE (i965)
|
||||
GL_ARB_texture_storage DONE (all drivers)
|
||||
GL_ARB_transform_feedback_instanced DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_base_instance DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
@@ -149,27 +149,27 @@ GL 4.2, GLSL 4.20:
|
||||
|
||||
GL 4.3, GLSL 4.30:
|
||||
|
||||
GL_ARB_arrays_of_arrays DONE (all drivers that support GLSL 1.30)
|
||||
GL_ARB_arrays_of_arrays started (Timothy)
|
||||
GL_ARB_ES3_compatibility DONE (all drivers that support GLSL 3.30)
|
||||
GL_ARB_clear_buffer_object DONE (all drivers)
|
||||
GL_ARB_compute_shader DONE (i965)
|
||||
GL_ARB_copy_image DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_compute_shader in progress (jljusten)
|
||||
GL_ARB_copy_image DONE (i965) (gallium - in progress, VMware)
|
||||
GL_KHR_debug DONE (all drivers)
|
||||
GL_ARB_explicit_uniform_location DONE (all drivers that support GLSL)
|
||||
GL_ARB_fragment_layer_viewport DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe)
|
||||
GL_ARB_fragment_layer_viewport DONE (nv50, nvc0, r600, radeonsi, llvmpipe)
|
||||
GL_ARB_framebuffer_no_attachments DONE (i965)
|
||||
GL_ARB_internalformat_query2 in progress (elima)
|
||||
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_program_interface_query DONE (all drivers)
|
||||
GL_ARB_robust_buffer_access_behavior not started
|
||||
GL_ARB_shader_image_size DONE (i965)
|
||||
GL_ARB_shader_storage_buffer_object DONE (i965, nvc0)
|
||||
GL_ARB_shader_storage_buffer_object in progress (Iago Toral, Samuel Iglesias)
|
||||
GL_ARB_stencil_texturing DONE (i965/gen8+, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_texture_buffer_range DONE (nv50, nvc0, i965, r600, radeonsi, llvmpipe)
|
||||
GL_ARB_texture_query_levels DONE (all drivers that support GLSL 1.30)
|
||||
GL_ARB_texture_storage_multisample DONE (all drivers that support GL_ARB_texture_multisample)
|
||||
GL_ARB_texture_view DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_texture_view DONE (i965, nv50, nvc0, llvmpipe, softpipe)
|
||||
GL_ARB_vertex_attrib_binding DONE (all drivers)
|
||||
|
||||
|
||||
@@ -177,16 +177,10 @@ 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_clear_texture DONE (i965, nv50, nvc0)
|
||||
GL_ARB_enhanced_layouts in progress (Timothy)
|
||||
- compile-time constant expressions DONE
|
||||
- explicit byte offsets for blocks in progress
|
||||
- forced alignment within blocks in progress
|
||||
- specified vec4-slot component numbers in progress
|
||||
- specified transform/feedback layout in progress
|
||||
- input/output block locations DONE
|
||||
GL_ARB_clear_texture DONE (i965) (gallium - in progress, VMware)
|
||||
GL_ARB_enhanced_layouts not started
|
||||
GL_ARB_multi_bind DONE (all drivers)
|
||||
GL_ARB_query_buffer_object DONE (nvc0)
|
||||
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_stencil8 DONE (nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_vertex_type_10f_11f_11f_rev DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
@@ -200,25 +194,25 @@ GL 4.5, GLSL 4.50:
|
||||
GL_ARB_derivative_control DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_direct_state_access DONE (all drivers)
|
||||
GL_ARB_get_texture_sub_image DONE (all drivers)
|
||||
GL_ARB_shader_texture_image_samples DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_texture_barrier DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_KHR_context_flush_control DONE (all - but needs GLX/EGL extension to be useful)
|
||||
GL_ARB_shader_texture_image_samples not started
|
||||
GL_ARB_texture_barrier DONE (nv50, nvc0, 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 DONE (all drivers that support GLSL 1.30)
|
||||
GL_ARB_compute_shader DONE (i965)
|
||||
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 DONE (i965)
|
||||
GL_ARB_program_interface_query DONE (all drivers)
|
||||
GL_ARB_shader_atomic_counters DONE (i965, nvc0)
|
||||
GL_ARB_shader_atomic_counters DONE (i965)
|
||||
GL_ARB_shader_image_load_store DONE (i965)
|
||||
GL_ARB_shader_image_size DONE (i965)
|
||||
GL_ARB_shader_storage_buffer_object DONE (i965, nvc0)
|
||||
GL_ARB_shader_storage_buffer_object in progress (Iago Toral, Samuel Iglesias)
|
||||
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)
|
||||
@@ -229,35 +223,10 @@ GLES3.1, GLSL ES 3.1
|
||||
GS5 Packing/bitfield/conversion functions DONE (i965, nvc0, r600, radeonsi)
|
||||
GL_EXT_shader_integer_mix DONE (all drivers that support GLSL)
|
||||
|
||||
Additional functionality not covered above:
|
||||
glMemoryBarrierByRegion DONE
|
||||
glGetTexLevelParameter[fi]v - needs updates DONE
|
||||
glGetBooleani_v - restrict to GLES enums
|
||||
gl_HelperInvocation support DONE (i965, nvc0, r600)
|
||||
|
||||
GLES3.2, GLSL ES 3.2
|
||||
GL_EXT_color_buffer_float DONE (all drivers)
|
||||
GL_KHR_blend_equation_advanced not started
|
||||
GL_KHR_debug DONE (all drivers)
|
||||
GL_KHR_robustness 90% done (the ARB variant)
|
||||
GL_KHR_texture_compression_astc_ldr DONE (i965/gen9+)
|
||||
GL_OES_copy_image not started (based on GL_ARB_copy_image, which is done for some drivers)
|
||||
GL_OES_draw_buffers_indexed not started
|
||||
GL_OES_draw_elements_base_vertex DONE (all drivers)
|
||||
GL_OES_geometry_shader started (Marta)
|
||||
GL_OES_gpu_shader5 not started (based on parts of GL_ARB_gpu_shader5, which is done for some drivers)
|
||||
GL_OES_primitive_bounding box not started
|
||||
GL_OES_sample_shading not started (based on parts of GL_ARB_sample_shading, which is done for some drivers)
|
||||
GL_OES_sample_variables not started (based on parts of GL_ARB_sample_shading, which is done for some drivers)
|
||||
GL_OES_shader_image_atomic not started (based on parts of GL_ARB_shader_image_load_store, which is done for some drivers)
|
||||
GL_OES_shader_io_blocks not started (based on parts of GLSL 1.50, which is done)
|
||||
GL_OES_shader_multisample_interpolation not started (based on parts of GL_ARB_gpu_shader5, which is done)
|
||||
GL_OES_tessellation_shader not started (based on GL_ARB_tessellation_shader, which is done for some drivers)
|
||||
GL_OES_texture_border_clamp not started (based on GL_ARB_texture_border_clamp, which is done)
|
||||
GL_OES_texture_buffer not started (based on GL_ARB_texture_buffer_object, GL_ARB_texture_buffer_range, and GL_ARB_texture_buffer_object_rgb32 that are all done)
|
||||
GL_OES_texture_cube_map_array not started (based on GL_ARB_texture_cube_map_array, which is done for all drivers)
|
||||
GL_OES_texture_stencil8 DONE (all drivers that support GL_ARB_texture_stencil8)
|
||||
GL_OES_texture_storage_multisample_2d_array DONE (all drivers that support GL_ARB_texture_multisample)
|
||||
Additional functions not covered above:
|
||||
glMemoryBarrierByRegion
|
||||
glGetTexLevelParameter[fi]v - needs updates to restrict to GLES enums
|
||||
glGetBooleani_v - needs updates to restrict to GLES enums
|
||||
|
||||
More info about these features and the work involved can be found at
|
||||
http://dri.freedesktop.org/wiki/MissingFunctionality
|
||||
|
||||
@@ -2,8 +2,8 @@ The software may implement third party technologies (e.g. third party
|
||||
libraries) that are not licensed to you by AMD and for which you may need
|
||||
to obtain licenses from other parties. Unless explicitly stated otherwise,
|
||||
these third party technologies are not licensed hereunder. Such third
|
||||
party technologies include, but are not limited, to H.264, H.265, HEVC, MPEG-2,
|
||||
MPEG-4, AVC, and VC-1.
|
||||
party technologies include, but are not limited, to H.264, MPEG-2, MPEG-4,
|
||||
AVC, and VC-1.
|
||||
|
||||
For MPEG-2 Encoding Products ANY USE OF THIS PRODUCT IN ANY MANNER OTHER
|
||||
THAN PERSONAL USE THAT COMPLIES WITH THE MPEG-2 STANDARD FOR ENCODING VIDEO
|
||||
|
||||
@@ -87,13 +87,6 @@ created in a <code>lib64</code> directory at the top of the Mesa source
|
||||
tree.</p>
|
||||
</dd>
|
||||
|
||||
<dt><code>--sysconfdir=DIR</code></dt>
|
||||
<dd><p>This option specifies the directory where the configuration
|
||||
files will be installed. The default is <code>${prefix}/etc</code>.
|
||||
Currently there's only one config file provided when dri drivers are
|
||||
enabled - it's <code>drirc</code>.</p>
|
||||
</dd>
|
||||
|
||||
<dt><code>--enable-static, --disable-shared</code></dt>
|
||||
<dd><p>By default, Mesa
|
||||
will build shared libraries. Either of these options will force static
|
||||
@@ -224,7 +217,7 @@ GLX.
|
||||
<dt><code>--with-expat=DIR</code>
|
||||
<dd><p><strong>DEPRECATED</strong>, use <code>PKG_CONFIG_PATH</code> instead.</p>
|
||||
<p>The DRI-enabled libGL uses expat to
|
||||
parse the DRI configuration files in <code>${sysconfdir}/drirc</code> and
|
||||
parse the DRI configuration files in <code>/etc/drirc</code> and
|
||||
<code>~/.drirc</code>. This option allows a specific expat installation
|
||||
to be used. For example, <code>--with-expat=/usr/local</code> will
|
||||
search for expat headers and libraries in <code>/usr/local/include</code>
|
||||
|
||||
@@ -90,14 +90,14 @@
|
||||
<li><a href="http://www.opengl.org" target="_parent">OpenGL website</a>
|
||||
<li><a href="http://dri.freedesktop.org" target="_parent">DRI website</a>
|
||||
<li><a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>
|
||||
<li><a href="http://planet.freedesktop.org" target="_parent">Developer blogs</a>
|
||||
</ul>
|
||||
|
||||
<b>Hosted by:</b>
|
||||
<br>
|
||||
<blockquote>
|
||||
<a href="http://sourceforge.net"
|
||||
target="_parent">sourceforge.net</a>
|
||||
target="_parent"><img src="http://sourceforge.net/sflogo.php?group_id=3&type=1"
|
||||
width="88" height="31" align="bottom" alt="Sourceforge.net" border="0"></a>
|
||||
</blockquote>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -91,20 +91,11 @@ This is only valid for versions >= 3.0.
|
||||
<li> Mesa may not really implement all the features of the given version.
|
||||
(for developers only)
|
||||
</ul>
|
||||
<li>MESA_GLES_VERSION_OVERRIDE - changes the value returned by
|
||||
glGetString(GL_VERSION) for OpenGL ES.
|
||||
<ul>
|
||||
<li> The format should be MAJOR.MINOR
|
||||
<li> Examples: 2.0, 3.0, 3.1
|
||||
<li> Mesa may not really implement all the features of the given version.
|
||||
(for developers only)
|
||||
</ul>
|
||||
<li>MESA_GLSL_VERSION_OVERRIDE - changes the value returned by
|
||||
glGetString(GL_SHADING_LANGUAGE_VERSION). Valid values are integers, such as
|
||||
"130". Mesa will not really implement all the features of the given language version
|
||||
if it's higher than what's normally reported. (for developers only)
|
||||
<li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
|
||||
<li>MESA_NO_MINMAX_CACHE - when set, the minmax index cache is globally disabled.
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -162,7 +153,6 @@ See the <a href="xlibdriver.html">Xlib software driver page</a> for details.
|
||||
<li>no16 - suppress generation of 16-wide fragment shaders. useful for debugging broken shaders</li>
|
||||
<li>blorp - emit messages about the blorp operations (blits & clears)</li>
|
||||
<li>nodualobj - suppress generation of dual-object geometry shader code</li>
|
||||
<li>optimizer - dump shader assembly to files at each optimization pass and iteration that make progress</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
@@ -188,14 +178,6 @@ Mesa EGL supports different sets of environment variables. See the
|
||||
<li>GALLIUM_HUD - draws various information on the screen, like framerate,
|
||||
cpu load, driver statistics, performance counters, etc.
|
||||
Set GALLIUM_HUD=help and run e.g. glxgears for more info.
|
||||
<li>GALLIUM_HUD_PERIOD - sets the hud update rate in seconds (float). Use zero
|
||||
to update every frame. The default period is 1/2 second.
|
||||
<li>GALLIUM_HUD_VISIBLE - control default visibility, defaults to true.
|
||||
<li>GALLIUM_HUD_TOGGLE_SIGNAL - toggle visibility via user specified signal.
|
||||
Especially useful to toggle hud at specific points of application and
|
||||
disable for unencumbered viewing the rest of the time. For example, set
|
||||
GALLIUM_HUD_VISIBLE to false and GALLIUM_HUD_SIGNAL_TOGGLE to 10 (SIGUSR1).
|
||||
Use kill -10 <pid> to toggle the hud as desired.
|
||||
<li>GALLIUM_LOG_FILE - specifies a file for logging all errors, warnings, etc.
|
||||
rather than stderr.
|
||||
<li>GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment
|
||||
@@ -232,7 +214,7 @@ See src/mesa/state_tracker/st_debug.c for other options.
|
||||
<li>LP_PERF - a comma-separated list of options to selectively no-op various
|
||||
parts of the driver. See the source code for details.
|
||||
<li>LP_NUM_THREADS - an integer indicating how many threads to use for rendering.
|
||||
Zero turns off threading completely. The default value is the number of CPU
|
||||
Zero turns of threading completely. The default value is the number of CPU
|
||||
cores present.
|
||||
</ul>
|
||||
|
||||
@@ -247,31 +229,6 @@ for details.
|
||||
</ul>
|
||||
|
||||
|
||||
<h3>VA-API state tracker environment variables</h3>
|
||||
<ul>
|
||||
<li>VAAPI_MPEG4_ENABLED - enable MPEG4 for VA-API, disabled by default.
|
||||
</ul>
|
||||
|
||||
|
||||
<h3>VC4 driver environment variables</h3>
|
||||
<ul>
|
||||
<li>VC4_DEBUG - a comma-separated list of named flags, which do various things:
|
||||
<ul>
|
||||
<li>cl - dump command list during creation</li>
|
||||
<li>qpu - dump generated QPU instructions</li>
|
||||
<li>qir - dump QPU IR during program compile</li>
|
||||
<li>nir - dump NIR during program compile</li>
|
||||
<li>tgsi - dump TGSI during program compile</li>
|
||||
<li>shaderdb - dump program compile information for shader-db analysis</li>
|
||||
<li>perf - print during performance-related events</li>
|
||||
<li>norast - skip actual hardware execution of commands</li>
|
||||
<li>always_flush - flush after each draw call</li>
|
||||
<li>always_sync - wait for finish after each flush</li>
|
||||
<li>dump - write a GPU command stream trace file (VC4 simulator only)</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<p>
|
||||
Other Gallium drivers have their own environment variables. These may change
|
||||
frequently so the source code should be consulted for details.
|
||||
|
||||
125
docs/index.html
125
docs/index.html
@@ -16,142 +16,25 @@
|
||||
|
||||
<h1>News</h1>
|
||||
|
||||
<h2>February 10, 2016</h2>
|
||||
<p>
|
||||
<a href="relnotes/11.1.2.html">Mesa 11.1.2</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>January 22, 2016</h2>
|
||||
<p>
|
||||
<a href="relnotes/11.0.9.html">Mesa 11.0.9</a> is released.
|
||||
This is a bug-fix release.
|
||||
<br>
|
||||
NOTE: It is anticipated that 11.0.9 will be the final release in the 11.0
|
||||
series. Users of 11.0 are encouraged to migrate to the 11.1 series in order
|
||||
to obtain future fixes.
|
||||
</p>
|
||||
|
||||
<h2>January 13, 2016</h2>
|
||||
<p>
|
||||
<a href="relnotes/11.1.1.html">Mesa 11.1.1</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>December 21, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/11.0.8.html">Mesa 11.0.8</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>December 15, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/11.1.0.html">Mesa 11.1.0</a> is released. This is a new
|
||||
development release. See the release notes for more information about
|
||||
the release.
|
||||
</p>
|
||||
|
||||
<h2>December 9, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/11.0.7.html">Mesa 11.0.7</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa demos 8.3.0 is also released.
|
||||
See the <a href="http://lists.freedesktop.org/archives/mesa-announce/2015-December/000191.html">announcement</a> for more information about the release.
|
||||
You can download it from <a href="ftp://ftp.freedesktop.org/pub/mesa/demos/8.3.0/">ftp.freedesktop.org/pub/mesa/demos/8.3.0/</a>.
|
||||
</p>
|
||||
|
||||
<h2>November 21, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/11.0.6.html">Mesa 11.0.6</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>November 11, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/11.0.5.html">Mesa 11.0.5</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>October 24, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/11.0.4.html">Mesa 11.0.4</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>October 10, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/11.0.3.html">Mesa 11.0.3</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>October 3, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.6.9.html">Mesa 10.6.9</a> is released.
|
||||
This is a bug-fix release.
|
||||
<br>
|
||||
NOTE: It is anticipated that 10.6.9 will be the final release in the 10.6
|
||||
series. Users of 10.6 are encouraged to migrate to the 11.0 series in order
|
||||
to obtain future fixes.
|
||||
</p>
|
||||
|
||||
<h2>September 28, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/11.0.2.html">Mesa 11.0.2</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>September 26, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/11.0.1.html">Mesa 11.0.1</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>September 20, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.6.8.html">Mesa 10.6.8</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>September 12, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/11.0.0.html">Mesa 11.0.0</a> is released. This is a new
|
||||
development release. See the release notes for more information about
|
||||
the release.
|
||||
</p>
|
||||
|
||||
<h2>September 10, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.6.7.html">Mesa 10.6.7</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>September 4, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.6.6.html">Mesa 10.6.6</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>August 22, 2015</h2>
|
||||
<h2>August 22 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.6.5.html">Mesa 10.6.5</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>August 11, 2015</h2>
|
||||
<h2>August 11 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.6.4.html">Mesa 10.6.4</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>July 26, 2015</h2>
|
||||
<h2>July 26 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.6.3.html">Mesa 10.6.3</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>July 11, 2015</h2>
|
||||
<h2>July 11 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.6.2.html">Mesa 10.6.2</a> is released.
|
||||
This is a bug-fix release.
|
||||
|
||||
@@ -39,7 +39,7 @@ Version 2.6.4 or later should work.
|
||||
</li>
|
||||
<br>
|
||||
<li><a href="http://www.makotemplates.org/">Python Mako module</a> -
|
||||
Python Mako module is required. Version 0.3.4 or later should work.
|
||||
Python Mako module is required. Version 0.7.3 or later should work.
|
||||
</li>
|
||||
</br>
|
||||
<li><a href="http://www.scons.org/">SCons</a> is required for building on
|
||||
@@ -58,9 +58,6 @@ On Windows with MinGW, install flex and bison with:
|
||||
For MSVC on Windows, install
|
||||
<a href="http://winflexbison.sourceforge.net/">Win flex-bison</a>.
|
||||
</li>
|
||||
<br>
|
||||
<li>For building on Windows, Microsoft Visual Studio 2013 or later is required.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
@@ -21,23 +21,6 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="relnotes/11.1.2.html">11.1.2 release notes</a>
|
||||
<li><a href="relnotes/11.0.9.html">11.0.9 release notes</a>
|
||||
<li><a href="relnotes/11.1.1.html">11.1.1 release notes</a>
|
||||
<li><a href="relnotes/11.0.8.html">11.0.8 release notes</a>
|
||||
<li><a href="relnotes/11.1.0.html">11.1.0 release notes</a>
|
||||
<li><a href="relnotes/11.0.7.html">11.0.7 release notes</a>
|
||||
<li><a href="relnotes/11.0.6.html">11.0.6 release notes</a>
|
||||
<li><a href="relnotes/11.0.5.html">11.0.5 release notes</a>
|
||||
<li><a href="relnotes/11.0.4.html">11.0.4 release notes</a>
|
||||
<li><a href="relnotes/11.0.3.html">11.0.3 release notes</a>
|
||||
<li><a href="relnotes/10.6.9.html">10.6.9 release notes</a>
|
||||
<li><a href="relnotes/11.0.2.html">11.0.2 release notes</a>
|
||||
<li><a href="relnotes/11.0.1.html">11.0.1 release notes</a>
|
||||
<li><a href="relnotes/10.6.8.html">10.6.8 release notes</a>
|
||||
<li><a href="relnotes/11.0.0.html">11.0.0 release notes</a>
|
||||
<li><a href="relnotes/10.6.7.html">10.6.7 release notes</a>
|
||||
<li><a href="relnotes/10.6.6.html">10.6.6 release notes</a>
|
||||
<li><a href="relnotes/10.6.5.html">10.6.5 release notes</a>
|
||||
<li><a href="relnotes/10.6.4.html">10.6.4 release notes</a>
|
||||
<li><a href="relnotes/10.6.3.html">10.6.3 release notes</a>
|
||||
|
||||
@@ -1,164 +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.6 Release Notes / September 04, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.6.6 is a bug fix release which fixes bugs found since the 10.6.5 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.6.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>
|
||||
416517aa9df4791f97d34451a9e4da33c966afcd18c115c5769b92b15b018ef5 mesa-10.6.6.tar.gz
|
||||
570f2154b7340ff5db61ff103bc6e85165b8958798b78a50fa2df488e98e5778 mesa-10.6.6.tar.xz
|
||||
</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=84677">Bug 84677</a> - Triangle disappears with glPolygonMode GL_LINE</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90734">Bug 90734</a> - glBufferSubData is corrupting data when buffer is > 32k</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90748">Bug 90748</a> - [BDW Bisected]dEQP-GLES3.functional.fbo.completeness.renderable.texture.depth.rg_half_float_oes fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90902">Bug 90902</a> - [bsw][regression] dEQP: "Found invalid pixel values"</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90925">Bug 90925</a> - "high fidelity": Segfault in _mesa_program_resource_find_name</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91254">Bug 91254</a> - (regresion) video using VA-API on Intel slow and freeze system with mesa 10.6 or 10.6.1</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91292">Bug 91292</a> - [BDW+] glVertexAttribDivisor not working in combination with glPolygonMode</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91673">Bug 91673</a> - Segfault when calling glTexSubImage2D on storage texture to bound FBO</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91726">Bug 91726</a> - R600 asserts in tgsi_cmp/make_src_for_op3</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Chris Wilson (2):</p>
|
||||
<ul>
|
||||
<li>i965: Prevent coordinate overflow in intel_emit_linear_blit</li>
|
||||
<li>i965: Always re-emit the pipeline select during invariant state emission</li>
|
||||
</ul>
|
||||
|
||||
<p>Daniel Scharrer (1):</p>
|
||||
<ul>
|
||||
<li>mesa: add missing queries for ARB_direct_state_access</li>
|
||||
</ul>
|
||||
|
||||
<p>Dave Airlie (8):</p>
|
||||
<ul>
|
||||
<li>mesa/arb_gpu_shader_fp64: add support for glGetUniformdv</li>
|
||||
<li>mesa/texgetimage: fix missing stencil check</li>
|
||||
<li>st/readpixels: fix accel path for skipimages.</li>
|
||||
<li>texcompress_s3tc/fxt1: fix stride checks (v1.1)</li>
|
||||
<li>mesa/readpixels: check strides are equal before skipping conversion</li>
|
||||
<li>mesa: enable texture stencil8 for multisample</li>
|
||||
<li>r600/sb: update last_cf for finalize if.</li>
|
||||
<li>r600g: fix calculation for gpr allocation</li>
|
||||
</ul>
|
||||
|
||||
<p>David Heidelberg (1):</p>
|
||||
<ul>
|
||||
<li>st/nine: Require gcc >= 4.6</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (2):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 10.6.5</li>
|
||||
<li>get-pick-list.sh: Require explicit "10.6" for nominating stable patches</li>
|
||||
</ul>
|
||||
|
||||
<p>Glenn Kennard (4):</p>
|
||||
<ul>
|
||||
<li>r600g: Fix assert in tgsi_cmp</li>
|
||||
<li>r600g/sb: Handle undef in read port tracker</li>
|
||||
<li>r600g/sb: Don't read junk after EOP</li>
|
||||
<li>r600g/sb: Don't crash on empty if jump target</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (5):</p>
|
||||
<ul>
|
||||
<li>st/mesa: fix assignments with 4-operand arguments (i.e. BFI)</li>
|
||||
<li>st/mesa: pass through 4th opcode argument in bitmap/pixel visitors</li>
|
||||
<li>nv50,nvc0: disable depth bounds test on blit</li>
|
||||
<li>nv50: fix 2d engine blits for 64- and 128-bit formats</li>
|
||||
<li>mesa: only copy the requested teximage faces</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (1):</p>
|
||||
<ul>
|
||||
<li>i965/fs: Split VGRFs after lowering pull constants</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (3):</p>
|
||||
<ul>
|
||||
<li>i965: Fix copy propagation type changes.</li>
|
||||
<li>Revert "i965: Advertise a line width of 40.0 on Cherryview and Skylake."</li>
|
||||
<li>i965: Momentarily pretend to support ARB_texture_stencil8 for blits.</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (3):</p>
|
||||
<ul>
|
||||
<li>gallium/radeon: fix the ADDRESS_HI mask for EVENT_WRITE CIK packets</li>
|
||||
<li>mesa: create multisample fallback textures like normal textures</li>
|
||||
<li>radeonsi: fix a Unigine Heaven hang when drirc is missing</li>
|
||||
</ul>
|
||||
|
||||
<p>Matt Turner (1):</p>
|
||||
<ul>
|
||||
<li>i965/fs: Handle MRF destinations in lower_integer_multiplication().</li>
|
||||
</ul>
|
||||
|
||||
<p>Neil Roberts (2):</p>
|
||||
<ul>
|
||||
<li>i965: Swap the order of the vertex ID and edge flag attributes</li>
|
||||
<li>i965/bdw: Fix 3DSTATE_VF_INSTANCING when the edge flag is used</li>
|
||||
</ul>
|
||||
|
||||
<p>Tapani Pälli (5):</p>
|
||||
<ul>
|
||||
<li>mesa: update fbo state in glTexStorage</li>
|
||||
<li>glsl: build stageref mask using IR, not symbol table</li>
|
||||
<li>glsl: expose build_program_resource_list function</li>
|
||||
<li>glsl: create program resource list after LinkShader</li>
|
||||
<li>mesa: add GL_RED, GL_RG support for floating point textures</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,75 +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.7 Release Notes / September 10, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.6.7 is a bug fix release which fixes bugs found since the 10.6.6 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.6.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>
|
||||
4ba10c59abee30d72476543a57afd2f33803dabf4620dc333b335d47966ff842 mesa-10.6.7.tar.gz
|
||||
feb1f640b915dada88a7c793dfaff0ae23580f8903f87a6b76469253de0d28d8 mesa-10.6.7.tar.xz
|
||||
</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=90751">Bug 90751</a> - [BDW Bisected]dEQP-GLES3.functional.fbo.completeness.renderable.texture.stencil.stencil_index8 fails</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Dave Airlie (1):</p>
|
||||
<ul>
|
||||
<li>mesa/teximage: use correct extension for accept stencil texture.</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (3):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 10.6.6</li>
|
||||
<li>Revert "i965: Momentarily pretend to support ARB_texture_stencil8 for blits."</li>
|
||||
<li>Update version to 10.6.7</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (1):</p>
|
||||
<ul>
|
||||
<li>glsl: Handle attribute aliasing in attribute storage limit check.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,136 +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.8 Release Notes / September 20, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.6.8 is a bug fix release which fixes bugs found since the 10.6.7 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.6.8 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>
|
||||
1f34dba2a8059782e3e4e0f18b9628004e253b2c69085f735b846d2e63c9e250 mesa-10.6.8.tar.gz
|
||||
e36ee5ceeadb3966fb5ce5b4cf18322dbb76a4f075558ae49c3bba94f57d58fd mesa-10.6.8.tar.xz
|
||||
</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=90621">Bug 90621</a> - Mesa fail to build from git</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91526">Bug 91526</a> - World of Warcraft (on Wine) has UI corruption with nouveau</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91719">Bug 91719</a> - [SNB,HSW,BYT] dEQP regressions associated with using NIR for vertex shaders</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Alejandro Piñeiro (1):</p>
|
||||
<ul>
|
||||
<li>i965/vec4: fill src_reg type using the constructor type parameter</li>
|
||||
</ul>
|
||||
|
||||
<p>Antia Puentes (1):</p>
|
||||
<ul>
|
||||
<li>i965/vec4: Fix saturation errors when coalescing registers</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (2):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 10.6.7</li>
|
||||
<li>cherry-ignore: add commit non applicable for 10.6</li>
|
||||
</ul>
|
||||
|
||||
<p>Hans de Goede (4):</p>
|
||||
<ul>
|
||||
<li>nv30: Fix creation of scanout buffers</li>
|
||||
<li>nv30: Implement color resolve for msaa</li>
|
||||
<li>nv30: Fix max width / height checks in nv30 sifm code</li>
|
||||
<li>nv30: Disable msaa unless requested from the env by NV30_MAX_MSAA</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (2):</p>
|
||||
<ul>
|
||||
<li>mesa: Pass the type to _mesa_uniform_matrix as a glsl_base_type</li>
|
||||
<li>mesa: Don't allow wrong type setters for matrix uniforms</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (5):</p>
|
||||
<ul>
|
||||
<li>st/mesa: don't fall back to 16F when 32F is requested</li>
|
||||
<li>nvc0: always emit a full shader colormask</li>
|
||||
<li>nvc0: remove BGRA4 format support</li>
|
||||
<li>st/mesa: avoid integer overflows with buffers >= 512MB</li>
|
||||
<li>nv50, nvc0: fix max texture buffer size to 128M elements</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (1):</p>
|
||||
<ul>
|
||||
<li>i965/vec4: Don't reswizzle hardware registers</li>
|
||||
</ul>
|
||||
|
||||
<p>Jose Fonseca (1):</p>
|
||||
<ul>
|
||||
<li>gallivm: Workaround LLVM PR23628.</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (1):</p>
|
||||
<ul>
|
||||
<li>i965: Momentarily pretend to support ARB_texture_stencil8 for blits.</li>
|
||||
</ul>
|
||||
|
||||
<p>Oded Gabbay (1):</p>
|
||||
<ul>
|
||||
<li>llvmpipe: convert double to long long instead of unsigned long long</li>
|
||||
</ul>
|
||||
|
||||
<p>Ray Strode (1):</p>
|
||||
<ul>
|
||||
<li>gbm: convert gbm bo format to fourcc format on dma-buf import</li>
|
||||
</ul>
|
||||
|
||||
<p>Ulrich Weigand (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Fix texture compression on big-endian systems</li>
|
||||
</ul>
|
||||
|
||||
<p>Vinson Lee (1):</p>
|
||||
<ul>
|
||||
<li>gallivm: Do not use NoFramePointerElim with LLVM 3.7.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,130 +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.9 Release Notes / Octover 03, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.6.9 is a bug fix release which fixes bugs found since the 10.6.8 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.6.9 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>
|
||||
3406876aac67546d0c3e2cb97da330b62644c313e7992b95618662e13c54296a mesa-10.6.9.tar.gz
|
||||
b04c4de6280b863babc2929573da17218d92e9e4ba6272d548d135415723e8c3 mesa-10.6.9.tar.xz
|
||||
</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=38109">Bug 38109</a> - i915 driver crashes if too few vertices are submitted (Mesa 7.10.2)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55552">Bug 55552</a> - Compile errors with --enable-mangling</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86281">Bug 86281</a> - brw_meta_fast_clear (brw=brw@entry=0x7fffd4097a08, fb=fb@entry=0x7fffd40fa900, buffers=buffers@entry=2, partial_clear=partial_clear@entry=false)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91970">Bug 91970</a> - [BSW regression] dEQP-GLES3.functional.shaders.precision.int.highp_mul_vertex</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92072">Bug 92072</a> - Wine breakage since d082c5324 (st/mesa: don't call st_validate_state in BlitFramebuffer)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Brian Paul (1):</p>
|
||||
<ul>
|
||||
<li>st/mesa: try PIPE_BIND_RENDER_TARGET when choosing float texture formats</li>
|
||||
</ul>
|
||||
|
||||
<p>Chris Wilson (1):</p>
|
||||
<ul>
|
||||
<li>i965: Remove early release of DRI2 miptree</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (4):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 10.6.8</li>
|
||||
<li>cherry-ignore: add commit non applicable for 10.6</li>
|
||||
<li>cherry-ignore: add commit non applicable for 10.6</li>
|
||||
<li>Update version to 10.6.9</li>
|
||||
</ul>
|
||||
|
||||
<p>Iago Toral Quiroga (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for default framebuffer.</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (5):</p>
|
||||
<ul>
|
||||
<li>t_dd_dmatmp: Make "count" actually be the count</li>
|
||||
<li>t_dd_dmatmp: Clean up improper code formatting from previous patch</li>
|
||||
<li>t_dd_dmatmp: Use '& 3' instead of '% 4' everywhere</li>
|
||||
<li>t_dd_dmatmp: Pull out common 'count -= count & 3' code</li>
|
||||
<li>t_dd_dmatmp: Use addition instead of subtraction in loop bounds</li>
|
||||
</ul>
|
||||
|
||||
<p>Jeremy Huddleston (1):</p>
|
||||
<ul>
|
||||
<li>configure.ac: Add support to enable read-only text segment on x86.</li>
|
||||
</ul>
|
||||
|
||||
<p>Kristian Høgsberg Kristensen (1):</p>
|
||||
<ul>
|
||||
<li>i965: Respect stride and subreg_offset for ATTR registers</li>
|
||||
</ul>
|
||||
|
||||
<p>Kyle Brenneman (3):</p>
|
||||
<ul>
|
||||
<li>glx: Fix build errors with --enable-mangling (v2)</li>
|
||||
<li>mapi: Make _glapi_get_stub work with "gl" or "mgl" prefix.</li>
|
||||
<li>glx: Don't hard-code the name "libGL.so.1" in driOpenDriver (v3)</li>
|
||||
</ul>
|
||||
|
||||
<p>Leo Liu (1):</p>
|
||||
<ul>
|
||||
<li>radeon/vce: fix vui time_scale zero error</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (1):</p>
|
||||
<ul>
|
||||
<li>st/mesa: fix front buffer regression after dropping st_validate_state in Blit</li>
|
||||
</ul>
|
||||
|
||||
<p>Roland Scheidegger (1):</p>
|
||||
<ul>
|
||||
<li>mesa: fix mipmap generation for immutable, compressed textures</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -14,7 +14,7 @@
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 11.0.0 Release Notes / September 12, 2015</h1>
|
||||
<h1>Mesa 11.0.0 Release Notes / TBD</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.0.0 is a new development release.
|
||||
@@ -33,8 +33,7 @@ because compatibility contexts are not supported.
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
7d7e4ddffa3b162506efa01e2cc41e329caa4995336b92e5cc21f2e1fb36c1b3 mesa-11.0.0.tar.gz
|
||||
e095a3eb2eca9dfde7efca8946527c8ae20a0cc938a8c78debc7f158ad44af32 mesa-11.0.0.tar.xz
|
||||
TBD.
|
||||
</pre>
|
||||
|
||||
|
||||
@@ -84,175 +83,13 @@ Note: some of the new features are only available with certain drivers.
|
||||
<li>EGL 1.5 on r600, radeonsi, nv50, nvc0</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<p>This list is likely incomplete.</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=51658">Bug 51658</a> - r200 (& possibly radeon) DRI fixes for gnome shell on Mesa 8.0.3</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=65525">Bug 65525</a> - [llvmpipe] lp_scene.h:210:lp_scene_alloc: Assertion `size <= (64 * 1024)' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66346">Bug 66346</a> - shader_query.cpp:49: error: invalid conversion from 'void*' to 'GLuint'</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73512">Bug 73512</a> - [clover] mesa.icd. should contain full path</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73528">Bug 73528</a> - Deferred lighting in Second Life causes system hiccups and screen flickering</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74329">Bug 74329</a> - Please expose OES_texture_float and OES_texture_half_float on the ES3 context</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80500">Bug 80500</a> - Flickering shadows in unreleased title trace</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82186">Bug 82186</a> - [r600g] BARTS GPU lockup with minecraft shaders</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84225">Bug 84225</a> - Allow constant-index-expression sampler array indexing with GLSL-ES < 300</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84677">Bug 84677</a> - Triangle disappears with glPolygonMode GL_LINE</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85252">Bug 85252</a> - Segfault in compiler while processing ternary operator with void arguments</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89131">Bug 89131</a> - [Bisected] Graphical corruption in Weston, shows old framebuffer pieces</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90000">Bug 90000</a> - [i965 Bisected NIR] Piglit/gglean_fragprog1-z-write_test fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90073">Bug 90073</a> - Leaks in xcb_dri3_open_reply_fds() and get_render_node_from_id_path_tag</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90249">Bug 90249</a> - Fails to build egl_dri2 on osx</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90310">Bug 90310</a> - Fails to build gallium_dri.so at linking stage with clang because of multiple redefinitions</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90347">Bug 90347</a> - [NVE0+] Failure to insert texbar under some circumstances (causing bad colors in Terasology)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90466">Bug 90466</a> - arm: linker error ndefined reference to `nir_metadata_preserve'</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90520">Bug 90520</a> - Register spilling clobbers registers used elsewhere in the shader</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90537">Bug 90537</a> - radeonsi bo/va conflict on RADEON_GEM_VA (rscreen->ws->buffer_from_handle returns NULL)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90547">Bug 90547</a> - [BDW/BSW/SKL Bisected]Piglit/glean@vertprog1-rsq_test_2_(reciprocal_square_root_of_negative_value) fais</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90580">Bug 90580</a> - [HSW bisected] integer multiplication bug</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90600">Bug 90600</a> - IOError: [Errno 2] No such file or directory: 'gl_API.xml'</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90621">Bug 90621</a> - Mesa fail to build from git</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90629">Bug 90629</a> - [i965] SIMD16 dual_source_blend assertion `src[i].file != GRF || src[i].width == dst.width' failed</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90691">Bug 90691</a> - [BSW]Piglit/spec/nv_conditional_render/dlist fails intermittently</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90728">Bug 90728</a> - dvd playback with vlc and vdpau causes segmentation fault</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90734">Bug 90734</a> - glBufferSubData is corrupting data when buffer is > 32k</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90748">Bug 90748</a> - [BDW Bisected]dEQP-GLES3.functional.fbo.completeness.renderable.texture.depth.rg_half_float_oes fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90749">Bug 90749</a> - [BDW Bisected]dEQP-GLES3.functional.rasterization.fbo.rbo_multisample_max.primitives.lines_wide fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90751">Bug 90751</a> - [BDW Bisected]dEQP-GLES3.functional.fbo.completeness.renderable.texture.stencil.stencil_index8 fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90797">Bug 90797</a> - [ALL bisected] Mesa change cause performance case manhattan fail.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90817">Bug 90817</a> - swrast fails to load with certain remote X servers</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90830">Bug 90830</a> - [bsw bisected regression] GPU hang for spec.arb_gpu_shader5.execution.sampler_array_indexing.vs-nonzero-base</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90839">Bug 90839</a> - [10.5.5/10.6 regression, bisected] PBO glDrawPixels no longer using blit fastpath</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90873">Bug 90873</a> - Kernel hang, TearFree On, Mate desktop environment</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90887">Bug 90887</a> - PhiMovesPass in register allocator broken</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90895">Bug 90895</a> - [IVB/HSW/BDW/BSW Bisected] GLB2.7 Egypt, GfxBench3.0 T-Rex & ALU and many SynMark cases performance reduced by 10-23%</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90902">Bug 90902</a> - [bsw][regression] dEQP: "Found invalid pixel values"</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90903">Bug 90903</a> - egl_dri2.c:dri2_load fails to load libglapi on osx</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90904">Bug 90904</a> - OSX: EXC_BAD_ACCESS when using translate_sse + gallium + softpipe/llvmpipe</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90905">Bug 90905</a> - mesa: Finish subdir-objects transition</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90925">Bug 90925</a> - "high fidelity": Segfault in _mesa_program_resource_find_name</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91022">Bug 91022</a> - [g45 g965 bisected] assertions generated from textureGrad cube samplers fix</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91047">Bug 91047</a> - [SNB Bisected] Messed up Fog in Super Smash Bros. Melee in Dolphin</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91056">Bug 91056</a> - The Bard's Tale (2005, native) has rendering issues</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91077">Bug 91077</a> - dri2_glx.c:1186: undefined reference to `loader_open_device'</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91099">Bug 91099</a> - [llvmpipe] piglit glsl-max-varyings >max_varying_components regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91101">Bug 91101</a> - [softpipe] piglit glsl-1.50@execution@geometry@max-input-components regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91117">Bug 91117</a> - Nimbus (running in wine) has rendering issues, objects are semi-transparent</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91124">Bug 91124</a> - Civilization V (in Wine) has rendering issues: text missing, menu bar corrupted</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91173">Bug 91173</a> - Oddworld: Stranger's Wrath HD: disfigured models in wrong colors</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91193">Bug 91193</a> - [290x] Dota2 reborn ingame rendering breaks with git-af4b9c7</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91222">Bug 91222</a> - lp_test_format regression on CentOS 7</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91226">Bug 91226</a> - Crash in glLinkProgram (NEW)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91231">Bug 91231</a> - [NV92] Psychonauts (native) segfaults on start when DRI3 enabled</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91254">Bug 91254</a> - (regresion) video using VA-API on Intel slow and freeze system with mesa 10.6 or 10.6.1</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91290">Bug 91290</a> - SIGSEGV glcpp/glcpp-parse.y:1077</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91292">Bug 91292</a> - [BDW+] glVertexAttribDivisor not working in combination with glPolygonMode</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91337">Bug 91337</a> - OSMesaGetProcAdress("OSMesaPixelStore") returns nil</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91418">Bug 91418</a> - Visual Studio 2015 vsnprintf build error</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91425">Bug 91425</a> - [regression, bisected] Piglit spec/ext_packed_float/ getteximage-invalid-format-for-packed-type fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91441">Bug 91441</a> - make check DispatchSanity_test.GL30 regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91444">Bug 91444</a> - regression bisected radeonsi: don't change pipe_resource in resource_copy_region</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91461">Bug 91461</a> - gl_TessLevel* writes have no effect for all but the last TCS invocation</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91513">Bug 91513</a> - [IVB/HSW/BDW/SKL Bisected] Lightsmark performance reduced by 7%-10%</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91526">Bug 91526</a> - World of Warcraft (on Wine) has UI corruption with nouveau</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91544">Bug 91544</a> - [i965, regression, bisected] regression of several tests in 93977d3a151675946c03e</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91551">Bug 91551</a> - DXTn compressed normal maps produce severe artifacts on all NV5x and NVDx chipsets</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91570">Bug 91570</a> - Upgrading mesa to 10.6 causes segfault in OpenGL applications with GeForce4 MX 440 / AGP 8X</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91591">Bug 91591</a> - rounding.h:102:2: error: #error "Unsupported or undefined LONG_BIT"</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91610">Bug 91610</a> - [BSW] GPU hang for spec.shaders.point-vertex-id gl_instanceid divisor</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91673">Bug 91673</a> - Segfault when calling glTexSubImage2D on storage texture to bound FBO</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91726">Bug 91726</a> - R600 asserts in tgsi_cmp/make_src_for_op3</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91847">Bug 91847</a> - glGenerateTextureMipmap not working (no errors) unless glActiveTexture(GL_TEXTURE1) is called before</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91857">Bug 91857</a> - Mesa 10.6.3 linker is slow</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91881">Bug 91881</a> - regression: GPU lockups since mesa-11.0.0_rc1 on RV620 (r600) driver</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91890">Bug 91890</a> - [nve7] witcher2: blurry image & DATA_ERRORs (class 0xa097 mthd 0x2380/0x238c)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
TBD.
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<li>Removed the EGL loader from the Linux SCons build.</li>
|
||||
TBD.
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -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 11.0.1 Release Notes / September 26, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.0.1 is a bug fix release which fixes bugs found since the 11.0.0 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 11.0.1 implements the OpenGL 4.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.1. OpenGL
|
||||
4.1 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
6dab262877e12c0546a0e2970c6835a0f217e6d4026ccecb3cd5dd733d1ce867 mesa-11.0.1.tar.gz
|
||||
43d0dfcd1f1e36f07f8228cd76d90175d3fc74c1ed25d7071794a100a98ef2a6 mesa-11.0.1.tar.xz
|
||||
</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=38109">Bug 38109</a> - i915 driver crashes if too few vertices are submitted (Mesa 7.10.2)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91114">Bug 91114</a> - ES3-CTS.gtf.GL3Tests.shadow.shadow_execution_vert fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91716">Bug 91716</a> - [bisected] piglit.shaders.glsl-vs-int-attrib regresses on 32 bit BYT, HSW, IVB, SNB</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91719">Bug 91719</a> - [SNB,HSW,BYT] dEQP regressions associated with using NIR for vertex shaders</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92009">Bug 92009</a> - ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels fails</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Antia Puentes (2):</p>
|
||||
<ul>
|
||||
<li>i965/vec4: Fix saturation errors when coalescing registers</li>
|
||||
<li>i965/vec4_nir: Load constants as integers</li>
|
||||
</ul>
|
||||
|
||||
<p>Anuj Phogat (1):</p>
|
||||
<ul>
|
||||
<li>meta: Abort meta pbo path if TexSubImage need signed unsigned conversion</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (2):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 11.0.0</li>
|
||||
<li>Update version to 11.0.1</li>
|
||||
</ul>
|
||||
|
||||
<p>Iago Toral Quiroga (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for default framebuffer.</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (5):</p>
|
||||
<ul>
|
||||
<li>t_dd_dmatmp: Make "count" actually be the count</li>
|
||||
<li>t_dd_dmatmp: Clean up improper code formatting from previous patch</li>
|
||||
<li>t_dd_dmatmp: Use '& 3' instead of '% 4' everywhere</li>
|
||||
<li>t_dd_dmatmp: Pull out common 'count -= count & 3' code</li>
|
||||
<li>t_dd_dmatmp: Use addition instead of subtraction in loop bounds</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (6):</p>
|
||||
<ul>
|
||||
<li>st/mesa: avoid integer overflows with buffers >= 512MB</li>
|
||||
<li>nv50, nvc0: fix max texture buffer size to 128M elements</li>
|
||||
<li>freedreno/a3xx: fix blending of L8 format</li>
|
||||
<li>nv50,nvc0: detect underlying resource changes and update tic</li>
|
||||
<li>nv50,nvc0: flush texture cache in presence of coherent bufs</li>
|
||||
<li>radeonsi: load fmask ptr relative to the resources array</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (2):</p>
|
||||
<ul>
|
||||
<li>nir: Fix a bunch of ralloc parenting errors</li>
|
||||
<li>i965/vec4: Don't reswizzle hardware registers</li>
|
||||
</ul>
|
||||
|
||||
<p>Jeremy Huddleston (1):</p>
|
||||
<ul>
|
||||
<li>configure.ac: Add support to enable read-only text segment on x86.</li>
|
||||
</ul>
|
||||
|
||||
<p>Ray Strode (1):</p>
|
||||
<ul>
|
||||
<li>gbm: convert gbm bo format to fourcc format on dma-buf import</li>
|
||||
</ul>
|
||||
|
||||
<p>Tapani Pälli (2):</p>
|
||||
<ul>
|
||||
<li>mesa: fix errors when reading depth with glReadPixels</li>
|
||||
<li>i965: fix textureGrad for cubemaps</li>
|
||||
</ul>
|
||||
|
||||
<p>Ulrich Weigand (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Fix texture compression on big-endian systems</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,85 +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 11.0.2 Release Notes / September 28, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.0.2 is a bug fix release which fixes bugs found since the 11.0.1 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 11.0.2 implements the OpenGL 4.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.1. OpenGL
|
||||
4.1 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
45170773500d6ae2f9eb93fc85efee69f7c97084411ada4eddf92f78bca56d20 mesa-11.0.2.tar.gz
|
||||
fce11fb27eb87adf1e620a76455d635c6136dfa49ae58c53b34ef8d0c7b7eae4 mesa-11.0.2.tar.xz
|
||||
</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=91582">Bug 91582</a> - [bisected] Regression in DEQP gles2.functional.negative_api.texture.texsubimage2d_neg_offset</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91970">Bug 91970</a> - [BSW regression] dEQP-GLES3.functional.shaders.precision.int.highp_mul_vertex</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92095">Bug 92095</a> - [Regression, bisected] arb_shader_atomic_counters.compiler.builtins.frag</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Eduardo Lima Mitev (3):</p>
|
||||
<ul>
|
||||
<li>mesa: Fix order of format+type and internal format checks for glTexImageXD ops</li>
|
||||
<li>mesa: Move _mesa_base_tex_format() from teximage to glformats files</li>
|
||||
<li>mesa: Use the effective internal format instead for validation</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (2):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 11.0.1</li>
|
||||
<li>Update version to 11.0.2</li>
|
||||
</ul>
|
||||
|
||||
<p>Kristian Høgsberg Kristensen (1):</p>
|
||||
<ul>
|
||||
<li>i965: Respect stride and subreg_offset for ATTR registers</li>
|
||||
</ul>
|
||||
|
||||
<p>Matt Turner (1):</p>
|
||||
<ul>
|
||||
<li>glsl: Expose gl_MaxTess{Control,Evaluation}AtomicCounters.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,185 +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 11.0.3 Release Notes / October 10, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.0.3 is a bug fix release which fixes bugs found since the 11.0.2 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 11.0.3 implements the OpenGL 4.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.1. OpenGL
|
||||
4.1 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
c2210e3daecc10ed9fdcea500327652ed6effc2f47c4b9cee63fb08f560d7117 mesa-11.0.3.tar.gz
|
||||
ab2992eece21adc23c398720ef8c6933cb69ea42e1b2611dc09d031e17e033d6 mesa-11.0.3.tar.xz
|
||||
</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=55552">Bug 55552</a> - Compile errors with --enable-mangling</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71789">Bug 71789</a> - [r300g] Visuals not found in (default) depth = 24</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91044">Bug 91044</a> - piglit spec/egl_khr_create_context/valid debug flag gles* fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91342">Bug 91342</a> - Very dark textures on some objects in indoors environments in Postal 2</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91596">Bug 91596</a> - EGL_KHR_gl_colorspace (v2) causes problem with Android-x86 GUI</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91718">Bug 91718</a> - piglit.spec.arb_shader_image_load_store.invalid causes intermittent GPU HANG</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92072">Bug 92072</a> - Wine breakage since d082c5324 (st/mesa: don't call st_validate_state in BlitFramebuffer)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92265">Bug 92265</a> - Black windows in weston after update mesa to 11.0.2-1</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Brian Paul (1):</p>
|
||||
<ul>
|
||||
<li>st/mesa: try PIPE_BIND_RENDER_TARGET when choosing float texture formats</li>
|
||||
</ul>
|
||||
|
||||
<p>Daniel Scharrer (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Add abs input modifier to base for POW in ffvertex_prog</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (3):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 11.0.2</li>
|
||||
<li>Revert "nouveau: make sure there's always room to emit a fence"</li>
|
||||
<li>Update version to 11.0.3</li>
|
||||
</ul>
|
||||
|
||||
<p>Francisco Jerez (1):</p>
|
||||
<ul>
|
||||
<li>i965/fs: Fix hang on IVB and VLV with image format mismatch.</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (1):</p>
|
||||
<ul>
|
||||
<li>meta: Handle array textures in scaled MSAA blits</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (6):</p>
|
||||
<ul>
|
||||
<li>nouveau: be more careful about freeing temporary transfer buffers</li>
|
||||
<li>nouveau: delay deleting buffer with unflushed fence</li>
|
||||
<li>nouveau: wait to unref the transfer's bo until it's no longer used</li>
|
||||
<li>nv30: pretend to have packed texture/surface formats</li>
|
||||
<li>nv30: always go through translate module on big-endian</li>
|
||||
<li>nouveau: make sure there's always room to emit a fence</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Correctly handle GL_BGRA_EXT in ES3 format_and_type checks</li>
|
||||
</ul>
|
||||
|
||||
<p>Kyle Brenneman (3):</p>
|
||||
<ul>
|
||||
<li>glx: Fix build errors with --enable-mangling (v2)</li>
|
||||
<li>mapi: Make _glapi_get_stub work with "gl" or "mgl" prefix.</li>
|
||||
<li>glx: Don't hard-code the name "libGL.so.1" in driOpenDriver (v3)</li>
|
||||
</ul>
|
||||
|
||||
<p>Leo Liu (1):</p>
|
||||
<ul>
|
||||
<li>radeon/vce: fix vui time_scale zero error</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (21):</p>
|
||||
<ul>
|
||||
<li>st/mesa: fix front buffer regression after dropping st_validate_state in Blit</li>
|
||||
<li>radeonsi: handle index buffer alloc failures</li>
|
||||
<li>radeonsi: handle constant buffer alloc failures</li>
|
||||
<li>gallium/radeon: handle buffer_map staging buffer failures better</li>
|
||||
<li>gallium/radeon: handle buffer alloc failures in r600_draw_rectangle</li>
|
||||
<li>gallium/radeon: add a fail path for depth MSAA texture readback</li>
|
||||
<li>radeonsi: report alloc failure from si_shader_binary_read</li>
|
||||
<li>radeonsi: add malloc fail paths to si_create_shader_state</li>
|
||||
<li>radeonsi: skip drawing if the tess factor ring allocation fails</li>
|
||||
<li>radeonsi: skip drawing if GS ring allocations fail</li>
|
||||
<li>radeonsi: handle shader precompile failures</li>
|
||||
<li>radeonsi: handle fixed-func TCS shader create failure</li>
|
||||
<li>radeonsi: skip drawing if VS, TCS, TES, GS fail to compile or upload</li>
|
||||
<li>radeonsi: skip drawing if PS fails to compile or upload</li>
|
||||
<li>radeonsi: skip drawing if updating the scratch buffer fails</li>
|
||||
<li>radeonsi: don't forget to update scratch relocations for LS, HS, ES shaders</li>
|
||||
<li>radeonsi: handle dummy constant buffer allocation failure</li>
|
||||
<li>gallium/u_blitter: handle allocation failures</li>
|
||||
<li>radeonsi: add scratch buffer to the buffer list when it's re-allocated</li>
|
||||
<li>st/dri: don't use _ctx in client_wait_sync</li>
|
||||
<li>egl/dri2: don't require a context for ClientWaitSync (v2)</li>
|
||||
</ul>
|
||||
|
||||
<p>Matthew Waters (1):</p>
|
||||
<ul>
|
||||
<li>egl: rework handling EGL_CONTEXT_FLAGS</li>
|
||||
</ul>
|
||||
|
||||
<p>Michel Dänzer (1):</p>
|
||||
<ul>
|
||||
<li>st/dri: Use packed RGB formats</li>
|
||||
</ul>
|
||||
|
||||
<p>Roland Scheidegger (1):</p>
|
||||
<ul>
|
||||
<li>mesa: fix mipmap generation for immutable, compressed textures</li>
|
||||
</ul>
|
||||
|
||||
<p>Tom Stellard (3):</p>
|
||||
<ul>
|
||||
<li>gallium/radeon: Use call_once() when initailizing LLVM targets</li>
|
||||
<li>gallivm: Allow drivers and state trackers to initialize gallivm LLVM targets v2</li>
|
||||
<li>radeon/llvm: Initialize gallivm targets when initializing the AMDGPU target v2</li>
|
||||
</ul>
|
||||
|
||||
<p>Varad Gautam (1):</p>
|
||||
<ul>
|
||||
<li>egl: restore surface type before linking config to its display</li>
|
||||
</ul>
|
||||
|
||||
<p>Ville Syrjälä (3):</p>
|
||||
<ul>
|
||||
<li>i830: Fix collision between I830_UPLOAD_RASTER_RULES and I830_UPLOAD_TEX(0)</li>
|
||||
<li>i915: Fix texcoord vs. varying collision in fragment programs</li>
|
||||
<li>i915: Remember to call intel_prepare_render() before blitting</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,168 +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 11.0.4 Release Notes / October 24, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.0.4 is a bug fix release which fixes bugs found since the 11.0.3 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 11.0.4 implements the OpenGL 4.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.1. OpenGL
|
||||
4.1 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
ed412ca6a46d1bd055120e5c12806c15419ae8c4dd6d3f6ea20a83091d5c78bf mesa-11.0.4.tar.gz
|
||||
40201bf7fc6fa12a6d9edfe870b41eb4dd6669154e3c42c48a96f70805f5483d mesa-11.0.4.tar.xz
|
||||
</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=86281">Bug 86281</a> - brw_meta_fast_clear (brw=brw@entry=0x7fffd4097a08, fb=fb@entry=0x7fffd40fa900, buffers=buffers@entry=2, partial_clear=partial_clear@entry=false)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86720">Bug 86720</a> - [radeon] Europa Universalis 4 freezing during game start (10.3.3+, still broken on 11.0.2)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91788">Bug 91788</a> - [HSW Regression] Synmark2_v6 Multithread performance case FPS reduced by 36%</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92304">Bug 92304</a> - [cts] cts.shaders.negative conformance tests fail</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Alejandro Piñeiro (2):</p>
|
||||
<ul>
|
||||
<li>i965/vec4: check writemask when bailing out at register coalesce</li>
|
||||
<li>i965/vec4: fill src_reg type using the constructor type parameter</li>
|
||||
</ul>
|
||||
|
||||
<p>Brian Paul (2):</p>
|
||||
<ul>
|
||||
<li>vbo: fix incorrect switch statement in init_mat_currval()</li>
|
||||
<li>mesa: fix incorrect opcode in save_BlendFunci()</li>
|
||||
</ul>
|
||||
|
||||
<p>Chih-Wei Huang (3):</p>
|
||||
<ul>
|
||||
<li>mesa: android: Fix the incorrect path of sse_minmax.c</li>
|
||||
<li>nv50/ir: use C++11 standard std::unordered_map if possible</li>
|
||||
<li>nv30: include the header of ffs prototype</li>
|
||||
</ul>
|
||||
|
||||
<p>Chris Wilson (1):</p>
|
||||
<ul>
|
||||
<li>i965: Remove early release of DRI2 miptree</li>
|
||||
</ul>
|
||||
|
||||
<p>Dave Airlie (1):</p>
|
||||
<ul>
|
||||
<li>mesa/uniforms: fix get_uniform for doubles (v2)</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (1):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 11.0.3</li>
|
||||
</ul>
|
||||
|
||||
<p>Francisco Jerez (5):</p>
|
||||
<ul>
|
||||
<li>i965: Don't tell the hardware about our UAV access.</li>
|
||||
<li>mesa: Expose function to calculate whether a shader image unit is valid.</li>
|
||||
<li>mesa: Skip redundant texture completeness checking during image validation.</li>
|
||||
<li>i965: Use _mesa_is_image_unit_valid() instead of gl_image_unit::_Valid.</li>
|
||||
<li>mesa: Get rid of texture-dependent image unit derived state.</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (8):</p>
|
||||
<ul>
|
||||
<li>glsl: Allow built-in functions as constant expressions in OpenGL ES 1.00</li>
|
||||
<li>ff_fragment_shader: Use binding to set the sampler unit</li>
|
||||
<li>glsl/linker: Use constant_initializer instead of constant_value to initialize uniforms</li>
|
||||
<li>glsl: Use constant_initializer instead of constant_value to determine whether to keep an unused uniform</li>
|
||||
<li>glsl: Only set ir_variable::constant_value for const-decorated variables</li>
|
||||
<li>glsl: Restrict initializers for global variables to constant expression in ES</li>
|
||||
<li>glsl: Add method to determine whether an expression contains the sequence operator</li>
|
||||
<li>glsl: In later GLSL versions, sequence operator is cannot be a constant expression</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (1):</p>
|
||||
<ul>
|
||||
<li>nouveau: make sure there's always room to emit a fence</li>
|
||||
</ul>
|
||||
|
||||
<p>Indrajit Das (1):</p>
|
||||
<ul>
|
||||
<li>st/va: Used correct parameter to derive the value of the "h" variable in vlVaCreateImage</li>
|
||||
</ul>
|
||||
|
||||
<p>Jonathan Gray (1):</p>
|
||||
<ul>
|
||||
<li>configure.ac: ensure RM is set</li>
|
||||
</ul>
|
||||
|
||||
<p>Krzysztof Sobiecki (1):</p>
|
||||
<ul>
|
||||
<li>st/fbo: use pipe_surface_release instead of pipe_surface_reference</li>
|
||||
</ul>
|
||||
|
||||
<p>Leo Liu (1):</p>
|
||||
<ul>
|
||||
<li>st/omx/dec/h264: fix field picture type 0 poc disorder</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (3):</p>
|
||||
<ul>
|
||||
<li>st/mesa: fix clip state dependencies</li>
|
||||
<li>radeonsi: fix a GS copy shader leak</li>
|
||||
<li>gallium: add PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT</li>
|
||||
</ul>
|
||||
|
||||
<p>Nicolai Hähnle (1):</p>
|
||||
<ul>
|
||||
<li>u_vbuf: fix vb slot assignment for translated buffers</li>
|
||||
</ul>
|
||||
|
||||
<p>Rob Clark (1):</p>
|
||||
<ul>
|
||||
<li>freedreno/a3xx: cache-flush is needed after MEM_WRITE</li>
|
||||
</ul>
|
||||
|
||||
<p>Tapani Pälli (3):</p>
|
||||
<ul>
|
||||
<li>mesa: add GL_UNSIGNED_INT_24_8 to _mesa_pack_depth_span</li>
|
||||
<li>mesa: Set api prefix to version string when overriding version</li>
|
||||
<li>mesa: fix ARRAY_SIZE query for GetProgramResourceiv</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,172 +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 11.0.5 Release Notes / November 11, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.0.5 is a bug fix release which fixes bugs found since the 11.0.4 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 11.0.5 implements the OpenGL 4.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.1. OpenGL
|
||||
4.1 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
8495ef5c06f7f726452462b7d408a5b40048373ff908f2283a3b4d1f49b45ee6 mesa-11.0.5.tar.gz
|
||||
9c255a2a6695fcc6ef4a279e1df0aeaf417dc142f39ee59dfb533d80494bb67a mesa-11.0.5.tar.xz
|
||||
</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=91993">Bug 91993</a> - Graphical glitch in Astromenace (open-source game).</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92214">Bug 92214</a> - Flightgear crashes during splashboot with R600 driver, LLVM 3.7.0 and mesa 11.0.2</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92437">Bug 92437</a> - osmesa: Expose GL entry points for Windows build, via .def file</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92476">Bug 92476</a> - [cts] ES2-CTS.gtf.GL2ExtensionTests.egl_image.egl_image fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92623">Bug 92623</a> - Differences in prog_data ignored when caching fragment programs (causes hangs)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Alex Deucher (1):</p>
|
||||
<ul>
|
||||
<li>radeon/uvd: don't expose HEVC on old UVD hw (v3)</li>
|
||||
</ul>
|
||||
|
||||
<p>Ben Widawsky (1):</p>
|
||||
<ul>
|
||||
<li>i965/skl: Add GT4 PCI IDs</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (4):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 11.0.4</li>
|
||||
<li>cherry-ignore: ignore a possible wrong nomination</li>
|
||||
<li>Revert "mesa/glformats: Undo code changes from _mesa_base_tex_format() move"</li>
|
||||
<li>Update version to 11.0.5</li>
|
||||
</ul>
|
||||
|
||||
<p>Emmanuel Gil Peyrot (1):</p>
|
||||
<ul>
|
||||
<li>gbm.h: Add a missing stddef.h include for size_t.</li>
|
||||
</ul>
|
||||
|
||||
<p>Eric Anholt (1):</p>
|
||||
<ul>
|
||||
<li>vc4: When the create ioctl fails, free our cache and try again.</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (1):</p>
|
||||
<ul>
|
||||
<li>i965: Fix is-renderable check in intel_image_target_renderbuffer_storage</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (3):</p>
|
||||
<ul>
|
||||
<li>nvc0: respect edgeflag attribute width</li>
|
||||
<li>nouveau: set MaxDrawBuffers to the same value as MaxColorAttachments</li>
|
||||
<li>nouveau: relax fence emit space assert</li>
|
||||
</ul>
|
||||
|
||||
<p>Ivan Kalvachev (1):</p>
|
||||
<ul>
|
||||
<li>r600g: Fix special negative immediate constants when using ABS modifier.</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (2):</p>
|
||||
<ul>
|
||||
<li>nir/lower_vec_to_movs: Pass the shader around directly</li>
|
||||
<li>nir: Report progress from lower_vec_to_movs().</li>
|
||||
</ul>
|
||||
|
||||
<p>Jose Fonseca (2):</p>
|
||||
<ul>
|
||||
<li>gallivm: Translate all util_cpu_caps bits to LLVM attributes.</li>
|
||||
<li>gallivm: Explicitly disable unsupported CPU features.</li>
|
||||
</ul>
|
||||
|
||||
<p>Julien Isorce (4):</p>
|
||||
<ul>
|
||||
<li>st/va: pass picture desc to begin and decode</li>
|
||||
<li>nvc0: fix crash when nv50_miptree_from_handle fails</li>
|
||||
<li>st/va: do not destroy old buffer when new one failed</li>
|
||||
<li>st/va: add more errors checks in vlVaBufferSetNumElements and vlVaMapBuffer</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (6):</p>
|
||||
<ul>
|
||||
<li>i965: Fix missing BRW_NEW_*_PROG_DATA flagging caused by cache reuse.</li>
|
||||
<li>nir: Report progress from nir_split_var_copies().</li>
|
||||
<li>nir: Properly invalidate metadata in nir_split_var_copies().</li>
|
||||
<li>nir: Properly invalidate metadata in nir_opt_copy_prop().</li>
|
||||
<li>nir: Properly invalidate metadata in nir_lower_vec_to_movs().</li>
|
||||
<li>nir: Properly invalidate metadata in nir_opt_remove_phis().</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (1):</p>
|
||||
<ul>
|
||||
<li>radeonsi: add register definitions for Stoney</li>
|
||||
</ul>
|
||||
|
||||
<p>Nanley Chery (1):</p>
|
||||
<ul>
|
||||
<li>mesa/glformats: Undo code changes from _mesa_base_tex_format() move</li>
|
||||
</ul>
|
||||
|
||||
<p>Nicolai Hähnle (1):</p>
|
||||
<ul>
|
||||
<li>st/mesa: fix mipmap generation for immutable textures with incomplete pyramids</li>
|
||||
</ul>
|
||||
|
||||
<p>Nigel Stewart (1):</p>
|
||||
<ul>
|
||||
<li>osmesa: Expose GL entry points for Windows build via DEF file.</li>
|
||||
</ul>
|
||||
|
||||
<p>Roland Scheidegger (1):</p>
|
||||
<ul>
|
||||
<li>gallivm: disable f16c when not using AVX</li>
|
||||
</ul>
|
||||
|
||||
<p>Samuel Li (2):</p>
|
||||
<ul>
|
||||
<li>radeonsi: add support for Stoney asics (v3)</li>
|
||||
<li>radeonsi: add Stoney pci ids</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,145 +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 11.0.6 Release Notes / November 21, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.0.6 is a bug fix release which fixes bugs found since the 11.0.5 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 11.0.6 implements the OpenGL 4.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.1. OpenGL
|
||||
4.1 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
4bdf054af66ebabf3eca0616f9f5e44c2f234695661b570261c391bc2f4f7482 mesa-11.0.6.tar.gz
|
||||
8340e64cdc91999840404c211496f3de38e7b4cb38db34e2f72f1642c5134760 mesa-11.0.6.tar.xz
|
||||
</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=91780">Bug 91780</a> - Rendering issues with geometry shader</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92588">Bug 92588</a> - [HSW,BDW,BSW,SKL-Y][GLES 3.1 CTS] ES31-CTS.arrays_of_arrays.InteractionFunctionCalls2 - assert</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92738">Bug 92738</a> - Randon R7 240 doesn't work on 16KiB page size platform</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92860">Bug 92860</a> - [radeonsi][bisected] st/mesa: implement ARB_copy_image - Corruption in ARK Survival Evolved</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92900">Bug 92900</a> - [regression bisected] About 700 piglit regressions is what could go wrong</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Alex Deucher (1):</p>
|
||||
<ul>
|
||||
<li>radeonsi: enable optimal raster config setting for fiji (v2)</li>
|
||||
</ul>
|
||||
|
||||
<p>Ben Widawsky (1):</p>
|
||||
<ul>
|
||||
<li>i965/skl/gt4: Fix URB programming restriction.</li>
|
||||
</ul>
|
||||
|
||||
<p>Boyuan Zhang (2):</p>
|
||||
<ul>
|
||||
<li>st/vaapi: fix vaapi VC-1 simple/main corruption v2</li>
|
||||
<li>radeon/uvd: fix VC-1 simple/main profile decode v2</li>
|
||||
</ul>
|
||||
|
||||
<p>Dave Airlie (1):</p>
|
||||
<ul>
|
||||
<li>r600: initialised PGM_RESOURCES_2 for ES/GS</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (4):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 11.0.5</li>
|
||||
<li>cherry-ignore: add the swrast front buffer support</li>
|
||||
<li>automake: use static llvm for make distcheck</li>
|
||||
<li>Update version to 11.0.6</li>
|
||||
</ul>
|
||||
|
||||
<p>Eric Anholt (3):</p>
|
||||
<ul>
|
||||
<li>vc4: Return GL_OUT_OF_MEMORY when buffer allocation fails.</li>
|
||||
<li>vc4: Return NULL when we can't make our shadow for a sampler view.</li>
|
||||
<li>vc4: Add support for nir_op_uge, using the carry bit on QPU_A_SUB.</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (2):</p>
|
||||
<ul>
|
||||
<li>meta/generate_mipmap: Don't leak the sampler object</li>
|
||||
<li>meta/generate_mipmap: Only modify the draw framebuffer binding in fallback_required</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (2):</p>
|
||||
<ul>
|
||||
<li>mesa/copyimage: allow width/height to not be multiples of block</li>
|
||||
<li>nouveau: don't expose HEVC decoding support</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (1):</p>
|
||||
<ul>
|
||||
<li>nir/vars_to_ssa: Rework copy set handling in lower_copies_to_load_store</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (1):</p>
|
||||
<ul>
|
||||
<li>glsl: Allow implicit int -> uint conversions for the % operator.</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (1):</p>
|
||||
<ul>
|
||||
<li>radeonsi: initialize SX_PS_DOWNCONVERT to 0 on Stoney</li>
|
||||
</ul>
|
||||
|
||||
<p>Michel Dänzer (1):</p>
|
||||
<ul>
|
||||
<li>winsys/radeon: Use CPU page size instead of hardcoding 4096 bytes v3</li>
|
||||
</ul>
|
||||
|
||||
<p>Oded Gabbay (1):</p>
|
||||
<ul>
|
||||
<li>llvmpipe: use simple coeffs calc for 128bit vectors</li>
|
||||
</ul>
|
||||
|
||||
<p>Roland Scheidegger (2):</p>
|
||||
<ul>
|
||||
<li>radeon: fix bgrx8/xrgb8 blits</li>
|
||||
<li>r200: fix bgrx8/xrgb8 blits</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,154 +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 11.0.7 Release Notes / December 9, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.0.7 is a bug fix release which fixes bugs found since the 11.0.6 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 11.0.7 implements the OpenGL 4.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.1. OpenGL
|
||||
4.1 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
07c27004ff68b288097d17b2faa7bdf15ec73c96b7e6c9835266e544adf0a62f mesa-11.0.7.tar.gz
|
||||
e7e90a332ede6c8fd08eff90786a3fd1605a4e62ebf3a9b514047838194538cb mesa-11.0.7.tar.xz
|
||||
</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=90348">Bug 90348</a> - Spilling failure of b96 merged value</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92363">Bug 92363</a> - [BSW/BDW] ogles1conform Gets test fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92438">Bug 92438</a> - Segfault in pushbuf_kref when running the android emulator (qemu) on nv50</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93110">Bug 93110</a> - [NVE4] textureSize() and textureQueryLevels() uses a texture bound during the previous draw call</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93126">Bug 93126</a> - wrongly claim supporting GL_EXT_texture_rg</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Chris Wilson (1):</p>
|
||||
<ul>
|
||||
<li>meta: Compute correct buffer size with SkipRows/SkipPixels</li>
|
||||
</ul>
|
||||
|
||||
<p>Daniel Stone (1):</p>
|
||||
<ul>
|
||||
<li>egl/wayland: Ignore rects from SwapBuffersWithDamage</li>
|
||||
</ul>
|
||||
|
||||
<p>Dave Airlie (4):</p>
|
||||
<ul>
|
||||
<li>texgetimage: consolidate 1D array handling code.</li>
|
||||
<li>r600: geometry shader gsvs itemsize workaround</li>
|
||||
<li>r600: rv670 use at least 16es/gs threads</li>
|
||||
<li>r600: workaround empty geom shader.</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (4):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 11.0.6</li>
|
||||
<li>get-pick-list.sh: Require explicit "11.0" for nominating stable patches</li>
|
||||
<li>mesa; add get-extra-pick-list.sh script into bin/</li>
|
||||
<li>Update version to 11.0.7</li>
|
||||
</ul>
|
||||
|
||||
<p>François Tigeot (1):</p>
|
||||
<ul>
|
||||
<li>xmlconfig: Add support for DragonFly</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (22):</p>
|
||||
<ul>
|
||||
<li>mesa: Make bind_vertex_buffer avilable outside varray.c</li>
|
||||
<li>mesa: Refactor update_array_format to make _mesa_update_array_format_public</li>
|
||||
<li>mesa: Refactor enable_vertex_array_attrib to make _mesa_enable_vertex_array_attrib</li>
|
||||
<li>i965: Pass brw_context instead of gl_context to brw_draw_rectlist</li>
|
||||
<li>i965: Use DSA functions for VBOs in brw_meta_fast_clear</li>
|
||||
<li>i965: Use internal functions for buffer object access</li>
|
||||
<li>i965: Don't pollute the buffer object namespace in brw_meta_fast_clear</li>
|
||||
<li>meta: Use DSA functions for PBO in create_texture_for_pbo</li>
|
||||
<li>meta: Use _mesa_NamedBufferData and _mesa_NamedBufferSubData for users of _mesa_meta_setup_vertex_objects</li>
|
||||
<li>i965: Use _mesa_NamedBufferSubData for users of _mesa_meta_setup_vertex_objects</li>
|
||||
<li>meta: Don't leave the VBO bound after _mesa_meta_setup_vertex_objects</li>
|
||||
<li>meta: Track VBO using gl_buffer_object instead of GL API object handle</li>
|
||||
<li>meta: Use DSA functions for VBOs in _mesa_meta_setup_vertex_objects</li>
|
||||
<li>meta: Use internal functions for buffer object and VAO access</li>
|
||||
<li>meta: Don't pollute the buffer object namespace in _mesa_meta_setup_vertex_objects</li>
|
||||
<li>meta: Partially convert _mesa_meta_DrawTex to DSA</li>
|
||||
<li>meta: Track VBO using gl_buffer_object instead of GL API object handle in _mesa_meta_DrawTex</li>
|
||||
<li>meta: Use internal functions for buffer object and VAO access in _mesa_meta_DrawTex</li>
|
||||
<li>meta: Don't pollute the buffer object namespace in _mesa_meta_DrawTex</li>
|
||||
<li>meta/TexSubImage: Don't pollute the buffer object namespace</li>
|
||||
<li>meta/generate_mipmap: Don't leak the framebuffer object</li>
|
||||
<li>glsl: Fix off-by-one error in array size check assertion</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (7):</p>
|
||||
<ul>
|
||||
<li>nvc0/ir: actually emit AFETCH on kepler</li>
|
||||
<li>nir: fix typo in idiv lowering, causing large-udiv-udiv failures</li>
|
||||
<li>nouveau: use the buffer usage to determine placement when no binding</li>
|
||||
<li>nv50,nvc0: properly handle buffer storage invalidation on dsa buffer</li>
|
||||
<li>nv50/ir: fix (un)spilling of 3-wide results</li>
|
||||
<li>mesa: support GL_RED/GL_RG in ES2 contexts when driver support exists</li>
|
||||
<li>nvc0/ir: start offset at texBindBase for txq, like regular texturing</li>
|
||||
</ul>
|
||||
|
||||
<p>Jonathan Gray (1):</p>
|
||||
<ul>
|
||||
<li>automake: fix some occurrences of hardcoded -ldl and -lpthread</li>
|
||||
</ul>
|
||||
|
||||
<p>Leo Liu (1):</p>
|
||||
<ul>
|
||||
<li>radeon/vce: disable Stoney VCE for 11.0</li>
|
||||
</ul>
|
||||
|
||||
<p>Marta Lofstedt (1):</p>
|
||||
<ul>
|
||||
<li>gles2: Update gl2ext.h to revision: 32120</li>
|
||||
</ul>
|
||||
|
||||
<p>Oded Gabbay (1):</p>
|
||||
<ul>
|
||||
<li>llvmpipe: disable VSX in ppc due to LLVM PPC bug</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,200 +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 11.0.8 Release Notes / December 9, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.0.8 is a bug fix release which fixes bugs found since the 11.0.7 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 11.0.8 implements the OpenGL 4.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.1. OpenGL
|
||||
4.1 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
ab9db87b54d7525e4b611b82577ea9a9eae55927558df57b190059d5ecd9406f mesa-11.0.8.tar.gz
|
||||
5696e4730518b6805d2ed5def393c4293f425a2c2c01bd5ed4bdd7ad62f7ad75 mesa-11.0.8.tar.xz
|
||||
</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=91806">Bug 91806</a> - configure does not test whether assembler supports sse4.1</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92849">Bug 92849</a> - [IVB HSW BDW] piglit image load/store load-from-cleared-image.shader_test fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92909">Bug 92909</a> - Offset/alignment issue with layout std140 and vec3</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93004">Bug 93004</a> - Guild Wars 2 crash on nouveau DX11 cards</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93215">Bug 93215</a> - [Regression bisected] Ogles1conform Automatic mipmap generation test is fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93266">Bug 93266</a> - gl_arb_shading_language_420pack does not allow binding of image variables</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Boyuan Zhang (1):</p>
|
||||
<ul>
|
||||
<li>radeon/uvd: uv pitch separation for stoney</li>
|
||||
</ul>
|
||||
|
||||
<p>Dave Airlie (9):</p>
|
||||
<ul>
|
||||
<li>r600: do SQ flush ES ring rolling workaround</li>
|
||||
<li>r600: SMX returns CONTEXT_DONE early workaround</li>
|
||||
<li>r600/shader: split address get out to a function.</li>
|
||||
<li>r600/shader: add utility functions to do single slot arithmatic</li>
|
||||
<li>r600g: fix geom shader input indirect indexing.</li>
|
||||
<li>r600: handle geometry dynamic input array index</li>
|
||||
<li>radeonsi: handle doubles in lds load path.</li>
|
||||
<li>mesa/varray: set double arrays to non-normalised.</li>
|
||||
<li>mesa/shader: return correct attribute location for double matrix arrays</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (8):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 11.0.7</li>
|
||||
<li>cherry-ignore: don't pick a specific i965 formats patch</li>
|
||||
<li>Revert "i965/nir: Remove unused indirect handling"</li>
|
||||
<li>Revert "i965/state: Get rid of dword_pitch arguments to buffer functions"</li>
|
||||
<li>Revert "i965/vec4: Use a stride of 1 and byte offsets for UBOs"</li>
|
||||
<li>Revert "i965/fs: Use a stride of 1 and byte offsets for UBOs"</li>
|
||||
<li>Revert "i965/vec4: Use byte offsets for UBO pulls on Sandy Bridge"</li>
|
||||
<li>Update version to 11.0.8</li>
|
||||
</ul>
|
||||
|
||||
<p>Francisco Jerez (1):</p>
|
||||
<ul>
|
||||
<li>i965: Resolve color and flush for all active shader images in intel_update_state().</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (1):</p>
|
||||
<ul>
|
||||
<li>meta/generate_mipmap: Work-around GLES 1.x problem with GL_DRAW_FRAMEBUFFER</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (17):</p>
|
||||
<ul>
|
||||
<li>freedreno/a4xx: support lod_bias</li>
|
||||
<li>freedreno/a4xx: fix 5_5_5_1 texture sampler format</li>
|
||||
<li>freedreno/a4xx: point regid to "red" even for alpha-only rb formats</li>
|
||||
<li>nvc0/ir: fold postfactor into immediate</li>
|
||||
<li>nv50/ir: deal with loops with no breaks</li>
|
||||
<li>nv50/ir: the mad source might not have a defining instruction</li>
|
||||
<li>nv50/ir: fix instruction permutation logic</li>
|
||||
<li>nv50/ir: don't forget to mark flagsDef on cvt in txb lowering</li>
|
||||
<li>nv50/ir: fix DCE to not generate 96-bit loads</li>
|
||||
<li>nv50/ir: avoid looking at uninitialized srcMods entries</li>
|
||||
<li>gk110/ir: fix imul hi emission with limm arg</li>
|
||||
<li>gk104/ir: sampler doesn't matter for txf</li>
|
||||
<li>gk110/ir: fix imad sat/hi flag emission for immediate args</li>
|
||||
<li>nv50/ir: fix cutoff for using r63 vs r127 when replacing zero</li>
|
||||
<li>nv50/ir: can't have predication and immediates</li>
|
||||
<li>glsl: assign varying locations to tess shaders when doing SSO</li>
|
||||
<li>ttn: add TEX2 support</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (5):</p>
|
||||
<ul>
|
||||
<li>i965/vec4: Use byte offsets for UBO pulls on Sandy Bridge</li>
|
||||
<li>i965/fs: Use a stride of 1 and byte offsets for UBOs</li>
|
||||
<li>i965/vec4: Use a stride of 1 and byte offsets for UBOs</li>
|
||||
<li>i965/state: Get rid of dword_pitch arguments to buffer functions</li>
|
||||
<li>i965/nir: Remove unused indirect handling</li>
|
||||
</ul>
|
||||
|
||||
<p>Jonathan Gray (2):</p>
|
||||
<ul>
|
||||
<li>configure.ac: use pkg-config for libelf</li>
|
||||
<li>configure: check for python2.7 for PYTHON2</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (2):</p>
|
||||
<ul>
|
||||
<li>i965: Fix fragment shader struct inputs.</li>
|
||||
<li>i965: Fix scalar vertex shader struct outputs.</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (8):</p>
|
||||
<ul>
|
||||
<li>radeonsi: fix occlusion queries on Fiji</li>
|
||||
<li>radeonsi: fix a hang due to uninitialized border color registers</li>
|
||||
<li>radeonsi: fix Fiji for LLVM <= 3.7</li>
|
||||
<li>radeonsi: don't call of u_prims_for_vertices for patches and rectangles</li>
|
||||
<li>radeonsi: apply the streamout workaround to Fiji as well</li>
|
||||
<li>gallium/radeon: fix Hyper-Z hangs by programming PA_SC_MODE_CNTL_1 correctly</li>
|
||||
<li>tgsi/scan: add flag colors_written</li>
|
||||
<li>r600g: write all MRTs only if there is exactly one output (fixes a hang)</li>
|
||||
</ul>
|
||||
|
||||
<p>Matt Turner (1):</p>
|
||||
<ul>
|
||||
<li>glsl: Allow binding of image variables with 420pack.</li>
|
||||
</ul>
|
||||
|
||||
<p>Neil Roberts (2):</p>
|
||||
<ul>
|
||||
<li>i965: Add MESA_FORMAT_B8G8R8X8_SRGB to brw_format_for_mesa_format</li>
|
||||
<li>i965: Add B8G8R8X8_SRGB to the alpha format override</li>
|
||||
</ul>
|
||||
|
||||
<p>Oded Gabbay (1):</p>
|
||||
<ul>
|
||||
<li>configura.ac: fix test for SSE4.1 assembler support</li>
|
||||
</ul>
|
||||
|
||||
<p>Patrick Rudolph (2):</p>
|
||||
<ul>
|
||||
<li>nv50,nvc0: fix use-after-free when vertex buffers are unbound</li>
|
||||
<li>gallium/util: return correct number of bound vertex buffers</li>
|
||||
</ul>
|
||||
|
||||
<p>Samuel Pitoiset (1):</p>
|
||||
<ul>
|
||||
<li>nvc0: free memory allocated by the prog which reads MP perf counters</li>
|
||||
</ul>
|
||||
|
||||
<p>Tapani Pälli (1):</p>
|
||||
<ul>
|
||||
<li>i965: use _Shader to get fragment program when updating surface state</li>
|
||||
</ul>
|
||||
|
||||
<p>Tom Stellard (2):</p>
|
||||
<ul>
|
||||
<li>radeonsi: Rename si_shader::ls_rsrc{1,2} to si_shader::rsrc{1,2}</li>
|
||||
<li>radeonsi/compute: Use the compiler's COMPUTE_PGM_RSRC* register values</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,127 +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 11.0.9 Release Notes / January 22, 2016</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.0.9 is a bug fix release which fixes bugs found since the 11.0.8 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 11.0.9 implements the OpenGL 4.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.1. OpenGL
|
||||
4.1 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
1597c2e983f476f98efdd6cd58b5298896d18479ff542bdeff28b98b129ede05 mesa-11.0.9.tar.gz
|
||||
a1262ff1c66a16ccf341186cf0e57b306b8589eb2cc5ce92ffb6788ab01d2b01 mesa-11.0.9.tar.xz
|
||||
</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=91596">Bug 91596</a> - EGL_KHR_gl_colorspace (v2) causes problem with Android-x86 GUI</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92229">Bug 92229</a> - [APITRACE] SOMA have serious graphical errors</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93257">Bug 93257</a> - [SKL, bisected] ASTC dEQP tests segfault</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Emil Velikov (6):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 11.0.8</li>
|
||||
<li>cherry-ignore: add patch already in branch</li>
|
||||
<li>cherry-ignore: add the dri3 glx null check patch</li>
|
||||
<li>i915: correctly parse/set the context flags</li>
|
||||
<li>egl/dri2: expose srgb configs when KHR_gl_colorspace is available</li>
|
||||
<li>Update version to 11.0.9</li>
|
||||
</ul>
|
||||
|
||||
<p>Grazvydas Ignotas (1):</p>
|
||||
<ul>
|
||||
<li>r600: fix constant buffer size programming</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (5):</p>
|
||||
<ul>
|
||||
<li>nvc0: don't forget to reset VTX_TMP bufctx slot after blit completion</li>
|
||||
<li>nv50/ir: float(s32 & 0xff) = float(u8), not s8</li>
|
||||
<li>nv50,nvc0: make sure there's pushbuf space and that we ref the bo early</li>
|
||||
<li>nv50,nvc0: fix crash when increasing bsp bo size for h264</li>
|
||||
<li>nvc0: scale up inter_bo size so that it's 16M for a 4K video</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (2):</p>
|
||||
<ul>
|
||||
<li>ralloc: Fix ralloc_adopt() to the old context's last child's parent.</li>
|
||||
<li>nvc0: Set winding order regardless of domain.</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (1):</p>
|
||||
<ul>
|
||||
<li>radeonsi: don't miss changes to SPI_TMPRING_SIZE</li>
|
||||
</ul>
|
||||
|
||||
<p>Miklós Máté (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Don't leak ATIfs instructions in DeleteFragmentShader</li>
|
||||
</ul>
|
||||
|
||||
<p>Neil Roberts (1):</p>
|
||||
<ul>
|
||||
<li>i965: Fix crash when calling glViewport with no surface bound</li>
|
||||
</ul>
|
||||
|
||||
<p>Nicolai Hähnle (6):</p>
|
||||
<ul>
|
||||
<li>gallium/radeon: only dispose locally created target machine in radeon_llvm_compile</li>
|
||||
<li>mesa/bufferobj: make _mesa_delete_buffer_object externally accessible</li>
|
||||
<li>st/mesa: use _mesa_delete_buffer_object</li>
|
||||
<li>radeon: use _mesa_delete_buffer_object</li>
|
||||
<li>i915: use _mesa_delete_buffer_object</li>
|
||||
<li>i965: use _mesa_delete_buffer_object</li>
|
||||
</ul>
|
||||
|
||||
<p>Oded Gabbay (1):</p>
|
||||
<ul>
|
||||
<li>llvmpipe: use vpkswss when dst is signed</li>
|
||||
</ul>
|
||||
|
||||
<p>Rob Herring (1):</p>
|
||||
<ul>
|
||||
<li>freedreno/ir3: fix 32-bit builds with pointer-to-int-cast error enabled</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,281 +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 11.1.0 Release Notes / 15 December 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.1.0 is a new development release.
|
||||
People who are concerned with stability and reliability should stick
|
||||
with a previous release or wait for Mesa 11.1.1.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 11.1.0 implements the OpenGL 4.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.1. OpenGL
|
||||
4.1 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
e3bc44be4df5e4dc728dfda7b55b1aaeadfce36eca6a367b76cc07598070cb2d mesa-11.1.0.tar.gz
|
||||
9befe03b04223eb1ede177fa8cac001e2850292c8c12a3ec9929106afad9cf1f mesa-11.1.0.tar.xz
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
|
||||
<p>
|
||||
Note: some of the new features are only available with certain drivers.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>OpenGL 3.1 support on freedreno (a3xx, a4xx)</li>
|
||||
<li>OpenGL 3.3 support for VMware guest VM driver (supported by Workstation 12
|
||||
and Fusion 8).
|
||||
<li>GL_AMD_performance_monitor on nv50</li>
|
||||
<li>GL_ARB_arrays_of_arrays on i965</li>
|
||||
<li>GL_ARB_blend_func_extended on freedreno (a3xx)</li>
|
||||
<li>GL_ARB_clear_texture on nv50, nvc0</li>
|
||||
<li>GL_ARB_clip_control on freedreno/a4xx</li>
|
||||
<li>GL_ARB_copy_image on nv50, nvc0, radeonsi</li>
|
||||
<li>GL_ARB_depth_clamp on freedreno/a4xx</li>
|
||||
<li>GL_ARB_fragment_layer_viewport on i965 (gen6+)</li>
|
||||
<li>GL_ARB_gpu_shader_fp64 on r600 for Cypress/Cayman/Aruba chips</li>
|
||||
<li>GL_ARB_gpu_shader5 on r600 for Evergreen and later chips</li>
|
||||
<li>GL_ARB_seamless_cubemap_per_texture on freedreno/a4xx</li>
|
||||
<li>GL_ARB_shader_clock on i965 (gen7+)</li>
|
||||
<li>GL_ARB_shader_stencil_export on i965 (gen9+)</li>
|
||||
<li>GL_ARB_shader_storage_buffer_object on i965</li>
|
||||
<li>GL_ARB_shader_texture_image_samples on i965, nv50, nvc0, r600, radeonsi</li>
|
||||
<li>GL_ARB_texture_barrier / GL_NV_texture_barrier on i965</li>
|
||||
<li>GL_ARB_texture_buffer_range on freedreno/a3xx</li>
|
||||
<li>GL_ARB_texture_compression_bptc on freedreno/a4xx</li>
|
||||
<li>GL_ARB_texture_query_lod on softpipe</li>
|
||||
<li>GL_ARB_texture_view on radeonsi and r600 (for evergeen and newer)</li>
|
||||
<li>GL_ARB_vertex_type_2_10_10_10_rev on freedreno (a3xx, a4xx)</li>
|
||||
<li>GL_EXT_blend_func_extended on all drivers that support the ARB version</li>
|
||||
<li>GL_EXT_buffer_storage implemented for when ES 3.1 support is gained</li>
|
||||
<li>GL_EXT_draw_elements_base_vertex on all drivers</li>
|
||||
<li>GL_EXT_texture_compression_rgtc / latc on freedreno (a3xx & a4xx)</li>
|
||||
<li>GL_KHR_debug (GLES)</li>
|
||||
<li>GL_NV_conditional_render on freedreno</li>
|
||||
<li>GL_OES_draw_elements_base_vertex on all drivers</li>
|
||||
<li>EGL_KHR_create_context on softpipe, llvmpipe</li>
|
||||
<li>EGL_KHR_gl_colorspace on softpipe, llvmpipe</li>
|
||||
<li>new virgl gallium driver for qemu virtio-gpu</li>
|
||||
<li>16x multisampling on i965 (gen9+)</li>
|
||||
<li>GL_EXT_shader_samples_identical on i965.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<p>This list is likely incomplete.</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28130">Bug 28130</a> - vbo: premature flushing breaks GL_LINE_LOOP</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38109">Bug 38109</a> - i915 driver crashes if too few vertices are submitted (Mesa 7.10.2)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=49779">Bug 49779</a> - Extra line segments in GL_LINE_LOOP</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55552">Bug 55552</a> - Compile errors with --enable-mangling</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71789">Bug 71789</a> - [r300g] Visuals not found in (default) depth = 24</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79783">Bug 79783</a> - Distorted output in obs-studio where other vendors "work"</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80821">Bug 80821</a> - When LIBGL_ALWAYS_SOFTWARE is set, KHR_create_context is not supported</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81174">Bug 81174</a> - Gallium: GL_LINE_LOOP broken with more than 512 points</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83508">Bug 83508</a> - [UBO] Assertion for array of blocks</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84677">Bug 84677</a> - Triangle disappears with glPolygonMode GL_LINE</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86281">Bug 86281</a> - brw_meta_fast_clear (brw=brw@entry=0x7fffd4097a08, fb=fb@entry=0x7fffd40fa900, buffers=buffers@entry=2, partial_clear=partial_clear@entry=false)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86469">Bug 86469</a> - Unreal Engine demo doesn't run</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86720">Bug 86720</a> - [radeon] Europa Universalis 4 freezing during game start (10.3.3+, still broken on 11.0.2)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89014">Bug 89014</a> - PIPE_QUERY_GPU_FINISHED is not acting as expected on SI</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90175">Bug 90175</a> - [hsw bisected][PATCH] atomic counters doesn't work for a binding point different to zero</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90348">Bug 90348</a> - Spilling failure of b96 merged value</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90631">Bug 90631</a> - Compilation failure for fragment shader with many branches on Sandy Bridge</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90734">Bug 90734</a> - glBufferSubData is corrupting data when buffer is > 32k</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90887">Bug 90887</a> - PhiMovesPass in register allocator broken</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91044">Bug 91044</a> - piglit spec/egl_khr_create_context/valid debug flag gles* fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91114">Bug 91114</a> - ES3-CTS.gtf.GL3Tests.shadow.shadow_execution_vert fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91254">Bug 91254</a> - (regresion) video using VA-API on Intel slow and freeze system with mesa 10.6 or 10.6.1</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91292">Bug 91292</a> - [BDW+] glVertexAttribDivisor not working in combination with glPolygonMode</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91342">Bug 91342</a> - Very dark textures on some objects in indoors environments in Postal 2</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91526">Bug 91526</a> - World of Warcraft (on Wine) has UI corruption with nouveau</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91551">Bug 91551</a> - DXTn compressed normal maps produce severe artifacts on all NV5x and NVDx chipsets</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91596">Bug 91596</a> - EGL_KHR_gl_colorspace (v2) causes problem with Android-x86 GUI</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91716">Bug 91716</a> - [bisected] piglit.shaders.glsl-vs-int-attrib regresses on 32 bit BYT, HSW, IVB, SNB</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91718">Bug 91718</a> - piglit.spec.arb_shader_image_load_store.invalid causes intermittent GPU HANG</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91719">Bug 91719</a> - [SNB,HSW,BYT] dEQP regressions associated with using NIR for vertex shaders</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91726">Bug 91726</a> - R600 asserts in tgsi_cmp/make_src_for_op3</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91780">Bug 91780</a> - Rendering issues with geometry shader</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91785">Bug 91785</a> - make check DispatchSanity_test.GLES31 regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91788">Bug 91788</a> - [HSW Regression] Synmark2_v6 Multithread performance case FPS reduced by 36%</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91847">Bug 91847</a> - glGenerateTextureMipmap not working (no errors) unless glActiveTexture(GL_TEXTURE1) is called before</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91857">Bug 91857</a> - Mesa 10.6.3 linker is slow</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91881">Bug 91881</a> - regression: GPU lockups since mesa-11.0.0_rc1 on RV620 (r600) driver</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91890">Bug 91890</a> - [nve7] witcher2: blurry image & DATA_ERRORs (class 0xa097 mthd 0x2380/0x238c)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91898">Bug 91898</a> - src/util/mesa-sha1.c:250:25: fatal error: openssl/sha.h: No such file or directory</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91927">Bug 91927</a> - [SKL] [regression] piglit compressed textures tests fail with kernel upgrade</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91930">Bug 91930</a> - Program with GtkGLArea widget does not redraw</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91970">Bug 91970</a> - [BSW regression] dEQP-GLES3.functional.shaders.precision.int.highp_mul_vertex</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91985">Bug 91985</a> - [regression, bisected] FTBFS with commit f9caabe8f1: R600_UCP_CONST_BUFFER is undefined</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91993">Bug 91993</a> - Graphical glitch in Astromenace (open-source game).</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92009">Bug 92009</a> - ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92033">Bug 92033</a> - [SNB,regression,dEQP,bisected] functional.shaders.random tests regressed</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92052">Bug 92052</a> - nir/nir_builder.h:79: error: expected primary-expression before ‘.’ token</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92054">Bug 92054</a> - make check gbm-symbols-check regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92066">Bug 92066</a> - [ILK,G45,regression] New assertion on BRW_MAX_MRF breaks ilk and g45</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92072">Bug 92072</a> - Wine breakage since d082c5324 (st/mesa: don't call st_validate_state in BlitFramebuffer)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92095">Bug 92095</a> - [Regression, bisected] arb_shader_atomic_counters.compiler.builtins.frag</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92122">Bug 92122</a> - [bisected, cts] Regression with Assault Android Cactus</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92124">Bug 92124</a> - shader_query.cpp:841:34: error: ‘strndup’ was not declared in this scope</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92183">Bug 92183</a> - linker.cpp:3187:46: error: ‘strtok_r’ was not declared in this scope</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92193">Bug 92193</a> - [SKL] ES2-CTS.gtf.GL2ExtensionTests.compressed_astc_texture.compressed_astc_texture fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92214">Bug 92214</a> - Flightgear crashes during splashboot with R600 driver, LLVM 3.7.0 and mesa 11.0.2</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92221">Bug 92221</a> - Unintended code changes in _mesa_base_tex_format commit</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92265">Bug 92265</a> - Black windows in weston after update mesa to 11.0.2-1</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92304">Bug 92304</a> - [cts] cts.shaders.negative conformance tests fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92363">Bug 92363</a> - [BSW/BDW] ogles1conform Gets test fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92437">Bug 92437</a> - osmesa: Expose GL entry points for Windows build, via .def file</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92438">Bug 92438</a> - Segfault in pushbuf_kref when running the android emulator (qemu) on nv50</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92476">Bug 92476</a> - [cts] ES2-CTS.gtf.GL2ExtensionTests.egl_image.egl_image fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92588">Bug 92588</a> - [HSW,BDW,BSW,SKL-Y][GLES 3.1 CTS] ES31-CTS.arrays_of_arrays.InteractionFunctionCalls2 - assert</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92621">Bug 92621</a> - [G965 ILK G45] Regression: 24 piglit regressions in glsl-1.10</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92623">Bug 92623</a> - Differences in prog_data ignored when caching fragment programs (causes hangs)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92634">Bug 92634</a> - gallium's vl_mpeg12_decoder does not work with st/va</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92639">Bug 92639</a> - [Regression bisected] Ogles1conform mustpass.c fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92641">Bug 92641</a> - [SKL BSW] [Regression] Ogles1conform userclip.c fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92645">Bug 92645</a> - kodi vdpau interop fails since mesa,meta: move gl_texture_object::TargetIndex initializations</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92705">Bug 92705</a> - [clover] fail to build with llvm-svn/clang-svn 3.8</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92709">Bug 92709</a> - "LLVM triggered Diagnostic Handler: unsupported call to function ldexpf in main" when starting race in stuntrally</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92738">Bug 92738</a> - Randon R7 240 doesn't work on 16KiB page size platform</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92744">Bug 92744</a> - [g965 Regression bisected] Performance regression and piglit assertions due to liveness analysis</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92770">Bug 92770</a> - [SNB, regression, dEQP] deqp-gles3.functional.shaders.discard.dynamic_loop_texture</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92824">Bug 92824</a> - [regression, bisected] `make check` dispatch-sanity broken by GL_EXT_buffer_storage</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92849">Bug 92849</a> - [IVB HSW BDW] piglit image load/store load-from-cleared-image.shader_test fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92859">Bug 92859</a> - [regression, bisected] validate_intrinsic_instr: Assertion triggered</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92860">Bug 92860</a> - [radeonsi][bisected] st/mesa: implement ARB_copy_image - Corruption in ARK Survival Evolved</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92900">Bug 92900</a> - [regression bisected] About 700 piglit regressions is what could go wrong</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92909">Bug 92909</a> - Offset/alignment issue with layout std140 and vec3</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92985">Bug 92985</a> - Mac OS X build error "ar: no archive members specified"</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93015">Bug 93015</a> - Tonga Elemental segfault + VM faults since radeon: implement r600_query_hw_get_result via function pointers</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93048">Bug 93048</a> - [CTS regression] mesa af2723 breaks GL Conformance for debug extension</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93063">Bug 93063</a> - drm_helper.h:227:1: error: static declaration of ‘pipe_virgl_create_screen’ follows non-static declaration</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93091">Bug 93091</a> - [opencl] segfault when running any opencl programs (like clinfo)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93126">Bug 93126</a> - wrongly claim supporting GL_EXT_texture_rg</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93180">Bug 93180</a> - [regression] arb_separate_shader_objects.active sampler conflict fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93235">Bug 93235</a> - [regression] dispatch sanity broken by GetPointerv</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93266">Bug 93266</a> - gl_arb_shading_language_420pack does not allow binding of image variables</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<li>MPEG4 decoding has been disabled by default in the VAAPI driver</li>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,197 +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 11.1.1 Release Notes / January 13, 2016</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.1.1 is a bug fix release which fixes bugs found since the 11.1.0 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 11.1.1 implements the OpenGL 4.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.1. OpenGL
|
||||
4.1 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
b15089817540ba0bffd0aad323ecf3a8ff6779568451827c7274890b4a269d58 mesa-11.1.1.tar.gz
|
||||
64db074fc514136b5fb3890111f0d50604db52f0b1e94ba3fcb0fe8668a7fd20 mesa-11.1.1.tar.xz
|
||||
</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=91806">Bug 91806</a> - configure does not test whether assembler supports sse4.1</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92229">Bug 92229</a> - [APITRACE] SOMA have serious graphical errors</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92233">Bug 92233</a> - Unigine Heaven 4.0 silhuette run</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93004">Bug 93004</a> - Guild Wars 2 crash on nouveau DX11 cards</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93215">Bug 93215</a> - [Regression bisected] Ogles1conform Automatic mipmap generation test is fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93257">Bug 93257</a> - [SKL, bisected] ASTC dEQP tests segfault</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Brian Paul (1):</p>
|
||||
<ul>
|
||||
<li>st/mesa: check state->mesa in early return check in st_validate_state()</li>
|
||||
</ul>
|
||||
|
||||
<p>Dave Airlie (6):</p>
|
||||
<ul>
|
||||
<li>mesa/varray: set double arrays to non-normalised.</li>
|
||||
<li>mesa/shader: return correct attribute location for double matrix arrays</li>
|
||||
<li>glsl: pass stage into mark function</li>
|
||||
<li>glsl/fp64: add helper for dual slot double detection.</li>
|
||||
<li>glsl: fix count_attribute_slots to allow for different 64-bit handling</li>
|
||||
<li>glsl: only update doubles inputs for vertex inputs.</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (4):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 11.0.1</li>
|
||||
<li>cherry-ignore: drop the "re-enable" DCC on Stoney</li>
|
||||
<li>cherry-ignore: don't pick a specific i965 formats patch</li>
|
||||
<li>Update version to 11.1.1</li>
|
||||
</ul>
|
||||
|
||||
<p>Eric Anholt (2):</p>
|
||||
<ul>
|
||||
<li>vc4: Warn instead of abort()ing on exec ioctl failures.</li>
|
||||
<li>vc4: Keep sample mask writes from being reordered after TLB writes</li>
|
||||
</ul>
|
||||
|
||||
<p>Grazvydas Ignotas (1):</p>
|
||||
<ul>
|
||||
<li>r600: fix constant buffer size programming</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (1):</p>
|
||||
<ul>
|
||||
<li>meta/generate_mipmap: Work-around GLES 1.x problem with GL_DRAW_FRAMEBUFFER</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (9):</p>
|
||||
<ul>
|
||||
<li>nv50/ir: can't have predication and immediates</li>
|
||||
<li>gk104/ir: simplify and fool-proof texbar algorithm</li>
|
||||
<li>glsl: assign varying locations to tess shaders when doing SSO</li>
|
||||
<li>glx/dri3: a drawable might not be bound at wait time</li>
|
||||
<li>nvc0: don't forget to reset VTX_TMP bufctx slot after blit completion</li>
|
||||
<li>nv50/ir: float(s32 & 0xff) = float(u8), not s8</li>
|
||||
<li>nv50,nvc0: make sure there's pushbuf space and that we ref the bo early</li>
|
||||
<li>nv50,nvc0: fix crash when increasing bsp bo size for h264</li>
|
||||
<li>nvc0: scale up inter_bo size so that it's 16M for a 4K video</li>
|
||||
</ul>
|
||||
|
||||
<p>Jonathan Gray (2):</p>
|
||||
<ul>
|
||||
<li>configure.ac: use pkg-config for libelf</li>
|
||||
<li>configure: check for python2.7 for PYTHON2</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (5):</p>
|
||||
<ul>
|
||||
<li>ralloc: Fix ralloc_adopt() to the old context's last child's parent.</li>
|
||||
<li>drirc: Disable ARB_blend_func_extended for Heaven 4.0/Valley 1.0.</li>
|
||||
<li>glsl: Fix varying struct locations when varying packing is disabled.</li>
|
||||
<li>nvc0: Set winding order regardless of domain.</li>
|
||||
<li>nir: Add a lower_fdiv option, turn fdiv into fmul/frcp.</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (7):</p>
|
||||
<ul>
|
||||
<li>tgsi/scan: add flag colors_written</li>
|
||||
<li>r600g: write all MRTs only if there is exactly one output (fixes a hang)</li>
|
||||
<li>radeonsi: don't call of u_prims_for_vertices for patches and rectangles</li>
|
||||
<li>radeonsi: apply the streamout workaround to Fiji as well</li>
|
||||
<li>gallium/radeon: fix Hyper-Z hangs by programming PA_SC_MODE_CNTL_1 correctly</li>
|
||||
<li>program: add _mesa_reserve_parameter_storage</li>
|
||||
<li>st/mesa: fix GLSL uniform updates for glBitmap & glDrawPixels (v2)</li>
|
||||
</ul>
|
||||
|
||||
<p>Mark Janes (1):</p>
|
||||
<ul>
|
||||
<li>Add missing platform information for KBL</li>
|
||||
</ul>
|
||||
|
||||
<p>Miklós Máté (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Don't leak ATIfs instructions in DeleteFragmentShader</li>
|
||||
</ul>
|
||||
|
||||
<p>Neil Roberts (3):</p>
|
||||
<ul>
|
||||
<li>i965: Add MESA_FORMAT_B8G8R8X8_SRGB to brw_format_for_mesa_format</li>
|
||||
<li>i965: Add B8G8R8X8_SRGB to the alpha format override</li>
|
||||
<li>i965: Fix crash when calling glViewport with no surface bound</li>
|
||||
</ul>
|
||||
|
||||
<p>Nicolai Hähnle (2):</p>
|
||||
<ul>
|
||||
<li>gallium/radeon: only dispose locally created target machine in radeon_llvm_compile</li>
|
||||
<li>gallium/radeon: fix regression in a number of driver queries</li>
|
||||
</ul>
|
||||
|
||||
<p>Oded Gabbay (1):</p>
|
||||
<ul>
|
||||
<li>configura.ac: fix test for SSE4.1 assembler support</li>
|
||||
</ul>
|
||||
|
||||
<p>Patrick Rudolph (2):</p>
|
||||
<ul>
|
||||
<li>nv50,nvc0: fix use-after-free when vertex buffers are unbound</li>
|
||||
<li>gallium/util: return correct number of bound vertex buffers</li>
|
||||
</ul>
|
||||
|
||||
<p>Rob Herring (1):</p>
|
||||
<ul>
|
||||
<li>freedreno/ir3: fix 32-bit builds with pointer-to-int-cast error enabled</li>
|
||||
</ul>
|
||||
|
||||
<p>Samuel Pitoiset (3):</p>
|
||||
<ul>
|
||||
<li>nvc0: free memory allocated by the prog which reads MP perf counters</li>
|
||||
<li>nv50,nvc0: free memory allocated by performance metrics</li>
|
||||
<li>nv50: free memory allocated by the prog which reads MP perf counters</li>
|
||||
</ul>
|
||||
|
||||
<p>Sarah Sharp (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Add KBL PCI IDs and platform information.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,182 +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 11.1.2 Release Notes / February 10, 2016</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.1.2 is a bug fix release which fixes bugs found since the 11.1.1 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 11.1.2 implements the OpenGL 4.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.1. OpenGL
|
||||
4.1 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
ba0e7462b2936b86e6684c26fbb55519f8d9ad31d13a1c1e1afbe41e73466eea mesa-11.1.2.tar.gz
|
||||
8f72aead896b340ba0f7a4a474bfaf71681f5d675592aec1cb7ba698e319148b mesa-11.1.2.tar.xz
|
||||
</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=91596">Bug 91596</a> - EGL_KHR_gl_colorspace (v2) causes problem with Android-x86 GUI</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93628">Bug 93628</a> - Exception: attempt to use unavailable module DRM when building MesaGL 11.1.0 on windows</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93648">Bug 93648</a> - Random lines being rendered when playing Dolphin (geometry shaders related, w/ apitrace)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93650">Bug 93650</a> - GL_ARB_separate_shader_objects is buggy (PCSX2)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93717">Bug 93717</a> - Meta mipmap generation can corrupt texture state</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93722">Bug 93722</a> - Segfault when compiling shader with a subroutine that takes a parameter</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93731">Bug 93731</a> - glUniformSubroutinesuiv segfaults when subroutine uniform is bound to a specific location</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93761">Bug 93761</a> - A conditional discard in a fragment shader causes no depth writing at all</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Ben Widawsky (1):</p>
|
||||
<ul>
|
||||
<li>i965/bxt: Fix conservative wm thread counts.</li>
|
||||
</ul>
|
||||
|
||||
<p>Dave Airlie (1):</p>
|
||||
<ul>
|
||||
<li>glsl: fix subroutine lowering reusing actual parmaters</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (6):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 11.1.1</li>
|
||||
<li>cherry-ignore: drop the i965/kbl .num_slices patch</li>
|
||||
<li>i915: correctly parse/set the context flags</li>
|
||||
<li>targets/dri: android: use WHOLE static libraries</li>
|
||||
<li>egl/dri2: expose srgb configs when KHR_gl_colorspace is available</li>
|
||||
<li>Update version to 11.1.2</li>
|
||||
</ul>
|
||||
|
||||
<p>Eric Anholt (2):</p>
|
||||
<ul>
|
||||
<li>vc4: Don't record the seqno of a failed job submit.</li>
|
||||
<li>vc4: Throttle outstanding rendering after submission.</li>
|
||||
</ul>
|
||||
|
||||
<p>François Tigeot (1):</p>
|
||||
<ul>
|
||||
<li>gallium: Add DragonFly support</li>
|
||||
</ul>
|
||||
|
||||
<p>Grazvydas Ignotas (1):</p>
|
||||
<ul>
|
||||
<li>r600g: don't leak driver const buffers</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (2):</p>
|
||||
<ul>
|
||||
<li>meta/blit: Restore GL_DEPTH_STENCIL_TEXTURE_MODE state for GL_TEXTURE_RECTANGLE</li>
|
||||
<li>meta: Use internal functions to set texture parameters</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (6):</p>
|
||||
<ul>
|
||||
<li>st/mesa: use surface format to generate mipmaps when available</li>
|
||||
<li>glsl: always compute proper varying type, irrespective of varying packing</li>
|
||||
<li>nvc0: avoid crashing when there are holes in vertex array bindings</li>
|
||||
<li>nv50,nvc0: fix buffer clearing to respect engine alignment requirements</li>
|
||||
<li>nv50/ir: fix false global CSE on instructions with multiple defs</li>
|
||||
<li>st/mesa: treat a write as a read for range purposes</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (3):</p>
|
||||
<ul>
|
||||
<li>i965/vec4: Use UW type for multiply into accumulator on GEN8+</li>
|
||||
<li>i965/fs/generator: Take an actual shader stage rather than a string</li>
|
||||
<li>i965/fs: Always set channel 2 of texture headers in some stages</li>
|
||||
</ul>
|
||||
|
||||
<p>Jose Fonseca (2):</p>
|
||||
<ul>
|
||||
<li>scons: Conditionally use DRM module on pipe-loader.</li>
|
||||
<li>pipe-loader: Fix PATH_MAX define on MSVC.</li>
|
||||
</ul>
|
||||
|
||||
<p>Karol Herbst (1):</p>
|
||||
<ul>
|
||||
<li>nv50/ir: fix memory corruption when spilling and redoing RA</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (2):</p>
|
||||
<ul>
|
||||
<li>glsl: Make bitfield_insert/extract and bfi/bfm non-vectorizable.</li>
|
||||
<li>glsl: Allow implicit int -> uint conversions for bitwise operators (&, ^, |).</li>
|
||||
</ul>
|
||||
|
||||
<p>Leo Liu (2):</p>
|
||||
<ul>
|
||||
<li>vl: add zig zag scan for list 4x4</li>
|
||||
<li>st/omx/dec/h264: fix corruption when scaling matrix present flag set</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (1):</p>
|
||||
<ul>
|
||||
<li>radeonsi: don't miss changes to SPI_TMPRING_SIZE</li>
|
||||
</ul>
|
||||
|
||||
<p>Nicolai Hähnle (11):</p>
|
||||
<ul>
|
||||
<li>mesa/bufferobj: make _mesa_delete_buffer_object externally accessible</li>
|
||||
<li>st/mesa: use _mesa_delete_buffer_object</li>
|
||||
<li>radeon: use _mesa_delete_buffer_object</li>
|
||||
<li>i915: use _mesa_delete_buffer_object</li>
|
||||
<li>i965: use _mesa_delete_buffer_object</li>
|
||||
<li>util/u_pstipple.c: copy immediates during transformation</li>
|
||||
<li>radeonsi: extract the VGT_GS_MODE calculation into its own function</li>
|
||||
<li>radeonsi: ensure that VGT_GS_MODE is sent when necessary</li>
|
||||
<li>radeonsi: add DCC buffer for sampler views on new CS</li>
|
||||
<li>st/mesa: use the correct address generation functions in st_TexSubImage blit</li>
|
||||
<li>radeonsi: fix discard-only fragment shaders (11.1 version)</li>
|
||||
</ul>
|
||||
|
||||
<p>Timothy Arceri (4):</p>
|
||||
<ul>
|
||||
<li>glsl: fix segfault linking subroutine uniform with explicit location</li>
|
||||
<li>mesa: fix segfault in glUniformSubroutinesuiv()</li>
|
||||
<li>glsl: fix interface block error message</li>
|
||||
<li>glsl: create helper to remove outer vertex index array used by some stages</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,85 +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 11.2.0 Release Notes / TBD</h1>
|
||||
|
||||
<p>
|
||||
Mesa 11.2.0 is a new development release.
|
||||
People who are concerned with stability and reliability should stick
|
||||
with a previous release or wait for Mesa 11.2.1.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 11.2.0 implements the OpenGL 4.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.1. OpenGL
|
||||
4.1 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>
|
||||
Note: some of the new features are only available with certain drivers.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>GL_ARB_arrays_of_arrays on all gallium drivers that provide GLSL 1.30</li>
|
||||
<li>GL_ARB_base_instance on freedreno/a4xx</li>
|
||||
<li>GL_ARB_compute_shader on i965</li>
|
||||
<li>GL_ARB_copy_image on r600</li>
|
||||
<li>GL_ARB_indirect_parameters on nvc0</li>
|
||||
<li>GL_ARB_query_buffer_object on nvc0</li>
|
||||
<li>GL_ARB_shader_atomic_counters on nvc0</li>
|
||||
<li>GL_ARB_shader_draw_parameters on i965, nvc0</li>
|
||||
<li>GL_ARB_shader_storage_buffer_object on nvc0</li>
|
||||
<li>GL_ARB_tessellation_shader on i965 and r600 (evergreen/cayman only)</li>
|
||||
<li>GL_ARB_texture_buffer_object_rgb32 on freedreno/a4xx</li>
|
||||
<li>GL_ARB_texture_buffer_range on freedreno/a4xx</li>
|
||||
<li>GL_ARB_texture_query_lod on freedreno/a4xx</li>
|
||||
<li>GL_ARB_texture_rgb10_a2ui on freedreno/a4xx</li>
|
||||
<li>GL_ARB_texture_view on freedreno/a4xx</li>
|
||||
<li>GL_ARB_vertex_type_10f_11f_11f_rev on freedreno/a4xx</li>
|
||||
<li>GL_KHR_texture_compression_astc_ldr on freedreno/a4xx</li>
|
||||
<li>GL_AMD_performance_monitor on radeonsi (CIK+ only)</li>
|
||||
<li>GL_ATI_meminfo on r600, radeonsi</li>
|
||||
<li>GL_NVX_gpu_memory_info on r600, radeonsi</li>
|
||||
<li>New OSMesaCreateContextAttribs() function (for creating core profile
|
||||
contexts)</li>
|
||||
</ul>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
TBD.
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
Microsoft Visual Studio 2013 or later is now required for building
|
||||
on Windows.
|
||||
Previously, Visual Studio 2008 and later were supported.
|
||||
|
||||
TBD.
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -63,20 +63,6 @@ execution. These are generally used for debugging.
|
||||
Example: export MESA_GLSL=dump,nopt
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Shaders can be dumped and replaced on runtime for debugging purposes. Mesa
|
||||
needs to be configured with '--with-sha1' to enable this functionality. This
|
||||
feature is not currently supported by SCons build.
|
||||
|
||||
This is controlled via following environment variables:
|
||||
<ul>
|
||||
<li><b>MESA_SHADER_DUMP_PATH</b> - path where shader sources are dumped
|
||||
<li><b>MESA_SHADER_READ_PATH</b> - path where replacement shaders are read
|
||||
</ul>
|
||||
Note, path set must exist before running for dumping or replacing to work.
|
||||
When both are set, these paths should be different so the dumped shaders do
|
||||
not clobber the replacement shaders.
|
||||
</p>
|
||||
|
||||
<h2 id="support">GLSL Version</h2>
|
||||
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
Name
|
||||
|
||||
EXT_shader_samples_identical
|
||||
|
||||
Name Strings
|
||||
|
||||
GL_EXT_shader_samples_identical
|
||||
|
||||
Contact
|
||||
|
||||
Ian Romanick, Intel (ian.d.romanick 'at' intel.com)
|
||||
|
||||
Contributors
|
||||
|
||||
Chris Forbes, Mesa
|
||||
Magnus Wendt, Intel
|
||||
Neil S. Roberts, Intel
|
||||
Graham Sellers, AMD
|
||||
|
||||
Status
|
||||
|
||||
XXX - Not complete yet.
|
||||
|
||||
Version
|
||||
|
||||
Last Modified Date: November 19, 2015
|
||||
Revision: 6
|
||||
|
||||
Number
|
||||
|
||||
TBD
|
||||
|
||||
Dependencies
|
||||
|
||||
OpenGL 3.2, or OpenGL ES 3.1, or ARB_texture_multisample is required.
|
||||
|
||||
This extension is written against the OpenGL 4.5 (Core Profile)
|
||||
Specification
|
||||
|
||||
Overview
|
||||
|
||||
Multisampled antialiasing has become a common method for improving the
|
||||
quality of rendered images. Multisampling differs from supersampling in
|
||||
that the color of a primitive that covers all or part of a pixel is
|
||||
resolved once, regardless of the number of samples covered. If a large
|
||||
polygon is rendered, the colors of all samples in each interior pixel will
|
||||
be the same. This suggests a simple compression scheme that can reduce
|
||||
the necessary memory bandwidth requirements. In one such scheme, each
|
||||
sample is stored in a separate slice of the multisample surface. An
|
||||
additional multisample control surface (MCS) contains a mapping from pixel
|
||||
samples to slices.
|
||||
|
||||
If all the values stored in the MCS for a particular pixel are the same,
|
||||
then all the samples have the same value. Applications can take advantage
|
||||
of this information to reduce the bandwidth of reading multisample
|
||||
textures. A custom multisample resolve filter could optimize resolving
|
||||
pixels where every sample is identical by reading the color once.
|
||||
|
||||
color = texelFetch(sampler, coordinate, 0);
|
||||
if (!textureSamplesIdenticalEXT(sampler, coordinate)) {
|
||||
for (int i = 1; i < MAX_SAMPLES; i++) {
|
||||
vec4 c = texelFetch(sampler, coordinate, i);
|
||||
|
||||
//... accumulate c into color
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
New Procedures and Functions
|
||||
|
||||
None.
|
||||
|
||||
New Tokens
|
||||
|
||||
None.
|
||||
|
||||
Additions to the OpenGL 4.5 (Core Profile) Specification
|
||||
|
||||
None.
|
||||
|
||||
Modifications to The OpenGL Shading Language Specification, Version 4.50.5
|
||||
|
||||
Including the following line in a shader can be used to control the
|
||||
language features described in this extension:
|
||||
|
||||
#extension GL_EXT_shader_samples_identical
|
||||
|
||||
A new preprocessor #define is added to the OpenGL Shading Language:
|
||||
|
||||
#define GL_EXT_shader_samples_identical
|
||||
|
||||
Add to the table in section 8.7 "Texture Lookup Functions"
|
||||
|
||||
Syntax:
|
||||
|
||||
bool textureSamplesIdenticalEXT(gsampler2DMS sampler, ivec2 coord)
|
||||
|
||||
bool textureSamplesIdenticalEXT(gsampler2DMSArray sampler,
|
||||
ivec3 coord)
|
||||
|
||||
Description:
|
||||
|
||||
Returns true if it can be determined that all samples within the texel
|
||||
of the multisample texture bound to <sampler> at <coord> contain the
|
||||
same values or false if this cannot be determined."
|
||||
|
||||
Additions to the AGL/EGL/GLX/WGL Specifications
|
||||
|
||||
None
|
||||
|
||||
Errors
|
||||
|
||||
None
|
||||
|
||||
New State
|
||||
|
||||
None
|
||||
|
||||
New Implementation Dependent State
|
||||
|
||||
None
|
||||
|
||||
Issues
|
||||
|
||||
1) What should the new functions be called?
|
||||
|
||||
RESOLVED: textureSamplesIdenticalEXT. Initially
|
||||
textureAllSamplesIdenticalEXT was considered, but
|
||||
textureSamplesIdenticalEXT is more similar to the existing textureSamples
|
||||
function.
|
||||
|
||||
2) It seems like applications could implement additional optimization if
|
||||
they were provided with raw MCS data. Should this extension also
|
||||
provide that data?
|
||||
|
||||
There are a number of challenges in providing raw MCS data. The biggest
|
||||
problem being that the amount of MCS data depends on the number of
|
||||
samples, and that is not known at compile time. Additionally, without new
|
||||
texelFetch functions, applications would have difficulty utilizing the
|
||||
information.
|
||||
|
||||
Another option is to have a function that returns an array of tuples of
|
||||
sample number and count. This also has difficulties with the maximum
|
||||
array size not being known at compile time.
|
||||
|
||||
RESOLVED: Do not expose raw MCS data in this extension.
|
||||
|
||||
3) Should this extension also extend SPIR-V?
|
||||
|
||||
RESOLVED: Yes, but this has not yet been written.
|
||||
|
||||
4) Is it possible for textureSamplesIdenticalEXT to report false negatives?
|
||||
|
||||
RESOLVED: Yes. It is possible that the underlying hardware may not detect
|
||||
that separate writes of the same color to different samples of a pixel are
|
||||
the same. The shader function is at the whim of the underlying hardware
|
||||
implementation. It is also possible that a compressed multisample surface
|
||||
is not used. In that case the function will likely always return false.
|
||||
|
||||
Revision History
|
||||
|
||||
Rev Date Author Changes
|
||||
--- ---------- -------- ---------------------------------------------
|
||||
1 2014/08/20 cforbes Initial version
|
||||
2 2015/10/23 idr Change from MESA to EXT. Rebase on OpenGL 4.5,
|
||||
and add dependency on OpenGL ES 3.1. Initial
|
||||
draft of overview section and issues 1 through
|
||||
3.
|
||||
3 2015/10/27 idr Typo fixes.
|
||||
4 2015/11/10 idr Rename extension from EXT_shader_multisample_compression
|
||||
to EXT_shader_samples_identical.
|
||||
Add issue #4.
|
||||
5 2015/11/18 idr Fix some typos spotted by gsellers. Change the
|
||||
name of the name of the function to
|
||||
textureSamplesIdenticalEXT.
|
||||
6 2015/11/19 idr Fix more typos spotted by Nicolai Hähnle.
|
||||
@@ -42,7 +42,9 @@ Tungsten Graphics, Inc. have supported the ongoing development of Mesa.
|
||||
<li>The
|
||||
<a href="http://www.mesa3d.org">Mesa</a>
|
||||
website is hosted by
|
||||
<a href="http://sourceforge.net">sourceforge.net</a>.
|
||||
<a href="http://sourceforge.net">
|
||||
<img src="http://sourceforge.net/sflogo.php?group_id=3&type=1"
|
||||
width="88" height="31" align="bottom" alt="Sourceforge.net" border="0"></a>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
|
||||
@@ -30,10 +30,6 @@
|
||||
<dt><a href="http://www.valgrind.org">Valgrind</a></dt>
|
||||
<dd>is a very useful tool for tracking down
|
||||
memory-related problems in your code.</dd>
|
||||
|
||||
<dt><a href="http:scan.coverity.com/projects/mesa">Coverity</a><dt>
|
||||
<dd>provides static code analysis of Mesa. If you create an account
|
||||
you can see the results and try to fix outstanding issues.</dd>
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -26,31 +26,6 @@ VMware Workstation running on Linux or Windows and VMware Fusion running on
|
||||
MacOS are all supported.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
With the August 2015 Workstation 12 / Fusion 8 releases, OpenGL 3.3
|
||||
is supported in the guest.
|
||||
This requires:
|
||||
<ul>
|
||||
<li>The VM is configured for virtual hardware version 12.
|
||||
<li>The host OS, GPU and graphics driver supports DX11 (Windows) or
|
||||
OpenGL 4.0 (Linux, Mac)
|
||||
<li>On Linux, the vmwgfx kernel module must be version 2.9.0 or later.
|
||||
<li>A recent version of Mesa with the updated svga gallium driver.
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Otherwise, OpenGL 2.1 is supported.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
OpenGL 3.3 support can be disabled by setting the environment variable
|
||||
SVGA_VGPU10=0.
|
||||
You will then have OpenGL 2.1 support.
|
||||
This may be useful to work around application bugs (such as incorrect use
|
||||
of the OpenGL 3.x core profile).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Most modern Linux distros include the SVGA3D driver so end users shouldn't
|
||||
be concerned with this information.
|
||||
@@ -148,33 +123,10 @@ To get the latest code from git:
|
||||
<h2>Building the Code</h2>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Determine where the GL-related libraries reside on your system and set
|
||||
the LIBDIR environment variable accordingly.
|
||||
<br><br>
|
||||
For 32-bit Ubuntu systems:
|
||||
<pre>
|
||||
export LIBDIR=/usr/lib/i386-linux-gnu
|
||||
</pre>
|
||||
For 64-bit Ubuntu systems:
|
||||
<pre>
|
||||
export LIBDIR=/usr/lib/x86_64-linux-gnu
|
||||
</pre>
|
||||
For 32-bit Fedora systems:
|
||||
<pre>
|
||||
export LIBDIR=/usr/lib
|
||||
</pre>
|
||||
For 64-bit Fedora systems:
|
||||
<pre>
|
||||
export LIBDIR=/usr/lib64
|
||||
</pre>
|
||||
|
||||
</li>
|
||||
|
||||
<li>Build libdrm:
|
||||
<li>Build libdrm: If you're on a 32-bit system, you should skip the --libdir configure option. Note also the comment about toolchain libdrm above.
|
||||
<pre>
|
||||
cd $TOP/drm
|
||||
./autogen.sh --prefix=/usr --libdir=${LIBDIR}
|
||||
./autogen.sh --prefix=/usr --libdir=/usr/lib64
|
||||
make
|
||||
sudo make install
|
||||
</pre>
|
||||
@@ -185,9 +137,12 @@ The libxatracker library is used exclusively by the X server to do render,
|
||||
copy and video acceleration:
|
||||
<br>
|
||||
The following configure options doesn't build the EGL system.
|
||||
<br>
|
||||
As before, if you're on a 32-bit system, you should skip the --libdir
|
||||
configure option.
|
||||
<pre>
|
||||
cd $TOP/mesa
|
||||
./autogen.sh --prefix=/usr --libdir=${LIBDIR} --with-gallium-drivers=svga --with-dri-drivers=swrast --enable-xa --disable-dri3 --enable-glx-tls
|
||||
./autogen.sh --prefix=/usr --libdir=/usr/lib64 --with-gallium-drivers=svga --with-dri-drivers= --enable-xa --disable-dri3
|
||||
make
|
||||
sudo make install
|
||||
</pre>
|
||||
@@ -197,39 +152,25 @@ if they're not installed in your system. You should be told what's missing.
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<li>xf86-video-vmware: Now, once libxatracker is installed, we proceed with
|
||||
building and replacing the current Xorg driver.
|
||||
First check if your system is 32- or 64-bit.
|
||||
<li>xf86-video-vmware: Now, once libxatracker is installed, we proceed with building and replacing the current Xorg driver. First check if your system is 32- or 64-bit. If you're building for a 32-bit system, you will not be needing the --libdir=/usr/lib64 option to autogen.
|
||||
<pre>
|
||||
cd $TOP/xf86-video-vmware
|
||||
./autogen.sh --prefix=/usr --libdir=${LIBDIR}
|
||||
./autogen.sh --prefix=/usr --libdir=/usr/lib64
|
||||
make
|
||||
sudo make install
|
||||
</pre>
|
||||
|
||||
<li>vmwgfx kernel module. First make sure that any old version of this kernel module is removed from the system by issuing
|
||||
<pre>
|
||||
<pre>
|
||||
sudo rm /lib/modules/`uname -r`/kernel/drivers/gpu/drm/vmwgfx.ko*
|
||||
</pre>
|
||||
Build and install:
|
||||
<pre>
|
||||
</pre>
|
||||
Then
|
||||
<pre>
|
||||
cd $TOP/vmwgfx
|
||||
make
|
||||
sudo make install
|
||||
sudo depmod -a
|
||||
</pre>
|
||||
If you're using a Ubuntu OS:
|
||||
<pre>
|
||||
sudo update-initramfs -u
|
||||
</pre>
|
||||
If you're using a Fedora OS:
|
||||
<pre>
|
||||
sudo dracut --force
|
||||
</pre>
|
||||
Add 'vmwgfx' to the /etc/modules file:
|
||||
<pre>
|
||||
echo vmwgfx | sudo tee -a /etc/modules
|
||||
</pre>
|
||||
sudo cp 00-vmwgfx.rules /etc/udev/rules.d
|
||||
sudo depmod -ae
|
||||
</pre>
|
||||
|
||||
Note: some distros put DRM kernel drivers in different directories.
|
||||
For example, sometimes vmwgfx.ko might be found in
|
||||
@@ -286,16 +227,6 @@ If you don't see this, try setting this environment variable:
|
||||
then rerun glxinfo and examine the output for error messages.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If OpenGL 3.3 is not working (you only get OpenGL 2.1):
|
||||
</p>
|
||||
<ul>
|
||||
<li>Make sure the VM uses hardware version 12.
|
||||
<li>Make sure the vmwgfx kernel module is version 2.9.0 or later.
|
||||
<li>Check the vmware.log file for errors.
|
||||
<li>Run 'dmesg | grep vmwgfx' and look for "DX: yes".
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -227,7 +227,6 @@ typedef struct _RGNDATA {
|
||||
#define D3DERR_DRIVERINVALIDCALL MAKE_D3DHRESULT(2157)
|
||||
#define D3DERR_DEVICEREMOVED MAKE_D3DHRESULT(2160)
|
||||
#define D3DERR_DEVICEHUNG MAKE_D3DHRESULT(2164)
|
||||
#define S_PRESENT_OCCLUDED MAKE_D3DSTATUS(2168)
|
||||
|
||||
/********************************************************
|
||||
* Bitmasks *
|
||||
|
||||
@@ -495,7 +495,7 @@ struct __DRIdamageExtensionRec {
|
||||
* SWRast Loader extension.
|
||||
*/
|
||||
#define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
|
||||
#define __DRI_SWRAST_LOADER_VERSION 3
|
||||
#define __DRI_SWRAST_LOADER_VERSION 2
|
||||
struct __DRIswrastLoaderExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
@@ -528,15 +528,6 @@ struct __DRIswrastLoaderExtensionRec {
|
||||
void (*putImage2)(__DRIdrawable *drawable, int op,
|
||||
int x, int y, int width, int height, int stride,
|
||||
char *data, void *loaderPrivate);
|
||||
|
||||
/**
|
||||
* Put image to drawable
|
||||
*
|
||||
* \since 3
|
||||
*/
|
||||
void (*getImage2)(__DRIdrawable *readable,
|
||||
int x, int y, int width, int height, int stride,
|
||||
char *data, void *loaderPrivate);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,8 +58,8 @@ extern "C" {
|
||||
#include <GL/gl.h>
|
||||
|
||||
|
||||
#define OSMESA_MAJOR_VERSION 11
|
||||
#define OSMESA_MINOR_VERSION 2
|
||||
#define OSMESA_MAJOR_VERSION 10
|
||||
#define OSMESA_MINOR_VERSION 0
|
||||
#define OSMESA_PATCH_VERSION 0
|
||||
|
||||
|
||||
@@ -95,18 +95,6 @@ extern "C" {
|
||||
#define OSMESA_MAX_WIDTH 0x24 /* new in 4.0 */
|
||||
#define OSMESA_MAX_HEIGHT 0x25 /* new in 4.0 */
|
||||
|
||||
/*
|
||||
* Accepted in OSMesaCreateContextAttrib's attribute list.
|
||||
*/
|
||||
#define OSMESA_DEPTH_BITS 0x30
|
||||
#define OSMESA_STENCIL_BITS 0x31
|
||||
#define OSMESA_ACCUM_BITS 0x32
|
||||
#define OSMESA_PROFILE 0x33
|
||||
#define OSMESA_CORE_PROFILE 0x34
|
||||
#define OSMESA_COMPAT_PROFILE 0x35
|
||||
#define OSMESA_CONTEXT_MAJOR_VERSION 0x36
|
||||
#define OSMESA_CONTEXT_MINOR_VERSION 0x37
|
||||
|
||||
|
||||
typedef struct osmesa_context *OSMesaContext;
|
||||
|
||||
@@ -139,35 +127,6 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
|
||||
GLint accumBits, OSMesaContext sharelist);
|
||||
|
||||
|
||||
/*
|
||||
* Create an Off-Screen Mesa rendering context with attribute list.
|
||||
* The list is composed of (attribute, value) pairs and terminated with
|
||||
* attribute==0. Supported Attributes:
|
||||
*
|
||||
* Attributes Values
|
||||
* --------------------------------------------------------------------------
|
||||
* OSMESA_FORMAT OSMESA_RGBA*, OSMESA_BGRA, OSMESA_ARGB, etc.
|
||||
* OSMESA_DEPTH_BITS 0*, 16, 24, 32
|
||||
* OSMESA_STENCIL_BITS 0*, 8
|
||||
* OSMESA_ACCUM_BITS 0*, 16
|
||||
* OSMESA_PROFILE OSMESA_COMPAT_PROFILE*, OSMESA_CORE_PROFILE
|
||||
* OSMESA_CONTEXT_MAJOR_VERSION 1*, 2, 3
|
||||
* OSMESA_CONTEXT_MINOR_VERSION 0+
|
||||
*
|
||||
* Note: * = default value
|
||||
*
|
||||
* We return a context version >= what's specified by OSMESA_CONTEXT_MAJOR/
|
||||
* MINOR_VERSION for the given profile. For example, if you request a GL 1.4
|
||||
* compat profile, you might get a GL 3.0 compat profile.
|
||||
* Otherwise, null is returned if the version/profile is not supported.
|
||||
*
|
||||
* New in Mesa 11.2
|
||||
*/
|
||||
GLAPI OSMesaContext GLAPIENTRY
|
||||
OSMesaCreateContextAttribs( const int *attribList, OSMesaContext sharelist );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Destroy an Off-Screen Mesa rendering context.
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -102,8 +102,9 @@ call_once(once_flag *flag, void (*func)(void))
|
||||
static inline int
|
||||
cnd_broadcast(cnd_t *cond)
|
||||
{
|
||||
assert(cond != NULL);
|
||||
return (pthread_cond_broadcast(cond) == 0) ? thrd_success : thrd_error;
|
||||
if (!cond) return thrd_error;
|
||||
pthread_cond_broadcast(cond);
|
||||
return thrd_success;
|
||||
}
|
||||
|
||||
// 7.25.3.2
|
||||
@@ -118,16 +119,18 @@ cnd_destroy(cnd_t *cond)
|
||||
static inline int
|
||||
cnd_init(cnd_t *cond)
|
||||
{
|
||||
assert(cond != NULL);
|
||||
return (pthread_cond_init(cond, NULL) == 0) ? thrd_success : thrd_error;
|
||||
if (!cond) return thrd_error;
|
||||
pthread_cond_init(cond, NULL);
|
||||
return thrd_success;
|
||||
}
|
||||
|
||||
// 7.25.3.4
|
||||
static inline int
|
||||
cnd_signal(cnd_t *cond)
|
||||
{
|
||||
assert(cond != NULL);
|
||||
return (pthread_cond_signal(cond) == 0) ? thrd_success : thrd_error;
|
||||
if (!cond) return thrd_error;
|
||||
pthread_cond_signal(cond);
|
||||
return thrd_success;
|
||||
}
|
||||
|
||||
// 7.25.3.5
|
||||
@@ -136,14 +139,7 @@ cnd_timedwait(cnd_t *cond, mtx_t *mtx, const xtime *xt)
|
||||
{
|
||||
struct timespec abs_time;
|
||||
int rt;
|
||||
|
||||
assert(mtx != NULL);
|
||||
assert(cond != NULL);
|
||||
assert(xt != NULL);
|
||||
|
||||
abs_time.tv_sec = xt->sec;
|
||||
abs_time.tv_nsec = xt->nsec;
|
||||
|
||||
if (!cond || !mtx || !xt) return thrd_error;
|
||||
rt = pthread_cond_timedwait(cond, mtx, &abs_time);
|
||||
if (rt == ETIMEDOUT)
|
||||
return thrd_busy;
|
||||
@@ -154,9 +150,9 @@ cnd_timedwait(cnd_t *cond, mtx_t *mtx, const xtime *xt)
|
||||
static inline int
|
||||
cnd_wait(cnd_t *cond, mtx_t *mtx)
|
||||
{
|
||||
assert(mtx != NULL);
|
||||
assert(cond != NULL);
|
||||
return (pthread_cond_wait(cond, mtx) == 0) ? thrd_success : thrd_error;
|
||||
if (!cond || !mtx) return thrd_error;
|
||||
pthread_cond_wait(cond, mtx);
|
||||
return thrd_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +161,7 @@ cnd_wait(cnd_t *cond, mtx_t *mtx)
|
||||
static inline void
|
||||
mtx_destroy(mtx_t *mtx)
|
||||
{
|
||||
assert(mtx != NULL);
|
||||
assert(mtx);
|
||||
pthread_mutex_destroy(mtx);
|
||||
}
|
||||
|
||||
@@ -174,7 +170,7 @@ static inline int
|
||||
mtx_init(mtx_t *mtx, int type)
|
||||
{
|
||||
pthread_mutexattr_t attr;
|
||||
assert(mtx != NULL);
|
||||
if (!mtx) return thrd_error;
|
||||
if (type != mtx_plain && type != mtx_timed && type != mtx_try
|
||||
&& type != (mtx_plain|mtx_recursive)
|
||||
&& type != (mtx_timed|mtx_recursive)
|
||||
@@ -192,8 +188,9 @@ mtx_init(mtx_t *mtx, int type)
|
||||
static inline int
|
||||
mtx_lock(mtx_t *mtx)
|
||||
{
|
||||
assert(mtx != NULL);
|
||||
return (pthread_mutex_lock(mtx) == 0) ? thrd_success : thrd_error;
|
||||
if (!mtx) return thrd_error;
|
||||
pthread_mutex_lock(mtx);
|
||||
return thrd_success;
|
||||
}
|
||||
|
||||
static inline int
|
||||
@@ -206,9 +203,7 @@ thrd_yield(void);
|
||||
static inline int
|
||||
mtx_timedlock(mtx_t *mtx, const xtime *xt)
|
||||
{
|
||||
assert(mtx != NULL);
|
||||
assert(xt != NULL);
|
||||
|
||||
if (!mtx || !xt) return thrd_error;
|
||||
{
|
||||
#ifdef EMULATED_THREADS_USE_NATIVE_TIMEDLOCK
|
||||
struct timespec ts;
|
||||
@@ -238,7 +233,7 @@ mtx_timedlock(mtx_t *mtx, const xtime *xt)
|
||||
static inline int
|
||||
mtx_trylock(mtx_t *mtx)
|
||||
{
|
||||
assert(mtx != NULL);
|
||||
if (!mtx) return thrd_error;
|
||||
return (pthread_mutex_trylock(mtx) == 0) ? thrd_success : thrd_busy;
|
||||
}
|
||||
|
||||
@@ -246,8 +241,9 @@ mtx_trylock(mtx_t *mtx)
|
||||
static inline int
|
||||
mtx_unlock(mtx_t *mtx)
|
||||
{
|
||||
assert(mtx != NULL);
|
||||
return (pthread_mutex_unlock(mtx) == 0) ? thrd_success : thrd_error;
|
||||
if (!mtx) return thrd_error;
|
||||
pthread_mutex_unlock(mtx);
|
||||
return thrd_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -257,7 +253,7 @@ static inline int
|
||||
thrd_create(thrd_t *thr, thrd_start_t func, void *arg)
|
||||
{
|
||||
struct impl_thrd_param *pack;
|
||||
assert(thr != NULL);
|
||||
if (!thr) return thrd_error;
|
||||
pack = (struct impl_thrd_param *)malloc(sizeof(struct impl_thrd_param));
|
||||
if (!pack) return thrd_nomem;
|
||||
pack->func = func;
|
||||
@@ -333,7 +329,7 @@ thrd_yield(void)
|
||||
static inline int
|
||||
tss_create(tss_t *key, tss_dtor_t dtor)
|
||||
{
|
||||
assert(key != NULL);
|
||||
if (!key) return thrd_error;
|
||||
return (pthread_key_create(key, dtor) == 0) ? thrd_success : thrd_error;
|
||||
}
|
||||
|
||||
|
||||
305
include/c99/inttypes.h
Normal file
305
include/c99/inttypes.h
Normal file
@@ -0,0 +1,305 @@
|
||||
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006 Alexander Chemeris
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _MSC_INTTYPES_H_ // [
|
||||
#define _MSC_INTTYPES_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
// 7.8 Format conversion of integer types
|
||||
|
||||
typedef struct {
|
||||
intmax_t quot;
|
||||
intmax_t rem;
|
||||
} imaxdiv_t;
|
||||
|
||||
// 7.8.1 Macros for format specifiers
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198
|
||||
|
||||
// The fprintf macros for signed integers are:
|
||||
#define PRId8 "d"
|
||||
#define PRIi8 "i"
|
||||
#define PRIdLEAST8 "d"
|
||||
#define PRIiLEAST8 "i"
|
||||
#define PRIdFAST8 "d"
|
||||
#define PRIiFAST8 "i"
|
||||
|
||||
#define PRId16 "hd"
|
||||
#define PRIi16 "hi"
|
||||
#define PRIdLEAST16 "hd"
|
||||
#define PRIiLEAST16 "hi"
|
||||
#define PRIdFAST16 "hd"
|
||||
#define PRIiFAST16 "hi"
|
||||
|
||||
#define PRId32 "I32d"
|
||||
#define PRIi32 "I32i"
|
||||
#define PRIdLEAST32 "I32d"
|
||||
#define PRIiLEAST32 "I32i"
|
||||
#define PRIdFAST32 "I32d"
|
||||
#define PRIiFAST32 "I32i"
|
||||
|
||||
#define PRId64 "I64d"
|
||||
#define PRIi64 "I64i"
|
||||
#define PRIdLEAST64 "I64d"
|
||||
#define PRIiLEAST64 "I64i"
|
||||
#define PRIdFAST64 "I64d"
|
||||
#define PRIiFAST64 "I64i"
|
||||
|
||||
#define PRIdMAX "I64d"
|
||||
#define PRIiMAX "I64i"
|
||||
|
||||
#define PRIdPTR "Id"
|
||||
#define PRIiPTR "Ii"
|
||||
|
||||
// The fprintf macros for unsigned integers are:
|
||||
#define PRIo8 "o"
|
||||
#define PRIu8 "u"
|
||||
#define PRIx8 "x"
|
||||
#define PRIX8 "X"
|
||||
#define PRIoLEAST8 "o"
|
||||
#define PRIuLEAST8 "u"
|
||||
#define PRIxLEAST8 "x"
|
||||
#define PRIXLEAST8 "X"
|
||||
#define PRIoFAST8 "o"
|
||||
#define PRIuFAST8 "u"
|
||||
#define PRIxFAST8 "x"
|
||||
#define PRIXFAST8 "X"
|
||||
|
||||
#define PRIo16 "ho"
|
||||
#define PRIu16 "hu"
|
||||
#define PRIx16 "hx"
|
||||
#define PRIX16 "hX"
|
||||
#define PRIoLEAST16 "ho"
|
||||
#define PRIuLEAST16 "hu"
|
||||
#define PRIxLEAST16 "hx"
|
||||
#define PRIXLEAST16 "hX"
|
||||
#define PRIoFAST16 "ho"
|
||||
#define PRIuFAST16 "hu"
|
||||
#define PRIxFAST16 "hx"
|
||||
#define PRIXFAST16 "hX"
|
||||
|
||||
#define PRIo32 "I32o"
|
||||
#define PRIu32 "I32u"
|
||||
#define PRIx32 "I32x"
|
||||
#define PRIX32 "I32X"
|
||||
#define PRIoLEAST32 "I32o"
|
||||
#define PRIuLEAST32 "I32u"
|
||||
#define PRIxLEAST32 "I32x"
|
||||
#define PRIXLEAST32 "I32X"
|
||||
#define PRIoFAST32 "I32o"
|
||||
#define PRIuFAST32 "I32u"
|
||||
#define PRIxFAST32 "I32x"
|
||||
#define PRIXFAST32 "I32X"
|
||||
|
||||
#define PRIo64 "I64o"
|
||||
#define PRIu64 "I64u"
|
||||
#define PRIx64 "I64x"
|
||||
#define PRIX64 "I64X"
|
||||
#define PRIoLEAST64 "I64o"
|
||||
#define PRIuLEAST64 "I64u"
|
||||
#define PRIxLEAST64 "I64x"
|
||||
#define PRIXLEAST64 "I64X"
|
||||
#define PRIoFAST64 "I64o"
|
||||
#define PRIuFAST64 "I64u"
|
||||
#define PRIxFAST64 "I64x"
|
||||
#define PRIXFAST64 "I64X"
|
||||
|
||||
#define PRIoMAX "I64o"
|
||||
#define PRIuMAX "I64u"
|
||||
#define PRIxMAX "I64x"
|
||||
#define PRIXMAX "I64X"
|
||||
|
||||
#define PRIoPTR "Io"
|
||||
#define PRIuPTR "Iu"
|
||||
#define PRIxPTR "Ix"
|
||||
#define PRIXPTR "IX"
|
||||
|
||||
// The fscanf macros for signed integers are:
|
||||
#define SCNd8 "d"
|
||||
#define SCNi8 "i"
|
||||
#define SCNdLEAST8 "d"
|
||||
#define SCNiLEAST8 "i"
|
||||
#define SCNdFAST8 "d"
|
||||
#define SCNiFAST8 "i"
|
||||
|
||||
#define SCNd16 "hd"
|
||||
#define SCNi16 "hi"
|
||||
#define SCNdLEAST16 "hd"
|
||||
#define SCNiLEAST16 "hi"
|
||||
#define SCNdFAST16 "hd"
|
||||
#define SCNiFAST16 "hi"
|
||||
|
||||
#define SCNd32 "ld"
|
||||
#define SCNi32 "li"
|
||||
#define SCNdLEAST32 "ld"
|
||||
#define SCNiLEAST32 "li"
|
||||
#define SCNdFAST32 "ld"
|
||||
#define SCNiFAST32 "li"
|
||||
|
||||
#define SCNd64 "I64d"
|
||||
#define SCNi64 "I64i"
|
||||
#define SCNdLEAST64 "I64d"
|
||||
#define SCNiLEAST64 "I64i"
|
||||
#define SCNdFAST64 "I64d"
|
||||
#define SCNiFAST64 "I64i"
|
||||
|
||||
#define SCNdMAX "I64d"
|
||||
#define SCNiMAX "I64i"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNdPTR "I64d"
|
||||
# define SCNiPTR "I64i"
|
||||
#else // _WIN64 ][
|
||||
# define SCNdPTR "ld"
|
||||
# define SCNiPTR "li"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// The fscanf macros for unsigned integers are:
|
||||
#define SCNo8 "o"
|
||||
#define SCNu8 "u"
|
||||
#define SCNx8 "x"
|
||||
#define SCNX8 "X"
|
||||
#define SCNoLEAST8 "o"
|
||||
#define SCNuLEAST8 "u"
|
||||
#define SCNxLEAST8 "x"
|
||||
#define SCNXLEAST8 "X"
|
||||
#define SCNoFAST8 "o"
|
||||
#define SCNuFAST8 "u"
|
||||
#define SCNxFAST8 "x"
|
||||
#define SCNXFAST8 "X"
|
||||
|
||||
#define SCNo16 "ho"
|
||||
#define SCNu16 "hu"
|
||||
#define SCNx16 "hx"
|
||||
#define SCNX16 "hX"
|
||||
#define SCNoLEAST16 "ho"
|
||||
#define SCNuLEAST16 "hu"
|
||||
#define SCNxLEAST16 "hx"
|
||||
#define SCNXLEAST16 "hX"
|
||||
#define SCNoFAST16 "ho"
|
||||
#define SCNuFAST16 "hu"
|
||||
#define SCNxFAST16 "hx"
|
||||
#define SCNXFAST16 "hX"
|
||||
|
||||
#define SCNo32 "lo"
|
||||
#define SCNu32 "lu"
|
||||
#define SCNx32 "lx"
|
||||
#define SCNX32 "lX"
|
||||
#define SCNoLEAST32 "lo"
|
||||
#define SCNuLEAST32 "lu"
|
||||
#define SCNxLEAST32 "lx"
|
||||
#define SCNXLEAST32 "lX"
|
||||
#define SCNoFAST32 "lo"
|
||||
#define SCNuFAST32 "lu"
|
||||
#define SCNxFAST32 "lx"
|
||||
#define SCNXFAST32 "lX"
|
||||
|
||||
#define SCNo64 "I64o"
|
||||
#define SCNu64 "I64u"
|
||||
#define SCNx64 "I64x"
|
||||
#define SCNX64 "I64X"
|
||||
#define SCNoLEAST64 "I64o"
|
||||
#define SCNuLEAST64 "I64u"
|
||||
#define SCNxLEAST64 "I64x"
|
||||
#define SCNXLEAST64 "I64X"
|
||||
#define SCNoFAST64 "I64o"
|
||||
#define SCNuFAST64 "I64u"
|
||||
#define SCNxFAST64 "I64x"
|
||||
#define SCNXFAST64 "I64X"
|
||||
|
||||
#define SCNoMAX "I64o"
|
||||
#define SCNuMAX "I64u"
|
||||
#define SCNxMAX "I64x"
|
||||
#define SCNXMAX "I64X"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNoPTR "I64o"
|
||||
# define SCNuPTR "I64u"
|
||||
# define SCNxPTR "I64x"
|
||||
# define SCNXPTR "I64X"
|
||||
#else // _WIN64 ][
|
||||
# define SCNoPTR "lo"
|
||||
# define SCNuPTR "lu"
|
||||
# define SCNxPTR "lx"
|
||||
# define SCNXPTR "lX"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
#endif // __STDC_FORMAT_MACROS ]
|
||||
|
||||
// 7.8.2 Functions for greatest-width integer types
|
||||
|
||||
// 7.8.2.1 The imaxabs function
|
||||
#define imaxabs _abs64
|
||||
|
||||
// 7.8.2.2 The imaxdiv function
|
||||
|
||||
// This is modified version of div() function from Microsoft's div.c found
|
||||
// in %MSVC.NET%\crt\src\div.c
|
||||
#ifdef STATIC_IMAXDIV // [
|
||||
static
|
||||
#else // STATIC_IMAXDIV ][
|
||||
_inline
|
||||
#endif // STATIC_IMAXDIV ]
|
||||
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
|
||||
{
|
||||
imaxdiv_t result;
|
||||
|
||||
result.quot = numer / denom;
|
||||
result.rem = numer % denom;
|
||||
|
||||
if (numer < 0 && result.rem > 0) {
|
||||
// did division wrong; must fix up
|
||||
++result.quot;
|
||||
result.rem -= denom;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 7.8.2.3 The strtoimax and strtoumax functions
|
||||
#define strtoimax _strtoi64
|
||||
#define strtoumax _strtoui64
|
||||
|
||||
// 7.8.2.4 The wcstoimax and wcstoumax functions
|
||||
#define wcstoimax _wcstoi64
|
||||
#define wcstoumax _wcstoui64
|
||||
|
||||
|
||||
#endif // _MSC_INTTYPES_H_ ]
|
||||
@@ -1,6 +1,6 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2010 VMware, Inc.
|
||||
* Copyright 2007-2010 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
@@ -25,32 +25,22 @@
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _STDBOOL_H_
|
||||
#define _STDBOOL_H_
|
||||
|
||||
#include "lp_bld_format.h"
|
||||
#ifndef __cplusplus
|
||||
|
||||
#define false 0
|
||||
#define true 1
|
||||
#define bool _Bool
|
||||
|
||||
|
||||
LLVMTypeRef
|
||||
lp_build_format_cache_type(struct gallivm_state *gallivm)
|
||||
{
|
||||
LLVMTypeRef elem_types[LP_BUILD_FORMAT_CACHE_MEMBER_COUNT];
|
||||
LLVMTypeRef s;
|
||||
|
||||
elem_types[LP_BUILD_FORMAT_CACHE_MEMBER_DATA] =
|
||||
LLVMArrayType(LLVMInt32TypeInContext(gallivm->context),
|
||||
LP_BUILD_FORMAT_CACHE_SIZE * 16);
|
||||
elem_types[LP_BUILD_FORMAT_CACHE_MEMBER_TAGS] =
|
||||
LLVMArrayType(LLVMInt64TypeInContext(gallivm->context),
|
||||
LP_BUILD_FORMAT_CACHE_SIZE);
|
||||
#if LP_BUILD_FORMAT_CACHE_DEBUG
|
||||
elem_types[LP_BUILD_FORMAT_CACHE_MEMBER_ACCESS_TOTAL] =
|
||||
LLVMInt64TypeInContext(gallivm->context);
|
||||
elem_types[LP_BUILD_FORMAT_CACHE_MEMBER_ACCESS_MISS] =
|
||||
LLVMInt64TypeInContext(gallivm->context);
|
||||
/* For compilers that don't have the builtin _Bool type. */
|
||||
#if (defined(_MSC_VER) && _MSC_VER < 1800)
|
||||
typedef unsigned char _Bool;
|
||||
#endif
|
||||
|
||||
s = LLVMStructTypeInContext(gallivm->context, elem_types,
|
||||
LP_BUILD_FORMAT_CACHE_MEMBER_COUNT, 0);
|
||||
#endif /* !__cplusplus */
|
||||
|
||||
return s;
|
||||
}
|
||||
#define __bool_true_false_are_defined 1
|
||||
|
||||
#endif /* !_STDBOOL_H_ */
|
||||
247
include/c99/stdint.h
Normal file
247
include/c99/stdint.h
Normal file
@@ -0,0 +1,247 @@
|
||||
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006-2008 Alexander Chemeris
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _MSC_STDINT_H_ // [
|
||||
#define _MSC_STDINT_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
|
||||
// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
|
||||
// or compiler give many errors like this:
|
||||
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
# include <wchar.h>
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
// Define _W64 macros to mark types changing their size, like intptr_t.
|
||||
#ifndef _W64
|
||||
# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
|
||||
# define _W64 __w64
|
||||
# else
|
||||
# define _W64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
// 7.18.1 Integer types
|
||||
|
||||
// 7.18.1.1 Exact-width integer types
|
||||
|
||||
// Visual Studio 6 and Embedded Visual C++ 4 doesn't
|
||||
// realize that, e.g. char has the same size as __int8
|
||||
// so we give up on __intX for them.
|
||||
#if (_MSC_VER < 1300)
|
||||
typedef signed char int8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
#else
|
||||
typedef signed __int8 int8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
#endif
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
|
||||
|
||||
// 7.18.1.2 Minimum-width integer types
|
||||
typedef int8_t int_least8_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef int64_t int_least64_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
|
||||
// 7.18.1.3 Fastest minimum-width integer types
|
||||
typedef int8_t int_fast8_t;
|
||||
typedef int16_t int_fast16_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
typedef int64_t int_fast64_t;
|
||||
typedef uint8_t uint_fast8_t;
|
||||
typedef uint16_t uint_fast16_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
typedef uint64_t uint_fast64_t;
|
||||
|
||||
// 7.18.1.4 Integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
typedef signed __int64 intptr_t;
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else // _WIN64 ][
|
||||
typedef _W64 signed int intptr_t;
|
||||
typedef _W64 unsigned int uintptr_t;
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.1.5 Greatest-width integer types
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
|
||||
|
||||
// 7.18.2 Limits of specified-width integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
|
||||
|
||||
// 7.18.2.1 Limits of exact-width integer types
|
||||
#define INT8_MIN ((int8_t)_I8_MIN)
|
||||
#define INT8_MAX _I8_MAX
|
||||
#define INT16_MIN ((int16_t)_I16_MIN)
|
||||
#define INT16_MAX _I16_MAX
|
||||
#define INT32_MIN ((int32_t)_I32_MIN)
|
||||
#define INT32_MAX _I32_MAX
|
||||
#define INT64_MIN ((int64_t)_I64_MIN)
|
||||
#define INT64_MAX _I64_MAX
|
||||
#define UINT8_MAX _UI8_MAX
|
||||
#define UINT16_MAX _UI16_MAX
|
||||
#define UINT32_MAX _UI32_MAX
|
||||
#define UINT64_MAX _UI64_MAX
|
||||
|
||||
// 7.18.2.2 Limits of minimum-width integer types
|
||||
#define INT_LEAST8_MIN INT8_MIN
|
||||
#define INT_LEAST8_MAX INT8_MAX
|
||||
#define INT_LEAST16_MIN INT16_MIN
|
||||
#define INT_LEAST16_MAX INT16_MAX
|
||||
#define INT_LEAST32_MIN INT32_MIN
|
||||
#define INT_LEAST32_MAX INT32_MAX
|
||||
#define INT_LEAST64_MIN INT64_MIN
|
||||
#define INT_LEAST64_MAX INT64_MAX
|
||||
#define UINT_LEAST8_MAX UINT8_MAX
|
||||
#define UINT_LEAST16_MAX UINT16_MAX
|
||||
#define UINT_LEAST32_MAX UINT32_MAX
|
||||
#define UINT_LEAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.3 Limits of fastest minimum-width integer types
|
||||
#define INT_FAST8_MIN INT8_MIN
|
||||
#define INT_FAST8_MAX INT8_MAX
|
||||
#define INT_FAST16_MIN INT16_MIN
|
||||
#define INT_FAST16_MAX INT16_MAX
|
||||
#define INT_FAST32_MIN INT32_MIN
|
||||
#define INT_FAST32_MAX INT32_MAX
|
||||
#define INT_FAST64_MIN INT64_MIN
|
||||
#define INT_FAST64_MAX INT64_MAX
|
||||
#define UINT_FAST8_MAX UINT8_MAX
|
||||
#define UINT_FAST16_MAX UINT16_MAX
|
||||
#define UINT_FAST32_MAX UINT32_MAX
|
||||
#define UINT_FAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.4 Limits of integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
# define INTPTR_MIN INT64_MIN
|
||||
# define INTPTR_MAX INT64_MAX
|
||||
# define UINTPTR_MAX UINT64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define INTPTR_MIN INT32_MIN
|
||||
# define INTPTR_MAX INT32_MAX
|
||||
# define UINTPTR_MAX UINT32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.2.5 Limits of greatest-width integer types
|
||||
#define INTMAX_MIN INT64_MIN
|
||||
#define INTMAX_MAX INT64_MAX
|
||||
#define UINTMAX_MAX UINT64_MAX
|
||||
|
||||
// 7.18.3 Limits of other integer types
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define PTRDIFF_MIN _I64_MIN
|
||||
# define PTRDIFF_MAX _I64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define PTRDIFF_MIN _I32_MIN
|
||||
# define PTRDIFF_MAX _I32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
#define SIG_ATOMIC_MIN INT_MIN
|
||||
#define SIG_ATOMIC_MAX INT_MAX
|
||||
|
||||
#ifndef SIZE_MAX // [
|
||||
# ifdef _WIN64 // [
|
||||
# define SIZE_MAX _UI64_MAX
|
||||
# else // _WIN64 ][
|
||||
# define SIZE_MAX _UI32_MAX
|
||||
# endif // _WIN64 ]
|
||||
#endif // SIZE_MAX ]
|
||||
|
||||
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
|
||||
#ifndef WCHAR_MIN // [
|
||||
# define WCHAR_MIN 0
|
||||
#endif // WCHAR_MIN ]
|
||||
#ifndef WCHAR_MAX // [
|
||||
# define WCHAR_MAX _UI16_MAX
|
||||
#endif // WCHAR_MAX ]
|
||||
|
||||
#define WINT_MIN 0
|
||||
#define WINT_MAX _UI16_MAX
|
||||
|
||||
#endif // __STDC_LIMIT_MACROS ]
|
||||
|
||||
|
||||
// 7.18.4 Limits of other integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
|
||||
|
||||
// 7.18.4.1 Macros for minimum-width integer constants
|
||||
|
||||
#define INT8_C(val) val##i8
|
||||
#define INT16_C(val) val##i16
|
||||
#define INT32_C(val) val##i32
|
||||
#define INT64_C(val) val##i64
|
||||
|
||||
#define UINT8_C(val) val##ui8
|
||||
#define UINT16_C(val) val##ui16
|
||||
#define UINT32_C(val) val##ui32
|
||||
#define UINT64_C(val) val##ui64
|
||||
|
||||
// 7.18.4.2 Macros for greatest-width integer constants
|
||||
#define INTMAX_C INT64_C
|
||||
#define UINTMAX_C UINT64_C
|
||||
|
||||
#endif // __STDC_CONSTANT_MACROS ]
|
||||
|
||||
|
||||
#endif // _MSC_STDINT_H_ ]
|
||||
@@ -36,17 +36,17 @@
|
||||
*/
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
# if _MSC_VER < 1800
|
||||
# error "Microsoft Visual Studio 2013 or higher required"
|
||||
# if _MSC_VER < 1500
|
||||
# error "Microsoft Visual Studio 2008 or higher required"
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Visual Studio will complain if we define the `inline` keyword, but
|
||||
* Visual Studio 2012 will complain if we define the `inline` keyword, but
|
||||
* actually it only supports the keyword on C++.
|
||||
*
|
||||
* To avoid this the _ALLOW_KEYWORD_MACROS must be set.
|
||||
*/
|
||||
# if !defined(_ALLOW_KEYWORD_MACROS)
|
||||
# if (_MSC_VER >= 1700) && !defined(_ALLOW_KEYWORD_MACROS)
|
||||
# define _ALLOW_KEYWORD_MACROS
|
||||
# endif
|
||||
|
||||
@@ -81,6 +81,8 @@
|
||||
/* Intel compiler supports inline keyword */
|
||||
# elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
|
||||
# define inline __inline
|
||||
# elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
|
||||
/* C99 supports inline keyword */
|
||||
# elif (__STDC_VERSION__ >= 199901L)
|
||||
/* C99 supports inline keyword */
|
||||
# else
|
||||
@@ -98,6 +100,8 @@
|
||||
#ifndef restrict
|
||||
# if (__STDC_VERSION__ >= 199901L)
|
||||
/* C99 */
|
||||
# elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
|
||||
/* C99 */
|
||||
# elif defined(__GNUC__)
|
||||
# define restrict __restrict__
|
||||
# elif defined(_MSC_VER)
|
||||
@@ -114,6 +118,8 @@
|
||||
#ifndef __func__
|
||||
# if (__STDC_VERSION__ >= 199901L)
|
||||
/* C99 */
|
||||
# elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
|
||||
/* C99 */
|
||||
# elif defined(__GNUC__)
|
||||
# define __func__ __FUNCTION__
|
||||
# elif defined(_MSC_VER)
|
||||
|
||||
@@ -38,16 +38,55 @@
|
||||
#include "c99_compat.h"
|
||||
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
/* This is to ensure that we get M_PI, etc. definitions */
|
||||
#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
|
||||
#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 !defined(_MSC_VER) && \
|
||||
__STDC_VERSION__ < 199901L && \
|
||||
(!defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 600) && \
|
||||
!defined(__cplusplus)
|
||||
#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)
|
||||
|
||||
@@ -69,8 +69,6 @@ typedef struct ID3DPresentVtbl
|
||||
HRESULT (WINAPI *SetCursor)(ID3DPresent *This, void *pBitmap, POINT *pHotspot, BOOL bShow);
|
||||
HRESULT (WINAPI *SetGammaRamp)(ID3DPresent *This, const D3DGAMMARAMP *pRamp, HWND hWndOverride);
|
||||
HRESULT (WINAPI *GetWindowInfo)(ID3DPresent *This, HWND hWnd, int *width, int *height, int *depth);
|
||||
/* Available since version 1.1 */
|
||||
BOOL (WINAPI *GetWindowOccluded)(ID3DPresent *This);
|
||||
} ID3DPresentVtbl;
|
||||
|
||||
struct ID3DPresent
|
||||
@@ -98,7 +96,6 @@ struct ID3DPresent
|
||||
#define ID3DPresent_SetCursor(p,a,b,c) (p)->lpVtbl->SetCursor(p,a,b,c)
|
||||
#define ID3DPresent_SetGammaRamp(p,a,b) (p)->lpVtbl->SetGammaRamp(p,a,b)
|
||||
#define ID3DPresent_GetWindowInfo(p,a,b,c,d) (p)->lpVtbl->GetWindowSize(p,a,b,c,d)
|
||||
#define ID3DPresent_GetWindowOccluded(p) (p)->lpVtbl->GetWindowOccluded(p)
|
||||
|
||||
typedef struct ID3DPresentGroupVtbl
|
||||
{
|
||||
|
||||
@@ -109,53 +109,21 @@ CHIPSET(0x162A, bdw_gt3, "Intel(R) Iris Pro P6300 (Broadwell GT3e)")
|
||||
CHIPSET(0x162B, bdw_gt3, "Intel(R) Iris 6100 (Broadwell GT3)")
|
||||
CHIPSET(0x162D, bdw_gt3, "Intel(R) Broadwell GT3")
|
||||
CHIPSET(0x162E, bdw_gt3, "Intel(R) Broadwell GT3")
|
||||
CHIPSET(0x1902, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)")
|
||||
CHIPSET(0x1906, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)")
|
||||
CHIPSET(0x190A, skl_gt1, "Intel(R) Skylake GT1")
|
||||
CHIPSET(0x190B, skl_gt1, "Intel(R) HD Graphics 510 (Skylake GT1)")
|
||||
CHIPSET(0x190E, skl_gt1, "Intel(R) Skylake GT1")
|
||||
CHIPSET(0x1912, skl_gt2, "Intel(R) HD Graphics 530 (Skylake GT2)")
|
||||
CHIPSET(0x1913, skl_gt2, "Intel(R) Skylake GT2f")
|
||||
CHIPSET(0x1915, skl_gt2, "Intel(R) Skylake GT2f")
|
||||
CHIPSET(0x1916, skl_gt2, "Intel(R) HD Graphics 520 (Skylake GT2)")
|
||||
CHIPSET(0x1917, skl_gt2, "Intel(R) Skylake GT2f")
|
||||
CHIPSET(0x191A, skl_gt2, "Intel(R) Skylake GT2")
|
||||
CHIPSET(0x191B, skl_gt2, "Intel(R) HD Graphics 530 (Skylake GT2)")
|
||||
CHIPSET(0x191D, skl_gt2, "Intel(R) HD Graphics P530 (Skylake GT2)")
|
||||
CHIPSET(0x191E, skl_gt2, "Intel(R) HD Graphics 515 (Skylake GT2)")
|
||||
CHIPSET(0x1921, skl_gt2, "Intel(R) HD Graphics 520 (Skylake GT2)")
|
||||
CHIPSET(0x1923, skl_gt3, "Intel(R) Skylake GT3e")
|
||||
CHIPSET(0x1926, skl_gt3, "Intel(R) Iris Graphics 540 (Skylake GT3e)")
|
||||
CHIPSET(0x1927, skl_gt3, "Intel(R) Iris Graphics 550 (Skylake GT3e)")
|
||||
CHIPSET(0x192A, skl_gt4, "Intel(R) Skylake GT4")
|
||||
CHIPSET(0x192B, skl_gt3, "Intel(R) Iris Graphics 555 (Skylake GT3e)")
|
||||
CHIPSET(0x192D, skl_gt3, "Intel(R) Iris Graphics P555 (Skylake GT3e)")
|
||||
CHIPSET(0x1932, skl_gt4, "Intel(R) Iris Pro Graphics 580 (Skylake GT4e)")
|
||||
CHIPSET(0x193A, skl_gt4, "Intel(R) Iris Pro Graphics P580 (Skylake GT4e)")
|
||||
CHIPSET(0x193B, skl_gt4, "Intel(R) Iris Pro Graphics 580 (Skylake GT4e)")
|
||||
CHIPSET(0x193D, skl_gt4, "Intel(R) Iris Pro Graphics P580 (Skylake GT4e)")
|
||||
CHIPSET(0x5902, kbl_gt1, "Intel(R) Kabylake GT1")
|
||||
CHIPSET(0x5906, kbl_gt1, "Intel(R) Kabylake GT1")
|
||||
CHIPSET(0x590A, kbl_gt1, "Intel(R) Kabylake GT1")
|
||||
CHIPSET(0x590B, kbl_gt1, "Intel(R) Kabylake GT1")
|
||||
CHIPSET(0x590E, kbl_gt1, "Intel(R) Kabylake GT1")
|
||||
CHIPSET(0x5913, kbl_gt1_5, "Intel(R) Kabylake GT1.5")
|
||||
CHIPSET(0x5915, kbl_gt1_5, "Intel(R) Kabylake GT1.5")
|
||||
CHIPSET(0x5917, kbl_gt1_5, "Intel(R) Kabylake GT1.5")
|
||||
CHIPSET(0x5912, kbl_gt2, "Intel(R) Kabylake GT2")
|
||||
CHIPSET(0x5916, kbl_gt2, "Intel(R) Kabylake GT2")
|
||||
CHIPSET(0x591A, kbl_gt2, "Intel(R) Kabylake GT2")
|
||||
CHIPSET(0x591B, kbl_gt2, "Intel(R) Kabylake GT2")
|
||||
CHIPSET(0x591D, kbl_gt2, "Intel(R) Kabylake GT2")
|
||||
CHIPSET(0x591E, kbl_gt2, "Intel(R) Kabylake GT2")
|
||||
CHIPSET(0x5921, kbl_gt2, "Intel(R) Kabylake GT2F")
|
||||
CHIPSET(0x5926, kbl_gt3, "Intel(R) Kabylake GT3")
|
||||
CHIPSET(0x592A, kbl_gt3, "Intel(R) Kabylake GT3")
|
||||
CHIPSET(0x592B, kbl_gt3, "Intel(R) Kabylake GT3")
|
||||
CHIPSET(0x5932, kbl_gt4, "Intel(R) Kabylake GT4")
|
||||
CHIPSET(0x593A, kbl_gt4, "Intel(R) Kabylake GT4")
|
||||
CHIPSET(0x593B, kbl_gt4, "Intel(R) Kabylake GT4")
|
||||
CHIPSET(0x593D, kbl_gt4, "Intel(R) Kabylake GT4")
|
||||
CHIPSET(0x1902, skl_gt1, "Intel(R) Skylake DT GT1")
|
||||
CHIPSET(0x1906, skl_gt1, "Intel(R) Skylake ULT GT1")
|
||||
CHIPSET(0x190A, skl_gt1, "Intel(R) Skylake SRV GT1")
|
||||
CHIPSET(0x190B, skl_gt1, "Intel(R) Skylake Halo GT1")
|
||||
CHIPSET(0x190E, skl_gt1, "Intel(R) Skylake ULX GT1")
|
||||
CHIPSET(0x1912, skl_gt2, "Intel(R) Skylake DT GT2")
|
||||
CHIPSET(0x1916, skl_gt2, "Intel(R) Skylake ULT GT2")
|
||||
CHIPSET(0x191A, skl_gt2, "Intel(R) Skylake SRV GT2")
|
||||
CHIPSET(0x191B, skl_gt2, "Intel(R) Skylake Halo GT2")
|
||||
CHIPSET(0x191D, skl_gt2, "Intel(R) Skylake WKS GT2")
|
||||
CHIPSET(0x191E, skl_gt2, "Intel(R) Skylake ULX GT2")
|
||||
CHIPSET(0x1921, skl_gt2, "Intel(R) Skylake ULT GT2F")
|
||||
CHIPSET(0x1926, skl_gt3, "Intel(R) Skylake ULT GT3")
|
||||
CHIPSET(0x192A, skl_gt3, "Intel(R) Skylake SRV GT3")
|
||||
CHIPSET(0x192B, skl_gt3, "Intel(R) Skylake Halo GT3")
|
||||
CHIPSET(0x22B0, chv, "Intel(R) HD Graphics (Cherryview)")
|
||||
CHIPSET(0x22B1, chv, "Intel(R) HD Graphics (Cherryview)")
|
||||
CHIPSET(0x22B2, chv, "Intel(R) HD Graphics (Cherryview)")
|
||||
|
||||
@@ -181,5 +181,3 @@ CHIPSET(0x9876, CARRIZO_, CARRIZO)
|
||||
CHIPSET(0x9877, CARRIZO_, CARRIZO)
|
||||
|
||||
CHIPSET(0x7300, FIJI_, FIJI)
|
||||
|
||||
CHIPSET(0x98E4, STONEY_, STONEY)
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
CHIPSET(0x0010, VIRTGL, VIRTGL)
|
||||
CHIPSET(0x1050, VIRTGL, VIRTGL)
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
if BUILD_SHARED
|
||||
if HAVE_COMPAT_SYMLINKS
|
||||
all-local : .install-gallium-links
|
||||
all-local : .libs/install-gallium-links
|
||||
|
||||
.install-gallium-links : $(dri_LTLIBRARIES) $(egl_LTLIBRARIES) $(lib_LTLIBRARIES)
|
||||
.libs/install-gallium-links : $(dri_LTLIBRARIES) $(egl_LTLIBRARIES) $(lib_LTLIBRARIES)
|
||||
$(AM_V_GEN)$(MKDIR_P) $(top_builddir)/$(LIB_DIR); \
|
||||
link_dir=$(top_builddir)/$(LIB_DIR)/gallium; \
|
||||
if test x$(egl_LTLIBRARIES) != x; then \
|
||||
@@ -23,15 +23,4 @@ all-local : .install-gallium-links
|
||||
fi; \
|
||||
done && touch $@
|
||||
endif
|
||||
|
||||
clean-local:
|
||||
for f in $(notdir $(dri_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*)) \
|
||||
$(notdir $(egl_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*)) \
|
||||
$(notdir $(lib_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*)); do \
|
||||
echo $$f; \
|
||||
$(RM) $(top_builddir)/$(LIB_DIR)/gallium/$$f; \
|
||||
done;
|
||||
rmdir $(top_builddir)/$(LIB_DIR)/gallium || true
|
||||
$(RM) .install-gallium-links
|
||||
|
||||
endif
|
||||
|
||||
@@ -94,8 +94,16 @@ def msvc2013_compat(env):
|
||||
'-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():
|
||||
@@ -292,7 +300,7 @@ def generate(env):
|
||||
|
||||
# C preprocessor options
|
||||
cppdefines = []
|
||||
cppdefines += ['__STDC_LIMIT_MACROS', '__STDC_CONSTANT_MACROS']
|
||||
cppdefines += ['__STDC_LIMIT_MACROS']
|
||||
if env['build'] in ('debug', 'checked'):
|
||||
cppdefines += ['DEBUG']
|
||||
else:
|
||||
@@ -471,12 +479,20 @@ def generate(env):
|
||||
# See also:
|
||||
# - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
|
||||
# - cl /?
|
||||
if 'MSVC_VERSION' not in env or distutils.version.LooseVersion(env['MSVC_VERSION']) < distutils.version.LooseVersion('12.0'):
|
||||
# Use bundled stdbool.h and stdint.h headers for older MSVC
|
||||
# versions. stdint.h was introduced in MSVC 2010, but stdbool.h
|
||||
# was only introduced in MSVC 2013.
|
||||
top_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
||||
env.Append(CPPPATH = [os.path.join(top_dir, 'include/c99')])
|
||||
if env['build'] == 'debug':
|
||||
ccflags += [
|
||||
'/Od', # disable optimizations
|
||||
'/Oi', # enable intrinsic functions
|
||||
]
|
||||
else:
|
||||
if 'MSVC_VERSION' in env and distutils.version.LooseVersion(env['MSVC_VERSION']) < distutils.version.LooseVersion('11.0'):
|
||||
print 'scons: warning: Visual Studio versions prior to 2012 are known to produce incorrect code when optimizations are enabled ( https://bugs.freedesktop.org/show_bug.cgi?id=58718 )'
|
||||
ccflags += [
|
||||
'/O2', # optimize for speed
|
||||
]
|
||||
|
||||
@@ -106,19 +106,7 @@ def generate(env):
|
||||
])
|
||||
env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')])
|
||||
# LIBS should match the output of `llvm-config --libs engine mcjit bitwriter x86asmprinter`
|
||||
if llvm_version >= distutils.version.LooseVersion('3.7'):
|
||||
env.Prepend(LIBS = [
|
||||
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
|
||||
'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
|
||||
'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMProfileData',
|
||||
'LLVMInstCombine', 'LLVMInstrumentation', 'LLVMTransformUtils', 'LLVMipa',
|
||||
'LLVMAnalysis', 'LLVMX86Desc', 'LLVMMCDisassembler',
|
||||
'LLVMX86Info', 'LLVMX86AsmPrinter', 'LLVMX86Utils',
|
||||
'LLVMMCJIT', 'LLVMTarget', 'LLVMExecutionEngine',
|
||||
'LLVMRuntimeDyld', 'LLVMObject', 'LLVMMCParser',
|
||||
'LLVMBitReader', 'LLVMMC', 'LLVMCore', 'LLVMSupport'
|
||||
])
|
||||
elif llvm_version >= distutils.version.LooseVersion('3.6'):
|
||||
if llvm_version >= distutils.version.LooseVersion('3.6'):
|
||||
env.Prepend(LIBS = [
|
||||
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
|
||||
'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
|
||||
|
||||
@@ -21,11 +21,8 @@
|
||||
|
||||
SUBDIRS = . gtest util mapi/glapi/gen mapi
|
||||
|
||||
# include only conditionally ?
|
||||
SUBDIRS += compiler
|
||||
|
||||
if NEED_OPENGL_COMMON
|
||||
SUBDIRS += mesa
|
||||
SUBDIRS += glsl mesa
|
||||
endif
|
||||
|
||||
SUBDIRS += loader
|
||||
|
||||
@@ -5,7 +5,7 @@ if env['platform'] == 'windows':
|
||||
SConscript('getopt/SConscript')
|
||||
|
||||
SConscript('util/SConscript')
|
||||
SConscript('compiler/SConscript')
|
||||
SConscript('glsl/SConscript')
|
||||
|
||||
if env['hostonly']:
|
||||
# We are just compiling the things necessary on the host for cross
|
||||
|
||||
1
src/compiler/.gitignore
vendored
1
src/compiler/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
glsl_compiler
|
||||
@@ -1,67 +0,0 @@
|
||||
# Mesa 3-D graphics library
|
||||
#
|
||||
# Copyright (C) 2015 Intel Corporation
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice 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.
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(LOCAL_PATH)/Makefile.sources
|
||||
|
||||
# ---------------------------------------
|
||||
# Build libmesa_compiler
|
||||
# ---------------------------------------
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := $(LIBCOMPILER_FILES)
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(MESA_TOP)/src/mapi \
|
||||
$(MESA_TOP)/src/mesa \
|
||||
$(MESA_TOP)/src/gallium/include \
|
||||
$(MESA_TOP)/src/gallium/auxiliary
|
||||
|
||||
LOCAL_MODULE := libmesa_compiler
|
||||
|
||||
include $(MESA_COMMON_MK)
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
# ---------------------------------------
|
||||
# Build libmesa_nir
|
||||
# ---------------------------------------
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(NIR_FILES)
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(MESA_TOP)/src/mapi \
|
||||
$(MESA_TOP)/src/mesa \
|
||||
$(MESA_TOP)/src/gallium/include \
|
||||
$(MESA_TOP)/src/gallium/auxiliary
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libmesa_compiler
|
||||
|
||||
LOCAL_MODULE := libmesa_nir
|
||||
|
||||
include $(LOCAL_PATH)/Android.gen.mk
|
||||
include $(MESA_COMMON_MK)
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
@@ -1,325 +0,0 @@
|
||||
#
|
||||
# Copyright © 2012 Jon TURNEY
|
||||
# Copyright (C) 2015 Intel Corporation
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
|
||||
include Makefile.sources
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/src/mapi \
|
||||
-I$(top_srcdir)/src/mesa/ \
|
||||
-I$(top_builddir)/src/compiler/glsl\
|
||||
-I$(top_srcdir)/src/compiler/glsl\
|
||||
-I$(top_srcdir)/src/compiler/glsl/glcpp\
|
||||
-I$(top_srcdir)/src/gallium/include \
|
||||
-I$(top_srcdir)/src/gallium/auxiliary \
|
||||
-I$(top_srcdir)/src/gtest/include \
|
||||
$(DEFINES)
|
||||
|
||||
AM_CFLAGS = \
|
||||
$(VISIBILITY_CFLAGS) \
|
||||
$(MSVC2013_COMPAT_CFLAGS)
|
||||
|
||||
AM_CXXFLAGS = \
|
||||
$(VISIBILITY_CXXFLAGS) \
|
||||
$(MSVC2013_COMPAT_CXXFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES = libcompiler.la
|
||||
|
||||
libcompiler_la_SOURCES = $(LIBCOMPILER_FILES)
|
||||
|
||||
check_PROGRAMS =
|
||||
TESTS =
|
||||
BUILT_SOURCES =
|
||||
CLEANFILES =
|
||||
EXTRA_DIST = SConscript
|
||||
|
||||
|
||||
EXTRA_DIST += glsl/tests glsl/glcpp/tests glsl/README \
|
||||
glsl/TODO glsl/glcpp/README \
|
||||
glsl/glsl_lexer.ll \
|
||||
glsl/glsl_parser.yy \
|
||||
glsl/glcpp/glcpp-lex.l \
|
||||
glsl/glcpp/glcpp-parse.y \
|
||||
glsl/Makefile.sources \
|
||||
glsl/SConscript
|
||||
|
||||
TESTS += glsl/glcpp/tests/glcpp-test \
|
||||
glsl/glcpp/tests/glcpp-test-cr-lf \
|
||||
glsl/tests/blob-test \
|
||||
glsl/tests/general-ir-test \
|
||||
glsl/tests/optimization-test \
|
||||
glsl/tests/sampler-types-test \
|
||||
glsl/tests/uniform-initializer-test
|
||||
|
||||
TESTS_ENVIRONMENT= \
|
||||
export PYTHON2=$(PYTHON2); \
|
||||
export PYTHON_FLAGS=$(PYTHON_FLAGS);
|
||||
|
||||
check_PROGRAMS += \
|
||||
glsl/glcpp/glcpp \
|
||||
glsl/glsl_test \
|
||||
glsl/tests/blob-test \
|
||||
glsl/tests/general-ir-test \
|
||||
glsl/tests/sampler-types-test \
|
||||
glsl/tests/uniform-initializer-test
|
||||
|
||||
noinst_PROGRAMS = glsl_compiler
|
||||
|
||||
glsl_tests_blob_test_SOURCES = \
|
||||
glsl/tests/blob_test.c
|
||||
glsl_tests_blob_test_LDADD = \
|
||||
glsl/libglsl.la
|
||||
|
||||
glsl_tests_general_ir_test_SOURCES = \
|
||||
glsl/standalone_scaffolding.cpp \
|
||||
glsl/tests/builtin_variable_test.cpp \
|
||||
glsl/tests/invalidate_locations_test.cpp \
|
||||
glsl/tests/general_ir_test.cpp \
|
||||
glsl/tests/varyings_test.cpp
|
||||
glsl_tests_general_ir_test_CFLAGS = \
|
||||
$(PTHREAD_CFLAGS)
|
||||
glsl_tests_general_ir_test_LDADD = \
|
||||
$(top_builddir)/src/gtest/libgtest.la \
|
||||
glsl/libglsl.la \
|
||||
$(top_builddir)/src/libglsl_util.la \
|
||||
$(PTHREAD_LIBS)
|
||||
|
||||
glsl_tests_uniform_initializer_test_SOURCES = \
|
||||
glsl/tests/copy_constant_to_storage_tests.cpp \
|
||||
glsl/tests/set_uniform_initializer_tests.cpp \
|
||||
glsl/tests/uniform_initializer_utils.cpp \
|
||||
glsl/tests/uniform_initializer_utils.h
|
||||
glsl_tests_uniform_initializer_test_CFLAGS = \
|
||||
$(PTHREAD_CFLAGS)
|
||||
glsl_tests_uniform_initializer_test_LDADD = \
|
||||
$(top_builddir)/src/gtest/libgtest.la \
|
||||
glsl/libglsl.la \
|
||||
$(top_builddir)/src/libglsl_util.la \
|
||||
$(PTHREAD_LIBS)
|
||||
|
||||
glsl_tests_sampler_types_test_SOURCES = \
|
||||
glsl/tests/sampler_types_test.cpp
|
||||
glsl_tests_sampler_types_test_CFLAGS = \
|
||||
$(PTHREAD_CFLAGS)
|
||||
glsl_tests_sampler_types_test_LDADD = \
|
||||
$(top_builddir)/src/gtest/libgtest.la \
|
||||
glsl/libglsl.la \
|
||||
$(top_builddir)/src/libglsl_util.la \
|
||||
$(PTHREAD_LIBS)
|
||||
|
||||
noinst_LTLIBRARIES += glsl/libglsl.la glsl/libglcpp.la
|
||||
|
||||
glsl_libglcpp_la_LIBADD = \
|
||||
$(top_builddir)/src/util/libmesautil.la
|
||||
glsl_libglcpp_la_SOURCES = \
|
||||
glsl/glcpp/glcpp-lex.c \
|
||||
glsl/glcpp/glcpp-parse.c \
|
||||
glsl/glcpp/glcpp-parse.h \
|
||||
$(LIBGLCPP_FILES)
|
||||
|
||||
glsl_glcpp_glcpp_SOURCES = \
|
||||
glsl/glcpp/glcpp.c
|
||||
glsl_glcpp_glcpp_LDADD = \
|
||||
glsl/libglcpp.la \
|
||||
$(top_builddir)/src/libglsl_util.la \
|
||||
-lm
|
||||
|
||||
glsl_libglsl_la_LIBADD = \
|
||||
nir/libnir.la \
|
||||
glsl/libglcpp.la
|
||||
|
||||
glsl_libglsl_la_SOURCES = \
|
||||
glsl/glsl_lexer.cpp \
|
||||
glsl/glsl_parser.cpp \
|
||||
glsl/glsl_parser.h \
|
||||
$(LIBGLSL_FILES)
|
||||
|
||||
|
||||
glsl_compiler_SOURCES = \
|
||||
$(GLSL_COMPILER_CXX_FILES)
|
||||
|
||||
glsl_compiler_LDADD = \
|
||||
glsl/libglsl.la \
|
||||
$(top_builddir)/src/libglsl_util.la \
|
||||
$(top_builddir)/src/util/libmesautil.la \
|
||||
$(PTHREAD_LIBS)
|
||||
|
||||
glsl_glsl_test_SOURCES = \
|
||||
glsl/standalone_scaffolding.cpp \
|
||||
glsl/test.cpp \
|
||||
glsl/test_optpass.cpp \
|
||||
glsl/test_optpass.h
|
||||
|
||||
glsl_glsl_test_LDADD = \
|
||||
glsl/libglsl.la \
|
||||
$(top_builddir)/src/libglsl_util.la \
|
||||
$(PTHREAD_LIBS)
|
||||
|
||||
# We write our own rules for yacc and lex below. We'd rather use automake,
|
||||
# but automake makes it especially difficult for a number of reasons:
|
||||
#
|
||||
# * < automake-1.12 generates .h files from .yy and .ypp files, but
|
||||
# >=automake-1.12 generates .hh and .hpp files respectively. There's no
|
||||
# good way of making a project that uses C++ yacc files compatible with
|
||||
# both versions of automake. Strong work automake developers.
|
||||
#
|
||||
# * Since we're generating code from .l/.y files in a subdirectory (glcpp/)
|
||||
# we'd like the resulting generated code to also go in glcpp/ for purposes
|
||||
# of distribution. Automake gives no way to do this.
|
||||
#
|
||||
# * Since we're building multiple yacc parsers into one library (and via one
|
||||
# Makefile) we have to use per-target YFLAGS. Using per-target YFLAGS causes
|
||||
# automake to name the resulting generated code as <library-name>_filename.c.
|
||||
# Frankly, that's ugly and we don't want a libglcpp_glcpp_parser.h file.
|
||||
|
||||
# In order to make build output print "LEX" and "YACC", we reproduce the
|
||||
# automake variables below.
|
||||
|
||||
AM_V_LEX = $(am__v_LEX_$(V))
|
||||
am__v_LEX_ = $(am__v_LEX_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_LEX_0 = @echo " LEX " $@;
|
||||
am__v_LEX_1 =
|
||||
|
||||
AM_V_YACC = $(am__v_YACC_$(V))
|
||||
am__v_YACC_ = $(am__v_YACC_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_YACC_0 = @echo " YACC " $@;
|
||||
am__v_YACC_1 =
|
||||
|
||||
MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
|
||||
YACC_GEN = $(AM_V_YACC)$(YACC) $(YFLAGS)
|
||||
LEX_GEN = $(AM_V_LEX)$(LEX) $(LFLAGS)
|
||||
|
||||
glsl/glsl_parser.cpp glsl/glsl_parser.h: glsl/glsl_parser.yy
|
||||
$(MKDIR_GEN)
|
||||
$(YACC_GEN) -o $@ -p "_mesa_glsl_" --defines=$(builddir)/glsl/glsl_parser.h $(srcdir)/glsl/glsl_parser.yy
|
||||
|
||||
glsl/glsl_lexer.cpp: glsl/glsl_lexer.ll
|
||||
$(MKDIR_GEN)
|
||||
$(LEX_GEN) -o $@ $(srcdir)/glsl/glsl_lexer.ll
|
||||
|
||||
glsl/glcpp/glcpp-parse.c glsl/glcpp/glcpp-parse.h: glsl/glcpp/glcpp-parse.y
|
||||
$(MKDIR_GEN)
|
||||
$(YACC_GEN) -o $@ -p "glcpp_parser_" --defines=$(builddir)/glsl/glcpp/glcpp-parse.h $(srcdir)/glsl/glcpp/glcpp-parse.y
|
||||
|
||||
glsl/glcpp/glcpp-lex.c: glsl/glcpp/glcpp-lex.l
|
||||
$(MKDIR_GEN)
|
||||
$(LEX_GEN) -o $@ $(srcdir)/glsl/glcpp/glcpp-lex.l
|
||||
|
||||
# Only the parsers (specifically the header files generated at the same time)
|
||||
# need to be in BUILT_SOURCES. Though if we list the parser headers YACC is
|
||||
# called for the .c/.cpp file and the .h files. By listing the .c/.cpp files
|
||||
# YACC is only executed once for each parser. The rest of the generated code
|
||||
# will be created at the appropriate times according to standard automake
|
||||
# dependency rules.
|
||||
BUILT_SOURCES += \
|
||||
glsl/glsl_parser.cpp \
|
||||
glsl/glsl_lexer.cpp \
|
||||
glsl/glcpp/glcpp-parse.c \
|
||||
glsl/glcpp/glcpp-lex.c
|
||||
CLEANFILES += \
|
||||
glsl/glcpp/glcpp-parse.h \
|
||||
glsl/glsl_parser.h \
|
||||
glsl/glsl_parser.cpp \
|
||||
glsl/glsl_lexer.cpp \
|
||||
glsl/glcpp/glcpp-parse.c \
|
||||
glsl/glcpp/glcpp-lex.c
|
||||
|
||||
clean-local:
|
||||
$(RM) -r subtest-cr subtest-cr-lf subtest-lf subtest-lf-cr
|
||||
|
||||
dist-hook:
|
||||
$(RM) glsl/glcpp/tests/*.out
|
||||
$(RM) glsl/glcpp/tests/subtest*/*.out
|
||||
|
||||
noinst_LTLIBRARIES += nir/libnir.la
|
||||
|
||||
nir_libnir_la_CPPFLAGS = \
|
||||
$(AM_CPPFLAGS) \
|
||||
-I$(top_builddir)/src/compiler/nir \
|
||||
-I$(top_srcdir)/src/compiler/nir
|
||||
|
||||
nir_libnir_la_LIBADD = \
|
||||
libcompiler.la
|
||||
|
||||
nir_libnir_la_SOURCES = \
|
||||
$(NIR_FILES) \
|
||||
$(NIR_GENERATED_FILES)
|
||||
|
||||
PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
|
||||
|
||||
nir/nir_builder_opcodes.h: nir/nir_opcodes.py nir/nir_builder_opcodes_h.py
|
||||
$(MKDIR_GEN)
|
||||
$(PYTHON_GEN) $(srcdir)/nir/nir_builder_opcodes_h.py > $@ || ($(RM) $@; false)
|
||||
|
||||
nir/nir_constant_expressions.c: nir/nir_opcodes.py nir/nir_constant_expressions.py
|
||||
$(MKDIR_GEN)
|
||||
$(PYTHON_GEN) $(srcdir)/nir/nir_constant_expressions.py > $@ || ($(RM) $@; false)
|
||||
|
||||
nir/nir_opcodes.h: nir/nir_opcodes.py nir/nir_opcodes_h.py
|
||||
$(MKDIR_GEN)
|
||||
$(PYTHON_GEN) $(srcdir)/nir/nir_opcodes_h.py > $@ || ($(RM) $@; false)
|
||||
|
||||
nir/nir_opcodes.c: nir/nir_opcodes.py nir/nir_opcodes_c.py
|
||||
$(MKDIR_GEN)
|
||||
$(PYTHON_GEN) $(srcdir)/nir/nir_opcodes_c.py > $@ || ($(RM) $@; false)
|
||||
|
||||
nir/nir_opt_algebraic.c: nir/nir_opt_algebraic.py nir/nir_algebraic.py
|
||||
$(MKDIR_GEN)
|
||||
$(PYTHON_GEN) $(srcdir)/nir/nir_opt_algebraic.py > $@ || ($(RM) $@; false)
|
||||
|
||||
|
||||
check_PROGRAMS += nir/tests/control_flow_tests
|
||||
|
||||
nir_tests_control_flow_tests_CPPFLAGS = \
|
||||
$(AM_CPPFLAGS) \
|
||||
-I$(top_builddir)/src/compiler/nir \
|
||||
-I$(top_srcdir)/src/compiler/nir
|
||||
|
||||
nir_tests_control_flow_tests_SOURCES = \
|
||||
nir/tests/control_flow_tests.cpp
|
||||
nir_tests_control_flow_tests_CFLAGS = \
|
||||
$(PTHREAD_CFLAGS)
|
||||
nir_tests_control_flow_tests_LDADD = \
|
||||
$(top_builddir)/src/gtest/libgtest.la \
|
||||
nir/libnir.la \
|
||||
$(top_builddir)/src/util/libmesautil.la \
|
||||
$(PTHREAD_LIBS)
|
||||
|
||||
|
||||
TESTS += nir/tests/control_flow_tests
|
||||
|
||||
|
||||
BUILT_SOURCES += $(NIR_GENERATED_FILES)
|
||||
CLEANFILES += $(NIR_GENERATED_FILES)
|
||||
|
||||
EXTRA_DIST += \
|
||||
nir/nir_algebraic.py \
|
||||
nir/nir_builder_opcodes_h.py \
|
||||
nir/nir_constant_expressions.py \
|
||||
nir/nir_opcodes.py \
|
||||
nir/nir_opcodes_c.py \
|
||||
nir/nir_opcodes_h.py \
|
||||
nir/nir_opt_algebraic.py \
|
||||
nir/tests \
|
||||
nir/Makefile.sources
|
||||
@@ -1,226 +0,0 @@
|
||||
LIBCOMPILER_FILES = \
|
||||
builtin_type_macros.h \
|
||||
glsl_types.cpp \
|
||||
glsl_types.h \
|
||||
nir_types.cpp \
|
||||
nir_types.h \
|
||||
shader_enums.c \
|
||||
shader_enums.h
|
||||
|
||||
# libglsl
|
||||
|
||||
LIBGLSL_FILES = \
|
||||
glsl/ast.h \
|
||||
glsl/ast_array_index.cpp \
|
||||
glsl/ast_expr.cpp \
|
||||
glsl/ast_function.cpp \
|
||||
glsl/ast_to_hir.cpp \
|
||||
glsl/ast_type.cpp \
|
||||
glsl/blob.c \
|
||||
glsl/blob.h \
|
||||
glsl/builtin_functions.cpp \
|
||||
glsl/builtin_types.cpp \
|
||||
glsl/builtin_variables.cpp \
|
||||
glsl/glsl_parser_extras.cpp \
|
||||
glsl/glsl_parser_extras.h \
|
||||
glsl/glsl_symbol_table.cpp \
|
||||
glsl/glsl_symbol_table.h \
|
||||
glsl/hir_field_selection.cpp \
|
||||
glsl/ir_basic_block.cpp \
|
||||
glsl/ir_basic_block.h \
|
||||
glsl/ir_builder.cpp \
|
||||
glsl/ir_builder.h \
|
||||
glsl/ir_clone.cpp \
|
||||
glsl/ir_constant_expression.cpp \
|
||||
glsl/ir.cpp \
|
||||
glsl/ir.h \
|
||||
glsl/ir_equals.cpp \
|
||||
glsl/ir_expression_flattening.cpp \
|
||||
glsl/ir_expression_flattening.h \
|
||||
glsl/ir_function_can_inline.cpp \
|
||||
glsl/ir_function_detect_recursion.cpp \
|
||||
glsl/ir_function_inlining.h \
|
||||
glsl/ir_function.cpp \
|
||||
glsl/ir_hierarchical_visitor.cpp \
|
||||
glsl/ir_hierarchical_visitor.h \
|
||||
glsl/ir_hv_accept.cpp \
|
||||
glsl/ir_import_prototypes.cpp \
|
||||
glsl/ir_optimization.h \
|
||||
glsl/ir_print_visitor.cpp \
|
||||
glsl/ir_print_visitor.h \
|
||||
glsl/ir_reader.cpp \
|
||||
glsl/ir_reader.h \
|
||||
glsl/ir_rvalue_visitor.cpp \
|
||||
glsl/ir_rvalue_visitor.h \
|
||||
glsl/ir_set_program_inouts.cpp \
|
||||
glsl/ir_uniform.h \
|
||||
glsl/ir_validate.cpp \
|
||||
glsl/ir_variable_refcount.cpp \
|
||||
glsl/ir_variable_refcount.h \
|
||||
glsl/ir_visitor.h \
|
||||
glsl/linker.cpp \
|
||||
glsl/linker.h \
|
||||
glsl/link_atomics.cpp \
|
||||
glsl/link_functions.cpp \
|
||||
glsl/link_interface_blocks.cpp \
|
||||
glsl/link_uniforms.cpp \
|
||||
glsl/link_uniform_initializers.cpp \
|
||||
glsl/link_uniform_block_active_visitor.cpp \
|
||||
glsl/link_uniform_block_active_visitor.h \
|
||||
glsl/link_uniform_blocks.cpp \
|
||||
glsl/link_varyings.cpp \
|
||||
glsl/link_varyings.h \
|
||||
glsl/list.h \
|
||||
glsl/loop_analysis.cpp \
|
||||
glsl/loop_analysis.h \
|
||||
glsl/loop_controls.cpp \
|
||||
glsl/loop_unroll.cpp \
|
||||
glsl/lower_buffer_access.cpp \
|
||||
glsl/lower_buffer_access.h \
|
||||
glsl/lower_clip_distance.cpp \
|
||||
glsl/lower_const_arrays_to_uniforms.cpp \
|
||||
glsl/lower_discard.cpp \
|
||||
glsl/lower_discard_flow.cpp \
|
||||
glsl/lower_if_to_cond_assign.cpp \
|
||||
glsl/lower_instructions.cpp \
|
||||
glsl/lower_jumps.cpp \
|
||||
glsl/lower_mat_op_to_vec.cpp \
|
||||
glsl/lower_noise.cpp \
|
||||
glsl/lower_offset_array.cpp \
|
||||
glsl/lower_packed_varyings.cpp \
|
||||
glsl/lower_named_interface_blocks.cpp \
|
||||
glsl/lower_packing_builtins.cpp \
|
||||
glsl/lower_subroutine.cpp \
|
||||
glsl/lower_tess_level.cpp \
|
||||
glsl/lower_texture_projection.cpp \
|
||||
glsl/lower_variable_index_to_cond_assign.cpp \
|
||||
glsl/lower_vec_index_to_cond_assign.cpp \
|
||||
glsl/lower_vec_index_to_swizzle.cpp \
|
||||
glsl/lower_vector.cpp \
|
||||
glsl/lower_vector_derefs.cpp \
|
||||
glsl/lower_vector_insert.cpp \
|
||||
glsl/lower_vertex_id.cpp \
|
||||
glsl/lower_output_reads.cpp \
|
||||
glsl/lower_shared_reference.cpp \
|
||||
glsl/lower_ubo_reference.cpp \
|
||||
glsl/opt_algebraic.cpp \
|
||||
glsl/opt_array_splitting.cpp \
|
||||
glsl/opt_conditional_discard.cpp \
|
||||
glsl/opt_constant_folding.cpp \
|
||||
glsl/opt_constant_propagation.cpp \
|
||||
glsl/opt_constant_variable.cpp \
|
||||
glsl/opt_copy_propagation.cpp \
|
||||
glsl/opt_copy_propagation_elements.cpp \
|
||||
glsl/opt_dead_builtin_variables.cpp \
|
||||
glsl/opt_dead_builtin_varyings.cpp \
|
||||
glsl/opt_dead_code.cpp \
|
||||
glsl/opt_dead_code_local.cpp \
|
||||
glsl/opt_dead_functions.cpp \
|
||||
glsl/opt_flatten_nested_if_blocks.cpp \
|
||||
glsl/opt_flip_matrices.cpp \
|
||||
glsl/opt_function_inlining.cpp \
|
||||
glsl/opt_if_simplification.cpp \
|
||||
glsl/opt_minmax.cpp \
|
||||
glsl/opt_noop_swizzle.cpp \
|
||||
glsl/opt_rebalance_tree.cpp \
|
||||
glsl/opt_redundant_jumps.cpp \
|
||||
glsl/opt_structure_splitting.cpp \
|
||||
glsl/opt_swizzle_swizzle.cpp \
|
||||
glsl/opt_tree_grafting.cpp \
|
||||
glsl/opt_vectorize.cpp \
|
||||
glsl/program.h \
|
||||
glsl/s_expression.cpp \
|
||||
glsl/s_expression.h
|
||||
|
||||
# glsl_compiler
|
||||
|
||||
GLSL_COMPILER_CXX_FILES = \
|
||||
glsl/standalone_scaffolding.cpp \
|
||||
glsl/standalone_scaffolding.h \
|
||||
glsl/main.cpp
|
||||
|
||||
# libglsl generated sources
|
||||
LIBGLSL_GENERATED_CXX_FILES = \
|
||||
glsl/glsl_lexer.cpp \
|
||||
glsl/glsl_parser.cpp
|
||||
|
||||
# libglcpp
|
||||
|
||||
LIBGLCPP_FILES = \
|
||||
glsl/glcpp/glcpp.h \
|
||||
glsl/glcpp/pp.c
|
||||
|
||||
LIBGLCPP_GENERATED_FILES = \
|
||||
glsl/glcpp/glcpp-lex.c \
|
||||
glsl/glcpp/glcpp-parse.c
|
||||
|
||||
NIR_GENERATED_FILES = \
|
||||
nir/nir_builder_opcodes.h \
|
||||
nir/nir_constant_expressions.c \
|
||||
nir/nir_opcodes.c \
|
||||
nir/nir_opcodes.h \
|
||||
nir/nir_opt_algebraic.c
|
||||
|
||||
NIR_FILES = \
|
||||
nir/glsl_to_nir.cpp \
|
||||
nir/glsl_to_nir.h \
|
||||
nir/nir.c \
|
||||
nir/nir.h \
|
||||
nir/nir_array.h \
|
||||
nir/nir_builder.h \
|
||||
nir/nir_clone.c \
|
||||
nir/nir_constant_expressions.h \
|
||||
nir/nir_control_flow.c \
|
||||
nir/nir_control_flow.h \
|
||||
nir/nir_control_flow_private.h \
|
||||
nir/nir_dominance.c \
|
||||
nir/nir_from_ssa.c \
|
||||
nir/nir_gs_count_vertices.c \
|
||||
nir/nir_intrinsics.c \
|
||||
nir/nir_intrinsics.h \
|
||||
nir/nir_instr_set.c \
|
||||
nir/nir_instr_set.h \
|
||||
nir/nir_liveness.c \
|
||||
nir/nir_lower_alu_to_scalar.c \
|
||||
nir/nir_lower_atomics.c \
|
||||
nir/nir_lower_clip.c \
|
||||
nir/nir_lower_global_vars_to_local.c \
|
||||
nir/nir_lower_gs_intrinsics.c \
|
||||
nir/nir_lower_load_const_to_scalar.c \
|
||||
nir/nir_lower_locals_to_regs.c \
|
||||
nir/nir_lower_idiv.c \
|
||||
nir/nir_lower_io.c \
|
||||
nir/nir_lower_outputs_to_temporaries.c \
|
||||
nir/nir_lower_phis_to_scalar.c \
|
||||
nir/nir_lower_samplers.c \
|
||||
nir/nir_lower_system_values.c \
|
||||
nir/nir_lower_tex.c \
|
||||
nir/nir_lower_to_source_mods.c \
|
||||
nir/nir_lower_two_sided_color.c \
|
||||
nir/nir_lower_vars_to_ssa.c \
|
||||
nir/nir_lower_var_copies.c \
|
||||
nir/nir_lower_vec_to_movs.c \
|
||||
nir/nir_metadata.c \
|
||||
nir/nir_move_vec_src_uses_to_dest.c \
|
||||
nir/nir_normalize_cubemap_coords.c \
|
||||
nir/nir_opt_constant_folding.c \
|
||||
nir/nir_opt_copy_propagate.c \
|
||||
nir/nir_opt_cse.c \
|
||||
nir/nir_opt_dce.c \
|
||||
nir/nir_opt_dead_cf.c \
|
||||
nir/nir_opt_gcm.c \
|
||||
nir/nir_opt_global_to_local.c \
|
||||
nir/nir_opt_peephole_select.c \
|
||||
nir/nir_opt_remove_phis.c \
|
||||
nir/nir_opt_undef.c \
|
||||
nir/nir_print.c \
|
||||
nir/nir_remove_dead_variables.c \
|
||||
nir/nir_search.c \
|
||||
nir/nir_search.h \
|
||||
nir/nir_split_var_copies.c \
|
||||
nir/nir_sweep.c \
|
||||
nir/nir_to_ssa.c \
|
||||
nir/nir_validate.c \
|
||||
nir/nir_vla.h \
|
||||
nir/nir_worklist.c \
|
||||
nir/nir_worklist.h
|
||||
@@ -1,24 +0,0 @@
|
||||
Import('*')
|
||||
|
||||
env = env.Clone()
|
||||
|
||||
env.MSVC2013Compat()
|
||||
|
||||
env.Prepend(CPPPATH = [
|
||||
'#include',
|
||||
'#src',
|
||||
'#src/mapi',
|
||||
'#src/mesa',
|
||||
'#src/gallium/include',
|
||||
'#src/gallium/auxiliary',
|
||||
])
|
||||
|
||||
sources = env.ParseSourceList('Makefile.sources', 'LIBCOMPILER_FILES')
|
||||
|
||||
compiler = env.ConvenienceLibrary(
|
||||
target = 'compiler',
|
||||
source = sources
|
||||
)
|
||||
Export('compiler')
|
||||
|
||||
SConscript('glsl/SConscript')
|
||||
@@ -1,78 +0,0 @@
|
||||
# Mesa 3-D graphics library
|
||||
#
|
||||
# Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
|
||||
# Copyright (C) 2010-2011 LunarG Inc.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# included by glsl Android.mk for source generation
|
||||
|
||||
ifeq ($(LOCAL_MODULE_CLASS),)
|
||||
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
|
||||
endif
|
||||
|
||||
intermediates := $(call local-generated-sources-dir)
|
||||
|
||||
LOCAL_SRC_FILES := $(LOCAL_SRC_FILES)
|
||||
|
||||
LOCAL_C_INCLUDES += \
|
||||
$(intermediates)/glcpp \
|
||||
$(LOCAL_PATH)/glcpp \
|
||||
|
||||
LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
|
||||
$(LIBGLCPP_GENERATED_FILES) \
|
||||
$(LIBGLSL_GENERATED_CXX_FILES))
|
||||
|
||||
define local-l-or-ll-to-c-or-cpp
|
||||
@mkdir -p $(dir $@)
|
||||
@echo "Mesa Lex: $(PRIVATE_MODULE) <= $<"
|
||||
$(hide) $(LEX) --nounistd -o$@ $<
|
||||
endef
|
||||
|
||||
define glsl_local-y-to-c-and-h
|
||||
@mkdir -p $(dir $@)
|
||||
@echo "Mesa Yacc: $(PRIVATE_MODULE) <= $<"
|
||||
$(hide) $(YACC) -o $@ -p "glcpp_parser_" $<
|
||||
endef
|
||||
|
||||
YACC_HEADER_SUFFIX := .hpp
|
||||
|
||||
define local-yy-to-cpp-and-h
|
||||
@mkdir -p $(dir $@)
|
||||
@echo "Mesa Yacc: $(PRIVATE_MODULE) <= $<"
|
||||
$(hide) $(YACC) -p "_mesa_glsl_" -o $@ $<
|
||||
touch $(@:$1=$(YACC_HEADER_SUFFIX))
|
||||
echo '#ifndef '$(@F:$1=_h) > $(@:$1=.h)
|
||||
echo '#define '$(@F:$1=_h) >> $(@:$1=.h)
|
||||
cat $(@:$1=$(YACC_HEADER_SUFFIX)) >> $(@:$1=.h)
|
||||
echo '#endif' >> $(@:$1=.h)
|
||||
rm -f $(@:$1=$(YACC_HEADER_SUFFIX))
|
||||
endef
|
||||
|
||||
$(intermediates)/glsl_lexer.cpp: $(LOCAL_PATH)/glsl_lexer.ll
|
||||
$(call local-l-or-ll-to-c-or-cpp)
|
||||
|
||||
$(intermediates)/glsl_parser.cpp: $(LOCAL_PATH)/glsl_parser.yy
|
||||
$(call local-yy-to-cpp-and-h,.cpp)
|
||||
|
||||
$(intermediates)/glcpp/glcpp-lex.c: $(LOCAL_PATH)/glcpp/glcpp-lex.l
|
||||
$(call local-l-or-ll-to-c-or-cpp)
|
||||
|
||||
$(intermediates)/glcpp/glcpp-parse.c: $(LOCAL_PATH)/glcpp/glcpp-parse.y
|
||||
$(call glsl_local-y-to-c-and-h)
|
||||
@@ -1,494 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file lower_buffer_access.cpp
|
||||
*
|
||||
* Helper for IR lowering pass to replace dereferences of buffer object based
|
||||
* shader variables with intrinsic function calls.
|
||||
*
|
||||
* This helper is used by lowering passes for UBOs, SSBOs and compute shader
|
||||
* shared variables.
|
||||
*/
|
||||
|
||||
#include "lower_buffer_access.h"
|
||||
#include "ir_builder.h"
|
||||
#include "main/macros.h"
|
||||
#include "util/list.h"
|
||||
#include "glsl_parser_extras.h"
|
||||
|
||||
using namespace ir_builder;
|
||||
|
||||
namespace lower_buffer_access {
|
||||
|
||||
static inline int
|
||||
writemask_for_size(unsigned n)
|
||||
{
|
||||
return ((1 << n) - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes a deref and recursively calls itself to break the deref down to the
|
||||
* point that the reads or writes generated are contiguous scalars or vectors.
|
||||
*/
|
||||
void
|
||||
lower_buffer_access::emit_access(void *mem_ctx,
|
||||
bool is_write,
|
||||
ir_dereference *deref,
|
||||
ir_variable *base_offset,
|
||||
unsigned int deref_offset,
|
||||
bool row_major,
|
||||
int matrix_columns,
|
||||
unsigned int packing,
|
||||
unsigned int write_mask)
|
||||
{
|
||||
if (deref->type->is_record()) {
|
||||
unsigned int field_offset = 0;
|
||||
|
||||
for (unsigned i = 0; i < deref->type->length; i++) {
|
||||
const struct glsl_struct_field *field =
|
||||
&deref->type->fields.structure[i];
|
||||
ir_dereference *field_deref =
|
||||
new(mem_ctx) ir_dereference_record(deref->clone(mem_ctx, NULL),
|
||||
field->name);
|
||||
|
||||
field_offset =
|
||||
glsl_align(field_offset,
|
||||
field->type->std140_base_alignment(row_major));
|
||||
|
||||
emit_access(mem_ctx, is_write, field_deref, base_offset,
|
||||
deref_offset + field_offset,
|
||||
row_major, 1, packing,
|
||||
writemask_for_size(field_deref->type->vector_elements));
|
||||
|
||||
field_offset += field->type->std140_size(row_major);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (deref->type->is_array()) {
|
||||
unsigned array_stride = packing == GLSL_INTERFACE_PACKING_STD430 ?
|
||||
deref->type->fields.array->std430_array_stride(row_major) :
|
||||
glsl_align(deref->type->fields.array->std140_size(row_major), 16);
|
||||
|
||||
for (unsigned i = 0; i < deref->type->length; i++) {
|
||||
ir_constant *element = new(mem_ctx) ir_constant(i);
|
||||
ir_dereference *element_deref =
|
||||
new(mem_ctx) ir_dereference_array(deref->clone(mem_ctx, NULL),
|
||||
element);
|
||||
emit_access(mem_ctx, is_write, element_deref, base_offset,
|
||||
deref_offset + i * array_stride,
|
||||
row_major, 1, packing,
|
||||
writemask_for_size(element_deref->type->vector_elements));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (deref->type->is_matrix()) {
|
||||
for (unsigned i = 0; i < deref->type->matrix_columns; i++) {
|
||||
ir_constant *col = new(mem_ctx) ir_constant(i);
|
||||
ir_dereference *col_deref =
|
||||
new(mem_ctx) ir_dereference_array(deref->clone(mem_ctx, NULL), col);
|
||||
|
||||
if (row_major) {
|
||||
/* For a row-major matrix, the next column starts at the next
|
||||
* element.
|
||||
*/
|
||||
int size_mul = deref->type->is_double() ? 8 : 4;
|
||||
emit_access(mem_ctx, is_write, col_deref, base_offset,
|
||||
deref_offset + i * size_mul,
|
||||
row_major, deref->type->matrix_columns, packing,
|
||||
writemask_for_size(col_deref->type->vector_elements));
|
||||
} else {
|
||||
int size_mul;
|
||||
|
||||
/* std430 doesn't round up vec2 size to a vec4 size */
|
||||
if (packing == GLSL_INTERFACE_PACKING_STD430 &&
|
||||
deref->type->vector_elements == 2 &&
|
||||
!deref->type->is_double()) {
|
||||
size_mul = 8;
|
||||
} else {
|
||||
/* std140 always rounds the stride of arrays (and matrices) to a
|
||||
* vec4, so matrices are always 16 between columns/rows. With
|
||||
* doubles, they will be 32 apart when there are more than 2 rows.
|
||||
*
|
||||
* For both std140 and std430, if the member is a
|
||||
* three-'component vector with components consuming N basic
|
||||
* machine units, the base alignment is 4N. For vec4, base
|
||||
* alignment is 4N.
|
||||
*/
|
||||
size_mul = (deref->type->is_double() &&
|
||||
deref->type->vector_elements > 2) ? 32 : 16;
|
||||
}
|
||||
|
||||
emit_access(mem_ctx, is_write, col_deref, base_offset,
|
||||
deref_offset + i * size_mul,
|
||||
row_major, deref->type->matrix_columns, packing,
|
||||
writemask_for_size(col_deref->type->vector_elements));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
assert(deref->type->is_scalar() || deref->type->is_vector());
|
||||
|
||||
if (!row_major) {
|
||||
ir_rvalue *offset =
|
||||
add(base_offset, new(mem_ctx) ir_constant(deref_offset));
|
||||
unsigned mask =
|
||||
is_write ? write_mask : (1 << deref->type->vector_elements) - 1;
|
||||
insert_buffer_access(mem_ctx, deref, deref->type, offset, mask, -1);
|
||||
} else {
|
||||
unsigned N = deref->type->is_double() ? 8 : 4;
|
||||
|
||||
/* We're dereffing a column out of a row-major matrix, so we
|
||||
* gather the vector from each stored row.
|
||||
*/
|
||||
assert(deref->type->base_type == GLSL_TYPE_FLOAT ||
|
||||
deref->type->base_type == GLSL_TYPE_DOUBLE);
|
||||
/* Matrices, row_major or not, are stored as if they were
|
||||
* arrays of vectors of the appropriate size in std140.
|
||||
* Arrays have their strides rounded up to a vec4, so the
|
||||
* matrix stride is always 16. However a double matrix may either be 16
|
||||
* or 32 depending on the number of columns.
|
||||
*/
|
||||
assert(matrix_columns <= 4);
|
||||
unsigned matrix_stride = 0;
|
||||
/* Matrix stride for std430 mat2xY matrices are not rounded up to
|
||||
* vec4 size. From OpenGL 4.3 spec, section 7.6.2.2 "Standard Uniform
|
||||
* Block Layout":
|
||||
*
|
||||
* "2. If the member is a two- or four-component vector with components
|
||||
* consuming N basic machine units, the base alignment is 2N or 4N,
|
||||
* respectively." [...]
|
||||
* "4. If the member is an array of scalars or vectors, the base alignment
|
||||
* and array stride are set to match the base alignment of a single array
|
||||
* element, according to rules (1), (2), and (3), and rounded up to the
|
||||
* base alignment of a vec4." [...]
|
||||
* "7. If the member is a row-major matrix with C columns and R rows, the
|
||||
* matrix is stored identically to an array of R row vectors with C
|
||||
* components each, according to rule (4)." [...]
|
||||
* "When using the std430 storage layout, shader storage blocks will be
|
||||
* laid out in buffer storage identically to uniform and shader storage
|
||||
* blocks using the std140 layout, except that the base alignment and
|
||||
* stride of arrays of scalars and vectors in rule 4 and of structures in
|
||||
* rule 9 are not rounded up a multiple of the base alignment of a vec4."
|
||||
*/
|
||||
if (packing == GLSL_INTERFACE_PACKING_STD430 && matrix_columns == 2)
|
||||
matrix_stride = 2 * N;
|
||||
else
|
||||
matrix_stride = glsl_align(matrix_columns * N, 16);
|
||||
|
||||
const glsl_type *deref_type = deref->type->base_type == GLSL_TYPE_FLOAT ?
|
||||
glsl_type::float_type : glsl_type::double_type;
|
||||
|
||||
for (unsigned i = 0; i < deref->type->vector_elements; i++) {
|
||||
ir_rvalue *chan_offset =
|
||||
add(base_offset,
|
||||
new(mem_ctx) ir_constant(deref_offset + i * matrix_stride));
|
||||
if (!is_write || ((1U << i) & write_mask))
|
||||
insert_buffer_access(mem_ctx, deref, deref_type, chan_offset,
|
||||
(1U << i), i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a thing being dereferenced is row-major
|
||||
*
|
||||
* There is some trickery here.
|
||||
*
|
||||
* If the thing being dereferenced is a member of uniform block \b without an
|
||||
* instance name, then the name of the \c ir_variable is the field name of an
|
||||
* interface type. If this field is row-major, then the thing referenced is
|
||||
* row-major.
|
||||
*
|
||||
* If the thing being dereferenced is a member of uniform block \b with an
|
||||
* instance name, then the last dereference in the tree will be an
|
||||
* \c ir_dereference_record. If that record field is row-major, then the
|
||||
* thing referenced is row-major.
|
||||
*/
|
||||
bool
|
||||
lower_buffer_access::is_dereferenced_thing_row_major(const ir_rvalue *deref)
|
||||
{
|
||||
bool matrix = false;
|
||||
const ir_rvalue *ir = deref;
|
||||
|
||||
while (true) {
|
||||
matrix = matrix || ir->type->without_array()->is_matrix();
|
||||
|
||||
switch (ir->ir_type) {
|
||||
case ir_type_dereference_array: {
|
||||
const ir_dereference_array *const array_deref =
|
||||
(const ir_dereference_array *) ir;
|
||||
|
||||
ir = array_deref->array;
|
||||
break;
|
||||
}
|
||||
|
||||
case ir_type_dereference_record: {
|
||||
const ir_dereference_record *const record_deref =
|
||||
(const ir_dereference_record *) ir;
|
||||
|
||||
ir = record_deref->record;
|
||||
|
||||
const int idx = ir->type->field_index(record_deref->field);
|
||||
assert(idx >= 0);
|
||||
|
||||
const enum glsl_matrix_layout matrix_layout =
|
||||
glsl_matrix_layout(ir->type->fields.structure[idx].matrix_layout);
|
||||
|
||||
switch (matrix_layout) {
|
||||
case GLSL_MATRIX_LAYOUT_INHERITED:
|
||||
break;
|
||||
case GLSL_MATRIX_LAYOUT_COLUMN_MAJOR:
|
||||
return false;
|
||||
case GLSL_MATRIX_LAYOUT_ROW_MAJOR:
|
||||
return matrix || deref->type->without_array()->is_record();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case ir_type_dereference_variable: {
|
||||
const ir_dereference_variable *const var_deref =
|
||||
(const ir_dereference_variable *) ir;
|
||||
|
||||
const enum glsl_matrix_layout matrix_layout =
|
||||
glsl_matrix_layout(var_deref->var->data.matrix_layout);
|
||||
|
||||
switch (matrix_layout) {
|
||||
case GLSL_MATRIX_LAYOUT_INHERITED: {
|
||||
/* For interface block matrix variables we handle inherited
|
||||
* layouts at HIR generation time, but we don't do that for shared
|
||||
* variables, which are always column-major
|
||||
*/
|
||||
ir_variable *var = deref->variable_referenced();
|
||||
assert((var->is_in_buffer_block() && !matrix) ||
|
||||
var->data.mode == ir_var_shader_shared);
|
||||
return false;
|
||||
}
|
||||
case GLSL_MATRIX_LAYOUT_COLUMN_MAJOR:
|
||||
return false;
|
||||
case GLSL_MATRIX_LAYOUT_ROW_MAJOR:
|
||||
return matrix || deref->type->without_array()->is_record();
|
||||
}
|
||||
|
||||
unreachable("invalid matrix layout");
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* The tree must have ended with a dereference that wasn't an
|
||||
* ir_dereference_variable. That is invalid, and it should be impossible.
|
||||
*/
|
||||
unreachable("invalid dereference tree");
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function initializes various values that will be used later by
|
||||
* emit_access when actually emitting loads or stores.
|
||||
*
|
||||
* Note: const_offset is an input as well as an output, clients must
|
||||
* initialize it to the offset of the variable in the underlying block, and
|
||||
* this function will adjust it by adding the constant offset of the member
|
||||
* being accessed into that variable.
|
||||
*/
|
||||
void
|
||||
lower_buffer_access::setup_buffer_access(void *mem_ctx,
|
||||
ir_variable *var,
|
||||
ir_rvalue *deref,
|
||||
ir_rvalue **offset,
|
||||
unsigned *const_offset,
|
||||
bool *row_major,
|
||||
int *matrix_columns,
|
||||
const glsl_struct_field **struct_field,
|
||||
unsigned packing)
|
||||
{
|
||||
*offset = new(mem_ctx) ir_constant(0u);
|
||||
*row_major = is_dereferenced_thing_row_major(deref);
|
||||
*matrix_columns = 1;
|
||||
|
||||
/* Calculate the offset to the start of the region of the UBO
|
||||
* dereferenced by *rvalue. This may be a variable offset if an
|
||||
* array dereference has a variable index.
|
||||
*/
|
||||
while (deref) {
|
||||
switch (deref->ir_type) {
|
||||
case ir_type_dereference_variable: {
|
||||
deref = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
case ir_type_dereference_array: {
|
||||
ir_dereference_array *deref_array = (ir_dereference_array *) deref;
|
||||
unsigned array_stride;
|
||||
if (deref_array->array->type->is_vector()) {
|
||||
/* We get this when storing or loading a component out of a vector
|
||||
* with a non-constant index. This happens for v[i] = f where v is
|
||||
* a vector (or m[i][j] = f where m is a matrix). If we don't
|
||||
* lower that here, it gets turned into v = vector_insert(v, i,
|
||||
* f), which loads the entire vector, modifies one component and
|
||||
* then write the entire thing back. That breaks if another
|
||||
* thread or SIMD channel is modifying the same vector.
|
||||
*/
|
||||
array_stride = 4;
|
||||
if (deref_array->array->type->is_double())
|
||||
array_stride *= 2;
|
||||
} else if (deref_array->array->type->is_matrix() && *row_major) {
|
||||
/* When loading a vector out of a row major matrix, the
|
||||
* step between the columns (vectors) is the size of a
|
||||
* float, while the step between the rows (elements of a
|
||||
* vector) is handled below in emit_ubo_loads.
|
||||
*/
|
||||
array_stride = 4;
|
||||
if (deref_array->array->type->is_double())
|
||||
array_stride *= 2;
|
||||
*matrix_columns = deref_array->array->type->matrix_columns;
|
||||
} else if (deref_array->type->without_array()->is_interface()) {
|
||||
/* We're processing an array dereference of an interface instance
|
||||
* array. The thing being dereferenced *must* be a variable
|
||||
* dereference because interfaces cannot be embedded in other
|
||||
* types. In terms of calculating the offsets for the lowering
|
||||
* pass, we don't care about the array index. All elements of an
|
||||
* interface instance array will have the same offsets relative to
|
||||
* the base of the block that backs them.
|
||||
*/
|
||||
deref = deref_array->array->as_dereference();
|
||||
break;
|
||||
} else {
|
||||
/* Whether or not the field is row-major (because it might be a
|
||||
* bvec2 or something) does not affect the array itself. We need
|
||||
* to know whether an array element in its entirety is row-major.
|
||||
*/
|
||||
const bool array_row_major =
|
||||
is_dereferenced_thing_row_major(deref_array);
|
||||
|
||||
/* The array type will give the correct interface packing
|
||||
* information
|
||||
*/
|
||||
if (packing == GLSL_INTERFACE_PACKING_STD430) {
|
||||
array_stride = deref_array->type->std430_array_stride(array_row_major);
|
||||
} else {
|
||||
array_stride = deref_array->type->std140_size(array_row_major);
|
||||
array_stride = glsl_align(array_stride, 16);
|
||||
}
|
||||
}
|
||||
|
||||
ir_rvalue *array_index = deref_array->array_index;
|
||||
if (array_index->type->base_type == GLSL_TYPE_INT)
|
||||
array_index = i2u(array_index);
|
||||
|
||||
ir_constant *const_index =
|
||||
array_index->constant_expression_value(NULL);
|
||||
if (const_index) {
|
||||
*const_offset += array_stride * const_index->value.u[0];
|
||||
} else {
|
||||
*offset = add(*offset,
|
||||
mul(array_index,
|
||||
new(mem_ctx) ir_constant(array_stride)));
|
||||
}
|
||||
deref = deref_array->array->as_dereference();
|
||||
break;
|
||||
}
|
||||
|
||||
case ir_type_dereference_record: {
|
||||
ir_dereference_record *deref_record = (ir_dereference_record *) deref;
|
||||
const glsl_type *struct_type = deref_record->record->type;
|
||||
unsigned intra_struct_offset = 0;
|
||||
|
||||
for (unsigned int i = 0; i < struct_type->length; i++) {
|
||||
const glsl_type *type = struct_type->fields.structure[i].type;
|
||||
|
||||
ir_dereference_record *field_deref = new(mem_ctx)
|
||||
ir_dereference_record(deref_record->record,
|
||||
struct_type->fields.structure[i].name);
|
||||
const bool field_row_major =
|
||||
is_dereferenced_thing_row_major(field_deref);
|
||||
|
||||
ralloc_free(field_deref);
|
||||
|
||||
unsigned field_align = 0;
|
||||
|
||||
if (packing == GLSL_INTERFACE_PACKING_STD430)
|
||||
field_align = type->std430_base_alignment(field_row_major);
|
||||
else
|
||||
field_align = type->std140_base_alignment(field_row_major);
|
||||
|
||||
intra_struct_offset = glsl_align(intra_struct_offset, field_align);
|
||||
|
||||
if (strcmp(struct_type->fields.structure[i].name,
|
||||
deref_record->field) == 0) {
|
||||
if (struct_field)
|
||||
*struct_field = &struct_type->fields.structure[i];
|
||||
break;
|
||||
}
|
||||
|
||||
if (packing == GLSL_INTERFACE_PACKING_STD430)
|
||||
intra_struct_offset += type->std430_size(field_row_major);
|
||||
else
|
||||
intra_struct_offset += type->std140_size(field_row_major);
|
||||
|
||||
/* If the field just examined was itself a structure, apply rule
|
||||
* #9:
|
||||
*
|
||||
* "The structure may have padding at the end; the base offset
|
||||
* of the member following the sub-structure is rounded up to
|
||||
* the next multiple of the base alignment of the structure."
|
||||
*/
|
||||
if (type->without_array()->is_record()) {
|
||||
intra_struct_offset = glsl_align(intra_struct_offset,
|
||||
field_align);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
*const_offset += intra_struct_offset;
|
||||
deref = deref_record->record->as_dereference();
|
||||
break;
|
||||
}
|
||||
|
||||
case ir_type_swizzle: {
|
||||
ir_swizzle *deref_swizzle = (ir_swizzle *) deref;
|
||||
|
||||
assert(deref_swizzle->mask.num_components == 1);
|
||||
|
||||
*const_offset += deref_swizzle->mask.x * sizeof(int);
|
||||
deref = deref_swizzle->val->as_dereference();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
assert(!"not reached");
|
||||
deref = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} /* namespace lower_buffer_access */
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file lower_buffer_access.h
|
||||
*
|
||||
* Helper for IR lowering pass to replace dereferences of buffer object based
|
||||
* shader variables with intrinsic function calls.
|
||||
*
|
||||
* This helper is used by lowering passes for UBOs, SSBOs and compute shader
|
||||
* shared variables.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef LOWER_BUFFER_ACCESS_H
|
||||
#define LOWER_BUFFER_ACCESS_H
|
||||
|
||||
#include "ir.h"
|
||||
#include "ir_rvalue_visitor.h"
|
||||
|
||||
namespace lower_buffer_access {
|
||||
|
||||
class lower_buffer_access : public ir_rvalue_enter_visitor {
|
||||
public:
|
||||
virtual void
|
||||
insert_buffer_access(void *mem_ctx, ir_dereference *deref,
|
||||
const glsl_type *type, ir_rvalue *offset,
|
||||
unsigned mask, int channel) = 0;
|
||||
|
||||
void emit_access(void *mem_ctx, bool is_write, ir_dereference *deref,
|
||||
ir_variable *base_offset, unsigned int deref_offset,
|
||||
bool row_major, int matrix_columns,
|
||||
unsigned int packing, unsigned int write_mask);
|
||||
|
||||
bool is_dereferenced_thing_row_major(const ir_rvalue *deref);
|
||||
|
||||
void setup_buffer_access(void *mem_ctx, ir_variable *var, ir_rvalue *deref,
|
||||
ir_rvalue **offset, unsigned *const_offset,
|
||||
bool *row_major, int *matrix_columns,
|
||||
const glsl_struct_field **struct_field,
|
||||
unsigned packing);
|
||||
};
|
||||
|
||||
} /* namespace lower_buffer_access */
|
||||
|
||||
#endif /* LOWER_BUFFER_ACCESS_H */
|
||||
@@ -1,496 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file lower_shared_reference.cpp
|
||||
*
|
||||
* IR lower pass to replace dereferences of compute shader shared variables
|
||||
* with intrinsic function calls.
|
||||
*
|
||||
* This relieves drivers of the responsibility of allocating space for the
|
||||
* shared variables in the shared memory region.
|
||||
*/
|
||||
|
||||
#include "lower_buffer_access.h"
|
||||
#include "ir_builder.h"
|
||||
#include "main/macros.h"
|
||||
#include "util/list.h"
|
||||
#include "glsl_parser_extras.h"
|
||||
|
||||
using namespace ir_builder;
|
||||
|
||||
namespace {
|
||||
|
||||
struct var_offset {
|
||||
struct list_head node;
|
||||
const ir_variable *var;
|
||||
unsigned offset;
|
||||
};
|
||||
|
||||
class lower_shared_reference_visitor :
|
||||
public lower_buffer_access::lower_buffer_access {
|
||||
public:
|
||||
|
||||
lower_shared_reference_visitor(struct gl_shader *shader)
|
||||
: list_ctx(ralloc_context(NULL)), shader(shader), shared_size(0u)
|
||||
{
|
||||
list_inithead(&var_offsets);
|
||||
}
|
||||
|
||||
~lower_shared_reference_visitor()
|
||||
{
|
||||
ralloc_free(list_ctx);
|
||||
}
|
||||
|
||||
enum {
|
||||
shared_load_access,
|
||||
shared_store_access,
|
||||
shared_atomic_access,
|
||||
} buffer_access_type;
|
||||
|
||||
void insert_buffer_access(void *mem_ctx, ir_dereference *deref,
|
||||
const glsl_type *type, ir_rvalue *offset,
|
||||
unsigned mask, int channel);
|
||||
|
||||
void handle_rvalue(ir_rvalue **rvalue);
|
||||
ir_visitor_status visit_enter(ir_assignment *ir);
|
||||
void handle_assignment(ir_assignment *ir);
|
||||
|
||||
ir_call *lower_shared_atomic_intrinsic(ir_call *ir);
|
||||
ir_call *check_for_shared_atomic_intrinsic(ir_call *ir);
|
||||
ir_visitor_status visit_enter(ir_call *ir);
|
||||
|
||||
unsigned get_shared_offset(const ir_variable *);
|
||||
|
||||
ir_call *shared_load(void *mem_ctx, const struct glsl_type *type,
|
||||
ir_rvalue *offset);
|
||||
ir_call *shared_store(void *mem_ctx, ir_rvalue *deref, ir_rvalue *offset,
|
||||
unsigned write_mask);
|
||||
|
||||
void *list_ctx;
|
||||
struct gl_shader *shader;
|
||||
struct list_head var_offsets;
|
||||
unsigned shared_size;
|
||||
bool progress;
|
||||
};
|
||||
|
||||
unsigned
|
||||
lower_shared_reference_visitor::get_shared_offset(const ir_variable *var)
|
||||
{
|
||||
list_for_each_entry(var_offset, var_entry, &var_offsets, node) {
|
||||
if (var_entry->var == var)
|
||||
return var_entry->offset;
|
||||
}
|
||||
|
||||
struct var_offset *new_entry = rzalloc(list_ctx, struct var_offset);
|
||||
list_add(&new_entry->node, &var_offsets);
|
||||
new_entry->var = var;
|
||||
|
||||
unsigned var_align = var->type->std430_base_alignment(false);
|
||||
new_entry->offset = glsl_align(shared_size, var_align);
|
||||
|
||||
unsigned var_size = var->type->std430_size(false);
|
||||
shared_size = new_entry->offset + var_size;
|
||||
|
||||
return new_entry->offset;
|
||||
}
|
||||
|
||||
void
|
||||
lower_shared_reference_visitor::handle_rvalue(ir_rvalue **rvalue)
|
||||
{
|
||||
if (!*rvalue)
|
||||
return;
|
||||
|
||||
ir_dereference *deref = (*rvalue)->as_dereference();
|
||||
if (!deref)
|
||||
return;
|
||||
|
||||
ir_variable *var = deref->variable_referenced();
|
||||
if (!var || var->data.mode != ir_var_shader_shared)
|
||||
return;
|
||||
|
||||
buffer_access_type = shared_load_access;
|
||||
|
||||
void *mem_ctx = ralloc_parent(shader->ir);
|
||||
|
||||
ir_rvalue *offset = NULL;
|
||||
unsigned const_offset = get_shared_offset(var);
|
||||
bool row_major;
|
||||
int matrix_columns;
|
||||
assert(var->get_interface_type() == NULL);
|
||||
const unsigned packing = GLSL_INTERFACE_PACKING_STD430;
|
||||
|
||||
setup_buffer_access(mem_ctx, var, deref,
|
||||
&offset, &const_offset,
|
||||
&row_major, &matrix_columns, NULL, packing);
|
||||
|
||||
/* Now that we've calculated the offset to the start of the
|
||||
* dereference, walk over the type and emit loads into a temporary.
|
||||
*/
|
||||
const glsl_type *type = (*rvalue)->type;
|
||||
ir_variable *load_var = new(mem_ctx) ir_variable(type,
|
||||
"shared_load_temp",
|
||||
ir_var_temporary);
|
||||
base_ir->insert_before(load_var);
|
||||
|
||||
ir_variable *load_offset = new(mem_ctx) ir_variable(glsl_type::uint_type,
|
||||
"shared_load_temp_offset",
|
||||
ir_var_temporary);
|
||||
base_ir->insert_before(load_offset);
|
||||
base_ir->insert_before(assign(load_offset, offset));
|
||||
|
||||
deref = new(mem_ctx) ir_dereference_variable(load_var);
|
||||
|
||||
emit_access(mem_ctx, false, deref, load_offset, const_offset, row_major,
|
||||
matrix_columns, packing, 0);
|
||||
|
||||
*rvalue = deref;
|
||||
|
||||
progress = true;
|
||||
}
|
||||
|
||||
void
|
||||
lower_shared_reference_visitor::handle_assignment(ir_assignment *ir)
|
||||
{
|
||||
if (!ir || !ir->lhs)
|
||||
return;
|
||||
|
||||
ir_rvalue *rvalue = ir->lhs->as_rvalue();
|
||||
if (!rvalue)
|
||||
return;
|
||||
|
||||
ir_dereference *deref = ir->lhs->as_dereference();
|
||||
if (!deref)
|
||||
return;
|
||||
|
||||
ir_variable *var = ir->lhs->variable_referenced();
|
||||
if (!var || var->data.mode != ir_var_shader_shared)
|
||||
return;
|
||||
|
||||
buffer_access_type = shared_store_access;
|
||||
|
||||
/* We have a write to a shared variable, so declare a temporary and rewrite
|
||||
* the assignment so that the temporary is the LHS.
|
||||
*/
|
||||
void *mem_ctx = ralloc_parent(shader->ir);
|
||||
|
||||
const glsl_type *type = rvalue->type;
|
||||
ir_variable *store_var = new(mem_ctx) ir_variable(type,
|
||||
"shared_store_temp",
|
||||
ir_var_temporary);
|
||||
base_ir->insert_before(store_var);
|
||||
ir->lhs = new(mem_ctx) ir_dereference_variable(store_var);
|
||||
|
||||
ir_rvalue *offset = NULL;
|
||||
unsigned const_offset = get_shared_offset(var);
|
||||
bool row_major;
|
||||
int matrix_columns;
|
||||
assert(var->get_interface_type() == NULL);
|
||||
const unsigned packing = GLSL_INTERFACE_PACKING_STD430;
|
||||
|
||||
setup_buffer_access(mem_ctx, var, deref,
|
||||
&offset, &const_offset,
|
||||
&row_major, &matrix_columns, NULL, packing);
|
||||
|
||||
deref = new(mem_ctx) ir_dereference_variable(store_var);
|
||||
|
||||
ir_variable *store_offset = new(mem_ctx) ir_variable(glsl_type::uint_type,
|
||||
"shared_store_temp_offset",
|
||||
ir_var_temporary);
|
||||
base_ir->insert_before(store_offset);
|
||||
base_ir->insert_before(assign(store_offset, offset));
|
||||
|
||||
/* Now we have to write the value assigned to the temporary back to memory */
|
||||
emit_access(mem_ctx, true, deref, store_offset, const_offset, row_major,
|
||||
matrix_columns, packing, ir->write_mask);
|
||||
|
||||
progress = true;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
lower_shared_reference_visitor::visit_enter(ir_assignment *ir)
|
||||
{
|
||||
handle_assignment(ir);
|
||||
return rvalue_visit(ir);
|
||||
}
|
||||
|
||||
void
|
||||
lower_shared_reference_visitor::insert_buffer_access(void *mem_ctx,
|
||||
ir_dereference *deref,
|
||||
const glsl_type *type,
|
||||
ir_rvalue *offset,
|
||||
unsigned mask,
|
||||
int channel)
|
||||
{
|
||||
if (buffer_access_type == shared_store_access) {
|
||||
ir_call *store = shared_store(mem_ctx, deref, offset, mask);
|
||||
base_ir->insert_after(store);
|
||||
} else {
|
||||
ir_call *load = shared_load(mem_ctx, type, offset);
|
||||
base_ir->insert_before(load);
|
||||
ir_rvalue *value = load->return_deref->as_rvalue()->clone(mem_ctx, NULL);
|
||||
base_ir->insert_before(assign(deref->clone(mem_ctx, NULL),
|
||||
value));
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
compute_shader_enabled(const _mesa_glsl_parse_state *state)
|
||||
{
|
||||
return state->stage == MESA_SHADER_COMPUTE;
|
||||
}
|
||||
|
||||
ir_call *
|
||||
lower_shared_reference_visitor::shared_store(void *mem_ctx,
|
||||
ir_rvalue *deref,
|
||||
ir_rvalue *offset,
|
||||
unsigned write_mask)
|
||||
{
|
||||
exec_list sig_params;
|
||||
|
||||
ir_variable *offset_ref = new(mem_ctx)
|
||||
ir_variable(glsl_type::uint_type, "offset" , ir_var_function_in);
|
||||
sig_params.push_tail(offset_ref);
|
||||
|
||||
ir_variable *val_ref = new(mem_ctx)
|
||||
ir_variable(deref->type, "value" , ir_var_function_in);
|
||||
sig_params.push_tail(val_ref);
|
||||
|
||||
ir_variable *writemask_ref = new(mem_ctx)
|
||||
ir_variable(glsl_type::uint_type, "write_mask" , ir_var_function_in);
|
||||
sig_params.push_tail(writemask_ref);
|
||||
|
||||
ir_function_signature *sig = new(mem_ctx)
|
||||
ir_function_signature(glsl_type::void_type, compute_shader_enabled);
|
||||
assert(sig);
|
||||
sig->replace_parameters(&sig_params);
|
||||
sig->is_intrinsic = true;
|
||||
|
||||
ir_function *f = new(mem_ctx) ir_function("__intrinsic_store_shared");
|
||||
f->add_signature(sig);
|
||||
|
||||
exec_list call_params;
|
||||
call_params.push_tail(offset->clone(mem_ctx, NULL));
|
||||
call_params.push_tail(deref->clone(mem_ctx, NULL));
|
||||
call_params.push_tail(new(mem_ctx) ir_constant(write_mask));
|
||||
return new(mem_ctx) ir_call(sig, NULL, &call_params);
|
||||
}
|
||||
|
||||
ir_call *
|
||||
lower_shared_reference_visitor::shared_load(void *mem_ctx,
|
||||
const struct glsl_type *type,
|
||||
ir_rvalue *offset)
|
||||
{
|
||||
exec_list sig_params;
|
||||
|
||||
ir_variable *offset_ref = new(mem_ctx)
|
||||
ir_variable(glsl_type::uint_type, "offset_ref" , ir_var_function_in);
|
||||
sig_params.push_tail(offset_ref);
|
||||
|
||||
ir_function_signature *sig =
|
||||
new(mem_ctx) ir_function_signature(type, compute_shader_enabled);
|
||||
assert(sig);
|
||||
sig->replace_parameters(&sig_params);
|
||||
sig->is_intrinsic = true;
|
||||
|
||||
ir_function *f = new(mem_ctx) ir_function("__intrinsic_load_shared");
|
||||
f->add_signature(sig);
|
||||
|
||||
ir_variable *result = new(mem_ctx)
|
||||
ir_variable(type, "shared_load_result", ir_var_temporary);
|
||||
base_ir->insert_before(result);
|
||||
ir_dereference_variable *deref_result = new(mem_ctx)
|
||||
ir_dereference_variable(result);
|
||||
|
||||
exec_list call_params;
|
||||
call_params.push_tail(offset->clone(mem_ctx, NULL));
|
||||
|
||||
return new(mem_ctx) ir_call(sig, deref_result, &call_params);
|
||||
}
|
||||
|
||||
/* Lowers the intrinsic call to a new internal intrinsic that swaps the access
|
||||
* to the shared variable in the first parameter by an offset. This involves
|
||||
* creating the new internal intrinsic (i.e. the new function signature).
|
||||
*/
|
||||
ir_call *
|
||||
lower_shared_reference_visitor::lower_shared_atomic_intrinsic(ir_call *ir)
|
||||
{
|
||||
/* Shared atomics usually have 2 parameters, the shared variable and an
|
||||
* integer argument. The exception is CompSwap, that has an additional
|
||||
* integer parameter.
|
||||
*/
|
||||
int param_count = ir->actual_parameters.length();
|
||||
assert(param_count == 2 || param_count == 3);
|
||||
|
||||
/* First argument must be a scalar integer shared variable */
|
||||
exec_node *param = ir->actual_parameters.get_head();
|
||||
ir_instruction *inst = (ir_instruction *) param;
|
||||
assert(inst->ir_type == ir_type_dereference_variable ||
|
||||
inst->ir_type == ir_type_dereference_array ||
|
||||
inst->ir_type == ir_type_dereference_record ||
|
||||
inst->ir_type == ir_type_swizzle);
|
||||
|
||||
ir_rvalue *deref = (ir_rvalue *) inst;
|
||||
assert(deref->type->is_scalar() && deref->type->is_integer());
|
||||
|
||||
ir_variable *var = deref->variable_referenced();
|
||||
assert(var);
|
||||
|
||||
/* Compute the offset to the start if the dereference
|
||||
*/
|
||||
void *mem_ctx = ralloc_parent(shader->ir);
|
||||
|
||||
ir_rvalue *offset = NULL;
|
||||
unsigned const_offset = get_shared_offset(var);
|
||||
bool row_major;
|
||||
int matrix_columns;
|
||||
assert(var->get_interface_type() == NULL);
|
||||
const unsigned packing = GLSL_INTERFACE_PACKING_STD430;
|
||||
buffer_access_type = shared_atomic_access;
|
||||
|
||||
setup_buffer_access(mem_ctx, var, deref,
|
||||
&offset, &const_offset,
|
||||
&row_major, &matrix_columns, NULL, packing);
|
||||
|
||||
assert(offset);
|
||||
assert(!row_major);
|
||||
assert(matrix_columns == 1);
|
||||
|
||||
ir_rvalue *deref_offset =
|
||||
add(offset, new(mem_ctx) ir_constant(const_offset));
|
||||
|
||||
/* Create the new internal function signature that will take an offset
|
||||
* instead of a shared variable
|
||||
*/
|
||||
exec_list sig_params;
|
||||
ir_variable *sig_param = new(mem_ctx)
|
||||
ir_variable(glsl_type::uint_type, "offset" , ir_var_function_in);
|
||||
sig_params.push_tail(sig_param);
|
||||
|
||||
const glsl_type *type = deref->type->base_type == GLSL_TYPE_INT ?
|
||||
glsl_type::int_type : glsl_type::uint_type;
|
||||
sig_param = new(mem_ctx)
|
||||
ir_variable(type, "data1", ir_var_function_in);
|
||||
sig_params.push_tail(sig_param);
|
||||
|
||||
if (param_count == 3) {
|
||||
sig_param = new(mem_ctx)
|
||||
ir_variable(type, "data2", ir_var_function_in);
|
||||
sig_params.push_tail(sig_param);
|
||||
}
|
||||
|
||||
ir_function_signature *sig =
|
||||
new(mem_ctx) ir_function_signature(deref->type,
|
||||
compute_shader_enabled);
|
||||
assert(sig);
|
||||
sig->replace_parameters(&sig_params);
|
||||
sig->is_intrinsic = true;
|
||||
|
||||
char func_name[64];
|
||||
sprintf(func_name, "%s_shared", ir->callee_name());
|
||||
ir_function *f = new(mem_ctx) ir_function(func_name);
|
||||
f->add_signature(sig);
|
||||
|
||||
/* Now, create the call to the internal intrinsic */
|
||||
exec_list call_params;
|
||||
call_params.push_tail(deref_offset);
|
||||
param = ir->actual_parameters.get_head()->get_next();
|
||||
ir_rvalue *param_as_rvalue = ((ir_instruction *) param)->as_rvalue();
|
||||
call_params.push_tail(param_as_rvalue->clone(mem_ctx, NULL));
|
||||
if (param_count == 3) {
|
||||
param = param->get_next();
|
||||
param_as_rvalue = ((ir_instruction *) param)->as_rvalue();
|
||||
call_params.push_tail(param_as_rvalue->clone(mem_ctx, NULL));
|
||||
}
|
||||
ir_dereference_variable *return_deref =
|
||||
ir->return_deref->clone(mem_ctx, NULL);
|
||||
return new(mem_ctx) ir_call(sig, return_deref, &call_params);
|
||||
}
|
||||
|
||||
ir_call *
|
||||
lower_shared_reference_visitor::check_for_shared_atomic_intrinsic(ir_call *ir)
|
||||
{
|
||||
exec_list& params = ir->actual_parameters;
|
||||
|
||||
if (params.length() < 2 || params.length() > 3)
|
||||
return ir;
|
||||
|
||||
ir_rvalue *rvalue =
|
||||
((ir_instruction *) params.get_head())->as_rvalue();
|
||||
if (!rvalue)
|
||||
return ir;
|
||||
|
||||
ir_variable *var = rvalue->variable_referenced();
|
||||
if (!var || var->data.mode != ir_var_shader_shared)
|
||||
return ir;
|
||||
|
||||
const char *callee = ir->callee_name();
|
||||
if (!strcmp("__intrinsic_atomic_add", callee) ||
|
||||
!strcmp("__intrinsic_atomic_min", callee) ||
|
||||
!strcmp("__intrinsic_atomic_max", callee) ||
|
||||
!strcmp("__intrinsic_atomic_and", callee) ||
|
||||
!strcmp("__intrinsic_atomic_or", callee) ||
|
||||
!strcmp("__intrinsic_atomic_xor", callee) ||
|
||||
!strcmp("__intrinsic_atomic_exchange", callee) ||
|
||||
!strcmp("__intrinsic_atomic_comp_swap", callee)) {
|
||||
return lower_shared_atomic_intrinsic(ir);
|
||||
}
|
||||
|
||||
return ir;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
lower_shared_reference_visitor::visit_enter(ir_call *ir)
|
||||
{
|
||||
ir_call *new_ir = check_for_shared_atomic_intrinsic(ir);
|
||||
if (new_ir != ir) {
|
||||
progress = true;
|
||||
base_ir->replace_with(new_ir);
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
|
||||
return rvalue_visit(ir);
|
||||
}
|
||||
|
||||
} /* unnamed namespace */
|
||||
|
||||
void
|
||||
lower_shared_reference(struct gl_shader *shader, unsigned *shared_size)
|
||||
{
|
||||
if (shader->Stage != MESA_SHADER_COMPUTE)
|
||||
return;
|
||||
|
||||
lower_shared_reference_visitor v(shader);
|
||||
|
||||
/* Loop over the instructions lowering references, because we take a deref
|
||||
* of an shared variable array using a shared variable dereference as the
|
||||
* index will produce a collection of instructions all of which have cloned
|
||||
* shared variable dereferences for that array index.
|
||||
*/
|
||||
do {
|
||||
v.progress = false;
|
||||
visit_list_elements(&v, shader->ir);
|
||||
} while (v.progress);
|
||||
|
||||
*shared_size = v.shared_size;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2013 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "ir.h"
|
||||
#include "ir_builder.h"
|
||||
#include "ir_rvalue_visitor.h"
|
||||
#include "ir_optimization.h"
|
||||
|
||||
using namespace ir_builder;
|
||||
|
||||
namespace {
|
||||
|
||||
class vector_deref_visitor : public ir_rvalue_enter_visitor {
|
||||
public:
|
||||
vector_deref_visitor()
|
||||
: progress(false)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~vector_deref_visitor()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void handle_rvalue(ir_rvalue **rv);
|
||||
virtual ir_visitor_status visit_enter(ir_assignment *ir);
|
||||
|
||||
bool progress;
|
||||
};
|
||||
|
||||
} /* anonymous namespace */
|
||||
|
||||
ir_visitor_status
|
||||
vector_deref_visitor::visit_enter(ir_assignment *ir)
|
||||
{
|
||||
if (!ir->lhs || ir->lhs->ir_type != ir_type_dereference_array)
|
||||
return ir_rvalue_enter_visitor::visit_enter(ir);
|
||||
|
||||
ir_dereference_array *const deref = (ir_dereference_array *) ir->lhs;
|
||||
if (!deref->array->type->is_vector())
|
||||
return ir_rvalue_enter_visitor::visit_enter(ir);
|
||||
|
||||
ir_dereference *const new_lhs = (ir_dereference *) deref->array;
|
||||
ir->set_lhs(new_lhs);
|
||||
|
||||
ir_constant *old_index_constant = deref->array_index->constant_expression_value();
|
||||
void *mem_ctx = ralloc_parent(ir);
|
||||
if (!old_index_constant) {
|
||||
ir->rhs = new(mem_ctx) ir_expression(ir_triop_vector_insert,
|
||||
new_lhs->type,
|
||||
new_lhs->clone(mem_ctx, NULL),
|
||||
ir->rhs,
|
||||
deref->array_index);
|
||||
ir->write_mask = (1 << new_lhs->type->vector_elements) - 1;
|
||||
} else {
|
||||
ir->write_mask = 1 << old_index_constant->get_int_component(0);
|
||||
}
|
||||
|
||||
return ir_rvalue_enter_visitor::visit_enter(ir);
|
||||
}
|
||||
|
||||
void
|
||||
vector_deref_visitor::handle_rvalue(ir_rvalue **rv)
|
||||
{
|
||||
if (*rv == NULL || (*rv)->ir_type != ir_type_dereference_array)
|
||||
return;
|
||||
|
||||
ir_dereference_array *const deref = (ir_dereference_array *) *rv;
|
||||
if (!deref->array->type->is_vector())
|
||||
return;
|
||||
|
||||
void *mem_ctx = ralloc_parent(deref);
|
||||
*rv = new(mem_ctx) ir_expression(ir_binop_vector_extract,
|
||||
deref->array,
|
||||
deref->array_index);
|
||||
}
|
||||
|
||||
bool
|
||||
lower_vector_derefs(gl_shader *shader)
|
||||
{
|
||||
vector_deref_visitor v;
|
||||
|
||||
visit_list_elements(&v, shader->ir);
|
||||
|
||||
return v.progress;
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
NIR_GENERATED_FILES = \
|
||||
nir_builder_opcodes.h \
|
||||
nir_constant_expressions.c \
|
||||
nir_opcodes.c \
|
||||
nir_opcodes.h \
|
||||
nir_opt_algebraic.c
|
||||
|
||||
NIR_FILES = \
|
||||
glsl_to_nir.cpp \
|
||||
glsl_to_nir.h \
|
||||
nir.c \
|
||||
nir.h \
|
||||
nir_array.h \
|
||||
nir_builder.h \
|
||||
nir_clone.c \
|
||||
nir_constant_expressions.h \
|
||||
nir_control_flow.c \
|
||||
nir_control_flow.h \
|
||||
nir_control_flow_private.h \
|
||||
nir_dominance.c \
|
||||
nir_from_ssa.c \
|
||||
nir_gs_count_vertices.c \
|
||||
nir_intrinsics.c \
|
||||
nir_intrinsics.h \
|
||||
nir_instr_set.c \
|
||||
nir_instr_set.h \
|
||||
nir_liveness.c \
|
||||
nir_lower_alu_to_scalar.c \
|
||||
nir_lower_atomics.c \
|
||||
nir_lower_clip.c \
|
||||
nir_lower_global_vars_to_local.c \
|
||||
nir_lower_gs_intrinsics.c \
|
||||
nir_lower_load_const_to_scalar.c \
|
||||
nir_lower_locals_to_regs.c \
|
||||
nir_lower_idiv.c \
|
||||
nir_lower_io.c \
|
||||
nir_lower_outputs_to_temporaries.c \
|
||||
nir_lower_phis_to_scalar.c \
|
||||
nir_lower_samplers.c \
|
||||
nir_lower_system_values.c \
|
||||
nir_lower_tex.c \
|
||||
nir_lower_to_source_mods.c \
|
||||
nir_lower_two_sided_color.c \
|
||||
nir_lower_vars_to_ssa.c \
|
||||
nir_lower_var_copies.c \
|
||||
nir_lower_vec_to_movs.c \
|
||||
nir_metadata.c \
|
||||
nir_move_vec_src_uses_to_dest.c \
|
||||
nir_normalize_cubemap_coords.c \
|
||||
nir_opt_constant_folding.c \
|
||||
nir_opt_copy_propagate.c \
|
||||
nir_opt_cse.c \
|
||||
nir_opt_dce.c \
|
||||
nir_opt_dead_cf.c \
|
||||
nir_opt_gcm.c \
|
||||
nir_opt_global_to_local.c \
|
||||
nir_opt_peephole_select.c \
|
||||
nir_opt_remove_phis.c \
|
||||
nir_opt_undef.c \
|
||||
nir_print.c \
|
||||
nir_remove_dead_variables.c \
|
||||
nir_search.c \
|
||||
nir_search.h \
|
||||
nir_split_var_copies.c \
|
||||
nir_sweep.c \
|
||||
nir_to_ssa.c \
|
||||
nir_validate.c \
|
||||
nir_vla.h \
|
||||
nir_worklist.c \
|
||||
nir_worklist.h
|
||||
|
||||
@@ -1,663 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2015 Red Hat
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
#include "nir_control_flow_private.h"
|
||||
|
||||
/* Secret Decoder Ring:
|
||||
* clone_foo():
|
||||
* Allocate and clone a foo.
|
||||
* __clone_foo():
|
||||
* Clone body of foo (ie. parent class, embedded struct, etc)
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
/* maps orig ptr -> cloned ptr: */
|
||||
struct hash_table *ptr_table;
|
||||
|
||||
/* List of phi sources. */
|
||||
struct list_head phi_srcs;
|
||||
|
||||
/* new shader object, used as memctx for just about everything else: */
|
||||
nir_shader *ns;
|
||||
} clone_state;
|
||||
|
||||
static void
|
||||
init_clone_state(clone_state *state)
|
||||
{
|
||||
state->ptr_table = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
|
||||
_mesa_key_pointer_equal);
|
||||
list_inithead(&state->phi_srcs);
|
||||
}
|
||||
|
||||
static void
|
||||
free_clone_state(clone_state *state)
|
||||
{
|
||||
_mesa_hash_table_destroy(state->ptr_table, NULL);
|
||||
}
|
||||
|
||||
static void *
|
||||
lookup_ptr(clone_state *state, const void *ptr)
|
||||
{
|
||||
struct hash_entry *entry;
|
||||
|
||||
if (!ptr)
|
||||
return NULL;
|
||||
|
||||
entry = _mesa_hash_table_search(state->ptr_table, ptr);
|
||||
assert(entry && "Failed to find pointer!");
|
||||
if (!entry)
|
||||
return NULL;
|
||||
|
||||
return entry->data;
|
||||
}
|
||||
|
||||
static void
|
||||
store_ptr(clone_state *state, void *nptr, const void *ptr)
|
||||
{
|
||||
_mesa_hash_table_insert(state->ptr_table, ptr, nptr);
|
||||
}
|
||||
|
||||
static nir_constant *
|
||||
clone_constant(clone_state *state, const nir_constant *c, nir_variable *nvar)
|
||||
{
|
||||
nir_constant *nc = ralloc(nvar, nir_constant);
|
||||
|
||||
nc->value = c->value;
|
||||
nc->num_elements = c->num_elements;
|
||||
nc->elements = ralloc_array(nvar, nir_constant *, c->num_elements);
|
||||
for (unsigned i = 0; i < c->num_elements; i++) {
|
||||
nc->elements[i] = clone_constant(state, c->elements[i], nvar);
|
||||
}
|
||||
|
||||
return nc;
|
||||
}
|
||||
|
||||
/* NOTE: for cloning nir_variable's, bypass nir_variable_create to avoid
|
||||
* having to deal with locals and globals separately:
|
||||
*/
|
||||
static nir_variable *
|
||||
clone_variable(clone_state *state, const nir_variable *var)
|
||||
{
|
||||
nir_variable *nvar = rzalloc(state->ns, nir_variable);
|
||||
store_ptr(state, nvar, var);
|
||||
|
||||
nvar->type = var->type;
|
||||
nvar->name = ralloc_strdup(nvar, var->name);
|
||||
nvar->data = var->data;
|
||||
nvar->num_state_slots = var->num_state_slots;
|
||||
nvar->state_slots = ralloc_array(nvar, nir_state_slot, var->num_state_slots);
|
||||
memcpy(nvar->state_slots, var->state_slots,
|
||||
var->num_state_slots * sizeof(nir_state_slot));
|
||||
if (var->constant_initializer) {
|
||||
nvar->constant_initializer =
|
||||
clone_constant(state, var->constant_initializer, nvar);
|
||||
}
|
||||
nvar->interface_type = var->interface_type;
|
||||
|
||||
return nvar;
|
||||
}
|
||||
|
||||
/* clone list of nir_variable: */
|
||||
static void
|
||||
clone_var_list(clone_state *state, struct exec_list *dst,
|
||||
const struct exec_list *list)
|
||||
{
|
||||
exec_list_make_empty(dst);
|
||||
foreach_list_typed(nir_variable, var, node, list) {
|
||||
nir_variable *nvar = clone_variable(state, var);
|
||||
exec_list_push_tail(dst, &nvar->node);
|
||||
}
|
||||
}
|
||||
|
||||
/* NOTE: for cloning nir_register's, bypass nir_global/local_reg_create()
|
||||
* to avoid having to deal with locals and globals separately:
|
||||
*/
|
||||
static nir_register *
|
||||
clone_register(clone_state *state, const nir_register *reg)
|
||||
{
|
||||
nir_register *nreg = rzalloc(state->ns, nir_register);
|
||||
store_ptr(state, nreg, reg);
|
||||
|
||||
nreg->num_components = reg->num_components;
|
||||
nreg->num_array_elems = reg->num_array_elems;
|
||||
nreg->index = reg->index;
|
||||
nreg->name = ralloc_strdup(nreg, reg->name);
|
||||
nreg->is_global = reg->is_global;
|
||||
nreg->is_packed = reg->is_packed;
|
||||
|
||||
/* reconstructing uses/defs/if_uses handled by nir_instr_insert() */
|
||||
list_inithead(&nreg->uses);
|
||||
list_inithead(&nreg->defs);
|
||||
list_inithead(&nreg->if_uses);
|
||||
|
||||
return nreg;
|
||||
}
|
||||
|
||||
/* clone list of nir_register: */
|
||||
static void
|
||||
clone_reg_list(clone_state *state, struct exec_list *dst,
|
||||
const struct exec_list *list)
|
||||
{
|
||||
exec_list_make_empty(dst);
|
||||
foreach_list_typed(nir_register, reg, node, list) {
|
||||
nir_register *nreg = clone_register(state, reg);
|
||||
exec_list_push_tail(dst, &nreg->node);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
__clone_src(clone_state *state, void *ninstr_or_if,
|
||||
nir_src *nsrc, const nir_src *src)
|
||||
{
|
||||
nsrc->is_ssa = src->is_ssa;
|
||||
if (src->is_ssa) {
|
||||
nsrc->ssa = lookup_ptr(state, src->ssa);
|
||||
} else {
|
||||
nsrc->reg.reg = lookup_ptr(state, src->reg.reg);
|
||||
if (src->reg.indirect) {
|
||||
nsrc->reg.indirect = ralloc(ninstr_or_if, nir_src);
|
||||
__clone_src(state, ninstr_or_if, nsrc->reg.indirect, src->reg.indirect);
|
||||
}
|
||||
nsrc->reg.base_offset = src->reg.base_offset;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
__clone_dst(clone_state *state, nir_instr *ninstr,
|
||||
nir_dest *ndst, const nir_dest *dst)
|
||||
{
|
||||
ndst->is_ssa = dst->is_ssa;
|
||||
if (dst->is_ssa) {
|
||||
nir_ssa_dest_init(ninstr, ndst, dst->ssa.num_components, dst->ssa.name);
|
||||
store_ptr(state, &ndst->ssa, &dst->ssa);
|
||||
} else {
|
||||
ndst->reg.reg = lookup_ptr(state, dst->reg.reg);
|
||||
if (dst->reg.indirect) {
|
||||
ndst->reg.indirect = ralloc(ninstr, nir_src);
|
||||
__clone_src(state, ninstr, ndst->reg.indirect, dst->reg.indirect);
|
||||
}
|
||||
ndst->reg.base_offset = dst->reg.base_offset;
|
||||
}
|
||||
}
|
||||
|
||||
static nir_deref *clone_deref(clone_state *state, const nir_deref *deref,
|
||||
nir_instr *ninstr, nir_deref *parent);
|
||||
|
||||
static nir_deref_var *
|
||||
clone_deref_var(clone_state *state, const nir_deref_var *dvar,
|
||||
nir_instr *ninstr)
|
||||
{
|
||||
nir_variable *nvar = lookup_ptr(state, dvar->var);
|
||||
nir_deref_var *ndvar = nir_deref_var_create(ninstr, nvar);
|
||||
|
||||
if (dvar->deref.child)
|
||||
ndvar->deref.child = clone_deref(state, dvar->deref.child,
|
||||
ninstr, &ndvar->deref);
|
||||
|
||||
return ndvar;
|
||||
}
|
||||
|
||||
static nir_deref_array *
|
||||
clone_deref_array(clone_state *state, const nir_deref_array *darr,
|
||||
nir_instr *ninstr, nir_deref *parent)
|
||||
{
|
||||
nir_deref_array *ndarr = nir_deref_array_create(parent);
|
||||
|
||||
ndarr->deref.type = darr->deref.type;
|
||||
if (darr->deref.child)
|
||||
ndarr->deref.child = clone_deref(state, darr->deref.child,
|
||||
ninstr, &ndarr->deref);
|
||||
|
||||
ndarr->deref_array_type = darr->deref_array_type;
|
||||
ndarr->base_offset = darr->base_offset;
|
||||
if (ndarr->deref_array_type == nir_deref_array_type_indirect)
|
||||
__clone_src(state, ninstr, &ndarr->indirect, &darr->indirect);
|
||||
|
||||
return ndarr;
|
||||
}
|
||||
|
||||
static nir_deref_struct *
|
||||
clone_deref_struct(clone_state *state, const nir_deref_struct *dstr,
|
||||
nir_instr *ninstr, nir_deref *parent)
|
||||
{
|
||||
nir_deref_struct *ndstr = nir_deref_struct_create(parent, dstr->index);
|
||||
|
||||
ndstr->deref.type = dstr->deref.type;
|
||||
if (dstr->deref.child)
|
||||
ndstr->deref.child = clone_deref(state, dstr->deref.child,
|
||||
ninstr, &ndstr->deref);
|
||||
|
||||
return ndstr;
|
||||
}
|
||||
|
||||
static nir_deref *
|
||||
clone_deref(clone_state *state, const nir_deref *dref,
|
||||
nir_instr *ninstr, nir_deref *parent)
|
||||
{
|
||||
switch (dref->deref_type) {
|
||||
case nir_deref_type_array:
|
||||
return &clone_deref_array(state, nir_deref_as_array(dref),
|
||||
ninstr, parent)->deref;
|
||||
case nir_deref_type_struct:
|
||||
return &clone_deref_struct(state, nir_deref_as_struct(dref),
|
||||
ninstr, parent)->deref;
|
||||
default:
|
||||
unreachable("bad deref type");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static nir_alu_instr *
|
||||
clone_alu(clone_state *state, const nir_alu_instr *alu)
|
||||
{
|
||||
nir_alu_instr *nalu = nir_alu_instr_create(state->ns, alu->op);
|
||||
|
||||
__clone_dst(state, &nalu->instr, &nalu->dest.dest, &alu->dest.dest);
|
||||
nalu->dest.saturate = alu->dest.saturate;
|
||||
nalu->dest.write_mask = alu->dest.write_mask;
|
||||
|
||||
for (unsigned i = 0; i < nir_op_infos[alu->op].num_inputs; i++) {
|
||||
__clone_src(state, &nalu->instr, &nalu->src[i].src, &alu->src[i].src);
|
||||
nalu->src[i].negate = alu->src[i].negate;
|
||||
nalu->src[i].abs = alu->src[i].abs;
|
||||
memcpy(nalu->src[i].swizzle, alu->src[i].swizzle,
|
||||
sizeof(nalu->src[i].swizzle));
|
||||
}
|
||||
|
||||
return nalu;
|
||||
}
|
||||
|
||||
static nir_intrinsic_instr *
|
||||
clone_intrinsic(clone_state *state, const nir_intrinsic_instr *itr)
|
||||
{
|
||||
nir_intrinsic_instr *nitr =
|
||||
nir_intrinsic_instr_create(state->ns, itr->intrinsic);
|
||||
|
||||
unsigned num_variables = nir_intrinsic_infos[itr->intrinsic].num_variables;
|
||||
unsigned num_srcs = nir_intrinsic_infos[itr->intrinsic].num_srcs;
|
||||
|
||||
if (nir_intrinsic_infos[itr->intrinsic].has_dest)
|
||||
__clone_dst(state, &nitr->instr, &nitr->dest, &itr->dest);
|
||||
|
||||
nitr->num_components = itr->num_components;
|
||||
memcpy(nitr->const_index, itr->const_index, sizeof(nitr->const_index));
|
||||
|
||||
for (unsigned i = 0; i < num_variables; i++) {
|
||||
nitr->variables[i] = clone_deref_var(state, itr->variables[i],
|
||||
&nitr->instr);
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < num_srcs; i++)
|
||||
__clone_src(state, &nitr->instr, &nitr->src[i], &itr->src[i]);
|
||||
|
||||
return nitr;
|
||||
}
|
||||
|
||||
static nir_load_const_instr *
|
||||
clone_load_const(clone_state *state, const nir_load_const_instr *lc)
|
||||
{
|
||||
nir_load_const_instr *nlc =
|
||||
nir_load_const_instr_create(state->ns, lc->def.num_components);
|
||||
|
||||
memcpy(&nlc->value, &lc->value, sizeof(nlc->value));
|
||||
|
||||
store_ptr(state, &nlc->def, &lc->def);
|
||||
|
||||
return nlc;
|
||||
}
|
||||
|
||||
static nir_ssa_undef_instr *
|
||||
clone_ssa_undef(clone_state *state, const nir_ssa_undef_instr *sa)
|
||||
{
|
||||
nir_ssa_undef_instr *nsa =
|
||||
nir_ssa_undef_instr_create(state->ns, sa->def.num_components);
|
||||
|
||||
store_ptr(state, &nsa->def, &sa->def);
|
||||
|
||||
return nsa;
|
||||
}
|
||||
|
||||
static nir_tex_instr *
|
||||
clone_tex(clone_state *state, const nir_tex_instr *tex)
|
||||
{
|
||||
nir_tex_instr *ntex = nir_tex_instr_create(state->ns, tex->num_srcs);
|
||||
|
||||
ntex->sampler_dim = tex->sampler_dim;
|
||||
ntex->dest_type = tex->dest_type;
|
||||
ntex->op = tex->op;
|
||||
__clone_dst(state, &ntex->instr, &ntex->dest, &tex->dest);
|
||||
for (unsigned i = 0; i < ntex->num_srcs; i++) {
|
||||
ntex->src[i].src_type = tex->src[i].src_type;
|
||||
__clone_src(state, &ntex->instr, &ntex->src[i].src, &tex->src[i].src);
|
||||
}
|
||||
ntex->coord_components = tex->coord_components;
|
||||
ntex->is_array = tex->is_array;
|
||||
ntex->is_shadow = tex->is_shadow;
|
||||
ntex->is_new_style_shadow = tex->is_new_style_shadow;
|
||||
ntex->component = tex->component;
|
||||
|
||||
ntex->texture_index = tex->texture_index;
|
||||
if (tex->texture)
|
||||
ntex->texture = clone_deref_var(state, tex->texture, &ntex->instr);
|
||||
ntex->texture_array_size = tex->texture_array_size;
|
||||
|
||||
ntex->sampler_index = tex->sampler_index;
|
||||
if (tex->sampler)
|
||||
ntex->sampler = clone_deref_var(state, tex->sampler, &ntex->instr);
|
||||
|
||||
return ntex;
|
||||
}
|
||||
|
||||
static nir_phi_instr *
|
||||
clone_phi(clone_state *state, const nir_phi_instr *phi, nir_block *nblk)
|
||||
{
|
||||
nir_phi_instr *nphi = nir_phi_instr_create(state->ns);
|
||||
|
||||
__clone_dst(state, &nphi->instr, &nphi->dest, &phi->dest);
|
||||
|
||||
/* Cloning a phi node is a bit different from other instructions. The
|
||||
* sources of phi instructions are the only time where we can use an SSA
|
||||
* def before it is defined. In order to handle this, we just copy over
|
||||
* the sources from the old phi instruction directly and then fix them up
|
||||
* in a second pass once all the instrutions in the function have been
|
||||
* properly cloned.
|
||||
*
|
||||
* In order to ensure that the copied sources (which are the same as the
|
||||
* old phi instruction's sources for now) don't get inserted into the old
|
||||
* shader's use-def lists, we have to add the phi instruction *before* we
|
||||
* set up its sources.
|
||||
*/
|
||||
nir_instr_insert_after_block(nblk, &nphi->instr);
|
||||
|
||||
foreach_list_typed(nir_phi_src, src, node, &phi->srcs) {
|
||||
nir_phi_src *nsrc = ralloc(nphi, nir_phi_src);
|
||||
|
||||
/* Just copy the old source for now. */
|
||||
memcpy(nsrc, src, sizeof(*src));
|
||||
|
||||
/* Since we're not letting nir_insert_instr handle use/def stuff for us,
|
||||
* we have to set the parent_instr manually. It doesn't really matter
|
||||
* when we do it, so we might as well do it here.
|
||||
*/
|
||||
nsrc->src.parent_instr = &nphi->instr;
|
||||
|
||||
/* Stash it in the list of phi sources. We'll walk this list and fix up
|
||||
* sources at the very end of clone_function_impl.
|
||||
*/
|
||||
list_add(&nsrc->src.use_link, &state->phi_srcs);
|
||||
|
||||
exec_list_push_tail(&nphi->srcs, &nsrc->node);
|
||||
}
|
||||
|
||||
return nphi;
|
||||
}
|
||||
|
||||
static nir_jump_instr *
|
||||
clone_jump(clone_state *state, const nir_jump_instr *jmp)
|
||||
{
|
||||
nir_jump_instr *njmp = nir_jump_instr_create(state->ns, jmp->type);
|
||||
|
||||
return njmp;
|
||||
}
|
||||
|
||||
static nir_call_instr *
|
||||
clone_call(clone_state *state, const nir_call_instr *call)
|
||||
{
|
||||
nir_function *ncallee = lookup_ptr(state, call->callee);
|
||||
nir_call_instr *ncall = nir_call_instr_create(state->ns, ncallee);
|
||||
|
||||
for (unsigned i = 0; i < ncall->num_params; i++)
|
||||
ncall->params[i] = clone_deref_var(state, call->params[i], &ncall->instr);
|
||||
|
||||
ncall->return_deref = clone_deref_var(state, call->return_deref,
|
||||
&ncall->instr);
|
||||
|
||||
return ncall;
|
||||
}
|
||||
|
||||
static nir_instr *
|
||||
clone_instr(clone_state *state, const nir_instr *instr)
|
||||
{
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_alu:
|
||||
return &clone_alu(state, nir_instr_as_alu(instr))->instr;
|
||||
case nir_instr_type_intrinsic:
|
||||
return &clone_intrinsic(state, nir_instr_as_intrinsic(instr))->instr;
|
||||
case nir_instr_type_load_const:
|
||||
return &clone_load_const(state, nir_instr_as_load_const(instr))->instr;
|
||||
case nir_instr_type_ssa_undef:
|
||||
return &clone_ssa_undef(state, nir_instr_as_ssa_undef(instr))->instr;
|
||||
case nir_instr_type_tex:
|
||||
return &clone_tex(state, nir_instr_as_tex(instr))->instr;
|
||||
case nir_instr_type_phi:
|
||||
unreachable("Cannot clone phis with clone_instr");
|
||||
case nir_instr_type_jump:
|
||||
return &clone_jump(state, nir_instr_as_jump(instr))->instr;
|
||||
case nir_instr_type_call:
|
||||
return &clone_call(state, nir_instr_as_call(instr))->instr;
|
||||
case nir_instr_type_parallel_copy:
|
||||
unreachable("Cannot clone parallel copies");
|
||||
default:
|
||||
unreachable("bad instr type");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static nir_block *
|
||||
clone_block(clone_state *state, struct exec_list *cf_list, const nir_block *blk)
|
||||
{
|
||||
/* Don't actually create a new block. Just use the one from the tail of
|
||||
* the list. NIR guarantees that the tail of the list is a block and that
|
||||
* no two blocks are side-by-side in the IR; It should be empty.
|
||||
*/
|
||||
nir_block *nblk =
|
||||
exec_node_data(nir_block, exec_list_get_tail(cf_list), cf_node.node);
|
||||
assert(nblk->cf_node.type == nir_cf_node_block);
|
||||
assert(exec_list_is_empty(&nblk->instr_list));
|
||||
|
||||
/* We need this for phi sources */
|
||||
store_ptr(state, nblk, blk);
|
||||
|
||||
nir_foreach_instr(blk, instr) {
|
||||
if (instr->type == nir_instr_type_phi) {
|
||||
/* Phi instructions are a bit of a special case when cloning because
|
||||
* we don't want inserting the instruction to automatically handle
|
||||
* use/defs for us. Instead, we need to wait until all the
|
||||
* blocks/instructions are in so that we can set their sources up.
|
||||
*/
|
||||
clone_phi(state, nir_instr_as_phi(instr), nblk);
|
||||
} else {
|
||||
nir_instr *ninstr = clone_instr(state, instr);
|
||||
nir_instr_insert_after_block(nblk, ninstr);
|
||||
}
|
||||
}
|
||||
|
||||
return nblk;
|
||||
}
|
||||
|
||||
static void
|
||||
clone_cf_list(clone_state *state, struct exec_list *dst,
|
||||
const struct exec_list *list);
|
||||
|
||||
static nir_if *
|
||||
clone_if(clone_state *state, struct exec_list *cf_list, const nir_if *i)
|
||||
{
|
||||
nir_if *ni = nir_if_create(state->ns);
|
||||
|
||||
__clone_src(state, ni, &ni->condition, &i->condition);
|
||||
|
||||
nir_cf_node_insert_end(cf_list, &ni->cf_node);
|
||||
|
||||
clone_cf_list(state, &ni->then_list, &i->then_list);
|
||||
clone_cf_list(state, &ni->else_list, &i->else_list);
|
||||
|
||||
return ni;
|
||||
}
|
||||
|
||||
static nir_loop *
|
||||
clone_loop(clone_state *state, struct exec_list *cf_list, const nir_loop *loop)
|
||||
{
|
||||
nir_loop *nloop = nir_loop_create(state->ns);
|
||||
|
||||
nir_cf_node_insert_end(cf_list, &nloop->cf_node);
|
||||
|
||||
clone_cf_list(state, &nloop->body, &loop->body);
|
||||
|
||||
return nloop;
|
||||
}
|
||||
|
||||
/* clone list of nir_cf_node: */
|
||||
static void
|
||||
clone_cf_list(clone_state *state, struct exec_list *dst,
|
||||
const struct exec_list *list)
|
||||
{
|
||||
foreach_list_typed(nir_cf_node, cf, node, list) {
|
||||
switch (cf->type) {
|
||||
case nir_cf_node_block:
|
||||
clone_block(state, dst, nir_cf_node_as_block(cf));
|
||||
break;
|
||||
case nir_cf_node_if:
|
||||
clone_if(state, dst, nir_cf_node_as_if(cf));
|
||||
break;
|
||||
case nir_cf_node_loop:
|
||||
clone_loop(state, dst, nir_cf_node_as_loop(cf));
|
||||
break;
|
||||
default:
|
||||
unreachable("bad cf type");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static nir_function_impl *
|
||||
clone_function_impl(clone_state *state, const nir_function_impl *fi,
|
||||
nir_function *nfxn)
|
||||
{
|
||||
nir_function_impl *nfi = nir_function_impl_create(nfxn);
|
||||
|
||||
clone_var_list(state, &nfi->locals, &fi->locals);
|
||||
clone_reg_list(state, &nfi->registers, &fi->registers);
|
||||
nfi->reg_alloc = fi->reg_alloc;
|
||||
|
||||
nfi->num_params = fi->num_params;
|
||||
nfi->params = ralloc_array(state->ns, nir_variable *, fi->num_params);
|
||||
for (unsigned i = 0; i < fi->num_params; i++) {
|
||||
nfi->params[i] = lookup_ptr(state, fi->params[i]);
|
||||
}
|
||||
nfi->return_var = lookup_ptr(state, fi->return_var);
|
||||
|
||||
assert(list_empty(&state->phi_srcs));
|
||||
|
||||
clone_cf_list(state, &nfi->body, &fi->body);
|
||||
|
||||
/* After we've cloned almost everything, we have to walk the list of phi
|
||||
* sources and fix them up. Thanks to loops, the block and SSA value for a
|
||||
* phi source may not be defined when we first encounter it. Instead, we
|
||||
* add it to the phi_srcs list and we fix it up here.
|
||||
*/
|
||||
list_for_each_entry_safe(nir_phi_src, src, &state->phi_srcs, src.use_link) {
|
||||
src->pred = lookup_ptr(state, src->pred);
|
||||
assert(src->src.is_ssa);
|
||||
src->src.ssa = lookup_ptr(state, src->src.ssa);
|
||||
|
||||
/* Remove from this list and place in the uses of the SSA def */
|
||||
list_del(&src->src.use_link);
|
||||
list_addtail(&src->src.use_link, &src->src.ssa->uses);
|
||||
}
|
||||
assert(list_empty(&state->phi_srcs));
|
||||
|
||||
/* All metadata is invalidated in the cloning process */
|
||||
nfi->valid_metadata = 0;
|
||||
|
||||
return nfi;
|
||||
}
|
||||
|
||||
static nir_function *
|
||||
clone_function(clone_state *state, const nir_function *fxn, nir_shader *ns)
|
||||
{
|
||||
assert(ns == state->ns);
|
||||
nir_function *nfxn = nir_function_create(ns, fxn->name);
|
||||
|
||||
/* Needed for call instructions */
|
||||
store_ptr(state, nfxn, fxn);
|
||||
|
||||
nfxn->num_params = fxn->num_params;
|
||||
nfxn->params = ralloc_array(state->ns, nir_parameter, fxn->num_params);
|
||||
memcpy(nfxn->params, fxn->params, sizeof(nir_parameter) * fxn->num_params);
|
||||
|
||||
nfxn->return_type = fxn->return_type;
|
||||
|
||||
/* At first glance, it looks like we should clone the function_impl here.
|
||||
* However, call instructions need to be able to reference at least the
|
||||
* function and those will get processed as we clone the function_impl's.
|
||||
* We stop here and do function_impls as a second pass.
|
||||
*/
|
||||
|
||||
return nfxn;
|
||||
}
|
||||
|
||||
nir_shader *
|
||||
nir_shader_clone(void *mem_ctx, const nir_shader *s)
|
||||
{
|
||||
clone_state state;
|
||||
init_clone_state(&state);
|
||||
|
||||
nir_shader *ns = nir_shader_create(mem_ctx, s->stage, s->options);
|
||||
state.ns = ns;
|
||||
|
||||
clone_var_list(&state, &ns->uniforms, &s->uniforms);
|
||||
clone_var_list(&state, &ns->inputs, &s->inputs);
|
||||
clone_var_list(&state, &ns->outputs, &s->outputs);
|
||||
clone_var_list(&state, &ns->globals, &s->globals);
|
||||
clone_var_list(&state, &ns->system_values, &s->system_values);
|
||||
|
||||
/* Go through and clone functions */
|
||||
foreach_list_typed(nir_function, fxn, node, &s->functions)
|
||||
clone_function(&state, fxn, ns);
|
||||
|
||||
/* Only after all functions are cloned can we clone the actual function
|
||||
* implementations. This is because nir_call_instr's need to reference the
|
||||
* functions of other functions and we don't know what order the functions
|
||||
* will have in the list.
|
||||
*/
|
||||
nir_foreach_function(s, fxn) {
|
||||
nir_function *nfxn = lookup_ptr(&state, fxn);
|
||||
clone_function_impl(&state, fxn->impl, nfxn);
|
||||
}
|
||||
|
||||
clone_reg_list(&state, &ns->registers, &s->registers);
|
||||
ns->reg_alloc = s->reg_alloc;
|
||||
|
||||
ns->info = s->info;
|
||||
ns->info.name = ralloc_strdup(ns, ns->info.name);
|
||||
if (ns->info.label)
|
||||
ns->info.label = ralloc_strdup(ns, ns->info.label);
|
||||
|
||||
ns->num_inputs = s->num_inputs;
|
||||
ns->num_uniforms = s->num_uniforms;
|
||||
ns->num_outputs = s->num_outputs;
|
||||
|
||||
free_clone_state(&state);
|
||||
|
||||
return ns;
|
||||
}
|
||||
@@ -1,808 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Connor Abbott (cwabbott0@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "nir_control_flow_private.h"
|
||||
|
||||
/**
|
||||
* \name Control flow modification
|
||||
*
|
||||
* These functions modify the control flow tree while keeping the control flow
|
||||
* graph up-to-date. The invariants respected are:
|
||||
* 1. Each then statement, else statement, or loop body must have at least one
|
||||
* control flow node.
|
||||
* 2. Each if-statement and loop must have one basic block before it and one
|
||||
* after.
|
||||
* 3. Two basic blocks cannot be directly next to each other.
|
||||
* 4. If a basic block has a jump instruction, there must be only one and it
|
||||
* must be at the end of the block.
|
||||
* 5. The CFG must always be connected - this means that we must insert a fake
|
||||
* CFG edge for loops with no break statement.
|
||||
*
|
||||
* The purpose of the second one is so that we have places to insert code during
|
||||
* GCM, as well as eliminating the possibility of critical edges.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
static bool
|
||||
block_ends_in_jump(nir_block *block)
|
||||
{
|
||||
return !exec_list_is_empty(&block->instr_list) &&
|
||||
nir_block_last_instr(block)->type == nir_instr_type_jump;
|
||||
}
|
||||
|
||||
static inline void
|
||||
block_add_pred(nir_block *block, nir_block *pred)
|
||||
{
|
||||
_mesa_set_add(block->predecessors, pred);
|
||||
}
|
||||
|
||||
static inline void
|
||||
block_remove_pred(nir_block *block, nir_block *pred)
|
||||
{
|
||||
struct set_entry *entry = _mesa_set_search(block->predecessors, pred);
|
||||
|
||||
assert(entry);
|
||||
|
||||
_mesa_set_remove(block->predecessors, entry);
|
||||
}
|
||||
|
||||
static void
|
||||
link_blocks(nir_block *pred, nir_block *succ1, nir_block *succ2)
|
||||
{
|
||||
pred->successors[0] = succ1;
|
||||
if (succ1 != NULL)
|
||||
block_add_pred(succ1, pred);
|
||||
|
||||
pred->successors[1] = succ2;
|
||||
if (succ2 != NULL)
|
||||
block_add_pred(succ2, pred);
|
||||
}
|
||||
|
||||
static void
|
||||
unlink_blocks(nir_block *pred, nir_block *succ)
|
||||
{
|
||||
if (pred->successors[0] == succ) {
|
||||
pred->successors[0] = pred->successors[1];
|
||||
pred->successors[1] = NULL;
|
||||
} else {
|
||||
assert(pred->successors[1] == succ);
|
||||
pred->successors[1] = NULL;
|
||||
}
|
||||
|
||||
block_remove_pred(succ, pred);
|
||||
}
|
||||
|
||||
static void
|
||||
unlink_block_successors(nir_block *block)
|
||||
{
|
||||
if (block->successors[1] != NULL)
|
||||
unlink_blocks(block, block->successors[1]);
|
||||
if (block->successors[0] != NULL)
|
||||
unlink_blocks(block, block->successors[0]);
|
||||
}
|
||||
|
||||
static void
|
||||
link_non_block_to_block(nir_cf_node *node, nir_block *block)
|
||||
{
|
||||
if (node->type == nir_cf_node_if) {
|
||||
/*
|
||||
* We're trying to link an if to a block after it; this just means linking
|
||||
* the last block of the then and else branches.
|
||||
*/
|
||||
|
||||
nir_if *if_stmt = nir_cf_node_as_if(node);
|
||||
|
||||
nir_cf_node *last_then = nir_if_last_then_node(if_stmt);
|
||||
assert(last_then->type == nir_cf_node_block);
|
||||
nir_block *last_then_block = nir_cf_node_as_block(last_then);
|
||||
|
||||
nir_cf_node *last_else = nir_if_last_else_node(if_stmt);
|
||||
assert(last_else->type == nir_cf_node_block);
|
||||
nir_block *last_else_block = nir_cf_node_as_block(last_else);
|
||||
|
||||
if (!block_ends_in_jump(last_then_block)) {
|
||||
unlink_block_successors(last_then_block);
|
||||
link_blocks(last_then_block, block, NULL);
|
||||
}
|
||||
|
||||
if (!block_ends_in_jump(last_else_block)) {
|
||||
unlink_block_successors(last_else_block);
|
||||
link_blocks(last_else_block, block, NULL);
|
||||
}
|
||||
} else {
|
||||
assert(node->type == nir_cf_node_loop);
|
||||
|
||||
/*
|
||||
* We can only get to this codepath if we're inserting a new loop, or
|
||||
* at least a loop with no break statements; we can't insert break
|
||||
* statements into a loop when we haven't inserted it into the CFG
|
||||
* because we wouldn't know which block comes after the loop
|
||||
* and therefore, which block should be the successor of the block with
|
||||
* the break). Therefore, we need to insert a fake edge (see invariant
|
||||
* #5).
|
||||
*/
|
||||
|
||||
nir_loop *loop = nir_cf_node_as_loop(node);
|
||||
|
||||
nir_cf_node *last = nir_loop_last_cf_node(loop);
|
||||
assert(last->type == nir_cf_node_block);
|
||||
nir_block *last_block = nir_cf_node_as_block(last);
|
||||
|
||||
last_block->successors[1] = block;
|
||||
block_add_pred(block, last_block);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
link_block_to_non_block(nir_block *block, nir_cf_node *node)
|
||||
{
|
||||
if (node->type == nir_cf_node_if) {
|
||||
/*
|
||||
* We're trying to link a block to an if after it; this just means linking
|
||||
* the block to the first block of the then and else branches.
|
||||
*/
|
||||
|
||||
nir_if *if_stmt = nir_cf_node_as_if(node);
|
||||
|
||||
nir_cf_node *first_then = nir_if_first_then_node(if_stmt);
|
||||
assert(first_then->type == nir_cf_node_block);
|
||||
nir_block *first_then_block = nir_cf_node_as_block(first_then);
|
||||
|
||||
nir_cf_node *first_else = nir_if_first_else_node(if_stmt);
|
||||
assert(first_else->type == nir_cf_node_block);
|
||||
nir_block *first_else_block = nir_cf_node_as_block(first_else);
|
||||
|
||||
unlink_block_successors(block);
|
||||
link_blocks(block, first_then_block, first_else_block);
|
||||
} else {
|
||||
/*
|
||||
* For similar reasons as the corresponding case in
|
||||
* link_non_block_to_block(), don't worry about if the loop header has
|
||||
* any predecessors that need to be unlinked.
|
||||
*/
|
||||
|
||||
assert(node->type == nir_cf_node_loop);
|
||||
|
||||
nir_loop *loop = nir_cf_node_as_loop(node);
|
||||
|
||||
nir_cf_node *loop_header = nir_loop_first_cf_node(loop);
|
||||
assert(loop_header->type == nir_cf_node_block);
|
||||
nir_block *loop_header_block = nir_cf_node_as_block(loop_header);
|
||||
|
||||
unlink_block_successors(block);
|
||||
link_blocks(block, loop_header_block, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace a block's successor with a different one.
|
||||
*/
|
||||
static void
|
||||
replace_successor(nir_block *block, nir_block *old_succ, nir_block *new_succ)
|
||||
{
|
||||
if (block->successors[0] == old_succ) {
|
||||
block->successors[0] = new_succ;
|
||||
} else {
|
||||
assert(block->successors[1] == old_succ);
|
||||
block->successors[1] = new_succ;
|
||||
}
|
||||
|
||||
block_remove_pred(old_succ, block);
|
||||
block_add_pred(new_succ, block);
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes a basic block and inserts a new empty basic block before it, making its
|
||||
* predecessors point to the new block. This essentially splits the block into
|
||||
* an empty header and a body so that another non-block CF node can be inserted
|
||||
* between the two. Note that this does *not* link the two basic blocks, so
|
||||
* some kind of cleanup *must* be performed after this call.
|
||||
*/
|
||||
|
||||
static nir_block *
|
||||
split_block_beginning(nir_block *block)
|
||||
{
|
||||
nir_block *new_block = nir_block_create(ralloc_parent(block));
|
||||
new_block->cf_node.parent = block->cf_node.parent;
|
||||
exec_node_insert_node_before(&block->cf_node.node, &new_block->cf_node.node);
|
||||
|
||||
struct set_entry *entry;
|
||||
set_foreach(block->predecessors, entry) {
|
||||
nir_block *pred = (nir_block *) entry->key;
|
||||
replace_successor(pred, block, new_block);
|
||||
}
|
||||
|
||||
/* Any phi nodes must stay part of the new block, or else their
|
||||
* sourcse will be messed up. This will reverse the order of the phi's, but
|
||||
* order shouldn't matter.
|
||||
*/
|
||||
nir_foreach_instr_safe(block, instr) {
|
||||
if (instr->type != nir_instr_type_phi)
|
||||
break;
|
||||
|
||||
exec_node_remove(&instr->node);
|
||||
instr->block = new_block;
|
||||
exec_list_push_head(&new_block->instr_list, &instr->node);
|
||||
}
|
||||
|
||||
return new_block;
|
||||
}
|
||||
|
||||
static void
|
||||
rewrite_phi_preds(nir_block *block, nir_block *old_pred, nir_block *new_pred)
|
||||
{
|
||||
nir_foreach_instr_safe(block, instr) {
|
||||
if (instr->type != nir_instr_type_phi)
|
||||
break;
|
||||
|
||||
nir_phi_instr *phi = nir_instr_as_phi(instr);
|
||||
nir_foreach_phi_src(phi, src) {
|
||||
if (src->pred == old_pred) {
|
||||
src->pred = new_pred;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
insert_phi_undef(nir_block *block, nir_block *pred)
|
||||
{
|
||||
nir_function_impl *impl = nir_cf_node_get_function(&block->cf_node);
|
||||
nir_foreach_instr(block, instr) {
|
||||
if (instr->type != nir_instr_type_phi)
|
||||
break;
|
||||
|
||||
nir_phi_instr *phi = nir_instr_as_phi(instr);
|
||||
nir_ssa_undef_instr *undef =
|
||||
nir_ssa_undef_instr_create(ralloc_parent(phi),
|
||||
phi->dest.ssa.num_components);
|
||||
nir_instr_insert_before_cf_list(&impl->body, &undef->instr);
|
||||
nir_phi_src *src = ralloc(phi, nir_phi_src);
|
||||
src->pred = pred;
|
||||
src->src.parent_instr = &phi->instr;
|
||||
src->src.is_ssa = true;
|
||||
src->src.ssa = &undef->def;
|
||||
|
||||
list_addtail(&src->src.use_link, &undef->def.uses);
|
||||
|
||||
exec_list_push_tail(&phi->srcs, &src->node);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the successors of source to the successors of dest, leaving both
|
||||
* successors of source NULL.
|
||||
*/
|
||||
|
||||
static void
|
||||
move_successors(nir_block *source, nir_block *dest)
|
||||
{
|
||||
nir_block *succ1 = source->successors[0];
|
||||
nir_block *succ2 = source->successors[1];
|
||||
|
||||
if (succ1) {
|
||||
unlink_blocks(source, succ1);
|
||||
rewrite_phi_preds(succ1, source, dest);
|
||||
}
|
||||
|
||||
if (succ2) {
|
||||
unlink_blocks(source, succ2);
|
||||
rewrite_phi_preds(succ2, source, dest);
|
||||
}
|
||||
|
||||
unlink_block_successors(dest);
|
||||
link_blocks(dest, succ1, succ2);
|
||||
}
|
||||
|
||||
/* Given a basic block with no successors that has been inserted into the
|
||||
* control flow tree, gives it the successors it would normally have assuming
|
||||
* it doesn't end in a jump instruction. Also inserts phi sources with undefs
|
||||
* if necessary.
|
||||
*/
|
||||
static void
|
||||
block_add_normal_succs(nir_block *block)
|
||||
{
|
||||
if (exec_node_is_tail_sentinel(block->cf_node.node.next)) {
|
||||
nir_cf_node *parent = block->cf_node.parent;
|
||||
if (parent->type == nir_cf_node_if) {
|
||||
nir_cf_node *next = nir_cf_node_next(parent);
|
||||
assert(next->type == nir_cf_node_block);
|
||||
nir_block *next_block = nir_cf_node_as_block(next);
|
||||
|
||||
link_blocks(block, next_block, NULL);
|
||||
} else {
|
||||
assert(parent->type == nir_cf_node_loop);
|
||||
nir_loop *loop = nir_cf_node_as_loop(parent);
|
||||
|
||||
nir_cf_node *head = nir_loop_first_cf_node(loop);
|
||||
assert(head->type == nir_cf_node_block);
|
||||
nir_block *head_block = nir_cf_node_as_block(head);
|
||||
|
||||
link_blocks(block, head_block, NULL);
|
||||
insert_phi_undef(head_block, block);
|
||||
}
|
||||
} else {
|
||||
nir_cf_node *next = nir_cf_node_next(&block->cf_node);
|
||||
if (next->type == nir_cf_node_if) {
|
||||
nir_if *next_if = nir_cf_node_as_if(next);
|
||||
|
||||
nir_cf_node *first_then = nir_if_first_then_node(next_if);
|
||||
assert(first_then->type == nir_cf_node_block);
|
||||
nir_block *first_then_block = nir_cf_node_as_block(first_then);
|
||||
|
||||
nir_cf_node *first_else = nir_if_first_else_node(next_if);
|
||||
assert(first_else->type == nir_cf_node_block);
|
||||
nir_block *first_else_block = nir_cf_node_as_block(first_else);
|
||||
|
||||
link_blocks(block, first_then_block, first_else_block);
|
||||
} else {
|
||||
assert(next->type == nir_cf_node_loop);
|
||||
nir_loop *next_loop = nir_cf_node_as_loop(next);
|
||||
|
||||
nir_cf_node *first = nir_loop_first_cf_node(next_loop);
|
||||
assert(first->type == nir_cf_node_block);
|
||||
nir_block *first_block = nir_cf_node_as_block(first);
|
||||
|
||||
link_blocks(block, first_block, NULL);
|
||||
insert_phi_undef(first_block, block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static nir_block *
|
||||
split_block_end(nir_block *block)
|
||||
{
|
||||
nir_block *new_block = nir_block_create(ralloc_parent(block));
|
||||
new_block->cf_node.parent = block->cf_node.parent;
|
||||
exec_node_insert_after(&block->cf_node.node, &new_block->cf_node.node);
|
||||
|
||||
if (block_ends_in_jump(block)) {
|
||||
/* Figure out what successor block would've had if it didn't have a jump
|
||||
* instruction, and make new_block have that successor.
|
||||
*/
|
||||
block_add_normal_succs(new_block);
|
||||
} else {
|
||||
move_successors(block, new_block);
|
||||
}
|
||||
|
||||
return new_block;
|
||||
}
|
||||
|
||||
static nir_block *
|
||||
split_block_before_instr(nir_instr *instr)
|
||||
{
|
||||
assert(instr->type != nir_instr_type_phi);
|
||||
nir_block *new_block = split_block_beginning(instr->block);
|
||||
|
||||
nir_foreach_instr_safe(instr->block, cur_instr) {
|
||||
if (cur_instr == instr)
|
||||
break;
|
||||
|
||||
exec_node_remove(&cur_instr->node);
|
||||
cur_instr->block = new_block;
|
||||
exec_list_push_tail(&new_block->instr_list, &cur_instr->node);
|
||||
}
|
||||
|
||||
return new_block;
|
||||
}
|
||||
|
||||
/* Splits a basic block at the point specified by the cursor. The "before" and
|
||||
* "after" arguments are filled out with the blocks resulting from the split
|
||||
* if non-NULL. Note that the "beginning" of the block is actually interpreted
|
||||
* as before the first non-phi instruction, and it's illegal to split a block
|
||||
* before a phi instruction.
|
||||
*/
|
||||
|
||||
static void
|
||||
split_block_cursor(nir_cursor cursor,
|
||||
nir_block **_before, nir_block **_after)
|
||||
{
|
||||
nir_block *before, *after;
|
||||
switch (cursor.option) {
|
||||
case nir_cursor_before_block:
|
||||
after = cursor.block;
|
||||
before = split_block_beginning(cursor.block);
|
||||
break;
|
||||
|
||||
case nir_cursor_after_block:
|
||||
before = cursor.block;
|
||||
after = split_block_end(cursor.block);
|
||||
break;
|
||||
|
||||
case nir_cursor_before_instr:
|
||||
after = cursor.instr->block;
|
||||
before = split_block_before_instr(cursor.instr);
|
||||
break;
|
||||
|
||||
case nir_cursor_after_instr:
|
||||
/* We lower this to split_block_before_instr() so that we can keep the
|
||||
* after-a-jump-instr case contained to split_block_end().
|
||||
*/
|
||||
if (nir_instr_is_last(cursor.instr)) {
|
||||
before = cursor.instr->block;
|
||||
after = split_block_end(cursor.instr->block);
|
||||
} else {
|
||||
after = cursor.instr->block;
|
||||
before = split_block_before_instr(nir_instr_next(cursor.instr));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
unreachable("not reached");
|
||||
}
|
||||
|
||||
if (_before)
|
||||
*_before = before;
|
||||
if (_after)
|
||||
*_after = after;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts a non-basic block between two basic blocks and links them together.
|
||||
*/
|
||||
|
||||
static void
|
||||
insert_non_block(nir_block *before, nir_cf_node *node, nir_block *after)
|
||||
{
|
||||
node->parent = before->cf_node.parent;
|
||||
exec_node_insert_after(&before->cf_node.node, &node->node);
|
||||
link_block_to_non_block(before, node);
|
||||
link_non_block_to_block(node, after);
|
||||
}
|
||||
|
||||
/* walk up the control flow tree to find the innermost enclosed loop */
|
||||
static nir_loop *
|
||||
nearest_loop(nir_cf_node *node)
|
||||
{
|
||||
while (node->type != nir_cf_node_loop) {
|
||||
node = node->parent;
|
||||
}
|
||||
|
||||
return nir_cf_node_as_loop(node);
|
||||
}
|
||||
|
||||
/*
|
||||
* update the CFG after a jump instruction has been added to the end of a block
|
||||
*/
|
||||
|
||||
void
|
||||
nir_handle_add_jump(nir_block *block)
|
||||
{
|
||||
nir_instr *instr = nir_block_last_instr(block);
|
||||
nir_jump_instr *jump_instr = nir_instr_as_jump(instr);
|
||||
|
||||
unlink_block_successors(block);
|
||||
|
||||
nir_function_impl *impl = nir_cf_node_get_function(&block->cf_node);
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
|
||||
if (jump_instr->type == nir_jump_break ||
|
||||
jump_instr->type == nir_jump_continue) {
|
||||
nir_loop *loop = nearest_loop(&block->cf_node);
|
||||
|
||||
if (jump_instr->type == nir_jump_continue) {
|
||||
nir_cf_node *first_node = nir_loop_first_cf_node(loop);
|
||||
assert(first_node->type == nir_cf_node_block);
|
||||
nir_block *first_block = nir_cf_node_as_block(first_node);
|
||||
link_blocks(block, first_block, NULL);
|
||||
} else {
|
||||
nir_cf_node *after = nir_cf_node_next(&loop->cf_node);
|
||||
assert(after->type == nir_cf_node_block);
|
||||
nir_block *after_block = nir_cf_node_as_block(after);
|
||||
link_blocks(block, after_block, NULL);
|
||||
|
||||
/* If we inserted a fake link, remove it */
|
||||
nir_cf_node *last = nir_loop_last_cf_node(loop);
|
||||
assert(last->type == nir_cf_node_block);
|
||||
nir_block *last_block = nir_cf_node_as_block(last);
|
||||
if (last_block->successors[1] != NULL)
|
||||
unlink_blocks(last_block, after_block);
|
||||
}
|
||||
} else {
|
||||
assert(jump_instr->type == nir_jump_return);
|
||||
link_blocks(block, impl->end_block, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
remove_phi_src(nir_block *block, nir_block *pred)
|
||||
{
|
||||
nir_foreach_instr(block, instr) {
|
||||
if (instr->type != nir_instr_type_phi)
|
||||
break;
|
||||
|
||||
nir_phi_instr *phi = nir_instr_as_phi(instr);
|
||||
nir_foreach_phi_src_safe(phi, src) {
|
||||
if (src->pred == pred) {
|
||||
list_del(&src->src.use_link);
|
||||
exec_node_remove(&src->node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Removes the successor of a block with a jump, and inserts a fake edge for
|
||||
* infinite loops. Note that the jump to be eliminated may be free-floating.
|
||||
*/
|
||||
|
||||
static void
|
||||
unlink_jump(nir_block *block, nir_jump_type type, bool add_normal_successors)
|
||||
{
|
||||
nir_block *next = block->successors[0];
|
||||
|
||||
if (block->successors[0])
|
||||
remove_phi_src(block->successors[0], block);
|
||||
if (block->successors[1])
|
||||
remove_phi_src(block->successors[1], block);
|
||||
|
||||
unlink_block_successors(block);
|
||||
if (add_normal_successors)
|
||||
block_add_normal_succs(block);
|
||||
|
||||
/* If we've just removed a break, and the block we were jumping to (after
|
||||
* the loop) now has zero predecessors, we've created a new infinite loop.
|
||||
*
|
||||
* NIR doesn't allow blocks (other than the start block) to have zero
|
||||
* predecessors. In particular, dominance assumes all blocks are reachable.
|
||||
* So, we insert a "fake link" by making successors[1] point after the loop.
|
||||
*
|
||||
* Note that we have to do this after unlinking/recreating the block's
|
||||
* successors. If we removed a "break" at the end of the loop, then
|
||||
* block == last_block, so block->successors[0] would already be "next",
|
||||
* and adding a fake link would create two identical successors. Doing
|
||||
* this afterward works, as we'll have changed block->successors[0] to
|
||||
* be the top of the loop.
|
||||
*/
|
||||
if (type == nir_jump_break && next->predecessors->entries == 0) {
|
||||
nir_loop *loop =
|
||||
nir_cf_node_as_loop(nir_cf_node_prev(&next->cf_node));
|
||||
|
||||
/* insert fake link */
|
||||
nir_cf_node *last = nir_loop_last_cf_node(loop);
|
||||
assert(last->type == nir_cf_node_block);
|
||||
nir_block *last_block = nir_cf_node_as_block(last);
|
||||
|
||||
last_block->successors[1] = next;
|
||||
block_add_pred(next, last_block);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nir_handle_remove_jump(nir_block *block, nir_jump_type type)
|
||||
{
|
||||
unlink_jump(block, type, true);
|
||||
|
||||
nir_function_impl *impl = nir_cf_node_get_function(&block->cf_node);
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
}
|
||||
|
||||
static void
|
||||
update_if_uses(nir_cf_node *node)
|
||||
{
|
||||
if (node->type != nir_cf_node_if)
|
||||
return;
|
||||
|
||||
nir_if *if_stmt = nir_cf_node_as_if(node);
|
||||
|
||||
if_stmt->condition.parent_if = if_stmt;
|
||||
if (if_stmt->condition.is_ssa) {
|
||||
list_addtail(&if_stmt->condition.use_link,
|
||||
&if_stmt->condition.ssa->if_uses);
|
||||
} else {
|
||||
list_addtail(&if_stmt->condition.use_link,
|
||||
&if_stmt->condition.reg.reg->if_uses);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stitch two basic blocks together into one. The aggregate must have the same
|
||||
* predecessors as the first and the same successors as the second.
|
||||
*/
|
||||
|
||||
static void
|
||||
stitch_blocks(nir_block *before, nir_block *after)
|
||||
{
|
||||
/*
|
||||
* We move after into before, so we have to deal with up to 2 successors vs.
|
||||
* possibly a large number of predecessors.
|
||||
*
|
||||
* TODO: special case when before is empty and after isn't?
|
||||
*/
|
||||
|
||||
if (block_ends_in_jump(before)) {
|
||||
assert(exec_list_is_empty(&after->instr_list));
|
||||
if (after->successors[0])
|
||||
remove_phi_src(after->successors[0], after);
|
||||
if (after->successors[1])
|
||||
remove_phi_src(after->successors[1], after);
|
||||
unlink_block_successors(after);
|
||||
exec_node_remove(&after->cf_node.node);
|
||||
} else {
|
||||
move_successors(after, before);
|
||||
|
||||
foreach_list_typed(nir_instr, instr, node, &after->instr_list) {
|
||||
instr->block = before;
|
||||
}
|
||||
|
||||
exec_list_append(&before->instr_list, &after->instr_list);
|
||||
exec_node_remove(&after->cf_node.node);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nir_cf_node_insert(nir_cursor cursor, nir_cf_node *node)
|
||||
{
|
||||
nir_block *before, *after;
|
||||
|
||||
split_block_cursor(cursor, &before, &after);
|
||||
|
||||
if (node->type == nir_cf_node_block) {
|
||||
nir_block *block = nir_cf_node_as_block(node);
|
||||
exec_node_insert_after(&before->cf_node.node, &block->cf_node.node);
|
||||
block->cf_node.parent = before->cf_node.parent;
|
||||
/* stitch_blocks() assumes that any block that ends with a jump has
|
||||
* already been setup with the correct successors, so we need to set
|
||||
* up jumps here as the block is being inserted.
|
||||
*/
|
||||
if (block_ends_in_jump(block))
|
||||
nir_handle_add_jump(block);
|
||||
|
||||
stitch_blocks(block, after);
|
||||
stitch_blocks(before, block);
|
||||
} else {
|
||||
update_if_uses(node);
|
||||
insert_non_block(before, node, after);
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
replace_ssa_def_uses(nir_ssa_def *def, void *void_impl)
|
||||
{
|
||||
nir_function_impl *impl = void_impl;
|
||||
void *mem_ctx = ralloc_parent(impl);
|
||||
|
||||
nir_ssa_undef_instr *undef =
|
||||
nir_ssa_undef_instr_create(mem_ctx, def->num_components);
|
||||
nir_instr_insert_before_cf_list(&impl->body, &undef->instr);
|
||||
nir_ssa_def_rewrite_uses(def, nir_src_for_ssa(&undef->def));
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup_cf_node(nir_cf_node *node, nir_function_impl *impl)
|
||||
{
|
||||
switch (node->type) {
|
||||
case nir_cf_node_block: {
|
||||
nir_block *block = nir_cf_node_as_block(node);
|
||||
/* We need to walk the instructions and clean up defs/uses */
|
||||
nir_foreach_instr_safe(block, instr) {
|
||||
if (instr->type == nir_instr_type_jump) {
|
||||
nir_jump_type jump_type = nir_instr_as_jump(instr)->type;
|
||||
unlink_jump(block, jump_type, false);
|
||||
} else {
|
||||
nir_foreach_ssa_def(instr, replace_ssa_def_uses, impl);
|
||||
nir_instr_remove(instr);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case nir_cf_node_if: {
|
||||
nir_if *if_stmt = nir_cf_node_as_if(node);
|
||||
foreach_list_typed(nir_cf_node, child, node, &if_stmt->then_list)
|
||||
cleanup_cf_node(child, impl);
|
||||
foreach_list_typed(nir_cf_node, child, node, &if_stmt->else_list)
|
||||
cleanup_cf_node(child, impl);
|
||||
|
||||
list_del(&if_stmt->condition.use_link);
|
||||
break;
|
||||
}
|
||||
|
||||
case nir_cf_node_loop: {
|
||||
nir_loop *loop = nir_cf_node_as_loop(node);
|
||||
foreach_list_typed(nir_cf_node, child, node, &loop->body)
|
||||
cleanup_cf_node(child, impl);
|
||||
break;
|
||||
}
|
||||
case nir_cf_node_function: {
|
||||
nir_function_impl *impl = nir_cf_node_as_function(node);
|
||||
foreach_list_typed(nir_cf_node, child, node, &impl->body)
|
||||
cleanup_cf_node(child, impl);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
unreachable("Invalid CF node type");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nir_cf_extract(nir_cf_list *extracted, nir_cursor begin, nir_cursor end)
|
||||
{
|
||||
nir_block *block_begin, *block_end, *block_before, *block_after;
|
||||
|
||||
/* In the case where begin points to an instruction in some basic block and
|
||||
* end points to the end of the same basic block, we rely on the fact that
|
||||
* splitting on an instruction moves earlier instructions into a new basic
|
||||
* block. If the later instructions were moved instead, then the end cursor
|
||||
* would be pointing to the same place that begin used to point to, which
|
||||
* is obviously not what we want.
|
||||
*/
|
||||
split_block_cursor(begin, &block_before, &block_begin);
|
||||
split_block_cursor(end, &block_end, &block_after);
|
||||
|
||||
extracted->impl = nir_cf_node_get_function(&block_begin->cf_node);
|
||||
exec_list_make_empty(&extracted->list);
|
||||
|
||||
/* Dominance and other block-related information is toast. */
|
||||
nir_metadata_preserve(extracted->impl, nir_metadata_none);
|
||||
|
||||
nir_cf_node *cf_node = &block_begin->cf_node;
|
||||
nir_cf_node *cf_node_end = &block_end->cf_node;
|
||||
while (true) {
|
||||
nir_cf_node *next = nir_cf_node_next(cf_node);
|
||||
|
||||
exec_node_remove(&cf_node->node);
|
||||
cf_node->parent = NULL;
|
||||
exec_list_push_tail(&extracted->list, &cf_node->node);
|
||||
|
||||
if (cf_node == cf_node_end)
|
||||
break;
|
||||
|
||||
cf_node = next;
|
||||
}
|
||||
|
||||
stitch_blocks(block_before, block_after);
|
||||
}
|
||||
|
||||
void
|
||||
nir_cf_reinsert(nir_cf_list *cf_list, nir_cursor cursor)
|
||||
{
|
||||
nir_block *before, *after;
|
||||
|
||||
split_block_cursor(cursor, &before, &after);
|
||||
|
||||
foreach_list_typed_safe(nir_cf_node, node, node, &cf_list->list) {
|
||||
exec_node_remove(&node->node);
|
||||
node->parent = before->cf_node.parent;
|
||||
exec_node_insert_node_before(&after->cf_node.node, &node->node);
|
||||
}
|
||||
|
||||
stitch_blocks(before,
|
||||
nir_cf_node_as_block(nir_cf_node_next(&before->cf_node)));
|
||||
stitch_blocks(nir_cf_node_as_block(nir_cf_node_prev(&after->cf_node)),
|
||||
after);
|
||||
}
|
||||
|
||||
void
|
||||
nir_cf_delete(nir_cf_list *cf_list)
|
||||
{
|
||||
foreach_list_typed(nir_cf_node, node, node, &cf_list->list) {
|
||||
cleanup_cf_node(node, cf_list->impl);
|
||||
}
|
||||
}
|
||||
@@ -1,162 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Connor Abbott (cwabbott0@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** NIR Control Flow Modification
|
||||
*
|
||||
* This file contains various API's that make modifying control flow in NIR,
|
||||
* while maintaining the invariants checked by the validator, much easier.
|
||||
* There are two parts to this:
|
||||
*
|
||||
* 1. Inserting control flow (if's and loops) in various places, for creating
|
||||
* IR either from scratch or as part of some lowering pass.
|
||||
* 2. Taking existing pieces of the IR and either moving them around or
|
||||
* deleting them.
|
||||
*/
|
||||
|
||||
/** Control flow insertion. */
|
||||
|
||||
/** puts a control flow node where the cursor is */
|
||||
void nir_cf_node_insert(nir_cursor cursor, nir_cf_node *node);
|
||||
|
||||
/** puts a control flow node immediately after another control flow node */
|
||||
static inline void
|
||||
nir_cf_node_insert_after(nir_cf_node *node, nir_cf_node *after)
|
||||
{
|
||||
nir_cf_node_insert(nir_after_cf_node(node), after);
|
||||
}
|
||||
|
||||
/** puts a control flow node immediately before another control flow node */
|
||||
static inline void
|
||||
nir_cf_node_insert_before(nir_cf_node *node, nir_cf_node *before)
|
||||
{
|
||||
nir_cf_node_insert(nir_before_cf_node(node), before);
|
||||
}
|
||||
|
||||
/** puts a control flow node at the beginning of a list from an if, loop, or function */
|
||||
static inline void
|
||||
nir_cf_node_insert_begin(struct exec_list *list, nir_cf_node *node)
|
||||
{
|
||||
nir_cf_node_insert(nir_before_cf_list(list), node);
|
||||
}
|
||||
|
||||
/** puts a control flow node at the end of a list from an if, loop, or function */
|
||||
static inline void
|
||||
nir_cf_node_insert_end(struct exec_list *list, nir_cf_node *node)
|
||||
{
|
||||
nir_cf_node_insert(nir_after_cf_list(list), node);
|
||||
}
|
||||
|
||||
|
||||
/** Control flow motion.
|
||||
*
|
||||
* These functions let you take a part of a control flow list (basically
|
||||
* equivalent to a series of statement in GLSL) and "extract" it from the IR,
|
||||
* so that it's a free-floating piece of IR that can be either re-inserted
|
||||
* somewhere else or deleted entirely. A few notes on using it:
|
||||
*
|
||||
* 1. Phi nodes are considered attached to the piece of control flow that
|
||||
* their sources come from. There are three places where phi nodes can
|
||||
* occur, which are the three places where a block can have multiple
|
||||
* predecessors:
|
||||
*
|
||||
* 1) After an if statement, if neither branch ends in a jump.
|
||||
* 2) After a loop, if there are multiple break's.
|
||||
* 3) At the beginning of a loop.
|
||||
*
|
||||
* For #1, the phi node is considered to be part of the if, and for #2 and
|
||||
* #3 the phi node is considered to be part of the loop. This allows us to
|
||||
* keep phi's intact, but it means that phi nodes cannot be separated from
|
||||
* the control flow they come from. For example, extracting an if without
|
||||
* extracting all the phi nodes after it is not allowed, and neither is
|
||||
* extracting only some of the phi nodes at the beginning of a block. It
|
||||
* also means that extracting from the beginning of a basic block actually
|
||||
* means extracting from the first non-phi instruction, since there's no
|
||||
* situation where extracting phi nodes without extracting what comes
|
||||
* before them makes any sense.
|
||||
*
|
||||
* 2. Phi node sources are guaranteed to remain valid, meaning that they still
|
||||
* correspond one-to-one with the predecessors of the basic block they're
|
||||
* part of. In addition, the original sources will be preserved unless they
|
||||
* correspond to a break or continue that was deleted. However, no attempt
|
||||
* is made to ensure that SSA form is maintained. In particular, it is
|
||||
* *not* guaranteed that definitions of SSA values will dominate all their
|
||||
* uses after all is said and done. Either the caller must ensure that this
|
||||
* is the case, or it must insert extra phi nodes to restore SSA.
|
||||
*
|
||||
* 3. It is invalid to move a piece of IR with a break/continue outside of the
|
||||
* loop it references. Doing this will result in invalid
|
||||
* successors/predecessors and phi node sources.
|
||||
*
|
||||
* 4. It is invalid to move a piece of IR from one function implementation to
|
||||
* another.
|
||||
*
|
||||
* 5. Extracting a control flow list will leave lots of dangling references to
|
||||
* and from other pieces of the IR. It also leaves things in a not 100%
|
||||
* consistent state. This means that some things (e.g. inserting
|
||||
* instructions) might not work reliably on the extracted control flow. It
|
||||
* also means that extracting control flow without re-inserting it or
|
||||
* deleting it is a Bad Thing (tm).
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
struct exec_list list;
|
||||
nir_function_impl *impl; /* for cleaning up if the list is deleted */
|
||||
} nir_cf_list;
|
||||
|
||||
void nir_cf_extract(nir_cf_list *extracted, nir_cursor begin, nir_cursor end);
|
||||
|
||||
void nir_cf_reinsert(nir_cf_list *cf_list, nir_cursor cursor);
|
||||
|
||||
void nir_cf_delete(nir_cf_list *cf_list);
|
||||
|
||||
static inline void
|
||||
nir_cf_list_extract(nir_cf_list *extracted, struct exec_list *cf_list)
|
||||
{
|
||||
nir_cf_extract(extracted, nir_before_cf_list(cf_list),
|
||||
nir_after_cf_list(cf_list));
|
||||
}
|
||||
|
||||
/** removes a control flow node, doing any cleanup necessary */
|
||||
static inline void
|
||||
nir_cf_node_remove(nir_cf_node *node)
|
||||
{
|
||||
nir_cf_list list;
|
||||
nir_cf_extract(&list, nir_before_cf_node(node), nir_after_cf_node(node));
|
||||
nir_cf_delete(&list);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2015 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
#include "nir_builder.h"
|
||||
|
||||
static nir_intrinsic_instr *
|
||||
as_intrinsic(nir_instr *instr, nir_intrinsic_op op)
|
||||
{
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
return NULL;
|
||||
|
||||
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
|
||||
if (intrin->intrinsic != op)
|
||||
return NULL;
|
||||
|
||||
return intrin;
|
||||
}
|
||||
|
||||
static nir_intrinsic_instr *
|
||||
as_set_vertex_count(nir_instr *instr)
|
||||
{
|
||||
return as_intrinsic(instr, nir_intrinsic_set_vertex_count);
|
||||
}
|
||||
|
||||
/**
|
||||
* If a geometry shader emits a constant number of vertices, return the
|
||||
* number of vertices. Otherwise, return -1 (unknown).
|
||||
*
|
||||
* This only works if you've used nir_lower_gs_intrinsics() to do vertex
|
||||
* counting at the NIR level.
|
||||
*/
|
||||
int
|
||||
nir_gs_count_vertices(const nir_shader *shader)
|
||||
{
|
||||
int count = -1;
|
||||
|
||||
nir_foreach_function(shader, function) {
|
||||
if (!function->impl)
|
||||
continue;
|
||||
|
||||
/* set_vertex_count intrinsics only appear in predecessors of the
|
||||
* end block. So we don't need to walk all of them.
|
||||
*/
|
||||
struct set_entry *entry;
|
||||
set_foreach(function->impl->end_block->predecessors, entry) {
|
||||
nir_block *block = (nir_block *) entry->key;
|
||||
|
||||
nir_foreach_instr_reverse(block, instr) {
|
||||
nir_intrinsic_instr *intrin = as_set_vertex_count(instr);
|
||||
if (!intrin)
|
||||
continue;
|
||||
|
||||
nir_const_value *val = nir_src_as_const_value(intrin->src[0]);
|
||||
/* We've found a non-constant value. Bail. */
|
||||
if (!val)
|
||||
return -1;
|
||||
|
||||
if (count == -1)
|
||||
count = val->i[0];
|
||||
|
||||
/* We've found contradictory set_vertex_count intrinsics.
|
||||
* This can happen if there are early-returns in main() and
|
||||
* different paths emit different numbers of vertices.
|
||||
*/
|
||||
if (count != val->i[0])
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
@@ -1,519 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Connor Abbott
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "nir_instr_set.h"
|
||||
#include "nir_vla.h"
|
||||
|
||||
#define HASH(hash, data) _mesa_fnv32_1a_accumulate((hash), (data))
|
||||
|
||||
static uint32_t
|
||||
hash_src(uint32_t hash, const nir_src *src)
|
||||
{
|
||||
assert(src->is_ssa);
|
||||
hash = HASH(hash, src->ssa);
|
||||
return hash;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
hash_alu_src(uint32_t hash, const nir_alu_src *src, unsigned num_components)
|
||||
{
|
||||
hash = HASH(hash, src->abs);
|
||||
hash = HASH(hash, src->negate);
|
||||
|
||||
for (unsigned i = 0; i < num_components; i++)
|
||||
hash = HASH(hash, src->swizzle[i]);
|
||||
|
||||
hash = hash_src(hash, &src->src);
|
||||
return hash;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
hash_alu(uint32_t hash, const nir_alu_instr *instr)
|
||||
{
|
||||
hash = HASH(hash, instr->op);
|
||||
hash = HASH(hash, instr->dest.dest.ssa.num_components);
|
||||
|
||||
if (nir_op_infos[instr->op].algebraic_properties & NIR_OP_IS_COMMUTATIVE) {
|
||||
assert(nir_op_infos[instr->op].num_inputs == 2);
|
||||
uint32_t hash0 = hash_alu_src(hash, &instr->src[0],
|
||||
nir_ssa_alu_instr_src_components(instr, 0));
|
||||
uint32_t hash1 = hash_alu_src(hash, &instr->src[1],
|
||||
nir_ssa_alu_instr_src_components(instr, 1));
|
||||
/* For commutative operations, we need some commutative way of
|
||||
* combining the hashes. One option would be to XOR them but that
|
||||
* means that anything with two identical sources will hash to 0 and
|
||||
* that's common enough we probably don't want the guaranteed
|
||||
* collision. Either addition or multiplication will also work.
|
||||
*/
|
||||
hash = hash0 * hash1;
|
||||
} else {
|
||||
for (unsigned i = 0; i < nir_op_infos[instr->op].num_inputs; i++) {
|
||||
hash = hash_alu_src(hash, &instr->src[i],
|
||||
nir_ssa_alu_instr_src_components(instr, i));
|
||||
}
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
hash_load_const(uint32_t hash, const nir_load_const_instr *instr)
|
||||
{
|
||||
hash = HASH(hash, instr->def.num_components);
|
||||
|
||||
hash = _mesa_fnv32_1a_accumulate_block(hash, instr->value.f,
|
||||
instr->def.num_components
|
||||
* sizeof(instr->value.f[0]));
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
static int
|
||||
cmp_phi_src(const void *data1, const void *data2)
|
||||
{
|
||||
nir_phi_src *src1 = *(nir_phi_src **)data1;
|
||||
nir_phi_src *src2 = *(nir_phi_src **)data2;
|
||||
return src1->pred - src2->pred;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
hash_phi(uint32_t hash, const nir_phi_instr *instr)
|
||||
{
|
||||
hash = HASH(hash, instr->instr.block);
|
||||
|
||||
/* sort sources by predecessor, since the order shouldn't matter */
|
||||
unsigned num_preds = instr->instr.block->predecessors->entries;
|
||||
NIR_VLA(nir_phi_src *, srcs, num_preds);
|
||||
unsigned i = 0;
|
||||
nir_foreach_phi_src(instr, src) {
|
||||
srcs[i++] = src;
|
||||
}
|
||||
|
||||
qsort(srcs, num_preds, sizeof(nir_phi_src *), cmp_phi_src);
|
||||
|
||||
for (i = 0; i < num_preds; i++) {
|
||||
hash = hash_src(hash, &srcs[i]->src);
|
||||
hash = HASH(hash, srcs[i]->pred);
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
hash_intrinsic(uint32_t hash, const nir_intrinsic_instr *instr)
|
||||
{
|
||||
const nir_intrinsic_info *info = &nir_intrinsic_infos[instr->intrinsic];
|
||||
hash = HASH(hash, instr->intrinsic);
|
||||
|
||||
if (info->has_dest)
|
||||
hash = HASH(hash, instr->dest.ssa.num_components);
|
||||
|
||||
assert(info->num_variables == 0);
|
||||
|
||||
hash = _mesa_fnv32_1a_accumulate_block(hash, instr->const_index,
|
||||
info->num_indices
|
||||
* sizeof(instr->const_index[0]));
|
||||
return hash;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
hash_tex(uint32_t hash, const nir_tex_instr *instr)
|
||||
{
|
||||
hash = HASH(hash, instr->op);
|
||||
hash = HASH(hash, instr->num_srcs);
|
||||
|
||||
for (unsigned i = 0; i < instr->num_srcs; i++) {
|
||||
hash = HASH(hash, instr->src[i].src_type);
|
||||
hash = hash_src(hash, &instr->src[i].src);
|
||||
}
|
||||
|
||||
hash = HASH(hash, instr->coord_components);
|
||||
hash = HASH(hash, instr->sampler_dim);
|
||||
hash = HASH(hash, instr->is_array);
|
||||
hash = HASH(hash, instr->is_shadow);
|
||||
hash = HASH(hash, instr->is_new_style_shadow);
|
||||
unsigned component = instr->component;
|
||||
hash = HASH(hash, component);
|
||||
hash = HASH(hash, instr->texture_index);
|
||||
hash = HASH(hash, instr->texture_array_size);
|
||||
hash = HASH(hash, instr->sampler_index);
|
||||
|
||||
assert(!instr->texture && !instr->sampler);
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
/* Computes a hash of an instruction for use in a hash table. Note that this
|
||||
* will only work for instructions where instr_can_rewrite() returns true, and
|
||||
* it should return identical hashes for two instructions that are the same
|
||||
* according nir_instrs_equal().
|
||||
*/
|
||||
|
||||
static uint32_t
|
||||
hash_instr(const void *data)
|
||||
{
|
||||
const nir_instr *instr = data;
|
||||
uint32_t hash = _mesa_fnv32_1a_offset_bias;
|
||||
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_alu:
|
||||
hash = hash_alu(hash, nir_instr_as_alu(instr));
|
||||
break;
|
||||
case nir_instr_type_load_const:
|
||||
hash = hash_load_const(hash, nir_instr_as_load_const(instr));
|
||||
break;
|
||||
case nir_instr_type_phi:
|
||||
hash = hash_phi(hash, nir_instr_as_phi(instr));
|
||||
break;
|
||||
case nir_instr_type_intrinsic:
|
||||
hash = hash_intrinsic(hash, nir_instr_as_intrinsic(instr));
|
||||
break;
|
||||
case nir_instr_type_tex:
|
||||
hash = hash_tex(hash, nir_instr_as_tex(instr));
|
||||
break;
|
||||
default:
|
||||
unreachable("Invalid instruction type");
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
bool
|
||||
nir_srcs_equal(nir_src src1, nir_src src2)
|
||||
{
|
||||
if (src1.is_ssa) {
|
||||
if (src2.is_ssa) {
|
||||
return src1.ssa == src2.ssa;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (src2.is_ssa) {
|
||||
return false;
|
||||
} else {
|
||||
if ((src1.reg.indirect == NULL) != (src2.reg.indirect == NULL))
|
||||
return false;
|
||||
|
||||
if (src1.reg.indirect) {
|
||||
if (!nir_srcs_equal(*src1.reg.indirect, *src2.reg.indirect))
|
||||
return false;
|
||||
}
|
||||
|
||||
return src1.reg.reg == src2.reg.reg &&
|
||||
src1.reg.base_offset == src2.reg.base_offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
nir_alu_srcs_equal(const nir_alu_instr *alu1, const nir_alu_instr *alu2,
|
||||
unsigned src1, unsigned src2)
|
||||
{
|
||||
if (alu1->src[src1].abs != alu2->src[src2].abs ||
|
||||
alu1->src[src1].negate != alu2->src[src2].negate)
|
||||
return false;
|
||||
|
||||
for (unsigned i = 0; i < nir_ssa_alu_instr_src_components(alu1, src1); i++) {
|
||||
if (alu1->src[src1].swizzle[i] != alu2->src[src2].swizzle[i])
|
||||
return false;
|
||||
}
|
||||
|
||||
return nir_srcs_equal(alu1->src[src1].src, alu2->src[src2].src);
|
||||
}
|
||||
|
||||
/* Returns "true" if two instructions are equal. Note that this will only
|
||||
* work for the subset of instructions defined by instr_can_rewrite(). Also,
|
||||
* it should only return "true" for instructions that hash_instr() will return
|
||||
* the same hash for (ignoring collisions, of course).
|
||||
*/
|
||||
|
||||
static bool
|
||||
nir_instrs_equal(const nir_instr *instr1, const nir_instr *instr2)
|
||||
{
|
||||
if (instr1->type != instr2->type)
|
||||
return false;
|
||||
|
||||
switch (instr1->type) {
|
||||
case nir_instr_type_alu: {
|
||||
nir_alu_instr *alu1 = nir_instr_as_alu(instr1);
|
||||
nir_alu_instr *alu2 = nir_instr_as_alu(instr2);
|
||||
|
||||
if (alu1->op != alu2->op)
|
||||
return false;
|
||||
|
||||
/* TODO: We can probably acutally do something more inteligent such
|
||||
* as allowing different numbers and taking a maximum or something
|
||||
* here */
|
||||
if (alu1->dest.dest.ssa.num_components != alu2->dest.dest.ssa.num_components)
|
||||
return false;
|
||||
|
||||
if (nir_op_infos[alu1->op].algebraic_properties & NIR_OP_IS_COMMUTATIVE) {
|
||||
assert(nir_op_infos[alu1->op].num_inputs == 2);
|
||||
return (nir_alu_srcs_equal(alu1, alu2, 0, 0) &&
|
||||
nir_alu_srcs_equal(alu1, alu2, 1, 1)) ||
|
||||
(nir_alu_srcs_equal(alu1, alu2, 0, 1) &&
|
||||
nir_alu_srcs_equal(alu1, alu2, 1, 0));
|
||||
} else {
|
||||
for (unsigned i = 0; i < nir_op_infos[alu1->op].num_inputs; i++) {
|
||||
if (!nir_alu_srcs_equal(alu1, alu2, i, i))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case nir_instr_type_tex: {
|
||||
nir_tex_instr *tex1 = nir_instr_as_tex(instr1);
|
||||
nir_tex_instr *tex2 = nir_instr_as_tex(instr2);
|
||||
|
||||
if (tex1->op != tex2->op)
|
||||
return false;
|
||||
|
||||
if (tex1->num_srcs != tex2->num_srcs)
|
||||
return false;
|
||||
for (unsigned i = 0; i < tex1->num_srcs; i++) {
|
||||
if (tex1->src[i].src_type != tex2->src[i].src_type ||
|
||||
!nir_srcs_equal(tex1->src[i].src, tex2->src[i].src)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (tex1->coord_components != tex2->coord_components ||
|
||||
tex1->sampler_dim != tex2->sampler_dim ||
|
||||
tex1->is_array != tex2->is_array ||
|
||||
tex1->is_shadow != tex2->is_shadow ||
|
||||
tex1->is_new_style_shadow != tex2->is_new_style_shadow ||
|
||||
tex1->component != tex2->component ||
|
||||
tex1->texture_index != tex2->texture_index ||
|
||||
tex1->texture_array_size != tex2->texture_array_size ||
|
||||
tex1->sampler_index != tex2->sampler_index) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Don't support un-lowered sampler derefs currently. */
|
||||
assert(!tex1->texture && !tex1->sampler &&
|
||||
!tex2->texture && !tex2->sampler);
|
||||
|
||||
return true;
|
||||
}
|
||||
case nir_instr_type_load_const: {
|
||||
nir_load_const_instr *load1 = nir_instr_as_load_const(instr1);
|
||||
nir_load_const_instr *load2 = nir_instr_as_load_const(instr2);
|
||||
|
||||
if (load1->def.num_components != load2->def.num_components)
|
||||
return false;
|
||||
|
||||
return memcmp(load1->value.f, load2->value.f,
|
||||
load1->def.num_components * sizeof(*load2->value.f)) == 0;
|
||||
}
|
||||
case nir_instr_type_phi: {
|
||||
nir_phi_instr *phi1 = nir_instr_as_phi(instr1);
|
||||
nir_phi_instr *phi2 = nir_instr_as_phi(instr2);
|
||||
|
||||
if (phi1->instr.block != phi2->instr.block)
|
||||
return false;
|
||||
|
||||
nir_foreach_phi_src(phi1, src1) {
|
||||
nir_foreach_phi_src(phi2, src2) {
|
||||
if (src1->pred == src2->pred) {
|
||||
if (!nir_srcs_equal(src1->src, src2->src))
|
||||
return false;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
case nir_instr_type_intrinsic: {
|
||||
nir_intrinsic_instr *intrinsic1 = nir_instr_as_intrinsic(instr1);
|
||||
nir_intrinsic_instr *intrinsic2 = nir_instr_as_intrinsic(instr2);
|
||||
const nir_intrinsic_info *info =
|
||||
&nir_intrinsic_infos[intrinsic1->intrinsic];
|
||||
|
||||
if (intrinsic1->intrinsic != intrinsic2->intrinsic ||
|
||||
intrinsic1->num_components != intrinsic2->num_components)
|
||||
return false;
|
||||
|
||||
if (info->has_dest && intrinsic1->dest.ssa.num_components !=
|
||||
intrinsic2->dest.ssa.num_components)
|
||||
return false;
|
||||
|
||||
for (unsigned i = 0; i < info->num_srcs; i++) {
|
||||
if (!nir_srcs_equal(intrinsic1->src[i], intrinsic2->src[i]))
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(info->num_variables == 0);
|
||||
|
||||
for (unsigned i = 0; i < info->num_indices; i++) {
|
||||
if (intrinsic1->const_index[i] != intrinsic2->const_index[i])
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
case nir_instr_type_call:
|
||||
case nir_instr_type_jump:
|
||||
case nir_instr_type_ssa_undef:
|
||||
case nir_instr_type_parallel_copy:
|
||||
default:
|
||||
unreachable("Invalid instruction type");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
src_is_ssa(nir_src *src, void *data)
|
||||
{
|
||||
(void) data;
|
||||
return src->is_ssa;
|
||||
}
|
||||
|
||||
static bool
|
||||
dest_is_ssa(nir_dest *dest, void *data)
|
||||
{
|
||||
(void) data;
|
||||
return dest->is_ssa;
|
||||
}
|
||||
|
||||
/* This function determines if uses of an instruction can safely be rewritten
|
||||
* to use another identical instruction instead. Note that this function must
|
||||
* be kept in sync with hash_instr() and nir_instrs_equal() -- only
|
||||
* instructions that pass this test will be handed on to those functions, and
|
||||
* conversely they must handle everything that this function returns true for.
|
||||
*/
|
||||
|
||||
static bool
|
||||
instr_can_rewrite(nir_instr *instr)
|
||||
{
|
||||
/* We only handle SSA. */
|
||||
if (!nir_foreach_dest(instr, dest_is_ssa, NULL) ||
|
||||
!nir_foreach_src(instr, src_is_ssa, NULL))
|
||||
return false;
|
||||
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_alu:
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_phi:
|
||||
return true;
|
||||
case nir_instr_type_tex: {
|
||||
nir_tex_instr *tex = nir_instr_as_tex(instr);
|
||||
|
||||
/* Don't support un-lowered sampler derefs currently. */
|
||||
if (tex->texture || tex->sampler)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
case nir_instr_type_intrinsic: {
|
||||
const nir_intrinsic_info *info =
|
||||
&nir_intrinsic_infos[nir_instr_as_intrinsic(instr)->intrinsic];
|
||||
return (info->flags & NIR_INTRINSIC_CAN_ELIMINATE) &&
|
||||
(info->flags & NIR_INTRINSIC_CAN_REORDER) &&
|
||||
info->num_variables == 0; /* not implemented yet */
|
||||
}
|
||||
case nir_instr_type_call:
|
||||
case nir_instr_type_jump:
|
||||
case nir_instr_type_ssa_undef:
|
||||
return false;
|
||||
case nir_instr_type_parallel_copy:
|
||||
default:
|
||||
unreachable("Invalid instruction type");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static nir_ssa_def *
|
||||
nir_instr_get_dest_ssa_def(nir_instr *instr)
|
||||
{
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_alu:
|
||||
assert(nir_instr_as_alu(instr)->dest.dest.is_ssa);
|
||||
return &nir_instr_as_alu(instr)->dest.dest.ssa;
|
||||
case nir_instr_type_load_const:
|
||||
return &nir_instr_as_load_const(instr)->def;
|
||||
case nir_instr_type_phi:
|
||||
assert(nir_instr_as_phi(instr)->dest.is_ssa);
|
||||
return &nir_instr_as_phi(instr)->dest.ssa;
|
||||
case nir_instr_type_intrinsic:
|
||||
assert(nir_instr_as_intrinsic(instr)->dest.is_ssa);
|
||||
return &nir_instr_as_intrinsic(instr)->dest.ssa;
|
||||
case nir_instr_type_tex:
|
||||
assert(nir_instr_as_tex(instr)->dest.is_ssa);
|
||||
return &nir_instr_as_tex(instr)->dest.ssa;
|
||||
default:
|
||||
unreachable("We never ask for any of these");
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
cmp_func(const void *data1, const void *data2)
|
||||
{
|
||||
return nir_instrs_equal(data1, data2);
|
||||
}
|
||||
|
||||
struct set *
|
||||
nir_instr_set_create(void *mem_ctx)
|
||||
{
|
||||
return _mesa_set_create(mem_ctx, hash_instr, cmp_func);
|
||||
}
|
||||
|
||||
void
|
||||
nir_instr_set_destroy(struct set *instr_set)
|
||||
{
|
||||
_mesa_set_destroy(instr_set, NULL);
|
||||
}
|
||||
|
||||
bool
|
||||
nir_instr_set_add_or_rewrite(struct set *instr_set, nir_instr *instr)
|
||||
{
|
||||
if (!instr_can_rewrite(instr))
|
||||
return false;
|
||||
|
||||
struct set_entry *entry = _mesa_set_search(instr_set, instr);
|
||||
if (entry) {
|
||||
nir_ssa_def *def = nir_instr_get_dest_ssa_def(instr);
|
||||
nir_ssa_def *new_def =
|
||||
nir_instr_get_dest_ssa_def((nir_instr *) entry->key);
|
||||
nir_ssa_def_rewrite_uses(def, nir_src_for_ssa(new_def));
|
||||
return true;
|
||||
}
|
||||
|
||||
_mesa_set_add(instr_set, instr);
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
nir_instr_set_remove(struct set *instr_set, nir_instr *instr)
|
||||
{
|
||||
if (!instr_can_rewrite(instr))
|
||||
return;
|
||||
|
||||
struct set_entry *entry = _mesa_set_search(instr_set, instr);
|
||||
if (entry)
|
||||
_mesa_set_remove(instr_set, entry);
|
||||
}
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Connor Abbott
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "nir.h"
|
||||
|
||||
/**
|
||||
* This file defines functions for creating, destroying, and manipulating an
|
||||
* "instruction set," which is an abstraction for finding duplicate
|
||||
* instructions using a hash set. Note that the question of whether an
|
||||
* instruction is actually a duplicate (e.g. whether it has any side effects)
|
||||
* is handled transparently. The user can pass any instruction to
|
||||
* nir_instr_set_add_or_rewrite() and nir_instr_set_remove(), and if the
|
||||
* instruction isn't safe to rewrite or isn't supported, it's silently
|
||||
* removed.
|
||||
*/
|
||||
|
||||
/*@{*/
|
||||
|
||||
/** Creates an instruction set, using a given ralloc mem_ctx */
|
||||
struct set *nir_instr_set_create(void *mem_ctx);
|
||||
|
||||
/** Destroys an instruction set. */
|
||||
void nir_instr_set_destroy(struct set *instr_set);
|
||||
|
||||
/**
|
||||
* Adds an instruction to an instruction set if it doesn't exist, or if it
|
||||
* does already exist, rewrites all uses of it to point to the other
|
||||
* already-inserted instruction. Returns 'true' if the uses of the instruction
|
||||
* were rewritten.
|
||||
*/
|
||||
bool nir_instr_set_add_or_rewrite(struct set *instr_set, nir_instr *instr);
|
||||
|
||||
/**
|
||||
* Removes an instruction from an instruction set, so that other instructions
|
||||
* won't be merged with it.
|
||||
*/
|
||||
void nir_instr_set_remove(struct set *instr_set, nir_instr *instr);
|
||||
|
||||
/*@}*/
|
||||
|
||||
@@ -1,317 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Connor Abbott (cwabbott0@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* This header file defines all the available intrinsics in one place. It
|
||||
* expands to a list of macros of the form:
|
||||
*
|
||||
* INTRINSIC(name, num_srcs, src_components, has_dest, dest_components,
|
||||
* num_variables, num_indices, idx0, idx1, idx2, flags)
|
||||
*
|
||||
* Which should correspond one-to-one with the nir_intrinsic_info structure. It
|
||||
* is included in both ir.h to create the nir_intrinsic enum (with members of
|
||||
* the form nir_intrinsic_(name)) and and in opcodes.c to create
|
||||
* nir_intrinsic_infos, which is a const array of nir_intrinsic_info structures
|
||||
* for each intrinsic.
|
||||
*/
|
||||
|
||||
#define ARR(...) { __VA_ARGS__ }
|
||||
|
||||
|
||||
INTRINSIC(load_var, 0, ARR(), true, 0, 1, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE)
|
||||
INTRINSIC(store_var, 1, ARR(0), false, 0, 1, 1, WRMASK, xx, xx, 0)
|
||||
INTRINSIC(copy_var, 0, ARR(), false, 0, 2, 0, xx, xx, xx, 0)
|
||||
|
||||
/*
|
||||
* Interpolation of input. The interp_var_at* intrinsics are similar to the
|
||||
* load_var intrinsic acting an a shader input except that they interpolate
|
||||
* the input differently. The at_sample and at_offset intrinsics take an
|
||||
* aditional source that is a integer sample id or a vec2 position offset
|
||||
* respectively.
|
||||
*/
|
||||
|
||||
INTRINSIC(interp_var_at_centroid, 0, ARR(0), true, 0, 1, 0, xx, xx, xx,
|
||||
NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
|
||||
INTRINSIC(interp_var_at_sample, 1, ARR(1), true, 0, 1, 0, xx, xx, xx,
|
||||
NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
|
||||
INTRINSIC(interp_var_at_offset, 1, ARR(2), true, 0, 1, 0, xx, xx, xx,
|
||||
NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
|
||||
|
||||
/*
|
||||
* Ask the driver for the size of a given buffer. It takes the buffer index
|
||||
* as source.
|
||||
*/
|
||||
INTRINSIC(get_buffer_size, 1, ARR(1), true, 1, 0, 0, xx, xx, xx,
|
||||
NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
|
||||
|
||||
/*
|
||||
* a barrier is an intrinsic with no inputs/outputs but which can't be moved
|
||||
* around/optimized in general
|
||||
*/
|
||||
#define BARRIER(name) INTRINSIC(name, 0, ARR(), false, 0, 0, 0, xx, xx, xx, 0)
|
||||
|
||||
BARRIER(barrier)
|
||||
BARRIER(discard)
|
||||
|
||||
/*
|
||||
* Memory barrier with semantics analogous to the memoryBarrier() GLSL
|
||||
* intrinsic.
|
||||
*/
|
||||
BARRIER(memory_barrier)
|
||||
|
||||
/*
|
||||
* Shader clock intrinsic with semantics analogous to the clock2x32ARB()
|
||||
* GLSL intrinsic.
|
||||
* The latter can be used as code motion barrier, which is currently not
|
||||
* feasible with NIR.
|
||||
*/
|
||||
INTRINSIC(shader_clock, 0, ARR(), true, 1, 0, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE)
|
||||
|
||||
/*
|
||||
* Memory barrier with semantics analogous to the compute shader
|
||||
* groupMemoryBarrier(), memoryBarrierAtomicCounter(), memoryBarrierBuffer(),
|
||||
* memoryBarrierImage() and memoryBarrierShared() GLSL intrinsics.
|
||||
*/
|
||||
BARRIER(group_memory_barrier)
|
||||
BARRIER(memory_barrier_atomic_counter)
|
||||
BARRIER(memory_barrier_buffer)
|
||||
BARRIER(memory_barrier_image)
|
||||
BARRIER(memory_barrier_shared)
|
||||
|
||||
/** A conditional discard, with a single boolean source. */
|
||||
INTRINSIC(discard_if, 1, ARR(1), false, 0, 0, 0, xx, xx, xx, 0)
|
||||
|
||||
/**
|
||||
* Basic Geometry Shader intrinsics.
|
||||
*
|
||||
* emit_vertex implements GLSL's EmitStreamVertex() built-in. It takes a single
|
||||
* index, which is the stream ID to write to.
|
||||
*
|
||||
* end_primitive implements GLSL's EndPrimitive() built-in.
|
||||
*/
|
||||
INTRINSIC(emit_vertex, 0, ARR(), false, 0, 0, 1, STREAM_ID, xx, xx, 0)
|
||||
INTRINSIC(end_primitive, 0, ARR(), false, 0, 0, 1, STREAM_ID, xx, xx, 0)
|
||||
|
||||
/**
|
||||
* Geometry Shader intrinsics with a vertex count.
|
||||
*
|
||||
* Alternatively, drivers may implement these intrinsics, and use
|
||||
* nir_lower_gs_intrinsics() to convert from the basic intrinsics.
|
||||
*
|
||||
* These maintain a count of the number of vertices emitted, as an additional
|
||||
* unsigned integer source.
|
||||
*/
|
||||
INTRINSIC(emit_vertex_with_counter, 1, ARR(1), false, 0, 0, 1, STREAM_ID, xx, xx, 0)
|
||||
INTRINSIC(end_primitive_with_counter, 1, ARR(1), false, 0, 0, 1, STREAM_ID, xx, xx, 0)
|
||||
INTRINSIC(set_vertex_count, 1, ARR(1), false, 0, 0, 0, xx, xx, xx, 0)
|
||||
|
||||
/*
|
||||
* Atomic counters
|
||||
*
|
||||
* The *_var variants take an atomic_uint nir_variable, while the other,
|
||||
* lowered, variants take a constant buffer index and register offset.
|
||||
*/
|
||||
|
||||
#define ATOMIC(name, flags) \
|
||||
INTRINSIC(atomic_counter_##name##_var, 0, ARR(), true, 1, 1, 0, xx, xx, xx, flags) \
|
||||
INTRINSIC(atomic_counter_##name, 1, ARR(1), true, 1, 0, 1, BASE, xx, xx, flags)
|
||||
|
||||
ATOMIC(inc, 0)
|
||||
ATOMIC(dec, 0)
|
||||
ATOMIC(read, NIR_INTRINSIC_CAN_ELIMINATE)
|
||||
|
||||
/*
|
||||
* Image load, store and atomic intrinsics.
|
||||
*
|
||||
* All image intrinsics take an image target passed as a nir_variable. Image
|
||||
* variables contain a number of memory and layout qualifiers that influence
|
||||
* the semantics of the intrinsic.
|
||||
*
|
||||
* All image intrinsics take a four-coordinate vector and a sample index as
|
||||
* first two sources, determining the location within the image that will be
|
||||
* accessed by the intrinsic. Components not applicable to the image target
|
||||
* in use are undefined. Image store takes an additional four-component
|
||||
* argument with the value to be written, and image atomic operations take
|
||||
* either one or two additional scalar arguments with the same meaning as in
|
||||
* the ARB_shader_image_load_store specification.
|
||||
*/
|
||||
INTRINSIC(image_load, 2, ARR(4, 1), true, 4, 1, 0, xx, xx, xx,
|
||||
NIR_INTRINSIC_CAN_ELIMINATE)
|
||||
INTRINSIC(image_store, 3, ARR(4, 1, 4), false, 0, 1, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(image_atomic_add, 3, ARR(4, 1, 1), true, 1, 1, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(image_atomic_min, 3, ARR(4, 1, 1), true, 1, 1, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(image_atomic_max, 3, ARR(4, 1, 1), true, 1, 1, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(image_atomic_and, 3, ARR(4, 1, 1), true, 1, 1, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(image_atomic_or, 3, ARR(4, 1, 1), true, 1, 1, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(image_atomic_xor, 3, ARR(4, 1, 1), true, 1, 1, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(image_atomic_exchange, 3, ARR(4, 1, 1), true, 1, 1, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(image_atomic_comp_swap, 4, ARR(4, 1, 1, 1), true, 1, 1, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(image_size, 0, ARR(), true, 4, 1, 0, xx, xx, xx,
|
||||
NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
|
||||
INTRINSIC(image_samples, 0, ARR(), true, 1, 1, 0, xx, xx, xx,
|
||||
NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
|
||||
|
||||
/*
|
||||
* SSBO atomic intrinsics
|
||||
*
|
||||
* All of the SSBO atomic memory operations read a value from memory,
|
||||
* compute a new value using one of the operations below, write the new
|
||||
* value to memory, and return the original value read.
|
||||
*
|
||||
* All operations take 3 sources except CompSwap that takes 4. These
|
||||
* sources represent:
|
||||
*
|
||||
* 0: The SSBO buffer index.
|
||||
* 1: The offset into the SSBO buffer of the variable that the atomic
|
||||
* operation will operate on.
|
||||
* 2: The data parameter to the atomic function (i.e. the value to add
|
||||
* in ssbo_atomic_add, etc).
|
||||
* 3: For CompSwap only: the second data parameter.
|
||||
*/
|
||||
INTRINSIC(ssbo_atomic_add, 3, ARR(1, 1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(ssbo_atomic_imin, 3, ARR(1, 1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(ssbo_atomic_umin, 3, ARR(1, 1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(ssbo_atomic_imax, 3, ARR(1, 1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(ssbo_atomic_umax, 3, ARR(1, 1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(ssbo_atomic_and, 3, ARR(1, 1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(ssbo_atomic_or, 3, ARR(1, 1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(ssbo_atomic_xor, 3, ARR(1, 1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(ssbo_atomic_exchange, 3, ARR(1, 1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(ssbo_atomic_comp_swap, 4, ARR(1, 1, 1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
|
||||
/*
|
||||
* CS shared variable atomic intrinsics
|
||||
*
|
||||
* All of the shared variable atomic memory operations read a value from
|
||||
* memory, compute a new value using one of the operations below, write the
|
||||
* new value to memory, and return the original value read.
|
||||
*
|
||||
* All operations take 2 sources except CompSwap that takes 3. These
|
||||
* sources represent:
|
||||
*
|
||||
* 0: The offset into the shared variable storage region that the atomic
|
||||
* operation will operate on.
|
||||
* 1: The data parameter to the atomic function (i.e. the value to add
|
||||
* in shared_atomic_add, etc).
|
||||
* 2: For CompSwap only: the second data parameter.
|
||||
*/
|
||||
INTRINSIC(shared_atomic_add, 2, ARR(1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(shared_atomic_imin, 2, ARR(1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(shared_atomic_umin, 2, ARR(1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(shared_atomic_imax, 2, ARR(1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(shared_atomic_umax, 2, ARR(1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(shared_atomic_and, 2, ARR(1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(shared_atomic_or, 2, ARR(1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(shared_atomic_xor, 2, ARR(1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(shared_atomic_exchange, 2, ARR(1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
INTRINSIC(shared_atomic_comp_swap, 3, ARR(1, 1, 1), true, 1, 0, 0, xx, xx, xx, 0)
|
||||
|
||||
#define SYSTEM_VALUE(name, components, num_indices, idx0, idx1, idx2) \
|
||||
INTRINSIC(load_##name, 0, ARR(), true, components, 0, num_indices, \
|
||||
idx0, idx1, idx2, \
|
||||
NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
|
||||
|
||||
SYSTEM_VALUE(front_face, 1, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(vertex_id, 1, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(vertex_id_zero_base, 1, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(base_vertex, 1, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(instance_id, 1, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(base_instance, 1, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(draw_id, 1, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(sample_id, 1, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(sample_pos, 2, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(sample_mask_in, 1, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(primitive_id, 1, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(invocation_id, 1, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(tess_coord, 3, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(tess_level_outer, 4, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(tess_level_inner, 2, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(patch_vertices_in, 1, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(local_invocation_id, 3, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(work_group_id, 3, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(user_clip_plane, 4, 1, UCP_ID, xx, xx)
|
||||
SYSTEM_VALUE(num_work_groups, 3, 0, xx, xx, xx)
|
||||
SYSTEM_VALUE(helper_invocation, 1, 0, xx, xx, xx)
|
||||
|
||||
/*
|
||||
* Load operations pull data from some piece of GPU memory. All load
|
||||
* operations operate in terms of offsets into some piece of theoretical
|
||||
* memory. Loads from externally visible memory (UBO and SSBO) simply take a
|
||||
* byte offset as a source. Loads from opaque memory (uniforms, inputs, etc.)
|
||||
* take a base+offset pair where the base (const_index[0]) gives the location
|
||||
* of the start of the variable being loaded and and the offset source is a
|
||||
* offset into that variable.
|
||||
*
|
||||
* Some load operations such as UBO/SSBO load and per_vertex loads take an
|
||||
* additional source to specify which UBO/SSBO/vertex to load from.
|
||||
*
|
||||
* The exact address type depends on the lowering pass that generates the
|
||||
* load/store intrinsics. Typically, this is vec4 units for things such as
|
||||
* varying slots and float units for fragment shader inputs. UBO and SSBO
|
||||
* offsets are always in bytes.
|
||||
*/
|
||||
|
||||
#define LOAD(name, srcs, num_indices, idx0, idx1, idx2, flags) \
|
||||
INTRINSIC(load_##name, srcs, ARR(1, 1, 1, 1), true, 0, 0, num_indices, idx0, idx1, idx2, flags)
|
||||
|
||||
/* src[] = { offset }. const_index[] = { base } */
|
||||
LOAD(uniform, 1, 1, BASE, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
|
||||
/* src[] = { buffer_index, offset }. No const_index */
|
||||
LOAD(ubo, 2, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
|
||||
/* src[] = { offset }. const_index[] = { base } */
|
||||
LOAD(input, 1, 1, BASE, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
|
||||
/* src[] = { vertex, offset }. const_index[] = { base } */
|
||||
LOAD(per_vertex_input, 2, 1, BASE, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
|
||||
/* src[] = { buffer_index, offset }. No const_index */
|
||||
LOAD(ssbo, 2, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE)
|
||||
/* src[] = { offset }. const_index[] = { base } */
|
||||
LOAD(output, 1, 1, BASE, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE)
|
||||
/* src[] = { vertex, offset }. const_index[] = { base } */
|
||||
LOAD(per_vertex_output, 2, 1, BASE, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE)
|
||||
/* src[] = { offset }. const_index[] = { base } */
|
||||
LOAD(shared, 1, 1, BASE, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE)
|
||||
|
||||
/*
|
||||
* Stores work the same way as loads, except now the first source is the value
|
||||
* to store and the second (and possibly third) source specify where to store
|
||||
* the value. SSBO and shared memory stores also have a write mask as
|
||||
* const_index[0].
|
||||
*/
|
||||
|
||||
#define STORE(name, srcs, num_indices, idx0, idx1, idx2, flags) \
|
||||
INTRINSIC(store_##name, srcs, ARR(0, 1, 1, 1), false, 0, 0, num_indices, idx0, idx1, idx2, flags)
|
||||
|
||||
/* src[] = { value, offset }. const_index[] = { base, write_mask } */
|
||||
STORE(output, 2, 2, BASE, WRMASK, xx, 0)
|
||||
/* src[] = { value, vertex, offset }. const_index[] = { base, write_mask } */
|
||||
STORE(per_vertex_output, 3, 2, BASE, WRMASK, xx, 0)
|
||||
/* src[] = { value, block_index, offset }. const_index[] = { write_mask } */
|
||||
STORE(ssbo, 3, 1, WRMASK, xx, xx, 0)
|
||||
/* src[] = { value, offset }. const_index[] = { base, write_mask } */
|
||||
STORE(shared, 2, 2, BASE, WRMASK, xx, 0)
|
||||
|
||||
LAST_INTRINSIC(store_shared)
|
||||
@@ -1,339 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2015 Red Hat
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Rob Clark <robclark@freedesktop.org>
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
#include "nir_builder.h"
|
||||
|
||||
#define MAX_CLIP_PLANES 8
|
||||
|
||||
/* Generates the lowering code for user-clip-planes, generating CLIPDIST
|
||||
* from UCP[n] + CLIPVERTEX or POSITION. Additionally, an optional pass
|
||||
* for fragment shaders to insert conditional kill's based on the inter-
|
||||
* polated CLIPDIST
|
||||
*
|
||||
* NOTE: should be run after nir_lower_outputs_to_temporaries() (or at
|
||||
* least in scenarios where you can count on each output written once
|
||||
* and only once).
|
||||
*/
|
||||
|
||||
|
||||
static nir_variable *
|
||||
create_clipdist_var(nir_shader *shader, unsigned drvloc,
|
||||
bool output, gl_varying_slot slot)
|
||||
{
|
||||
nir_variable *var = rzalloc(shader, nir_variable);
|
||||
|
||||
var->data.driver_location = drvloc;
|
||||
var->type = glsl_vec4_type();
|
||||
var->data.mode = output ? nir_var_shader_out : nir_var_shader_in;
|
||||
var->name = ralloc_asprintf(var, "clipdist_%d", drvloc);
|
||||
var->data.index = 0;
|
||||
var->data.location = slot;
|
||||
|
||||
if (output) {
|
||||
exec_list_push_tail(&shader->outputs, &var->node);
|
||||
shader->num_outputs++; /* TODO use type_size() */
|
||||
}
|
||||
else {
|
||||
exec_list_push_tail(&shader->inputs, &var->node);
|
||||
shader->num_inputs++; /* TODO use type_size() */
|
||||
}
|
||||
return var;
|
||||
}
|
||||
|
||||
static void
|
||||
store_clipdist_output(nir_builder *b, nir_variable *out, nir_ssa_def **val)
|
||||
{
|
||||
nir_intrinsic_instr *store;
|
||||
|
||||
store = nir_intrinsic_instr_create(b->shader, nir_intrinsic_store_output);
|
||||
store->num_components = 4;
|
||||
nir_intrinsic_set_base(store, out->data.driver_location);
|
||||
nir_intrinsic_set_write_mask(store, 0xf);
|
||||
store->src[0].ssa = nir_vec4(b, val[0], val[1], val[2], val[3]);
|
||||
store->src[0].is_ssa = true;
|
||||
store->src[1] = nir_src_for_ssa(nir_imm_int(b, 0));
|
||||
nir_builder_instr_insert(b, &store->instr);
|
||||
}
|
||||
|
||||
static void
|
||||
load_clipdist_input(nir_builder *b, nir_variable *in, nir_ssa_def **val)
|
||||
{
|
||||
nir_intrinsic_instr *load;
|
||||
|
||||
load = nir_intrinsic_instr_create(b->shader, nir_intrinsic_load_input);
|
||||
load->num_components = 4;
|
||||
nir_intrinsic_set_base(load, in->data.driver_location);
|
||||
load->src[0] = nir_src_for_ssa(nir_imm_int(b, 0));
|
||||
nir_ssa_dest_init(&load->instr, &load->dest, 4, NULL);
|
||||
nir_builder_instr_insert(b, &load->instr);
|
||||
|
||||
val[0] = nir_channel(b, &load->dest.ssa, 0);
|
||||
val[1] = nir_channel(b, &load->dest.ssa, 1);
|
||||
val[2] = nir_channel(b, &load->dest.ssa, 2);
|
||||
val[3] = nir_channel(b, &load->dest.ssa, 3);
|
||||
}
|
||||
|
||||
struct find_output_state
|
||||
{
|
||||
unsigned drvloc;
|
||||
nir_ssa_def *def;
|
||||
};
|
||||
|
||||
static bool
|
||||
find_output_in_block(nir_block *block, void *void_state)
|
||||
{
|
||||
struct find_output_state *state = void_state;
|
||||
nir_foreach_instr(block, instr) {
|
||||
|
||||
if (instr->type == nir_instr_type_intrinsic) {
|
||||
nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
|
||||
if ((intr->intrinsic == nir_intrinsic_store_output) &&
|
||||
nir_intrinsic_base(intr) == state->drvloc) {
|
||||
assert(state->def == NULL);
|
||||
assert(intr->src[0].is_ssa);
|
||||
assert(nir_src_as_const_value(intr->src[1]));
|
||||
state->def = intr->src[0].ssa;
|
||||
|
||||
#if !defined(DEBUG)
|
||||
/* for debug builds, scan entire shader to assert
|
||||
* if output is written multiple times. For release
|
||||
* builds just assume all is well and bail when we
|
||||
* find first:
|
||||
*/
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* TODO: maybe this would be a useful helper?
|
||||
* NOTE: assumes each output is written exactly once (and unconditionally)
|
||||
* so if needed nir_lower_outputs_to_temporaries()
|
||||
*/
|
||||
static nir_ssa_def *
|
||||
find_output(nir_shader *shader, unsigned drvloc)
|
||||
{
|
||||
struct find_output_state state = {
|
||||
.drvloc = drvloc,
|
||||
};
|
||||
|
||||
nir_foreach_function(shader, function) {
|
||||
if (function->impl) {
|
||||
nir_foreach_block_reverse(function->impl,
|
||||
find_output_in_block, &state);
|
||||
}
|
||||
}
|
||||
|
||||
return state.def;
|
||||
}
|
||||
|
||||
/*
|
||||
* VS lowering
|
||||
*/
|
||||
|
||||
static void
|
||||
lower_clip_vs(nir_function_impl *impl, unsigned ucp_enables,
|
||||
nir_ssa_def *cv, nir_variable **out)
|
||||
{
|
||||
nir_ssa_def *clipdist[MAX_CLIP_PLANES];
|
||||
nir_builder b;
|
||||
|
||||
nir_builder_init(&b, impl);
|
||||
|
||||
/* NIR should ensure that, even in case of loops/if-else, there
|
||||
* should be only a single predecessor block to end_block, which
|
||||
* makes the perfect place to insert the clipdist calculations.
|
||||
*
|
||||
* NOTE: in case of early return's, these would have to be lowered
|
||||
* to jumps to end_block predecessor in a previous pass. Not sure
|
||||
* if there is a good way to sanity check this, but for now the
|
||||
* users of this pass don't support sub-routines.
|
||||
*/
|
||||
assert(impl->end_block->predecessors->entries == 1);
|
||||
b.cursor = nir_after_cf_list(&impl->body);
|
||||
|
||||
for (int plane = 0; plane < MAX_CLIP_PLANES; plane++) {
|
||||
if (ucp_enables & (1 << plane)) {
|
||||
nir_ssa_def *ucp =
|
||||
nir_load_system_value(&b, nir_intrinsic_load_user_clip_plane, plane);
|
||||
|
||||
/* calculate clipdist[plane] - dot(ucp, cv): */
|
||||
clipdist[plane] = nir_fdot4(&b, ucp, cv);
|
||||
}
|
||||
else {
|
||||
/* 0.0 == don't-clip == disabled: */
|
||||
clipdist[plane] = nir_imm_float(&b, 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
if (ucp_enables & 0x0f)
|
||||
store_clipdist_output(&b, out[0], &clipdist[0]);
|
||||
if (ucp_enables & 0xf0)
|
||||
store_clipdist_output(&b, out[1], &clipdist[4]);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_dominance);
|
||||
}
|
||||
|
||||
/* ucp_enables is bitmask of enabled ucp's. Actual ucp values are
|
||||
* passed in to shader via user_clip_plane system-values
|
||||
*/
|
||||
void
|
||||
nir_lower_clip_vs(nir_shader *shader, unsigned ucp_enables)
|
||||
{
|
||||
int clipvertex = -1;
|
||||
int position = -1;
|
||||
int maxloc = -1;
|
||||
nir_ssa_def *cv;
|
||||
nir_variable *out[2] = { NULL };
|
||||
|
||||
if (!ucp_enables)
|
||||
return;
|
||||
|
||||
/* find clipvertex/position outputs: */
|
||||
nir_foreach_variable(var, &shader->outputs) {
|
||||
int loc = var->data.driver_location;
|
||||
|
||||
/* keep track of last used driver-location.. we'll be
|
||||
* appending CLIP_DIST0/CLIP_DIST1 after last existing
|
||||
* output:
|
||||
*/
|
||||
maxloc = MAX2(maxloc, loc);
|
||||
|
||||
switch (var->data.location) {
|
||||
case VARYING_SLOT_POS:
|
||||
position = loc;
|
||||
break;
|
||||
case VARYING_SLOT_CLIP_VERTEX:
|
||||
clipvertex = loc;
|
||||
break;
|
||||
case VARYING_SLOT_CLIP_DIST0:
|
||||
case VARYING_SLOT_CLIP_DIST1:
|
||||
/* if shader is already writing CLIPDIST, then
|
||||
* there should be no user-clip-planes to deal
|
||||
* with.
|
||||
*/
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (clipvertex != -1)
|
||||
cv = find_output(shader, clipvertex);
|
||||
else if (position != -1)
|
||||
cv = find_output(shader, position);
|
||||
else
|
||||
return;
|
||||
|
||||
/* insert CLIPDIST outputs: */
|
||||
if (ucp_enables & 0x0f)
|
||||
out[0] =
|
||||
create_clipdist_var(shader, ++maxloc, true, VARYING_SLOT_CLIP_DIST0);
|
||||
if (ucp_enables & 0xf0)
|
||||
out[1] =
|
||||
create_clipdist_var(shader, ++maxloc, true, VARYING_SLOT_CLIP_DIST1);
|
||||
|
||||
nir_foreach_function(shader, function) {
|
||||
if (!strcmp(function->name, "main"))
|
||||
lower_clip_vs(function->impl, ucp_enables, cv, out);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* FS lowering
|
||||
*/
|
||||
|
||||
static void
|
||||
lower_clip_fs(nir_function_impl *impl, unsigned ucp_enables,
|
||||
nir_variable **in)
|
||||
{
|
||||
nir_ssa_def *clipdist[MAX_CLIP_PLANES];
|
||||
nir_builder b;
|
||||
|
||||
nir_builder_init(&b, impl);
|
||||
b.cursor = nir_before_cf_list(&impl->body);
|
||||
|
||||
if (ucp_enables & 0x0f)
|
||||
load_clipdist_input(&b, in[0], &clipdist[0]);
|
||||
if (ucp_enables & 0xf0)
|
||||
load_clipdist_input(&b, in[1], &clipdist[4]);
|
||||
|
||||
for (int plane = 0; plane < MAX_CLIP_PLANES; plane++) {
|
||||
if (ucp_enables & (1 << plane)) {
|
||||
nir_intrinsic_instr *discard;
|
||||
nir_ssa_def *cond;
|
||||
|
||||
cond = nir_flt(&b, clipdist[plane], nir_imm_float(&b, 0.0));
|
||||
|
||||
discard = nir_intrinsic_instr_create(b.shader,
|
||||
nir_intrinsic_discard_if);
|
||||
discard->src[0] = nir_src_for_ssa(cond);
|
||||
nir_builder_instr_insert(&b, &discard->instr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* insert conditional kill based on interpolated CLIPDIST
|
||||
*/
|
||||
void
|
||||
nir_lower_clip_fs(nir_shader *shader, unsigned ucp_enables)
|
||||
{
|
||||
nir_variable *in[2];
|
||||
int maxloc = -1;
|
||||
|
||||
if (!ucp_enables)
|
||||
return;
|
||||
|
||||
nir_foreach_variable(var, &shader->inputs) {
|
||||
int loc = var->data.driver_location;
|
||||
|
||||
/* keep track of last used driver-location.. we'll be
|
||||
* appending CLIP_DIST0/CLIP_DIST1 after last existing
|
||||
* input:
|
||||
*/
|
||||
maxloc = MAX2(maxloc, loc);
|
||||
}
|
||||
|
||||
/* The shader won't normally have CLIPDIST inputs, so we
|
||||
* must add our own:
|
||||
*/
|
||||
/* insert CLIPDIST outputs: */
|
||||
if (ucp_enables & 0x0f)
|
||||
in[0] =
|
||||
create_clipdist_var(shader, ++maxloc, false,
|
||||
VARYING_SLOT_CLIP_DIST0);
|
||||
if (ucp_enables & 0xf0)
|
||||
in[1] =
|
||||
create_clipdist_var(shader, ++maxloc, false,
|
||||
VARYING_SLOT_CLIP_DIST1);
|
||||
|
||||
nir_foreach_function(shader, function) {
|
||||
if (!strcmp(function->name, "main"))
|
||||
lower_clip_fs(function->impl, ucp_enables, in);
|
||||
}
|
||||
}
|
||||
@@ -1,219 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2015 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
#include "nir_builder.h"
|
||||
|
||||
/**
|
||||
* \file nir_lower_gs_intrinsics.c
|
||||
*
|
||||
* Geometry Shaders can call EmitVertex()/EmitStreamVertex() to output an
|
||||
* arbitrary number of vertices. However, the shader must declare the maximum
|
||||
* number of vertices that it will ever output - further attempts to emit
|
||||
* vertices result in undefined behavior according to the GLSL specification.
|
||||
*
|
||||
* Drivers might use this maximum number of vertices to allocate enough space
|
||||
* to hold the geometry shader's output. Some drivers (such as i965) need to
|
||||
* implement "safety checks" which ensure that the shader hasn't emitted too
|
||||
* many vertices, to avoid overflowing that space and trashing other memory.
|
||||
*
|
||||
* The count of emitted vertices can also be useful in buffer offset
|
||||
* calculations, so drivers know where to write the GS output.
|
||||
*
|
||||
* However, for simple geometry shaders that emit a statically determinable
|
||||
* number of vertices, this extra bookkeeping is unnecessary and inefficient.
|
||||
* By tracking the vertex count in NIR, we allow constant folding/propagation
|
||||
* and dead control flow optimizations to eliminate most of it where possible.
|
||||
*
|
||||
* This pass introduces a new global variable which stores the current vertex
|
||||
* count (initialized to 0), and converts emit_vertex/end_primitive intrinsics
|
||||
* to their *_with_counter variants. emit_vertex is also wrapped in a safety
|
||||
* check to avoid buffer overflows. Finally, it adds a set_vertex_count
|
||||
* intrinsic at the end of the program, informing the driver of the final
|
||||
* vertex count.
|
||||
*/
|
||||
|
||||
struct state {
|
||||
nir_builder *builder;
|
||||
nir_variable *vertex_count_var;
|
||||
bool progress;
|
||||
};
|
||||
|
||||
/**
|
||||
* Replace emit_vertex intrinsics with:
|
||||
*
|
||||
* if (vertex_count < max_vertices) {
|
||||
* emit_vertex_with_counter vertex_count ...
|
||||
* vertex_count += 1
|
||||
* }
|
||||
*/
|
||||
static void
|
||||
rewrite_emit_vertex(nir_intrinsic_instr *intrin, struct state *state)
|
||||
{
|
||||
nir_builder *b = state->builder;
|
||||
|
||||
/* Load the vertex count */
|
||||
b->cursor = nir_before_instr(&intrin->instr);
|
||||
nir_ssa_def *count = nir_load_var(b, state->vertex_count_var);
|
||||
|
||||
nir_ssa_def *max_vertices = nir_imm_int(b, b->shader->info.gs.vertices_out);
|
||||
|
||||
/* Create: if (vertex_count < max_vertices) and insert it.
|
||||
*
|
||||
* The new if statement needs to be hooked up to the control flow graph
|
||||
* before we start inserting instructions into it.
|
||||
*/
|
||||
nir_if *if_stmt = nir_if_create(b->shader);
|
||||
if_stmt->condition = nir_src_for_ssa(nir_ilt(b, count, max_vertices));
|
||||
nir_builder_cf_insert(b, &if_stmt->cf_node);
|
||||
|
||||
/* Fill out the new then-block */
|
||||
b->cursor = nir_after_cf_list(&if_stmt->then_list);
|
||||
|
||||
nir_intrinsic_instr *lowered =
|
||||
nir_intrinsic_instr_create(b->shader,
|
||||
nir_intrinsic_emit_vertex_with_counter);
|
||||
nir_intrinsic_set_stream_id(lowered, nir_intrinsic_stream_id(intrin));
|
||||
lowered->src[0] = nir_src_for_ssa(count);
|
||||
nir_builder_instr_insert(b, &lowered->instr);
|
||||
|
||||
/* Increment the vertex count by 1 */
|
||||
nir_store_var(b, state->vertex_count_var,
|
||||
nir_iadd(b, count, nir_imm_int(b, 1)),
|
||||
0x1); /* .x */
|
||||
|
||||
nir_instr_remove(&intrin->instr);
|
||||
|
||||
state->progress = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace end_primitive with end_primitive_with_counter.
|
||||
*/
|
||||
static void
|
||||
rewrite_end_primitive(nir_intrinsic_instr *intrin, struct state *state)
|
||||
{
|
||||
nir_builder *b = state->builder;
|
||||
|
||||
b->cursor = nir_before_instr(&intrin->instr);
|
||||
nir_ssa_def *count = nir_load_var(b, state->vertex_count_var);
|
||||
|
||||
nir_intrinsic_instr *lowered =
|
||||
nir_intrinsic_instr_create(b->shader,
|
||||
nir_intrinsic_end_primitive_with_counter);
|
||||
nir_intrinsic_set_stream_id(lowered, nir_intrinsic_stream_id(intrin));
|
||||
lowered->src[0] = nir_src_for_ssa(count);
|
||||
nir_builder_instr_insert(b, &lowered->instr);
|
||||
|
||||
nir_instr_remove(&intrin->instr);
|
||||
|
||||
state->progress = true;
|
||||
}
|
||||
|
||||
static bool
|
||||
rewrite_intrinsics(nir_block *block, void *closure)
|
||||
{
|
||||
struct state *state = closure;
|
||||
|
||||
nir_foreach_instr_safe(block, instr) {
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
continue;
|
||||
|
||||
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
|
||||
switch (intrin->intrinsic) {
|
||||
case nir_intrinsic_emit_vertex:
|
||||
rewrite_emit_vertex(intrin, state);
|
||||
break;
|
||||
case nir_intrinsic_end_primitive:
|
||||
rewrite_end_primitive(intrin, state);
|
||||
break;
|
||||
default:
|
||||
/* not interesting; skip this */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a set_vertex_count intrinsic at the end of the program
|
||||
* (representing the final vertex count).
|
||||
*/
|
||||
static void
|
||||
append_set_vertex_count(nir_block *end_block, struct state *state)
|
||||
{
|
||||
nir_builder *b = state->builder;
|
||||
nir_shader *shader = state->builder->shader;
|
||||
|
||||
/* Insert the new intrinsic in all of the predecessors of the end block,
|
||||
* but before any jump instructions (return).
|
||||
*/
|
||||
struct set_entry *entry;
|
||||
set_foreach(end_block->predecessors, entry) {
|
||||
nir_block *pred = (nir_block *) entry->key;
|
||||
b->cursor = nir_after_block_before_jump(pred);
|
||||
|
||||
nir_ssa_def *count = nir_load_var(b, state->vertex_count_var);
|
||||
|
||||
nir_intrinsic_instr *set_vertex_count =
|
||||
nir_intrinsic_instr_create(shader, nir_intrinsic_set_vertex_count);
|
||||
set_vertex_count->src[0] = nir_src_for_ssa(count);
|
||||
|
||||
nir_builder_instr_insert(b, &set_vertex_count->instr);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
nir_lower_gs_intrinsics(nir_shader *shader)
|
||||
{
|
||||
struct state state;
|
||||
state.progress = false;
|
||||
|
||||
/* Create the counter variable */
|
||||
nir_variable *var = rzalloc(shader, nir_variable);
|
||||
var->data.mode = nir_var_global;
|
||||
var->type = glsl_uint_type();
|
||||
var->name = "vertex_count";
|
||||
var->constant_initializer = rzalloc(shader, nir_constant); /* initialize to 0 */
|
||||
|
||||
exec_list_push_tail(&shader->globals, &var->node);
|
||||
state.vertex_count_var = var;
|
||||
|
||||
nir_foreach_function(shader, function) {
|
||||
if (function->impl) {
|
||||
nir_builder b;
|
||||
nir_builder_init(&b, function->impl);
|
||||
state.builder = &b;
|
||||
|
||||
nir_foreach_block(function->impl, rewrite_intrinsics, &state);
|
||||
|
||||
/* This only works because we have a single main() function. */
|
||||
append_set_vertex_count(function->impl->end_block, &state);
|
||||
|
||||
nir_metadata_preserve(function->impl, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return state.progress;
|
||||
}
|
||||
@@ -1,348 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Connor Abbott (cwabbott0@gmail.com)
|
||||
* Jason Ekstrand (jason@jlekstrand.net)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This lowering pass converts references to input/output variables with
|
||||
* loads/stores to actual input/output intrinsics.
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
#include "nir_builder.h"
|
||||
|
||||
struct lower_io_state {
|
||||
nir_builder builder;
|
||||
void *mem_ctx;
|
||||
int (*type_size)(const struct glsl_type *type);
|
||||
nir_variable_mode mode;
|
||||
};
|
||||
|
||||
void
|
||||
nir_assign_var_locations(struct exec_list *var_list, unsigned *size,
|
||||
int (*type_size)(const struct glsl_type *))
|
||||
{
|
||||
unsigned location = 0;
|
||||
|
||||
nir_foreach_variable(var, var_list) {
|
||||
/*
|
||||
* UBO's have their own address spaces, so don't count them towards the
|
||||
* number of global uniforms
|
||||
*/
|
||||
if ((var->data.mode == nir_var_uniform || var->data.mode == nir_var_shader_storage) &&
|
||||
var->interface_type != NULL)
|
||||
continue;
|
||||
|
||||
var->data.driver_location = location;
|
||||
location += type_size(var->type);
|
||||
}
|
||||
|
||||
*size = location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if we're processing a stage whose inputs are arrays indexed
|
||||
* by a vertex number (such as geometry shader inputs).
|
||||
*/
|
||||
static bool
|
||||
is_per_vertex_input(struct lower_io_state *state, nir_variable *var)
|
||||
{
|
||||
gl_shader_stage stage = state->builder.shader->stage;
|
||||
|
||||
return var->data.mode == nir_var_shader_in && !var->data.patch &&
|
||||
(stage == MESA_SHADER_TESS_CTRL ||
|
||||
stage == MESA_SHADER_TESS_EVAL ||
|
||||
stage == MESA_SHADER_GEOMETRY);
|
||||
}
|
||||
|
||||
static bool
|
||||
is_per_vertex_output(struct lower_io_state *state, nir_variable *var)
|
||||
{
|
||||
gl_shader_stage stage = state->builder.shader->stage;
|
||||
return var->data.mode == nir_var_shader_out && !var->data.patch &&
|
||||
stage == MESA_SHADER_TESS_CTRL;
|
||||
}
|
||||
|
||||
static nir_ssa_def *
|
||||
get_io_offset(nir_builder *b, nir_deref_var *deref,
|
||||
nir_ssa_def **vertex_index,
|
||||
int (*type_size)(const struct glsl_type *))
|
||||
{
|
||||
nir_deref *tail = &deref->deref;
|
||||
|
||||
/* For per-vertex input arrays (i.e. geometry shader inputs), keep the
|
||||
* outermost array index separate. Process the rest normally.
|
||||
*/
|
||||
if (vertex_index != NULL) {
|
||||
tail = tail->child;
|
||||
assert(tail->deref_type == nir_deref_type_array);
|
||||
nir_deref_array *deref_array = nir_deref_as_array(tail);
|
||||
|
||||
nir_ssa_def *vtx = nir_imm_int(b, deref_array->base_offset);
|
||||
if (deref_array->deref_array_type == nir_deref_array_type_indirect) {
|
||||
vtx = nir_iadd(b, vtx, nir_ssa_for_src(b, deref_array->indirect, 1));
|
||||
}
|
||||
*vertex_index = vtx;
|
||||
}
|
||||
|
||||
/* Just emit code and let constant-folding go to town */
|
||||
nir_ssa_def *offset = nir_imm_int(b, 0);
|
||||
|
||||
while (tail->child != NULL) {
|
||||
const struct glsl_type *parent_type = tail->type;
|
||||
tail = tail->child;
|
||||
|
||||
if (tail->deref_type == nir_deref_type_array) {
|
||||
nir_deref_array *deref_array = nir_deref_as_array(tail);
|
||||
unsigned size = type_size(tail->type);
|
||||
|
||||
offset = nir_iadd(b, offset,
|
||||
nir_imm_int(b, size * deref_array->base_offset));
|
||||
|
||||
if (deref_array->deref_array_type == nir_deref_array_type_indirect) {
|
||||
nir_ssa_def *mul =
|
||||
nir_imul(b, nir_imm_int(b, size),
|
||||
nir_ssa_for_src(b, deref_array->indirect, 1));
|
||||
|
||||
offset = nir_iadd(b, offset, mul);
|
||||
}
|
||||
} else if (tail->deref_type == nir_deref_type_struct) {
|
||||
nir_deref_struct *deref_struct = nir_deref_as_struct(tail);
|
||||
|
||||
unsigned field_offset = 0;
|
||||
for (unsigned i = 0; i < deref_struct->index; i++) {
|
||||
field_offset += type_size(glsl_get_struct_field(parent_type, i));
|
||||
}
|
||||
offset = nir_iadd(b, offset, nir_imm_int(b, field_offset));
|
||||
}
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
static nir_intrinsic_op
|
||||
load_op(struct lower_io_state *state,
|
||||
nir_variable_mode mode, bool per_vertex)
|
||||
{
|
||||
nir_intrinsic_op op;
|
||||
switch (mode) {
|
||||
case nir_var_shader_in:
|
||||
op = per_vertex ? nir_intrinsic_load_per_vertex_input :
|
||||
nir_intrinsic_load_input;
|
||||
break;
|
||||
case nir_var_shader_out:
|
||||
op = per_vertex ? nir_intrinsic_load_per_vertex_output :
|
||||
nir_intrinsic_load_output;
|
||||
break;
|
||||
case nir_var_uniform:
|
||||
op = nir_intrinsic_load_uniform;
|
||||
break;
|
||||
default:
|
||||
unreachable("Unknown variable mode");
|
||||
}
|
||||
return op;
|
||||
}
|
||||
|
||||
static bool
|
||||
nir_lower_io_block(nir_block *block, void *void_state)
|
||||
{
|
||||
struct lower_io_state *state = void_state;
|
||||
|
||||
nir_builder *b = &state->builder;
|
||||
|
||||
nir_foreach_instr_safe(block, instr) {
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
continue;
|
||||
|
||||
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
|
||||
|
||||
if (intrin->intrinsic != nir_intrinsic_load_var &&
|
||||
intrin->intrinsic != nir_intrinsic_store_var)
|
||||
continue;
|
||||
|
||||
nir_variable_mode mode = intrin->variables[0]->var->data.mode;
|
||||
|
||||
if (state->mode != nir_var_all && state->mode != mode)
|
||||
continue;
|
||||
|
||||
if (mode != nir_var_shader_in &&
|
||||
mode != nir_var_shader_out &&
|
||||
mode != nir_var_uniform)
|
||||
continue;
|
||||
|
||||
b->cursor = nir_before_instr(instr);
|
||||
|
||||
switch (intrin->intrinsic) {
|
||||
case nir_intrinsic_load_var: {
|
||||
bool per_vertex =
|
||||
is_per_vertex_input(state, intrin->variables[0]->var) ||
|
||||
is_per_vertex_output(state, intrin->variables[0]->var);
|
||||
|
||||
nir_ssa_def *offset;
|
||||
nir_ssa_def *vertex_index;
|
||||
|
||||
offset = get_io_offset(b, intrin->variables[0],
|
||||
per_vertex ? &vertex_index : NULL,
|
||||
state->type_size);
|
||||
|
||||
nir_intrinsic_instr *load =
|
||||
nir_intrinsic_instr_create(state->mem_ctx,
|
||||
load_op(state, mode, per_vertex));
|
||||
load->num_components = intrin->num_components;
|
||||
|
||||
nir_intrinsic_set_base(load,
|
||||
intrin->variables[0]->var->data.driver_location);
|
||||
|
||||
if (per_vertex)
|
||||
load->src[0] = nir_src_for_ssa(vertex_index);
|
||||
|
||||
load->src[per_vertex ? 1 : 0] = nir_src_for_ssa(offset);
|
||||
|
||||
if (intrin->dest.is_ssa) {
|
||||
nir_ssa_dest_init(&load->instr, &load->dest,
|
||||
intrin->num_components, NULL);
|
||||
nir_ssa_def_rewrite_uses(&intrin->dest.ssa,
|
||||
nir_src_for_ssa(&load->dest.ssa));
|
||||
} else {
|
||||
nir_dest_copy(&load->dest, &intrin->dest, state->mem_ctx);
|
||||
}
|
||||
|
||||
nir_instr_insert_before(&intrin->instr, &load->instr);
|
||||
nir_instr_remove(&intrin->instr);
|
||||
break;
|
||||
}
|
||||
|
||||
case nir_intrinsic_store_var: {
|
||||
assert(mode == nir_var_shader_out);
|
||||
|
||||
nir_ssa_def *offset;
|
||||
nir_ssa_def *vertex_index;
|
||||
|
||||
bool per_vertex =
|
||||
is_per_vertex_output(state, intrin->variables[0]->var);
|
||||
|
||||
offset = get_io_offset(b, intrin->variables[0],
|
||||
per_vertex ? &vertex_index : NULL,
|
||||
state->type_size);
|
||||
|
||||
nir_intrinsic_op store_op =
|
||||
per_vertex ? nir_intrinsic_store_per_vertex_output :
|
||||
nir_intrinsic_store_output;
|
||||
|
||||
nir_intrinsic_instr *store = nir_intrinsic_instr_create(state->mem_ctx,
|
||||
store_op);
|
||||
store->num_components = intrin->num_components;
|
||||
|
||||
nir_src_copy(&store->src[0], &intrin->src[0], store);
|
||||
|
||||
nir_intrinsic_set_base(store,
|
||||
intrin->variables[0]->var->data.driver_location);
|
||||
nir_intrinsic_set_write_mask(store, nir_intrinsic_write_mask(intrin));
|
||||
|
||||
if (per_vertex)
|
||||
store->src[1] = nir_src_for_ssa(vertex_index);
|
||||
|
||||
store->src[per_vertex ? 2 : 1] = nir_src_for_ssa(offset);
|
||||
|
||||
nir_instr_insert_before(&intrin->instr, &store->instr);
|
||||
nir_instr_remove(&intrin->instr);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
nir_lower_io_impl(nir_function_impl *impl,
|
||||
nir_variable_mode mode,
|
||||
int (*type_size)(const struct glsl_type *))
|
||||
{
|
||||
struct lower_io_state state;
|
||||
|
||||
nir_builder_init(&state.builder, impl);
|
||||
state.mem_ctx = ralloc_parent(impl);
|
||||
state.mode = mode;
|
||||
state.type_size = type_size;
|
||||
|
||||
nir_foreach_block(impl, nir_lower_io_block, &state);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_block_index |
|
||||
nir_metadata_dominance);
|
||||
}
|
||||
|
||||
void
|
||||
nir_lower_io(nir_shader *shader, nir_variable_mode mode,
|
||||
int (*type_size)(const struct glsl_type *))
|
||||
{
|
||||
nir_foreach_function(shader, function) {
|
||||
if (function->impl)
|
||||
nir_lower_io_impl(function->impl, mode, type_size);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the offset soruce for a load/store intrinsic.
|
||||
*/
|
||||
nir_src *
|
||||
nir_get_io_offset_src(nir_intrinsic_instr *instr)
|
||||
{
|
||||
switch (instr->intrinsic) {
|
||||
case nir_intrinsic_load_input:
|
||||
case nir_intrinsic_load_output:
|
||||
case nir_intrinsic_load_uniform:
|
||||
return &instr->src[0];
|
||||
case nir_intrinsic_load_per_vertex_input:
|
||||
case nir_intrinsic_load_per_vertex_output:
|
||||
case nir_intrinsic_store_output:
|
||||
return &instr->src[1];
|
||||
case nir_intrinsic_store_per_vertex_output:
|
||||
return &instr->src[2];
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the vertex index source for a load/store per_vertex intrinsic.
|
||||
*/
|
||||
nir_src *
|
||||
nir_get_io_vertex_index_src(nir_intrinsic_instr *instr)
|
||||
{
|
||||
switch (instr->intrinsic) {
|
||||
case nir_intrinsic_load_per_vertex_input:
|
||||
case nir_intrinsic_load_per_vertex_output:
|
||||
return &instr->src[0];
|
||||
case nir_intrinsic_store_per_vertex_output:
|
||||
return &instr->src[1];
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -1,133 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2015 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Implements a pass that lowers output variables to a temporary plus an
|
||||
* output variable with a single copy at each exit point of the shader.
|
||||
* This way the output variable is only ever written.
|
||||
*
|
||||
* Because valid NIR requires that output variables are never read, this
|
||||
* pass is more of a helper for NIR producers and must be run before the
|
||||
* shader is ever validated.
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
|
||||
struct lower_outputs_state {
|
||||
nir_shader *shader;
|
||||
struct exec_list old_outputs;
|
||||
};
|
||||
|
||||
static void
|
||||
emit_output_copies(nir_cursor cursor, struct lower_outputs_state *state)
|
||||
{
|
||||
assert(exec_list_length(&state->shader->outputs) ==
|
||||
exec_list_length(&state->old_outputs));
|
||||
|
||||
foreach_two_lists(out_node, &state->shader->outputs,
|
||||
temp_node, &state->old_outputs) {
|
||||
nir_variable *output = exec_node_data(nir_variable, out_node, node);
|
||||
nir_variable *temp = exec_node_data(nir_variable, temp_node, node);
|
||||
|
||||
nir_intrinsic_instr *copy =
|
||||
nir_intrinsic_instr_create(state->shader, nir_intrinsic_copy_var);
|
||||
copy->variables[0] = nir_deref_var_create(copy, output);
|
||||
copy->variables[1] = nir_deref_var_create(copy, temp);
|
||||
|
||||
nir_instr_insert(cursor, ©->instr);
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
emit_output_copies_block(nir_block *block, void *state)
|
||||
{
|
||||
nir_foreach_instr(block, instr) {
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
continue;
|
||||
|
||||
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
|
||||
if (intrin->intrinsic == nir_intrinsic_emit_vertex)
|
||||
emit_output_copies(nir_before_instr(&intrin->instr), state);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
nir_lower_outputs_to_temporaries(nir_shader *shader)
|
||||
{
|
||||
struct lower_outputs_state state;
|
||||
|
||||
if (shader->stage == MESA_SHADER_TESS_CTRL)
|
||||
return;
|
||||
|
||||
state.shader = shader;
|
||||
exec_list_move_nodes_to(&shader->outputs, &state.old_outputs);
|
||||
|
||||
/* Walk over all of the outputs turn each output into a temporary and
|
||||
* make a new variable for the actual output.
|
||||
*/
|
||||
nir_foreach_variable(var, &state.old_outputs) {
|
||||
nir_variable *output = ralloc(shader, nir_variable);
|
||||
memcpy(output, var, sizeof *output);
|
||||
|
||||
/* The orignal is now the temporary */
|
||||
nir_variable *temp = var;
|
||||
|
||||
/* Reparent the name to the new variable */
|
||||
ralloc_steal(output, output->name);
|
||||
|
||||
/* Give the output a new name with @out-temp appended */
|
||||
temp->name = ralloc_asprintf(var, "%s@out-temp", output->name);
|
||||
temp->data.mode = nir_var_global;
|
||||
temp->constant_initializer = NULL;
|
||||
|
||||
exec_list_push_tail(&shader->outputs, &output->node);
|
||||
}
|
||||
|
||||
nir_foreach_function(shader, function) {
|
||||
if (function->impl == NULL)
|
||||
continue;
|
||||
|
||||
if (shader->stage == MESA_SHADER_GEOMETRY) {
|
||||
/* For geometry shaders, we have to emit the output copies right
|
||||
* before each EmitVertex call.
|
||||
*/
|
||||
nir_foreach_block(function->impl, emit_output_copies_block, &state);
|
||||
} else if (strcmp(function->name, "main") == 0) {
|
||||
/* For all other shader types, we need to do the copies right before
|
||||
* the jumps to the end block.
|
||||
*/
|
||||
struct set_entry *block_entry;
|
||||
set_foreach(function->impl->end_block->predecessors, block_entry) {
|
||||
struct nir_block *block = (void *)block_entry->key;
|
||||
emit_output_copies(nir_after_block_before_jump(block), &state);
|
||||
}
|
||||
}
|
||||
|
||||
nir_metadata_preserve(function->impl, nir_metadata_block_index |
|
||||
nir_metadata_dominance);
|
||||
}
|
||||
|
||||
exec_list_append(&shader->globals, &state.old_outputs);
|
||||
}
|
||||
@@ -1,198 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2007 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 2008 VMware, Inc. All Rights Reserved.
|
||||
* Copyright © 2014 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
#include "nir_builder.h"
|
||||
#include "program/hash_table.h"
|
||||
#include "compiler/glsl/ir_uniform.h"
|
||||
|
||||
#include "main/compiler.h"
|
||||
#include "main/mtypes.h"
|
||||
#include "program/prog_parameter.h"
|
||||
#include "program/program.h"
|
||||
|
||||
/* Calculate the sampler index based on array indicies and also
|
||||
* calculate the base uniform location for struct members.
|
||||
*/
|
||||
static void
|
||||
calc_sampler_offsets(nir_deref *tail, nir_tex_instr *instr,
|
||||
unsigned *array_elements, nir_ssa_def **indirect,
|
||||
nir_builder *b, unsigned *location)
|
||||
{
|
||||
if (tail->child == NULL)
|
||||
return;
|
||||
|
||||
switch (tail->child->deref_type) {
|
||||
case nir_deref_type_array: {
|
||||
nir_deref_array *deref_array = nir_deref_as_array(tail->child);
|
||||
|
||||
assert(deref_array->deref_array_type != nir_deref_array_type_wildcard);
|
||||
|
||||
calc_sampler_offsets(tail->child, instr, array_elements,
|
||||
indirect, b, location);
|
||||
instr->texture_index += deref_array->base_offset * *array_elements;
|
||||
|
||||
if (deref_array->deref_array_type == nir_deref_array_type_indirect) {
|
||||
nir_ssa_def *mul =
|
||||
nir_imul(b, nir_imm_int(b, *array_elements),
|
||||
nir_ssa_for_src(b, deref_array->indirect, 1));
|
||||
|
||||
nir_instr_rewrite_src(&instr->instr, &deref_array->indirect,
|
||||
NIR_SRC_INIT);
|
||||
|
||||
if (*indirect) {
|
||||
*indirect = nir_iadd(b, *indirect, mul);
|
||||
} else {
|
||||
*indirect = mul;
|
||||
}
|
||||
}
|
||||
|
||||
*array_elements *= glsl_get_length(tail->type);
|
||||
break;
|
||||
}
|
||||
|
||||
case nir_deref_type_struct: {
|
||||
nir_deref_struct *deref_struct = nir_deref_as_struct(tail->child);
|
||||
*location += glsl_get_record_location_offset(tail->type, deref_struct->index);
|
||||
calc_sampler_offsets(tail->child, instr, array_elements,
|
||||
indirect, b, location);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
unreachable("Invalid deref type");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
lower_sampler(nir_tex_instr *instr, const struct gl_shader_program *shader_program,
|
||||
gl_shader_stage stage, nir_builder *builder)
|
||||
{
|
||||
if (instr->texture == NULL)
|
||||
return;
|
||||
|
||||
/* In GLSL, we only fill out the texture field. The sampler is inferred */
|
||||
assert(instr->sampler == NULL);
|
||||
|
||||
instr->texture_index = 0;
|
||||
unsigned location = instr->texture->var->data.location;
|
||||
unsigned array_elements = 1;
|
||||
nir_ssa_def *indirect = NULL;
|
||||
|
||||
builder->cursor = nir_before_instr(&instr->instr);
|
||||
calc_sampler_offsets(&instr->texture->deref, instr, &array_elements,
|
||||
&indirect, builder, &location);
|
||||
|
||||
if (indirect) {
|
||||
/* First, we have to resize the array of texture sources */
|
||||
nir_tex_src *new_srcs = rzalloc_array(instr, nir_tex_src,
|
||||
instr->num_srcs + 2);
|
||||
|
||||
for (unsigned i = 0; i < instr->num_srcs; i++) {
|
||||
new_srcs[i].src_type = instr->src[i].src_type;
|
||||
nir_instr_move_src(&instr->instr, &new_srcs[i].src,
|
||||
&instr->src[i].src);
|
||||
}
|
||||
|
||||
ralloc_free(instr->src);
|
||||
instr->src = new_srcs;
|
||||
|
||||
/* Now we can go ahead and move the source over to being a
|
||||
* first-class texture source.
|
||||
*/
|
||||
instr->src[instr->num_srcs].src_type = nir_tex_src_texture_offset;
|
||||
instr->num_srcs++;
|
||||
nir_instr_rewrite_src(&instr->instr,
|
||||
&instr->src[instr->num_srcs - 1].src,
|
||||
nir_src_for_ssa(indirect));
|
||||
|
||||
instr->src[instr->num_srcs].src_type = nir_tex_src_sampler_offset;
|
||||
instr->num_srcs++;
|
||||
nir_instr_rewrite_src(&instr->instr,
|
||||
&instr->src[instr->num_srcs - 1].src,
|
||||
nir_src_for_ssa(indirect));
|
||||
|
||||
instr->texture_array_size = array_elements;
|
||||
}
|
||||
|
||||
if (location > shader_program->NumUniformStorage - 1 ||
|
||||
!shader_program->UniformStorage[location].opaque[stage].active) {
|
||||
assert(!"cannot return a sampler");
|
||||
return;
|
||||
}
|
||||
|
||||
instr->texture_index +=
|
||||
shader_program->UniformStorage[location].opaque[stage].index;
|
||||
|
||||
instr->sampler_index = instr->texture_index;
|
||||
|
||||
instr->texture = NULL;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
nir_builder builder;
|
||||
const struct gl_shader_program *shader_program;
|
||||
gl_shader_stage stage;
|
||||
} lower_state;
|
||||
|
||||
static bool
|
||||
lower_block_cb(nir_block *block, void *_state)
|
||||
{
|
||||
lower_state *state = (lower_state *) _state;
|
||||
|
||||
nir_foreach_instr(block, instr) {
|
||||
if (instr->type == nir_instr_type_tex) {
|
||||
nir_tex_instr *tex_instr = nir_instr_as_tex(instr);
|
||||
lower_sampler(tex_instr, state->shader_program, state->stage,
|
||||
&state->builder);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
lower_impl(nir_function_impl *impl, const struct gl_shader_program *shader_program,
|
||||
gl_shader_stage stage)
|
||||
{
|
||||
lower_state state;
|
||||
|
||||
nir_builder_init(&state.builder, impl);
|
||||
state.shader_program = shader_program;
|
||||
state.stage = stage;
|
||||
|
||||
nir_foreach_block(impl, lower_block_cb, &state);
|
||||
}
|
||||
|
||||
void
|
||||
nir_lower_samplers(nir_shader *shader,
|
||||
const struct gl_shader_program *shader_program)
|
||||
{
|
||||
nir_foreach_function(shader, function) {
|
||||
if (function->impl)
|
||||
lower_impl(function->impl, shader_program, shader->stage);
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Connor Abbott (cwabbott0@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
#include "nir_builder.h"
|
||||
|
||||
struct lower_system_values_state {
|
||||
nir_builder builder;
|
||||
bool progress;
|
||||
};
|
||||
|
||||
static bool
|
||||
convert_block(nir_block *block, void *void_state)
|
||||
{
|
||||
struct lower_system_values_state *state = void_state;
|
||||
|
||||
nir_builder *b = &state->builder;
|
||||
|
||||
nir_foreach_instr_safe(block, instr) {
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
continue;
|
||||
|
||||
nir_intrinsic_instr *load_var = nir_instr_as_intrinsic(instr);
|
||||
|
||||
if (load_var->intrinsic != nir_intrinsic_load_var)
|
||||
continue;
|
||||
|
||||
nir_variable *var = load_var->variables[0]->var;
|
||||
if (var->data.mode != nir_var_system_value)
|
||||
continue;
|
||||
|
||||
b->cursor = nir_after_instr(&load_var->instr);
|
||||
|
||||
nir_intrinsic_op sysval_op =
|
||||
nir_intrinsic_from_system_value(var->data.location);
|
||||
nir_ssa_def *sysval = nir_load_system_value(b, sysval_op, 0);
|
||||
|
||||
nir_ssa_def_rewrite_uses(&load_var->dest.ssa, nir_src_for_ssa(sysval));
|
||||
nir_instr_remove(&load_var->instr);
|
||||
|
||||
state->progress = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
convert_impl(nir_function_impl *impl)
|
||||
{
|
||||
struct lower_system_values_state state;
|
||||
|
||||
state.progress = false;
|
||||
nir_builder_init(&state.builder, impl);
|
||||
|
||||
nir_foreach_block(impl, convert_block, &state);
|
||||
nir_metadata_preserve(impl, nir_metadata_block_index |
|
||||
nir_metadata_dominance);
|
||||
return state.progress;
|
||||
}
|
||||
|
||||
bool
|
||||
nir_lower_system_values(nir_shader *shader)
|
||||
{
|
||||
bool progress = false;
|
||||
|
||||
nir_foreach_function(shader, function) {
|
||||
if (function->impl)
|
||||
progress = convert_impl(function->impl) || progress;
|
||||
}
|
||||
|
||||
exec_list_make_empty(&shader->system_values);
|
||||
|
||||
return progress;
|
||||
}
|
||||
@@ -1,355 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2015 Broadcom
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This lowering pass supports (as configured via nir_lower_tex_options)
|
||||
* various texture related conversions:
|
||||
* + texture projector lowering: converts the coordinate division for
|
||||
* texture projection to be done in ALU instructions instead of
|
||||
* asking the texture operation to do so.
|
||||
* + lowering RECT: converts the un-normalized RECT texture coordinates
|
||||
* to normalized coordinates with txs plus ALU instructions
|
||||
* + saturate s/t/r coords: to emulate certain texture clamp/wrap modes,
|
||||
* inserts instructions to clamp specified coordinates to [0.0, 1.0].
|
||||
* Note that this automatically triggers texture projector lowering if
|
||||
* needed, since clamping must happen after projector lowering.
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
#include "nir_builder.h"
|
||||
|
||||
typedef struct {
|
||||
nir_builder b;
|
||||
const nir_lower_tex_options *options;
|
||||
bool progress;
|
||||
} lower_tex_state;
|
||||
|
||||
static void
|
||||
project_src(nir_builder *b, nir_tex_instr *tex)
|
||||
{
|
||||
/* Find the projector in the srcs list, if present. */
|
||||
unsigned proj_index;
|
||||
for (proj_index = 0; proj_index < tex->num_srcs; proj_index++) {
|
||||
if (tex->src[proj_index].src_type == nir_tex_src_projector)
|
||||
break;
|
||||
}
|
||||
if (proj_index == tex->num_srcs)
|
||||
return;
|
||||
|
||||
b->cursor = nir_before_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *inv_proj =
|
||||
nir_frcp(b, nir_ssa_for_src(b, tex->src[proj_index].src, 1));
|
||||
|
||||
/* Walk through the sources projecting the arguments. */
|
||||
for (unsigned i = 0; i < tex->num_srcs; i++) {
|
||||
switch (tex->src[i].src_type) {
|
||||
case nir_tex_src_coord:
|
||||
case nir_tex_src_comparitor:
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
nir_ssa_def *unprojected =
|
||||
nir_ssa_for_src(b, tex->src[i].src, nir_tex_instr_src_size(tex, i));
|
||||
nir_ssa_def *projected = nir_fmul(b, unprojected, inv_proj);
|
||||
|
||||
/* Array indices don't get projected, so make an new vector with the
|
||||
* coordinate's array index untouched.
|
||||
*/
|
||||
if (tex->is_array && tex->src[i].src_type == nir_tex_src_coord) {
|
||||
switch (tex->coord_components) {
|
||||
case 4:
|
||||
projected = nir_vec4(b,
|
||||
nir_channel(b, projected, 0),
|
||||
nir_channel(b, projected, 1),
|
||||
nir_channel(b, projected, 2),
|
||||
nir_channel(b, unprojected, 3));
|
||||
break;
|
||||
case 3:
|
||||
projected = nir_vec3(b,
|
||||
nir_channel(b, projected, 0),
|
||||
nir_channel(b, projected, 1),
|
||||
nir_channel(b, unprojected, 2));
|
||||
break;
|
||||
case 2:
|
||||
projected = nir_vec2(b,
|
||||
nir_channel(b, projected, 0),
|
||||
nir_channel(b, unprojected, 1));
|
||||
break;
|
||||
default:
|
||||
unreachable("bad texture coord count for array");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
nir_instr_rewrite_src(&tex->instr,
|
||||
&tex->src[i].src,
|
||||
nir_src_for_ssa(projected));
|
||||
}
|
||||
|
||||
/* Now move the later tex sources down the array so that the projector
|
||||
* disappears.
|
||||
*/
|
||||
nir_instr_rewrite_src(&tex->instr, &tex->src[proj_index].src,
|
||||
NIR_SRC_INIT);
|
||||
for (unsigned i = proj_index + 1; i < tex->num_srcs; i++) {
|
||||
tex->src[i-1].src_type = tex->src[i].src_type;
|
||||
nir_instr_move_src(&tex->instr, &tex->src[i-1].src, &tex->src[i].src);
|
||||
}
|
||||
tex->num_srcs--;
|
||||
}
|
||||
|
||||
static nir_ssa_def *
|
||||
get_texture_size(nir_builder *b, nir_tex_instr *tex)
|
||||
{
|
||||
b->cursor = nir_before_instr(&tex->instr);
|
||||
|
||||
/* RECT textures should not be array: */
|
||||
assert(!tex->is_array);
|
||||
|
||||
nir_tex_instr *txs;
|
||||
|
||||
txs = nir_tex_instr_create(b->shader, 1);
|
||||
txs->op = nir_texop_txs;
|
||||
txs->sampler_dim = GLSL_SAMPLER_DIM_RECT;
|
||||
txs->texture_index = tex->texture_index;
|
||||
txs->dest_type = nir_type_int;
|
||||
|
||||
/* only single src, the lod: */
|
||||
txs->src[0].src = nir_src_for_ssa(nir_imm_int(b, 0));
|
||||
txs->src[0].src_type = nir_tex_src_lod;
|
||||
|
||||
nir_ssa_dest_init(&txs->instr, &txs->dest, 2, NULL);
|
||||
nir_builder_instr_insert(b, &txs->instr);
|
||||
|
||||
return nir_i2f(b, &txs->dest.ssa);
|
||||
}
|
||||
|
||||
static void
|
||||
lower_rect(nir_builder *b, nir_tex_instr *tex)
|
||||
{
|
||||
nir_ssa_def *txs = get_texture_size(b, tex);
|
||||
nir_ssa_def *scale = nir_frcp(b, txs);
|
||||
|
||||
/* Walk through the sources normalizing the requested arguments. */
|
||||
for (unsigned i = 0; i < tex->num_srcs; i++) {
|
||||
if (tex->src[i].src_type != nir_tex_src_coord)
|
||||
continue;
|
||||
|
||||
nir_ssa_def *coords =
|
||||
nir_ssa_for_src(b, tex->src[i].src, tex->coord_components);
|
||||
nir_instr_rewrite_src(&tex->instr,
|
||||
&tex->src[i].src,
|
||||
nir_src_for_ssa(nir_fmul(b, coords, scale)));
|
||||
}
|
||||
|
||||
tex->sampler_dim = GLSL_SAMPLER_DIM_2D;
|
||||
}
|
||||
|
||||
static void
|
||||
saturate_src(nir_builder *b, nir_tex_instr *tex, unsigned sat_mask)
|
||||
{
|
||||
b->cursor = nir_before_instr(&tex->instr);
|
||||
|
||||
/* Walk through the sources saturating the requested arguments. */
|
||||
for (unsigned i = 0; i < tex->num_srcs; i++) {
|
||||
if (tex->src[i].src_type != nir_tex_src_coord)
|
||||
continue;
|
||||
|
||||
nir_ssa_def *src =
|
||||
nir_ssa_for_src(b, tex->src[i].src, tex->coord_components);
|
||||
|
||||
/* split src into components: */
|
||||
nir_ssa_def *comp[4];
|
||||
|
||||
for (unsigned j = 0; j < tex->coord_components; j++)
|
||||
comp[j] = nir_channel(b, src, j);
|
||||
|
||||
/* clamp requested components, array index does not get clamped: */
|
||||
unsigned ncomp = tex->coord_components;
|
||||
if (tex->is_array)
|
||||
ncomp--;
|
||||
|
||||
for (unsigned j = 0; j < ncomp; j++) {
|
||||
if ((1 << j) & sat_mask) {
|
||||
if (tex->sampler_dim == GLSL_SAMPLER_DIM_RECT) {
|
||||
/* non-normalized texture coords, so clamp to texture
|
||||
* size rather than [0.0, 1.0]
|
||||
*/
|
||||
nir_ssa_def *txs = get_texture_size(b, tex);
|
||||
comp[j] = nir_fmax(b, comp[j], nir_imm_float(b, 0.0));
|
||||
comp[j] = nir_fmin(b, comp[j], nir_channel(b, txs, j));
|
||||
} else {
|
||||
comp[j] = nir_fsat(b, comp[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* and move the result back into a single vecN: */
|
||||
src = nir_vec(b, comp, tex->coord_components);
|
||||
|
||||
nir_instr_rewrite_src(&tex->instr,
|
||||
&tex->src[i].src,
|
||||
nir_src_for_ssa(src));
|
||||
}
|
||||
}
|
||||
|
||||
static nir_ssa_def *
|
||||
get_zero_or_one(nir_builder *b, nir_alu_type type, uint8_t swizzle_val)
|
||||
{
|
||||
nir_const_value v;
|
||||
|
||||
memset(&v, 0, sizeof(v));
|
||||
|
||||
if (swizzle_val == 4) {
|
||||
v.u[0] = v.u[1] = v.u[2] = v.u[3] = 0;
|
||||
} else {
|
||||
assert(swizzle_val == 5);
|
||||
if (type == nir_type_float)
|
||||
v.f[0] = v.f[1] = v.f[2] = v.f[3] = 1.0;
|
||||
else
|
||||
v.u[0] = v.u[1] = v.u[2] = v.u[3] = 1;
|
||||
}
|
||||
|
||||
return nir_build_imm(b, 4, v);
|
||||
}
|
||||
|
||||
static void
|
||||
swizzle_result(nir_builder *b, nir_tex_instr *tex, const uint8_t swizzle[4])
|
||||
{
|
||||
assert(tex->dest.is_ssa);
|
||||
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *swizzled;
|
||||
if (tex->op == nir_texop_tg4) {
|
||||
if (swizzle[tex->component] < 4) {
|
||||
/* This one's easy */
|
||||
tex->component = swizzle[tex->component];
|
||||
return;
|
||||
} else {
|
||||
swizzled = get_zero_or_one(b, tex->dest_type, swizzle[tex->component]);
|
||||
}
|
||||
} else {
|
||||
assert(nir_tex_instr_dest_size(tex) == 4);
|
||||
if (swizzle[0] < 4 && swizzle[1] < 4 &&
|
||||
swizzle[2] < 4 && swizzle[3] < 4) {
|
||||
unsigned swiz[4] = { swizzle[0], swizzle[1], swizzle[2], swizzle[3] };
|
||||
/* We have no 0's or 1's, just emit a swizzling MOV */
|
||||
swizzled = nir_swizzle(b, &tex->dest.ssa, swiz, 4, false);
|
||||
} else {
|
||||
nir_ssa_def *srcs[4];
|
||||
for (unsigned i = 0; i < 4; i++) {
|
||||
if (swizzle[i] < 4) {
|
||||
srcs[i] = nir_channel(b, &tex->dest.ssa, swizzle[i]);
|
||||
} else {
|
||||
srcs[i] = get_zero_or_one(b, tex->dest_type, swizzle[i]);
|
||||
}
|
||||
}
|
||||
swizzled = nir_vec(b, srcs, 4);
|
||||
}
|
||||
}
|
||||
|
||||
nir_ssa_def_rewrite_uses_after(&tex->dest.ssa, nir_src_for_ssa(swizzled),
|
||||
swizzled->parent_instr);
|
||||
}
|
||||
|
||||
static bool
|
||||
nir_lower_tex_block(nir_block *block, void *void_state)
|
||||
{
|
||||
lower_tex_state *state = void_state;
|
||||
nir_builder *b = &state->b;
|
||||
|
||||
nir_foreach_instr_safe(block, instr) {
|
||||
if (instr->type != nir_instr_type_tex)
|
||||
continue;
|
||||
|
||||
nir_tex_instr *tex = nir_instr_as_tex(instr);
|
||||
bool lower_txp = !!(state->options->lower_txp & (1 << tex->sampler_dim));
|
||||
|
||||
/* mask of src coords to saturate (clamp): */
|
||||
unsigned sat_mask = 0;
|
||||
|
||||
if ((1 << tex->sampler_index) & state->options->saturate_r)
|
||||
sat_mask |= (1 << 2); /* .z */
|
||||
if ((1 << tex->sampler_index) & state->options->saturate_t)
|
||||
sat_mask |= (1 << 1); /* .y */
|
||||
if ((1 << tex->sampler_index) & state->options->saturate_s)
|
||||
sat_mask |= (1 << 0); /* .x */
|
||||
|
||||
/* If we are clamping any coords, we must lower projector first
|
||||
* as clamping happens *after* projection:
|
||||
*/
|
||||
if (lower_txp || sat_mask) {
|
||||
project_src(b, tex);
|
||||
state->progress = true;
|
||||
}
|
||||
|
||||
if ((tex->sampler_dim == GLSL_SAMPLER_DIM_RECT) &&
|
||||
state->options->lower_rect) {
|
||||
lower_rect(b, tex);
|
||||
state->progress = true;
|
||||
}
|
||||
|
||||
if (sat_mask) {
|
||||
saturate_src(b, tex, sat_mask);
|
||||
state->progress = true;
|
||||
}
|
||||
|
||||
if (((1 << tex->texture_index) & state->options->swizzle_result) &&
|
||||
!nir_tex_instr_is_query(tex) &&
|
||||
!(tex->is_shadow && tex->is_new_style_shadow)) {
|
||||
swizzle_result(b, tex, state->options->swizzles[tex->texture_index]);
|
||||
state->progress = true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
nir_lower_tex_impl(nir_function_impl *impl, lower_tex_state *state)
|
||||
{
|
||||
nir_builder_init(&state->b, impl);
|
||||
|
||||
nir_foreach_block(impl, nir_lower_tex_block, state);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_block_index |
|
||||
nir_metadata_dominance);
|
||||
}
|
||||
|
||||
bool
|
||||
nir_lower_tex(nir_shader *shader, const nir_lower_tex_options *options)
|
||||
{
|
||||
lower_tex_state state;
|
||||
state.options = options;
|
||||
state.progress = false;
|
||||
|
||||
nir_foreach_function(shader, function) {
|
||||
if (function->impl)
|
||||
nir_lower_tex_impl(function->impl, &state);
|
||||
}
|
||||
|
||||
return state.progress;
|
||||
}
|
||||
@@ -1,212 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2015 Red Hat
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Rob Clark <robclark@freedesktop.org>
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
#include "nir_builder.h"
|
||||
|
||||
#define MAX_COLORS 2 /* VARYING_SLOT_COL0/COL1 */
|
||||
|
||||
typedef struct {
|
||||
nir_builder b;
|
||||
nir_shader *shader;
|
||||
nir_variable *face;
|
||||
struct {
|
||||
nir_variable *front; /* COLn */
|
||||
nir_variable *back; /* BFCn */
|
||||
} colors[MAX_COLORS];
|
||||
int colors_count;
|
||||
} lower_2side_state;
|
||||
|
||||
|
||||
/* Lowering pass for fragment shaders to emulated two-sided-color. For
|
||||
* each COLOR input, a corresponding BCOLOR input is created, and bcsel
|
||||
* instruction used to select front or back color based on FACE.
|
||||
*/
|
||||
|
||||
static nir_variable *
|
||||
create_input(nir_shader *shader, unsigned drvloc, gl_varying_slot slot)
|
||||
{
|
||||
nir_variable *var = rzalloc(shader, nir_variable);
|
||||
|
||||
var->data.driver_location = drvloc;
|
||||
var->type = glsl_vec4_type();
|
||||
var->data.mode = nir_var_shader_in;
|
||||
var->name = ralloc_asprintf(var, "in_%d", drvloc);
|
||||
var->data.index = 0;
|
||||
var->data.location = slot;
|
||||
|
||||
exec_list_push_tail(&shader->inputs, &var->node);
|
||||
|
||||
shader->num_inputs++; /* TODO use type_size() */
|
||||
|
||||
return var;
|
||||
}
|
||||
|
||||
static nir_ssa_def *
|
||||
load_input(nir_builder *b, nir_variable *in)
|
||||
{
|
||||
nir_intrinsic_instr *load;
|
||||
|
||||
load = nir_intrinsic_instr_create(b->shader, nir_intrinsic_load_input);
|
||||
load->num_components = 4;
|
||||
nir_intrinsic_set_base(load, in->data.driver_location);
|
||||
load->src[0] = nir_src_for_ssa(nir_imm_int(b, 0));
|
||||
nir_ssa_dest_init(&load->instr, &load->dest, 4, NULL);
|
||||
nir_builder_instr_insert(b, &load->instr);
|
||||
|
||||
return &load->dest.ssa;
|
||||
}
|
||||
|
||||
static int
|
||||
setup_inputs(lower_2side_state *state)
|
||||
{
|
||||
int maxloc = -1;
|
||||
|
||||
/* find color/face inputs: */
|
||||
nir_foreach_variable(var, &state->shader->inputs) {
|
||||
int loc = var->data.driver_location;
|
||||
|
||||
/* keep track of last used driver-location.. we'll be
|
||||
* appending BCLr/FACE after last existing input:
|
||||
*/
|
||||
maxloc = MAX2(maxloc, loc);
|
||||
|
||||
switch (var->data.location) {
|
||||
case VARYING_SLOT_COL0:
|
||||
case VARYING_SLOT_COL1:
|
||||
assert(state->colors_count < ARRAY_SIZE(state->colors));
|
||||
state->colors[state->colors_count].front = var;
|
||||
state->colors_count++;
|
||||
break;
|
||||
case VARYING_SLOT_FACE:
|
||||
state->face = var;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* if we don't have any color inputs, nothing to do: */
|
||||
if (state->colors_count == 0)
|
||||
return -1;
|
||||
|
||||
/* if we don't already have one, insert a FACE input: */
|
||||
if (!state->face) {
|
||||
state->face = create_input(state->shader, ++maxloc, VARYING_SLOT_FACE);
|
||||
state->face->data.interpolation = INTERP_QUALIFIER_FLAT;
|
||||
}
|
||||
|
||||
/* add required back-face color inputs: */
|
||||
for (int i = 0; i < state->colors_count; i++) {
|
||||
gl_varying_slot slot;
|
||||
|
||||
if (state->colors[i].front->data.location == VARYING_SLOT_COL0)
|
||||
slot = VARYING_SLOT_BFC0;
|
||||
else
|
||||
slot = VARYING_SLOT_BFC1;
|
||||
|
||||
state->colors[i].back = create_input(state->shader, ++maxloc, slot);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
nir_lower_two_sided_color_block(nir_block *block, void *void_state)
|
||||
{
|
||||
lower_2side_state *state = void_state;
|
||||
nir_builder *b = &state->b;
|
||||
|
||||
nir_foreach_instr_safe(block, instr) {
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
continue;
|
||||
|
||||
nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
|
||||
|
||||
if (intr->intrinsic != nir_intrinsic_load_input)
|
||||
continue;
|
||||
|
||||
int idx;
|
||||
for (idx = 0; idx < state->colors_count; idx++) {
|
||||
unsigned drvloc =
|
||||
state->colors[idx].front->data.driver_location;
|
||||
if (nir_intrinsic_base(intr) == drvloc) {
|
||||
assert(nir_src_as_const_value(intr->src[0]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (idx == state->colors_count)
|
||||
continue;
|
||||
|
||||
/* replace load_input(COLn) with
|
||||
* bcsel(load_input(FACE), load_input(COLn), load_input(BFCn))
|
||||
*/
|
||||
b->cursor = nir_before_instr(&intr->instr);
|
||||
nir_ssa_def *face = nir_channel(b, load_input(b, state->face), 0);
|
||||
nir_ssa_def *front = load_input(b, state->colors[idx].front);
|
||||
nir_ssa_def *back = load_input(b, state->colors[idx].back);
|
||||
nir_ssa_def *cond = nir_flt(b, face, nir_imm_float(b, 0.0));
|
||||
nir_ssa_def *color = nir_bcsel(b, cond, back, front);
|
||||
|
||||
assert(intr->dest.is_ssa);
|
||||
nir_ssa_def_rewrite_uses(&intr->dest.ssa, nir_src_for_ssa(color));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
nir_lower_two_sided_color_impl(nir_function_impl *impl,
|
||||
lower_2side_state *state)
|
||||
{
|
||||
nir_builder *b = &state->b;
|
||||
|
||||
nir_builder_init(b, impl);
|
||||
|
||||
nir_foreach_block(impl, nir_lower_two_sided_color_block, state);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_block_index |
|
||||
nir_metadata_dominance);
|
||||
}
|
||||
|
||||
void
|
||||
nir_lower_two_sided_color(nir_shader *shader)
|
||||
{
|
||||
lower_2side_state state = {
|
||||
.shader = shader,
|
||||
};
|
||||
|
||||
if (shader->stage != MESA_SHADER_FRAGMENT)
|
||||
return;
|
||||
|
||||
if (setup_inputs(&state) != 0)
|
||||
return;
|
||||
|
||||
nir_foreach_function(shader, function) {
|
||||
if (function->impl)
|
||||
nir_lower_two_sided_color_impl(function->impl, &state);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,312 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Jason Ekstrand (jason@jlekstrand.net)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
|
||||
/*
|
||||
* Implements a simple pass that lowers vecN instructions to a series of
|
||||
* moves with partial writes.
|
||||
*/
|
||||
|
||||
struct vec_to_movs_state {
|
||||
nir_function_impl *impl;
|
||||
bool progress;
|
||||
};
|
||||
|
||||
static bool
|
||||
src_matches_dest_reg(nir_dest *dest, nir_src *src)
|
||||
{
|
||||
if (dest->is_ssa || src->is_ssa)
|
||||
return false;
|
||||
|
||||
return (dest->reg.reg == src->reg.reg &&
|
||||
dest->reg.base_offset == src->reg.base_offset &&
|
||||
!dest->reg.indirect &&
|
||||
!src->reg.indirect);
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given starting writemask channel and corresponding source index in
|
||||
* the vec instruction, insert a MOV to the vec instruction's dest of all the
|
||||
* writemask channels that get read from the same src reg.
|
||||
*
|
||||
* Returns the writemask of our MOV, so the parent loop calling this knows
|
||||
* which ones have been processed.
|
||||
*/
|
||||
static unsigned
|
||||
insert_mov(nir_alu_instr *vec, unsigned start_idx, nir_shader *shader)
|
||||
{
|
||||
assert(start_idx < nir_op_infos[vec->op].num_inputs);
|
||||
|
||||
nir_alu_instr *mov = nir_alu_instr_create(shader, nir_op_imov);
|
||||
nir_alu_src_copy(&mov->src[0], &vec->src[start_idx], mov);
|
||||
nir_alu_dest_copy(&mov->dest, &vec->dest, mov);
|
||||
|
||||
mov->dest.write_mask = (1u << start_idx);
|
||||
mov->src[0].swizzle[start_idx] = vec->src[start_idx].swizzle[0];
|
||||
mov->src[0].negate = vec->src[start_idx].negate;
|
||||
mov->src[0].abs = vec->src[start_idx].abs;
|
||||
|
||||
for (unsigned i = start_idx + 1; i < 4; i++) {
|
||||
if (!(vec->dest.write_mask & (1 << i)))
|
||||
continue;
|
||||
|
||||
if (nir_srcs_equal(vec->src[i].src, vec->src[start_idx].src) &&
|
||||
vec->src[i].negate == vec->src[start_idx].negate &&
|
||||
vec->src[i].abs == vec->src[start_idx].abs) {
|
||||
mov->dest.write_mask |= (1 << i);
|
||||
mov->src[0].swizzle[i] = vec->src[i].swizzle[0];
|
||||
}
|
||||
}
|
||||
|
||||
unsigned channels_handled = mov->dest.write_mask;
|
||||
|
||||
/* In some situations (if the vecN is involved in a phi-web), we can end
|
||||
* up with a mov from a register to itself. Some of those channels may end
|
||||
* up doing nothing and there's no reason to have them as part of the mov.
|
||||
*/
|
||||
if (src_matches_dest_reg(&mov->dest.dest, &mov->src[0].src) &&
|
||||
!mov->src[0].abs && !mov->src[0].negate) {
|
||||
for (unsigned i = 0; i < 4; i++) {
|
||||
if (mov->src[0].swizzle[i] == i) {
|
||||
mov->dest.write_mask &= ~(1 << i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Only emit the instruction if it actually does something */
|
||||
if (mov->dest.write_mask) {
|
||||
nir_instr_insert_before(&vec->instr, &mov->instr);
|
||||
} else {
|
||||
ralloc_free(mov);
|
||||
}
|
||||
|
||||
return channels_handled;
|
||||
}
|
||||
|
||||
static bool
|
||||
has_replicated_dest(nir_alu_instr *alu)
|
||||
{
|
||||
return alu->op == nir_op_fdot_replicated2 ||
|
||||
alu->op == nir_op_fdot_replicated3 ||
|
||||
alu->op == nir_op_fdot_replicated4 ||
|
||||
alu->op == nir_op_fdph_replicated;
|
||||
}
|
||||
|
||||
/* Attempts to coalesce the "move" from the given source of the vec to the
|
||||
* destination of the instruction generating the value. If, for whatever
|
||||
* reason, we cannot coalesce the mmove, it does nothing and returns 0. We
|
||||
* can then call insert_mov as normal.
|
||||
*/
|
||||
static unsigned
|
||||
try_coalesce(nir_alu_instr *vec, unsigned start_idx, nir_shader *shader)
|
||||
{
|
||||
assert(start_idx < nir_op_infos[vec->op].num_inputs);
|
||||
|
||||
/* We will only even try if the source is SSA */
|
||||
if (!vec->src[start_idx].src.is_ssa)
|
||||
return 0;
|
||||
|
||||
assert(vec->src[start_idx].src.ssa);
|
||||
|
||||
/* If we are going to do a reswizzle, then the vecN operation must be the
|
||||
* only use of the source value. We also can't have any source modifiers.
|
||||
*/
|
||||
nir_foreach_use(vec->src[start_idx].src.ssa, src) {
|
||||
if (src->parent_instr != &vec->instr)
|
||||
return 0;
|
||||
|
||||
nir_alu_src *alu_src = exec_node_data(nir_alu_src, src, src);
|
||||
if (alu_src->abs || alu_src->negate)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!list_empty(&vec->src[start_idx].src.ssa->if_uses))
|
||||
return 0;
|
||||
|
||||
if (vec->src[start_idx].src.ssa->parent_instr->type != nir_instr_type_alu)
|
||||
return 0;
|
||||
|
||||
nir_alu_instr *src_alu =
|
||||
nir_instr_as_alu(vec->src[start_idx].src.ssa->parent_instr);
|
||||
|
||||
if (has_replicated_dest(src_alu)) {
|
||||
/* The fdot instruction is special: It replicates its result to all
|
||||
* components. This means that we can always rewrite its destination
|
||||
* and we don't need to swizzle anything.
|
||||
*/
|
||||
} else {
|
||||
/* We only care about being able to re-swizzle the instruction if it is
|
||||
* something that we can reswizzle. It must be per-component. The one
|
||||
* exception to this is the fdotN instructions which implicitly splat
|
||||
* their result out to all channels.
|
||||
*/
|
||||
if (nir_op_infos[src_alu->op].output_size != 0)
|
||||
return 0;
|
||||
|
||||
/* If we are going to reswizzle the instruction, we can't have any
|
||||
* non-per-component sources either.
|
||||
*/
|
||||
for (unsigned j = 0; j < nir_op_infos[src_alu->op].num_inputs; j++)
|
||||
if (nir_op_infos[src_alu->op].input_sizes[j] != 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Stash off all of the ALU instruction's swizzles. */
|
||||
uint8_t swizzles[4][4];
|
||||
for (unsigned j = 0; j < nir_op_infos[src_alu->op].num_inputs; j++)
|
||||
for (unsigned i = 0; i < 4; i++)
|
||||
swizzles[j][i] = src_alu->src[j].swizzle[i];
|
||||
|
||||
unsigned write_mask = 0;
|
||||
for (unsigned i = start_idx; i < 4; i++) {
|
||||
if (!(vec->dest.write_mask & (1 << i)))
|
||||
continue;
|
||||
|
||||
if (!vec->src[i].src.is_ssa ||
|
||||
vec->src[i].src.ssa != &src_alu->dest.dest.ssa)
|
||||
continue;
|
||||
|
||||
/* At this point, the give vec source matchese up with the ALU
|
||||
* instruction so we can re-swizzle that component to match.
|
||||
*/
|
||||
write_mask |= 1 << i;
|
||||
if (has_replicated_dest(src_alu)) {
|
||||
/* Since the destination is a single replicated value, we don't need
|
||||
* to do any reswizzling
|
||||
*/
|
||||
} else {
|
||||
for (unsigned j = 0; j < nir_op_infos[src_alu->op].num_inputs; j++)
|
||||
src_alu->src[j].swizzle[i] = swizzles[j][vec->src[i].swizzle[0]];
|
||||
}
|
||||
|
||||
/* Clear the no longer needed vec source */
|
||||
nir_instr_rewrite_src(&vec->instr, &vec->src[i].src, NIR_SRC_INIT);
|
||||
}
|
||||
|
||||
nir_instr_rewrite_dest(&src_alu->instr, &src_alu->dest.dest, vec->dest.dest);
|
||||
src_alu->dest.write_mask = write_mask;
|
||||
|
||||
return write_mask;
|
||||
}
|
||||
|
||||
static bool
|
||||
lower_vec_to_movs_block(nir_block *block, void *void_state)
|
||||
{
|
||||
struct vec_to_movs_state *state = void_state;
|
||||
nir_function_impl *impl = state->impl;
|
||||
nir_shader *shader = impl->function->shader;
|
||||
|
||||
nir_foreach_instr_safe(block, instr) {
|
||||
if (instr->type != nir_instr_type_alu)
|
||||
continue;
|
||||
|
||||
nir_alu_instr *vec = nir_instr_as_alu(instr);
|
||||
|
||||
switch (vec->op) {
|
||||
case nir_op_vec2:
|
||||
case nir_op_vec3:
|
||||
case nir_op_vec4:
|
||||
break;
|
||||
default:
|
||||
continue; /* The loop */
|
||||
}
|
||||
|
||||
if (vec->dest.dest.is_ssa) {
|
||||
/* Since we insert multiple MOVs, we have a register destination. */
|
||||
nir_register *reg = nir_local_reg_create(impl);
|
||||
reg->num_components = vec->dest.dest.ssa.num_components;
|
||||
|
||||
nir_ssa_def_rewrite_uses(&vec->dest.dest.ssa, nir_src_for_reg(reg));
|
||||
|
||||
nir_instr_rewrite_dest(&vec->instr, &vec->dest.dest,
|
||||
nir_dest_for_reg(reg));
|
||||
}
|
||||
|
||||
unsigned finished_write_mask = 0;
|
||||
|
||||
/* First, emit a MOV for all the src channels that are in the
|
||||
* destination reg, in case other values we're populating in the dest
|
||||
* might overwrite them.
|
||||
*/
|
||||
for (unsigned i = 0; i < 4; i++) {
|
||||
if (!(vec->dest.write_mask & (1 << i)))
|
||||
continue;
|
||||
|
||||
if (src_matches_dest_reg(&vec->dest.dest, &vec->src[i].src)) {
|
||||
finished_write_mask |= insert_mov(vec, i, shader);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Now, emit MOVs for all the other src channels. */
|
||||
for (unsigned i = 0; i < 4; i++) {
|
||||
if (!(vec->dest.write_mask & (1 << i)))
|
||||
continue;
|
||||
|
||||
if (!(finished_write_mask & (1 << i)))
|
||||
finished_write_mask |= try_coalesce(vec, i, shader);
|
||||
|
||||
if (!(finished_write_mask & (1 << i)))
|
||||
finished_write_mask |= insert_mov(vec, i, shader);
|
||||
}
|
||||
|
||||
nir_instr_remove(&vec->instr);
|
||||
ralloc_free(vec);
|
||||
state->progress = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
nir_lower_vec_to_movs_impl(nir_function_impl *impl)
|
||||
{
|
||||
struct vec_to_movs_state state = { impl, false };
|
||||
|
||||
nir_foreach_block(impl, lower_vec_to_movs_block, &state);
|
||||
|
||||
if (state.progress) {
|
||||
nir_metadata_preserve(impl, nir_metadata_block_index |
|
||||
nir_metadata_dominance);
|
||||
}
|
||||
|
||||
return state.progress;
|
||||
}
|
||||
|
||||
bool
|
||||
nir_lower_vec_to_movs(nir_shader *shader)
|
||||
{
|
||||
bool progress = false;
|
||||
|
||||
nir_foreach_function(shader, function) {
|
||||
if (function->impl)
|
||||
progress = nir_lower_vec_to_movs_impl(function->impl) || progress;
|
||||
}
|
||||
|
||||
return progress;
|
||||
}
|
||||
@@ -1,197 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Jason Ekstrand (jason@jlekstrand.net)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
|
||||
/*
|
||||
* Implements a pass that tries to move uses vecN sources to their
|
||||
* destinations. This is kind of like an inverse copy-propagation pass.
|
||||
* For instance, if you have
|
||||
*
|
||||
* ssa_1 = vec4(a, b, c, d)
|
||||
* ssa_2 = fadd(a, b)
|
||||
*
|
||||
* This will be turned into
|
||||
*
|
||||
* ssa_1 = vec4(a, b, c, d)
|
||||
* ssa_2 = fadd(ssa_1.x, ssa_1.y)
|
||||
*
|
||||
* While this is "worse" because it adds a bunch of unneeded dependencies, it
|
||||
* actually makes it much easier for vec4-based backends to coalesce the MOV's
|
||||
* that result from the vec4 operation because it doesn't have to worry about
|
||||
* quite as many reads.
|
||||
*/
|
||||
|
||||
/* Returns true if the given SSA def dominates the instruction. An SSA def is
|
||||
* considered to *not* dominate the instruction that defines it.
|
||||
*/
|
||||
static bool
|
||||
ssa_def_dominates_instr(nir_ssa_def *def, nir_instr *instr)
|
||||
{
|
||||
if (instr->index <= def->parent_instr->index) {
|
||||
return false;
|
||||
} else if (def->parent_instr->block == instr->block) {
|
||||
return def->parent_instr->index < instr->index;
|
||||
} else {
|
||||
return nir_block_dominates(def->parent_instr->block, instr->block);
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
move_vec_src_uses_to_dest_block(nir_block *block, void *shader)
|
||||
{
|
||||
nir_foreach_instr(block, instr) {
|
||||
if (instr->type != nir_instr_type_alu)
|
||||
continue;
|
||||
|
||||
nir_alu_instr *vec = nir_instr_as_alu(instr);
|
||||
|
||||
switch (vec->op) {
|
||||
case nir_op_vec2:
|
||||
case nir_op_vec3:
|
||||
case nir_op_vec4:
|
||||
break;
|
||||
default:
|
||||
continue; /* The loop */
|
||||
}
|
||||
|
||||
/* Can't handle non-SSA vec operations */
|
||||
if (!vec->dest.dest.is_ssa)
|
||||
continue;
|
||||
|
||||
/* Can't handle saturation */
|
||||
if (vec->dest.saturate)
|
||||
continue;
|
||||
|
||||
/* First, mark all of the sources we are going to consider for rewriting
|
||||
* to the destination
|
||||
*/
|
||||
int srcs_remaining = 0;
|
||||
for (unsigned i = 0; i < nir_op_infos[vec->op].num_inputs; i++) {
|
||||
/* We can't rewrite a source if it's not in SSA form */
|
||||
if (!vec->src[i].src.is_ssa)
|
||||
continue;
|
||||
|
||||
/* We can't rewrite a source if it has modifiers */
|
||||
if (vec->src[i].abs || vec->src[i].negate)
|
||||
continue;
|
||||
|
||||
srcs_remaining |= 1 << i;
|
||||
}
|
||||
|
||||
/* We can't actually do anything with this instruction */
|
||||
if (srcs_remaining == 0)
|
||||
continue;
|
||||
|
||||
for (unsigned i; i = ffs(srcs_remaining) - 1, srcs_remaining;) {
|
||||
int8_t swizzle[4] = { -1, -1, -1, -1 };
|
||||
|
||||
for (unsigned j = i; j < nir_op_infos[vec->op].num_inputs; j++) {
|
||||
if (vec->src[j].src.ssa != vec->src[i].src.ssa)
|
||||
continue;
|
||||
|
||||
/* Mark the given chanle as having been handled */
|
||||
srcs_remaining &= ~(1 << j);
|
||||
|
||||
/* Mark the appropreate channel as coming from src j */
|
||||
swizzle[vec->src[j].swizzle[0]] = j;
|
||||
}
|
||||
|
||||
nir_foreach_use_safe(vec->src[i].src.ssa, use) {
|
||||
if (use->parent_instr == &vec->instr)
|
||||
continue;
|
||||
|
||||
/* We need to dominate the use if we are going to rewrite it */
|
||||
if (!ssa_def_dominates_instr(&vec->dest.dest.ssa, use->parent_instr))
|
||||
continue;
|
||||
|
||||
/* For now, we'll just rewrite ALU instructions */
|
||||
if (use->parent_instr->type != nir_instr_type_alu)
|
||||
continue;
|
||||
|
||||
assert(use->is_ssa);
|
||||
|
||||
nir_alu_instr *use_alu = nir_instr_as_alu(use->parent_instr);
|
||||
|
||||
/* Figure out which source we're actually looking at */
|
||||
nir_alu_src *use_alu_src = exec_node_data(nir_alu_src, use, src);
|
||||
unsigned src_idx = use_alu_src - use_alu->src;
|
||||
assert(src_idx < nir_op_infos[use_alu->op].num_inputs);
|
||||
|
||||
bool can_reswizzle = true;
|
||||
for (unsigned j = 0; j < 4; j++) {
|
||||
if (!nir_alu_instr_channel_used(use_alu, src_idx, j))
|
||||
continue;
|
||||
|
||||
if (swizzle[use_alu_src->swizzle[j]] == -1) {
|
||||
can_reswizzle = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!can_reswizzle)
|
||||
continue;
|
||||
|
||||
/* At this point, we have determined that the given use can be
|
||||
* reswizzled to actually use the destination of the vecN operation.
|
||||
* Go ahead and rewrite it as needed.
|
||||
*/
|
||||
nir_instr_rewrite_src(use->parent_instr, use,
|
||||
nir_src_for_ssa(&vec->dest.dest.ssa));
|
||||
for (unsigned j = 0; j < 4; j++) {
|
||||
if (!nir_alu_instr_channel_used(use_alu, src_idx, j))
|
||||
continue;
|
||||
|
||||
use_alu_src->swizzle[j] = swizzle[use_alu_src->swizzle[j]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
nir_move_vec_src_uses_to_dest_impl(nir_shader *shader, nir_function_impl *impl)
|
||||
{
|
||||
nir_metadata_require(impl, nir_metadata_dominance);
|
||||
|
||||
nir_index_instrs(impl);
|
||||
nir_foreach_block(impl, move_vec_src_uses_to_dest_block, shader);
|
||||
|
||||
nir_metadata_preserve(impl, nir_metadata_block_index |
|
||||
nir_metadata_dominance);
|
||||
}
|
||||
|
||||
void
|
||||
nir_move_vec_src_uses_to_dest(nir_shader *shader)
|
||||
{
|
||||
nir_foreach_function(shader, function) {
|
||||
if (function->impl)
|
||||
nir_move_vec_src_uses_to_dest_impl(shader, function->impl);
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Jason Ekstrand (jason@jlekstrand.net)
|
||||
* Connor Abbott (cwabbott0@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "nir_instr_set.h"
|
||||
|
||||
/*
|
||||
* Implements common subexpression elimination
|
||||
*/
|
||||
|
||||
/*
|
||||
* Visits and CSE's the given block and all its descendants in the dominance
|
||||
* tree recursively. Note that the instr_set is guaranteed to only ever
|
||||
* contain instructions that dominate the current block.
|
||||
*/
|
||||
|
||||
static bool
|
||||
cse_block(nir_block *block, struct set *instr_set)
|
||||
{
|
||||
bool progress = false;
|
||||
|
||||
nir_foreach_instr_safe(block, instr) {
|
||||
if (nir_instr_set_add_or_rewrite(instr_set, instr)) {
|
||||
progress = true;
|
||||
nir_instr_remove(instr);
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < block->num_dom_children; i++) {
|
||||
nir_block *child = block->dom_children[i];
|
||||
progress |= cse_block(child, instr_set);
|
||||
}
|
||||
|
||||
nir_foreach_instr(block, instr)
|
||||
nir_instr_set_remove(instr_set, instr);
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
||||
static bool
|
||||
nir_opt_cse_impl(nir_function_impl *impl)
|
||||
{
|
||||
struct set *instr_set = nir_instr_set_create(NULL);
|
||||
|
||||
nir_metadata_require(impl, nir_metadata_dominance);
|
||||
|
||||
bool progress = cse_block(nir_start_block(impl), instr_set);
|
||||
|
||||
if (progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_block_index |
|
||||
nir_metadata_dominance);
|
||||
|
||||
nir_instr_set_destroy(instr_set);
|
||||
return progress;
|
||||
}
|
||||
|
||||
bool
|
||||
nir_opt_cse(nir_shader *shader)
|
||||
{
|
||||
bool progress = false;
|
||||
|
||||
nir_foreach_function(shader, function) {
|
||||
if (function->impl)
|
||||
progress |= nir_opt_cse_impl(function->impl);
|
||||
}
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
||||
@@ -1,358 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Connor Abbott
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Connor Abbott (cwabbott0@gmail.com)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "nir.h"
|
||||
#include "nir_control_flow.h"
|
||||
|
||||
/*
|
||||
* This file implements an optimization that deletes statically
|
||||
* unreachable/dead code. In NIR, one way this can happen if if an if
|
||||
* statement has a constant condition:
|
||||
*
|
||||
* if (true) {
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* We delete the if statement and paste the contents of the always-executed
|
||||
* branch into the surrounding control flow, possibly removing more code if
|
||||
* the branch had a jump at the end.
|
||||
*
|
||||
* Another way is that control flow can end in a jump so that code after it
|
||||
* never gets executed. In particular, this can happen after optimizing
|
||||
* something like:
|
||||
*
|
||||
* if (true) {
|
||||
* ...
|
||||
* break;
|
||||
* }
|
||||
* ...
|
||||
*
|
||||
* We also consider the case where both branches of an if end in a jump, e.g.:
|
||||
*
|
||||
* if (...) {
|
||||
* break;
|
||||
* } else {
|
||||
* continue;
|
||||
* }
|
||||
* ...
|
||||
*
|
||||
* Finally, we also handle removing useless loops, i.e. loops with no side
|
||||
* effects and without any definitions that are used elsewhere. This case is a
|
||||
* little different from the first two in that the code is actually run (it
|
||||
* just never does anything), but there are similar issues with needing to
|
||||
* be careful with restarting after deleting the cf_node (see dead_cf_list())
|
||||
* so this is a convenient place to remove them.
|
||||
*/
|
||||
|
||||
static void
|
||||
remove_after_cf_node(nir_cf_node *node)
|
||||
{
|
||||
nir_cf_node *end = node;
|
||||
while (!nir_cf_node_is_last(end))
|
||||
end = nir_cf_node_next(end);
|
||||
|
||||
nir_cf_list list;
|
||||
nir_cf_extract(&list, nir_after_cf_node(node), nir_after_cf_node(end));
|
||||
nir_cf_delete(&list);
|
||||
}
|
||||
|
||||
static void
|
||||
opt_constant_if(nir_if *if_stmt, bool condition)
|
||||
{
|
||||
/* First, we need to remove any phi nodes after the if by rewriting uses to
|
||||
* point to the correct source.
|
||||
*/
|
||||
nir_block *after = nir_cf_node_as_block(nir_cf_node_next(&if_stmt->cf_node));
|
||||
nir_block *last_block =
|
||||
nir_cf_node_as_block(condition ? nir_if_last_then_node(if_stmt)
|
||||
: nir_if_last_else_node(if_stmt));
|
||||
|
||||
nir_foreach_instr_safe(after, instr) {
|
||||
if (instr->type != nir_instr_type_phi)
|
||||
break;
|
||||
|
||||
nir_phi_instr *phi = nir_instr_as_phi(instr);
|
||||
nir_ssa_def *def = NULL;
|
||||
nir_foreach_phi_src(phi, phi_src) {
|
||||
if (phi_src->pred != last_block)
|
||||
continue;
|
||||
|
||||
assert(phi_src->src.is_ssa);
|
||||
def = phi_src->src.ssa;
|
||||
}
|
||||
|
||||
assert(def);
|
||||
assert(phi->dest.is_ssa);
|
||||
nir_ssa_def_rewrite_uses(&phi->dest.ssa, nir_src_for_ssa(def));
|
||||
nir_instr_remove(instr);
|
||||
}
|
||||
|
||||
/* The control flow list we're about to paste in may include a jump at the
|
||||
* end, and in that case we have to delete the rest of the control flow
|
||||
* list after the if since it's unreachable and the validator will balk if
|
||||
* we don't.
|
||||
*/
|
||||
|
||||
if (!exec_list_is_empty(&last_block->instr_list)) {
|
||||
nir_instr *last_instr = nir_block_last_instr(last_block);
|
||||
if (last_instr->type == nir_instr_type_jump)
|
||||
remove_after_cf_node(&if_stmt->cf_node);
|
||||
}
|
||||
|
||||
/* Finally, actually paste in the then or else branch and delete the if. */
|
||||
struct exec_list *cf_list = condition ? &if_stmt->then_list
|
||||
: &if_stmt->else_list;
|
||||
|
||||
nir_cf_list list;
|
||||
nir_cf_extract(&list, nir_before_cf_list(cf_list),
|
||||
nir_after_cf_list(cf_list));
|
||||
nir_cf_reinsert(&list, nir_after_cf_node(&if_stmt->cf_node));
|
||||
nir_cf_node_remove(&if_stmt->cf_node);
|
||||
}
|
||||
|
||||
static bool
|
||||
block_has_no_side_effects(nir_block *block, void *state)
|
||||
{
|
||||
(void) state;
|
||||
|
||||
nir_foreach_instr(block, instr) {
|
||||
if (instr->type == nir_instr_type_call)
|
||||
return false;
|
||||
|
||||
/* Return instructions can cause us to skip over other side-effecting
|
||||
* instructions after the loop, so consider them to have side effects
|
||||
* here.
|
||||
*/
|
||||
|
||||
if (instr->type == nir_instr_type_jump &&
|
||||
nir_instr_as_jump(instr)->type == nir_jump_return)
|
||||
return false;
|
||||
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
continue;
|
||||
|
||||
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
|
||||
if (!nir_intrinsic_infos[intrin->intrinsic].flags &
|
||||
NIR_INTRINSIC_CAN_ELIMINATE)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
def_not_live_out(nir_ssa_def *def, void *state)
|
||||
{
|
||||
nir_block *after = state;
|
||||
|
||||
return !BITSET_TEST(after->live_in, def->live_index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Test if a loop is dead. A loop is dead if:
|
||||
*
|
||||
* 1) It has no side effects (i.e. intrinsics which could possibly affect the
|
||||
* state of the program aside from producing an SSA value, indicated by a lack
|
||||
* of NIR_INTRINSIC_CAN_ELIMINATE).
|
||||
*
|
||||
* 2) It has no phi nodes after it, since those indicate values inside the
|
||||
* loop being used after the loop.
|
||||
*
|
||||
* 3) If there are no phi nodes after the loop, then the only way a value
|
||||
* defined inside the loop can be used outside the loop is if its definition
|
||||
* dominates the block after the loop. If none of the definitions that
|
||||
* dominate the loop exit are used outside the loop, then the loop is dead
|
||||
* and it can be deleted.
|
||||
*/
|
||||
|
||||
static bool
|
||||
loop_is_dead(nir_loop *loop)
|
||||
{
|
||||
nir_block *before = nir_cf_node_as_block(nir_cf_node_prev(&loop->cf_node));
|
||||
nir_block *after = nir_cf_node_as_block(nir_cf_node_next(&loop->cf_node));
|
||||
|
||||
if (!exec_list_is_empty(&after->instr_list) &&
|
||||
nir_block_first_instr(after)->type == nir_instr_type_phi)
|
||||
return false;
|
||||
|
||||
if (!nir_foreach_block_in_cf_node(&loop->cf_node, block_has_no_side_effects,
|
||||
NULL))
|
||||
return false;
|
||||
|
||||
nir_function_impl *impl = nir_cf_node_get_function(&loop->cf_node);
|
||||
nir_metadata_require(impl, nir_metadata_live_ssa_defs |
|
||||
nir_metadata_dominance);
|
||||
|
||||
for (nir_block *cur = after->imm_dom; cur != before; cur = cur->imm_dom) {
|
||||
nir_foreach_instr(cur, instr) {
|
||||
if (!nir_foreach_ssa_def(instr, def_not_live_out, after))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
dead_cf_block(nir_block *block)
|
||||
{
|
||||
nir_if *following_if = nir_block_get_following_if(block);
|
||||
if (following_if) {
|
||||
nir_const_value *const_value =
|
||||
nir_src_as_const_value(following_if->condition);
|
||||
|
||||
if (!const_value)
|
||||
return false;
|
||||
|
||||
opt_constant_if(following_if, const_value->u[0] != 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
nir_loop *following_loop = nir_block_get_following_loop(block);
|
||||
if (!following_loop)
|
||||
return false;
|
||||
|
||||
if (!loop_is_dead(following_loop))
|
||||
return false;
|
||||
|
||||
nir_cf_node_remove(&following_loop->cf_node);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
ends_in_jump(nir_block *block)
|
||||
{
|
||||
if (exec_list_is_empty(&block->instr_list))
|
||||
return false;
|
||||
|
||||
nir_instr *instr = nir_block_last_instr(block);
|
||||
return instr->type == nir_instr_type_jump;
|
||||
}
|
||||
|
||||
static bool
|
||||
dead_cf_list(struct exec_list *list, bool *list_ends_in_jump)
|
||||
{
|
||||
bool progress = false;
|
||||
*list_ends_in_jump = false;
|
||||
|
||||
nir_cf_node *prev = NULL;
|
||||
|
||||
foreach_list_typed(nir_cf_node, cur, node, list) {
|
||||
switch (cur->type) {
|
||||
case nir_cf_node_block: {
|
||||
nir_block *block = nir_cf_node_as_block(cur);
|
||||
if (dead_cf_block(block)) {
|
||||
/* We just deleted the if or loop after this block, so we may have
|
||||
* deleted the block before or after it -- which one is an
|
||||
* implementation detail. Therefore, to recover the place we were
|
||||
* at, we have to use the previous cf_node.
|
||||
*/
|
||||
|
||||
if (prev) {
|
||||
cur = nir_cf_node_next(prev);
|
||||
} else {
|
||||
cur = exec_node_data(nir_cf_node, exec_list_get_head(list),
|
||||
node);
|
||||
}
|
||||
|
||||
block = nir_cf_node_as_block(cur);
|
||||
|
||||
progress = true;
|
||||
}
|
||||
|
||||
if (ends_in_jump(block)) {
|
||||
*list_ends_in_jump = true;
|
||||
|
||||
if (!exec_node_is_tail_sentinel(cur->node.next)) {
|
||||
remove_after_cf_node(cur);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case nir_cf_node_if: {
|
||||
nir_if *if_stmt = nir_cf_node_as_if(cur);
|
||||
bool then_ends_in_jump, else_ends_in_jump;
|
||||
progress |= dead_cf_list(&if_stmt->then_list, &then_ends_in_jump);
|
||||
progress |= dead_cf_list(&if_stmt->else_list, &else_ends_in_jump);
|
||||
|
||||
if (then_ends_in_jump && else_ends_in_jump) {
|
||||
*list_ends_in_jump = true;
|
||||
nir_block *next = nir_cf_node_as_block(nir_cf_node_next(cur));
|
||||
if (!exec_list_is_empty(&next->instr_list) ||
|
||||
!exec_node_is_tail_sentinel(next->cf_node.node.next)) {
|
||||
remove_after_cf_node(cur);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case nir_cf_node_loop: {
|
||||
nir_loop *loop = nir_cf_node_as_loop(cur);
|
||||
bool dummy;
|
||||
progress |= dead_cf_list(&loop->body, &dummy);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
unreachable("unknown cf node type");
|
||||
}
|
||||
|
||||
prev = cur;
|
||||
}
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
||||
static bool
|
||||
opt_dead_cf_impl(nir_function_impl *impl)
|
||||
{
|
||||
bool dummy;
|
||||
bool progress = dead_cf_list(&impl->body, &dummy);
|
||||
|
||||
if (progress)
|
||||
nir_metadata_preserve(impl, nir_metadata_none);
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
||||
bool
|
||||
nir_opt_dead_cf(nir_shader *shader)
|
||||
{
|
||||
bool progress = false;
|
||||
|
||||
nir_foreach_function(shader, function)
|
||||
if (function->impl)
|
||||
progress |= opt_dead_cf_impl(function->impl);
|
||||
|
||||
return progress;
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2015 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <gtest/gtest.h>
|
||||
#include "nir.h"
|
||||
#include "nir_builder.h"
|
||||
|
||||
class nir_cf_test : public ::testing::Test {
|
||||
protected:
|
||||
nir_cf_test();
|
||||
~nir_cf_test();
|
||||
|
||||
nir_builder b;
|
||||
};
|
||||
|
||||
nir_cf_test::nir_cf_test()
|
||||
{
|
||||
static const nir_shader_compiler_options options = { };
|
||||
nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_VERTEX, &options);
|
||||
}
|
||||
|
||||
nir_cf_test::~nir_cf_test()
|
||||
{
|
||||
ralloc_free(b.shader);
|
||||
}
|
||||
|
||||
TEST_F(nir_cf_test, delete_break_in_loop)
|
||||
{
|
||||
/* Create IR:
|
||||
*
|
||||
* while (...) { break; }
|
||||
*/
|
||||
nir_loop *loop = nir_loop_create(b.shader);
|
||||
nir_cf_node_insert(nir_after_cf_list(&b.impl->body), &loop->cf_node);
|
||||
|
||||
b.cursor = nir_after_cf_list(&loop->body);
|
||||
|
||||
nir_jump_instr *jump = nir_jump_instr_create(b.shader, nir_jump_break);
|
||||
nir_builder_instr_insert(&b, &jump->instr);
|
||||
|
||||
/* At this point, we should have:
|
||||
*
|
||||
* impl main {
|
||||
* block block_0:
|
||||
* // preds:
|
||||
* // succs: block_1
|
||||
* loop {
|
||||
* block block_1:
|
||||
* // preds: block_0
|
||||
* break
|
||||
* // succs: block_2
|
||||
* }
|
||||
* block block_2:
|
||||
* // preds: block_1
|
||||
* // succs: block_3
|
||||
* block block_3:
|
||||
* }
|
||||
*/
|
||||
nir_block *block_0 = nir_start_block(b.impl);
|
||||
nir_block *block_1 = nir_cf_node_as_block(nir_loop_first_cf_node(loop));
|
||||
nir_block *block_2 = nir_cf_node_as_block(nir_cf_node_next(&loop->cf_node));
|
||||
nir_block *block_3 = b.impl->end_block;
|
||||
ASSERT_EQ(nir_cf_node_block, block_0->cf_node.type);
|
||||
ASSERT_EQ(nir_cf_node_block, block_1->cf_node.type);
|
||||
ASSERT_EQ(nir_cf_node_block, block_2->cf_node.type);
|
||||
ASSERT_EQ(nir_cf_node_block, block_3->cf_node.type);
|
||||
|
||||
/* Verify the successors and predecessors. */
|
||||
EXPECT_EQ(block_1, block_0->successors[0]);
|
||||
EXPECT_EQ(NULL, block_0->successors[1]);
|
||||
EXPECT_EQ(block_2, block_1->successors[0]);
|
||||
EXPECT_EQ(NULL, block_1->successors[1]);
|
||||
EXPECT_EQ(block_3, block_2->successors[0]);
|
||||
EXPECT_EQ(NULL, block_2->successors[1]);
|
||||
EXPECT_EQ(NULL, block_3->successors[0]);
|
||||
EXPECT_EQ(NULL, block_3->successors[1]);
|
||||
EXPECT_EQ(0, block_0->predecessors->entries);
|
||||
EXPECT_EQ(1, block_1->predecessors->entries);
|
||||
EXPECT_EQ(1, block_2->predecessors->entries);
|
||||
EXPECT_EQ(1, block_3->predecessors->entries);
|
||||
EXPECT_TRUE(_mesa_set_search(block_1->predecessors, block_0));
|
||||
EXPECT_TRUE(_mesa_set_search(block_2->predecessors, block_1));
|
||||
EXPECT_TRUE(_mesa_set_search(block_3->predecessors, block_2));
|
||||
|
||||
nir_print_shader(b.shader, stderr);
|
||||
|
||||
/* Now remove the break. */
|
||||
nir_instr_remove(&jump->instr);
|
||||
|
||||
nir_print_shader(b.shader, stderr);
|
||||
|
||||
/* At this point, we should have:
|
||||
*
|
||||
* impl main {
|
||||
* block block_0:
|
||||
* // preds:
|
||||
* // succs: block_1
|
||||
* loop {
|
||||
* block block_1:
|
||||
* // preds: block_0 block_1
|
||||
* // succs: block_1
|
||||
* }
|
||||
* block block_2:
|
||||
* // preds: block_1
|
||||
* // succs: block_3
|
||||
* block block_3:
|
||||
* }
|
||||
*
|
||||
* Re-verify the predecessors and successors.
|
||||
*/
|
||||
EXPECT_EQ(block_1, block_0->successors[0]);
|
||||
EXPECT_EQ(NULL, block_0->successors[1]);
|
||||
EXPECT_EQ(block_1, block_1->successors[0]); /* back to itself */
|
||||
EXPECT_EQ(block_2, block_1->successors[1]); /* fake successor */
|
||||
EXPECT_EQ(block_3, block_2->successors[0]);
|
||||
EXPECT_EQ(NULL, block_2->successors[1]);
|
||||
EXPECT_EQ(NULL, block_3->successors[0]);
|
||||
EXPECT_EQ(NULL, block_3->successors[1]);
|
||||
EXPECT_EQ(0, block_0->predecessors->entries);
|
||||
EXPECT_EQ(2, block_1->predecessors->entries);
|
||||
EXPECT_EQ(1, block_2->predecessors->entries);
|
||||
EXPECT_EQ(1, block_3->predecessors->entries);
|
||||
EXPECT_TRUE(_mesa_set_search(block_1->predecessors, block_0));
|
||||
EXPECT_TRUE(_mesa_set_search(block_1->predecessors, block_1));
|
||||
EXPECT_TRUE(_mesa_set_search(block_2->predecessors, block_1));
|
||||
EXPECT_TRUE(_mesa_set_search(block_3->predecessors, block_2));
|
||||
|
||||
nir_metadata_require(b.impl, nir_metadata_dominance);
|
||||
}
|
||||
@@ -1,257 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
*
|
||||
* Copyright © 2015 Red Hat
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Rob Clark <robclark@freedesktop.org>
|
||||
*/
|
||||
|
||||
#include "shader_enums.h"
|
||||
#include "util/macros.h"
|
||||
#include "mesa/main/config.h"
|
||||
|
||||
#define ENUM(x) [x] = #x
|
||||
#define NAME(val) ((((val) < ARRAY_SIZE(names)) && names[(val)]) ? names[(val)] : "UNKNOWN")
|
||||
|
||||
const char *
|
||||
gl_shader_stage_name(gl_shader_stage stage)
|
||||
{
|
||||
static const char *names[] = {
|
||||
ENUM(MESA_SHADER_VERTEX),
|
||||
ENUM(MESA_SHADER_TESS_CTRL),
|
||||
ENUM(MESA_SHADER_TESS_EVAL),
|
||||
ENUM(MESA_SHADER_GEOMETRY),
|
||||
ENUM(MESA_SHADER_FRAGMENT),
|
||||
ENUM(MESA_SHADER_COMPUTE),
|
||||
};
|
||||
STATIC_ASSERT(ARRAY_SIZE(names) == MESA_SHADER_STAGES);
|
||||
return NAME(stage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate a gl_shader_stage to a short shader stage name for debug
|
||||
* printouts and error messages.
|
||||
*/
|
||||
const char *
|
||||
_mesa_shader_stage_to_string(unsigned stage)
|
||||
{
|
||||
switch (stage) {
|
||||
case MESA_SHADER_VERTEX: return "vertex";
|
||||
case MESA_SHADER_FRAGMENT: return "fragment";
|
||||
case MESA_SHADER_GEOMETRY: return "geometry";
|
||||
case MESA_SHADER_COMPUTE: return "compute";
|
||||
case MESA_SHADER_TESS_CTRL: return "tessellation control";
|
||||
case MESA_SHADER_TESS_EVAL: return "tessellation evaluation";
|
||||
}
|
||||
|
||||
unreachable("Unknown shader stage.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate a gl_shader_stage to a shader stage abbreviation (VS, GS, FS)
|
||||
* for debug printouts and error messages.
|
||||
*/
|
||||
const char *
|
||||
_mesa_shader_stage_to_abbrev(unsigned stage)
|
||||
{
|
||||
switch (stage) {
|
||||
case MESA_SHADER_VERTEX: return "VS";
|
||||
case MESA_SHADER_FRAGMENT: return "FS";
|
||||
case MESA_SHADER_GEOMETRY: return "GS";
|
||||
case MESA_SHADER_COMPUTE: return "CS";
|
||||
case MESA_SHADER_TESS_CTRL: return "TCS";
|
||||
case MESA_SHADER_TESS_EVAL: return "TES";
|
||||
}
|
||||
|
||||
unreachable("Unknown shader stage.");
|
||||
}
|
||||
|
||||
const char *
|
||||
gl_vert_attrib_name(gl_vert_attrib attrib)
|
||||
{
|
||||
static const char *names[] = {
|
||||
ENUM(VERT_ATTRIB_POS),
|
||||
ENUM(VERT_ATTRIB_WEIGHT),
|
||||
ENUM(VERT_ATTRIB_NORMAL),
|
||||
ENUM(VERT_ATTRIB_COLOR0),
|
||||
ENUM(VERT_ATTRIB_COLOR1),
|
||||
ENUM(VERT_ATTRIB_FOG),
|
||||
ENUM(VERT_ATTRIB_COLOR_INDEX),
|
||||
ENUM(VERT_ATTRIB_EDGEFLAG),
|
||||
ENUM(VERT_ATTRIB_TEX0),
|
||||
ENUM(VERT_ATTRIB_TEX1),
|
||||
ENUM(VERT_ATTRIB_TEX2),
|
||||
ENUM(VERT_ATTRIB_TEX3),
|
||||
ENUM(VERT_ATTRIB_TEX4),
|
||||
ENUM(VERT_ATTRIB_TEX5),
|
||||
ENUM(VERT_ATTRIB_TEX6),
|
||||
ENUM(VERT_ATTRIB_TEX7),
|
||||
ENUM(VERT_ATTRIB_POINT_SIZE),
|
||||
ENUM(VERT_ATTRIB_GENERIC0),
|
||||
ENUM(VERT_ATTRIB_GENERIC1),
|
||||
ENUM(VERT_ATTRIB_GENERIC2),
|
||||
ENUM(VERT_ATTRIB_GENERIC3),
|
||||
ENUM(VERT_ATTRIB_GENERIC4),
|
||||
ENUM(VERT_ATTRIB_GENERIC5),
|
||||
ENUM(VERT_ATTRIB_GENERIC6),
|
||||
ENUM(VERT_ATTRIB_GENERIC7),
|
||||
ENUM(VERT_ATTRIB_GENERIC8),
|
||||
ENUM(VERT_ATTRIB_GENERIC9),
|
||||
ENUM(VERT_ATTRIB_GENERIC10),
|
||||
ENUM(VERT_ATTRIB_GENERIC11),
|
||||
ENUM(VERT_ATTRIB_GENERIC12),
|
||||
ENUM(VERT_ATTRIB_GENERIC13),
|
||||
ENUM(VERT_ATTRIB_GENERIC14),
|
||||
ENUM(VERT_ATTRIB_GENERIC15),
|
||||
};
|
||||
STATIC_ASSERT(ARRAY_SIZE(names) == VERT_ATTRIB_MAX);
|
||||
return NAME(attrib);
|
||||
}
|
||||
|
||||
const char *
|
||||
gl_varying_slot_name(gl_varying_slot slot)
|
||||
{
|
||||
static const char *names[] = {
|
||||
ENUM(VARYING_SLOT_POS),
|
||||
ENUM(VARYING_SLOT_COL0),
|
||||
ENUM(VARYING_SLOT_COL1),
|
||||
ENUM(VARYING_SLOT_FOGC),
|
||||
ENUM(VARYING_SLOT_TEX0),
|
||||
ENUM(VARYING_SLOT_TEX1),
|
||||
ENUM(VARYING_SLOT_TEX2),
|
||||
ENUM(VARYING_SLOT_TEX3),
|
||||
ENUM(VARYING_SLOT_TEX4),
|
||||
ENUM(VARYING_SLOT_TEX5),
|
||||
ENUM(VARYING_SLOT_TEX6),
|
||||
ENUM(VARYING_SLOT_TEX7),
|
||||
ENUM(VARYING_SLOT_PSIZ),
|
||||
ENUM(VARYING_SLOT_BFC0),
|
||||
ENUM(VARYING_SLOT_BFC1),
|
||||
ENUM(VARYING_SLOT_EDGE),
|
||||
ENUM(VARYING_SLOT_CLIP_VERTEX),
|
||||
ENUM(VARYING_SLOT_CLIP_DIST0),
|
||||
ENUM(VARYING_SLOT_CLIP_DIST1),
|
||||
ENUM(VARYING_SLOT_PRIMITIVE_ID),
|
||||
ENUM(VARYING_SLOT_LAYER),
|
||||
ENUM(VARYING_SLOT_VIEWPORT),
|
||||
ENUM(VARYING_SLOT_FACE),
|
||||
ENUM(VARYING_SLOT_PNTC),
|
||||
ENUM(VARYING_SLOT_TESS_LEVEL_OUTER),
|
||||
ENUM(VARYING_SLOT_TESS_LEVEL_INNER),
|
||||
ENUM(VARYING_SLOT_VAR0),
|
||||
ENUM(VARYING_SLOT_VAR1),
|
||||
ENUM(VARYING_SLOT_VAR2),
|
||||
ENUM(VARYING_SLOT_VAR3),
|
||||
ENUM(VARYING_SLOT_VAR4),
|
||||
ENUM(VARYING_SLOT_VAR5),
|
||||
ENUM(VARYING_SLOT_VAR6),
|
||||
ENUM(VARYING_SLOT_VAR7),
|
||||
ENUM(VARYING_SLOT_VAR8),
|
||||
ENUM(VARYING_SLOT_VAR9),
|
||||
ENUM(VARYING_SLOT_VAR10),
|
||||
ENUM(VARYING_SLOT_VAR11),
|
||||
ENUM(VARYING_SLOT_VAR12),
|
||||
ENUM(VARYING_SLOT_VAR13),
|
||||
ENUM(VARYING_SLOT_VAR14),
|
||||
ENUM(VARYING_SLOT_VAR15),
|
||||
ENUM(VARYING_SLOT_VAR16),
|
||||
ENUM(VARYING_SLOT_VAR17),
|
||||
ENUM(VARYING_SLOT_VAR18),
|
||||
ENUM(VARYING_SLOT_VAR19),
|
||||
ENUM(VARYING_SLOT_VAR20),
|
||||
ENUM(VARYING_SLOT_VAR21),
|
||||
ENUM(VARYING_SLOT_VAR22),
|
||||
ENUM(VARYING_SLOT_VAR23),
|
||||
ENUM(VARYING_SLOT_VAR24),
|
||||
ENUM(VARYING_SLOT_VAR25),
|
||||
ENUM(VARYING_SLOT_VAR26),
|
||||
ENUM(VARYING_SLOT_VAR27),
|
||||
ENUM(VARYING_SLOT_VAR28),
|
||||
ENUM(VARYING_SLOT_VAR29),
|
||||
ENUM(VARYING_SLOT_VAR30),
|
||||
ENUM(VARYING_SLOT_VAR31),
|
||||
};
|
||||
STATIC_ASSERT(ARRAY_SIZE(names) == VARYING_SLOT_MAX);
|
||||
return NAME(slot);
|
||||
}
|
||||
|
||||
const char *
|
||||
gl_system_value_name(gl_system_value sysval)
|
||||
{
|
||||
static const char *names[] = {
|
||||
ENUM(SYSTEM_VALUE_VERTEX_ID),
|
||||
ENUM(SYSTEM_VALUE_INSTANCE_ID),
|
||||
ENUM(SYSTEM_VALUE_VERTEX_ID_ZERO_BASE),
|
||||
ENUM(SYSTEM_VALUE_BASE_VERTEX),
|
||||
ENUM(SYSTEM_VALUE_INVOCATION_ID),
|
||||
ENUM(SYSTEM_VALUE_FRONT_FACE),
|
||||
ENUM(SYSTEM_VALUE_SAMPLE_ID),
|
||||
ENUM(SYSTEM_VALUE_SAMPLE_POS),
|
||||
ENUM(SYSTEM_VALUE_SAMPLE_MASK_IN),
|
||||
ENUM(SYSTEM_VALUE_TESS_COORD),
|
||||
ENUM(SYSTEM_VALUE_VERTICES_IN),
|
||||
ENUM(SYSTEM_VALUE_PRIMITIVE_ID),
|
||||
ENUM(SYSTEM_VALUE_TESS_LEVEL_OUTER),
|
||||
ENUM(SYSTEM_VALUE_TESS_LEVEL_INNER),
|
||||
ENUM(SYSTEM_VALUE_LOCAL_INVOCATION_ID),
|
||||
ENUM(SYSTEM_VALUE_WORK_GROUP_ID),
|
||||
ENUM(SYSTEM_VALUE_NUM_WORK_GROUPS),
|
||||
ENUM(SYSTEM_VALUE_VERTEX_CNT),
|
||||
};
|
||||
STATIC_ASSERT(ARRAY_SIZE(names) == SYSTEM_VALUE_MAX);
|
||||
return NAME(sysval);
|
||||
}
|
||||
|
||||
const char *
|
||||
glsl_interp_qualifier_name(enum glsl_interp_qualifier qual)
|
||||
{
|
||||
static const char *names[] = {
|
||||
ENUM(INTERP_QUALIFIER_NONE),
|
||||
ENUM(INTERP_QUALIFIER_SMOOTH),
|
||||
ENUM(INTERP_QUALIFIER_FLAT),
|
||||
ENUM(INTERP_QUALIFIER_NOPERSPECTIVE),
|
||||
};
|
||||
STATIC_ASSERT(ARRAY_SIZE(names) == INTERP_QUALIFIER_COUNT);
|
||||
return NAME(qual);
|
||||
}
|
||||
|
||||
const char *
|
||||
gl_frag_result_name(gl_frag_result result)
|
||||
{
|
||||
static const char *names[] = {
|
||||
ENUM(FRAG_RESULT_DEPTH),
|
||||
ENUM(FRAG_RESULT_STENCIL),
|
||||
ENUM(FRAG_RESULT_COLOR),
|
||||
ENUM(FRAG_RESULT_SAMPLE_MASK),
|
||||
ENUM(FRAG_RESULT_DATA0),
|
||||
ENUM(FRAG_RESULT_DATA1),
|
||||
ENUM(FRAG_RESULT_DATA2),
|
||||
ENUM(FRAG_RESULT_DATA3),
|
||||
ENUM(FRAG_RESULT_DATA4),
|
||||
ENUM(FRAG_RESULT_DATA5),
|
||||
ENUM(FRAG_RESULT_DATA6),
|
||||
ENUM(FRAG_RESULT_DATA7),
|
||||
};
|
||||
STATIC_ASSERT(ARRAY_SIZE(names) == FRAG_RESULT_MAX);
|
||||
return NAME(result);
|
||||
}
|
||||
@@ -44,10 +44,11 @@ LOCAL_CFLAGS := \
|
||||
-DHAVE_ANDROID_PLATFORM
|
||||
|
||||
ifeq ($(MESA_LOLLIPOP_BUILD),true)
|
||||
LOCAL_CFLAGS_32 := -DDEFAULT_DRIVER_DIR=\"/system/lib/$(MESA_DRI_MODULE_REL_PATH)\"
|
||||
LOCAL_CFLAGS_64 := -DDEFAULT_DRIVER_DIR=\"/system/lib64/$(MESA_DRI_MODULE_REL_PATH)\"
|
||||
LOCAL_CFLAGS_arm := -DDEFAULT_DRIVER_DIR=\"/system/lib/dri\"
|
||||
LOCAL_CFLAGS_x86 := -DDEFAULT_DRIVER_DIR=\"/system/lib/dri\"
|
||||
LOCAL_CFLAGS_x86_64 := -DDEFAULT_DRIVER_DIR=\"/system/lib64/dri\"
|
||||
else
|
||||
LOCAL_CFLAGS += -DDEFAULT_DRIVER_DIR=\"/system/lib/$(MESA_DRI_MODULE_REL_PATH)\"
|
||||
LOCAL_CFLAGS += -DDEFAULT_DRIVER_DIR=\"/system/lib/dri\"
|
||||
endif
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
|
||||
@@ -47,21 +47,12 @@ libEGL_la_LDFLAGS = \
|
||||
$(LD_NO_UNDEFINED)
|
||||
|
||||
dri2_backend_FILES =
|
||||
dri3_backend_FILES =
|
||||
|
||||
if HAVE_EGL_PLATFORM_X11
|
||||
AM_CFLAGS += -DHAVE_X11_PLATFORM
|
||||
AM_CFLAGS += $(XCB_DRI2_CFLAGS)
|
||||
libEGL_la_LIBADD += $(XCB_DRI2_LIBS)
|
||||
dri2_backend_FILES += drivers/dri2/platform_x11.c
|
||||
|
||||
if HAVE_DRI3
|
||||
dri3_backend_FILES += \
|
||||
drivers/dri2/platform_x11_dri3.c \
|
||||
drivers/dri2/platform_x11_dri3.h
|
||||
|
||||
libEGL_la_LIBADD += $(top_builddir)/src/loader/libloader_dri3_helper.la
|
||||
endif
|
||||
endif
|
||||
|
||||
if HAVE_EGL_PLATFORM_WAYLAND
|
||||
@@ -97,8 +88,7 @@ AM_CFLAGS += \
|
||||
|
||||
libEGL_la_SOURCES += \
|
||||
$(dri2_backend_core_FILES) \
|
||||
$(dri2_backend_FILES) \
|
||||
$(dri3_backend_FILES)
|
||||
$(dri2_backend_FILES)
|
||||
|
||||
libEGL_la_LIBADD += $(top_builddir)/src/loader/libloader.la
|
||||
libEGL_la_LIBADD += $(DLOPEN_LIBS) $(LIBDRM_LIBS)
|
||||
@@ -121,10 +111,7 @@ egl_HEADERS = \
|
||||
$(top_srcdir)/include/EGL/eglmesaext.h \
|
||||
$(top_srcdir)/include/EGL/eglplatform.h
|
||||
|
||||
TESTS = egl-symbols-check
|
||||
|
||||
EXTRA_DIST = \
|
||||
egl-symbols-check \
|
||||
SConscript \
|
||||
drivers/haiku \
|
||||
docs \
|
||||
|
||||
@@ -8,7 +8,6 @@ env = env.Clone()
|
||||
|
||||
env.Append(CPPPATH = [
|
||||
'#/include',
|
||||
'#/include/HaikuGL',
|
||||
'#/src/egl/main',
|
||||
'#/src',
|
||||
])
|
||||
@@ -16,6 +15,7 @@ env.Append(CPPPATH = [
|
||||
|
||||
# parse Makefile.sources
|
||||
egl_sources = env.ParseSourceList('Makefile.sources', 'LIBEGL_C_FILES')
|
||||
egl_sources.append(env.ParseSourceList('Makefile.sources', 'dri2_backend_core_FILES'))
|
||||
|
||||
env.Append(CPPDEFINES = [
|
||||
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_HAIKU',
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
#define WL_HIDE_DEPRECATED
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
@@ -131,10 +130,12 @@ const __DRIconfig *
|
||||
dri2_get_dri_config(struct dri2_egl_config *conf, EGLint surface_type,
|
||||
EGLenum colorspace)
|
||||
{
|
||||
const bool srgb = colorspace == EGL_GL_COLORSPACE_SRGB_KHR;
|
||||
|
||||
return surface_type == EGL_WINDOW_BIT ? conf->dri_double_config[srgb] :
|
||||
conf->dri_single_config[srgb];
|
||||
if (colorspace == EGL_GL_COLORSPACE_SRGB_KHR)
|
||||
return surface_type == EGL_WINDOW_BIT ? conf->dri_srgb_double_config :
|
||||
conf->dri_srgb_single_config;
|
||||
else
|
||||
return surface_type == EGL_WINDOW_BIT ? conf->dri_double_config :
|
||||
conf->dri_single_config;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
@@ -235,8 +236,6 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
|
||||
|
||||
case __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE:
|
||||
srgb = value != 0;
|
||||
if (!disp->Extensions.KHR_gl_colorspace && srgb)
|
||||
return NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -284,10 +283,14 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
|
||||
if (num_configs == 1) {
|
||||
conf = (struct dri2_egl_config *) matching_config;
|
||||
|
||||
if (double_buffer && !conf->dri_double_config[srgb])
|
||||
conf->dri_double_config[srgb] = dri_config;
|
||||
else if (!double_buffer && !conf->dri_single_config[srgb])
|
||||
conf->dri_single_config[srgb] = dri_config;
|
||||
if (double_buffer && srgb && !conf->dri_srgb_double_config)
|
||||
conf->dri_srgb_double_config = dri_config;
|
||||
else if (double_buffer && !srgb && !conf->dri_double_config)
|
||||
conf->dri_double_config = dri_config;
|
||||
else if (!double_buffer && srgb && !conf->dri_srgb_single_config)
|
||||
conf->dri_srgb_single_config = dri_config;
|
||||
else if (!double_buffer && !srgb && !conf->dri_single_config)
|
||||
conf->dri_single_config = dri_config;
|
||||
else
|
||||
/* a similar config type is already added (unlikely) => discard */
|
||||
return NULL;
|
||||
@@ -297,13 +300,18 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
|
||||
if (conf == NULL)
|
||||
return NULL;
|
||||
|
||||
if (double_buffer)
|
||||
conf->dri_double_config[srgb] = dri_config;
|
||||
else
|
||||
conf->dri_single_config[srgb] = dri_config;
|
||||
|
||||
memcpy(&conf->base, &base, sizeof base);
|
||||
conf->base.SurfaceType = 0;
|
||||
if (double_buffer) {
|
||||
if (srgb)
|
||||
conf->dri_srgb_double_config = dri_config;
|
||||
else
|
||||
conf->dri_double_config = dri_config;
|
||||
} else {
|
||||
if (srgb)
|
||||
conf->dri_srgb_single_config = dri_config;
|
||||
else
|
||||
conf->dri_single_config = dri_config;
|
||||
}
|
||||
conf->base.ConfigID = config_id;
|
||||
|
||||
_eglLinkConfig(&conf->base);
|
||||
@@ -354,12 +362,6 @@ struct dri2_extension_match {
|
||||
int offset;
|
||||
};
|
||||
|
||||
static struct dri2_extension_match dri3_driver_extensions[] = {
|
||||
{ __DRI_CORE, 1, offsetof(struct dri2_egl_display, core) },
|
||||
{ __DRI_IMAGE_DRIVER, 1, offsetof(struct dri2_egl_display, image_driver) },
|
||||
{ NULL, 0, 0 }
|
||||
};
|
||||
|
||||
static struct dri2_extension_match dri2_driver_extensions[] = {
|
||||
{ __DRI_CORE, 1, offsetof(struct dri2_egl_display, core) },
|
||||
{ __DRI_DRI2, 2, offsetof(struct dri2_egl_display, dri2) },
|
||||
@@ -393,13 +395,13 @@ dri2_bind_extensions(struct dri2_egl_display *dri2_dpy,
|
||||
void *field;
|
||||
|
||||
for (i = 0; extensions[i]; i++) {
|
||||
_eglLog(_EGL_DEBUG, "found extension `%s'", extensions[i]->name);
|
||||
_eglLog(_EGL_DEBUG, "DRI2: found extension `%s'", extensions[i]->name);
|
||||
for (j = 0; matches[j].name; j++) {
|
||||
if (strcmp(extensions[i]->name, matches[j].name) == 0 &&
|
||||
extensions[i]->version >= matches[j].version) {
|
||||
field = ((char *) dri2_dpy + matches[j].offset);
|
||||
*(const __DRIextension **) field = extensions[i];
|
||||
_eglLog(_EGL_INFO, "found extension %s version %d",
|
||||
_eglLog(_EGL_INFO, "DRI2: found extension %s version %d",
|
||||
extensions[i]->name, extensions[i]->version);
|
||||
}
|
||||
}
|
||||
@@ -408,7 +410,7 @@ dri2_bind_extensions(struct dri2_egl_display *dri2_dpy,
|
||||
for (j = 0; matches[j].name; j++) {
|
||||
field = ((char *) dri2_dpy + matches[j].offset);
|
||||
if (*(const __DRIextension **) field == NULL) {
|
||||
_eglLog(_EGL_WARNING, "did not find extension %s version %d",
|
||||
_eglLog(_EGL_WARNING, "DRI2: did not find extension %s version %d",
|
||||
matches[j].name, matches[j].version);
|
||||
ret = EGL_FALSE;
|
||||
}
|
||||
@@ -501,25 +503,6 @@ dri2_open_driver(_EGLDisplay *disp)
|
||||
return extensions;
|
||||
}
|
||||
|
||||
EGLBoolean
|
||||
dri2_load_driver_dri3(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = disp->DriverData;
|
||||
const __DRIextension **extensions;
|
||||
|
||||
extensions = dri2_open_driver(disp);
|
||||
if (!extensions)
|
||||
return EGL_FALSE;
|
||||
|
||||
if (!dri2_bind_extensions(dri2_dpy, dri3_driver_extensions, extensions)) {
|
||||
dlclose(dri2_dpy->driver);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
dri2_dpy->driver_extensions = extensions;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
EGLBoolean
|
||||
dri2_load_driver(_EGLDisplay *disp)
|
||||
{
|
||||
@@ -577,9 +560,7 @@ dri2_setup_screen(_EGLDisplay *disp)
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
unsigned int api_mask;
|
||||
|
||||
if (dri2_dpy->image_driver) {
|
||||
api_mask = dri2_dpy->image_driver->getAPIMask(dri2_dpy->dri_screen);
|
||||
} else if (dri2_dpy->dri2) {
|
||||
if (dri2_dpy->dri2) {
|
||||
api_mask = dri2_dpy->dri2->getAPIMask(dri2_dpy->dri_screen);
|
||||
} else {
|
||||
assert(dri2_dpy->swrast);
|
||||
@@ -599,7 +580,7 @@ dri2_setup_screen(_EGLDisplay *disp)
|
||||
if (api_mask & (1 << __DRI_API_GLES3))
|
||||
disp->ClientAPIs |= EGL_OPENGL_ES3_BIT_KHR;
|
||||
|
||||
assert(dri2_dpy->image_driver || dri2_dpy->dri2 || dri2_dpy->swrast);
|
||||
assert(dri2_dpy->dri2 || dri2_dpy->swrast);
|
||||
disp->Extensions.KHR_surfaceless_context = EGL_TRUE;
|
||||
disp->Extensions.MESA_configless_context = EGL_TRUE;
|
||||
|
||||
@@ -607,9 +588,7 @@ dri2_setup_screen(_EGLDisplay *disp)
|
||||
__DRI2_RENDERER_HAS_FRAMEBUFFER_SRGB))
|
||||
disp->Extensions.KHR_gl_colorspace = EGL_TRUE;
|
||||
|
||||
if (dri2_dpy->image_driver ||
|
||||
(dri2_dpy->dri2 && dri2_dpy->dri2->base.version >= 3) ||
|
||||
(dri2_dpy->swrast && dri2_dpy->swrast->base.version >= 3)) {
|
||||
if (dri2_dpy->dri2 && dri2_dpy->dri2->base.version >= 3) {
|
||||
disp->Extensions.KHR_create_context = EGL_TRUE;
|
||||
|
||||
if (dri2_dpy->robustness)
|
||||
@@ -671,14 +650,7 @@ dri2_create_screen(_EGLDisplay *disp)
|
||||
|
||||
dri2_dpy = disp->DriverData;
|
||||
|
||||
if (dri2_dpy->image_driver) {
|
||||
dri2_dpy->dri_screen =
|
||||
dri2_dpy->image_driver->createNewScreen2(0, dri2_dpy->fd,
|
||||
dri2_dpy->extensions,
|
||||
dri2_dpy->driver_extensions,
|
||||
&dri2_dpy->driver_configs,
|
||||
disp);
|
||||
} else if (dri2_dpy->dri2) {
|
||||
if (dri2_dpy->dri2) {
|
||||
if (dri2_dpy->dri2->base.version >= 4) {
|
||||
dri2_dpy->dri_screen =
|
||||
dri2_dpy->dri2->createNewScreen2(0, dri2_dpy->fd,
|
||||
@@ -714,7 +686,7 @@ dri2_create_screen(_EGLDisplay *disp)
|
||||
|
||||
extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
|
||||
|
||||
if (dri2_dpy->image_driver || dri2_dpy->dri2) {
|
||||
if (dri2_dpy->dri2) {
|
||||
if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
|
||||
goto cleanup_dri_screen;
|
||||
} else {
|
||||
@@ -812,7 +784,7 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
|
||||
if (dri2_dpy->own_dri_screen)
|
||||
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
|
||||
if (dri2_dpy->fd >= 0)
|
||||
if (dri2_dpy->fd)
|
||||
close(dri2_dpy->fd);
|
||||
if (dri2_dpy->driver)
|
||||
dlclose(dri2_dpy->driver);
|
||||
@@ -930,55 +902,6 @@ dri2_create_context_attribs_error(int dri_error)
|
||||
_eglError(egl_error, "dri2_create_context");
|
||||
}
|
||||
|
||||
static bool
|
||||
dri2_fill_context_attribs(struct dri2_egl_context *dri2_ctx,
|
||||
struct dri2_egl_display *dri2_dpy,
|
||||
uint32_t *ctx_attribs,
|
||||
unsigned *num_attribs)
|
||||
{
|
||||
int pos = 0;
|
||||
|
||||
assert(*num_attribs >= 8);
|
||||
|
||||
ctx_attribs[pos++] = __DRI_CTX_ATTRIB_MAJOR_VERSION;
|
||||
ctx_attribs[pos++] = dri2_ctx->base.ClientMajorVersion;
|
||||
ctx_attribs[pos++] = __DRI_CTX_ATTRIB_MINOR_VERSION;
|
||||
ctx_attribs[pos++] = dri2_ctx->base.ClientMinorVersion;
|
||||
|
||||
if (dri2_ctx->base.Flags != 0) {
|
||||
/* If the implementation doesn't support the __DRI2_ROBUSTNESS
|
||||
* extension, don't even try to send it the robust-access flag.
|
||||
* It may explode. Instead, generate the required EGL error here.
|
||||
*/
|
||||
if ((dri2_ctx->base.Flags & EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR) != 0
|
||||
&& !dri2_dpy->robustness) {
|
||||
_eglError(EGL_BAD_MATCH, "eglCreateContext");
|
||||
return false;
|
||||
}
|
||||
|
||||
ctx_attribs[pos++] = __DRI_CTX_ATTRIB_FLAGS;
|
||||
ctx_attribs[pos++] = dri2_ctx->base.Flags;
|
||||
}
|
||||
|
||||
if (dri2_ctx->base.ResetNotificationStrategy != EGL_NO_RESET_NOTIFICATION_KHR) {
|
||||
/* If the implementation doesn't support the __DRI2_ROBUSTNESS
|
||||
* extension, don't even try to send it a reset strategy. It may
|
||||
* explode. Instead, generate the required EGL error here.
|
||||
*/
|
||||
if (!dri2_dpy->robustness) {
|
||||
_eglError(EGL_BAD_CONFIG, "eglCreateContext");
|
||||
return false;
|
||||
}
|
||||
|
||||
ctx_attribs[pos++] = __DRI_CTX_ATTRIB_RESET_STRATEGY;
|
||||
ctx_attribs[pos++] = __DRI_CTX_RESET_LOSE_CONTEXT;
|
||||
}
|
||||
|
||||
*num_attribs = pos;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called via eglCreateContext(), drv->API.CreateContext().
|
||||
*/
|
||||
@@ -1047,10 +970,10 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
|
||||
* doubleBufferMode check in
|
||||
* src/mesa/main/context.c:check_compatible()
|
||||
*/
|
||||
if (dri2_config->dri_double_config[0])
|
||||
dri_config = dri2_config->dri_double_config[0];
|
||||
if (dri2_config->dri_double_config)
|
||||
dri_config = dri2_config->dri_double_config;
|
||||
else
|
||||
dri_config = dri2_config->dri_single_config[0];
|
||||
dri_config = dri2_config->dri_single_config;
|
||||
|
||||
/* EGL_WINDOW_BIT is set only when there is a dri_double_config. This
|
||||
* makes sure the back buffer will always be used.
|
||||
@@ -1061,34 +984,47 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
|
||||
else
|
||||
dri_config = NULL;
|
||||
|
||||
if (dri2_dpy->image_driver) {
|
||||
unsigned error;
|
||||
unsigned num_attribs = 8;
|
||||
uint32_t ctx_attribs[8];
|
||||
|
||||
if (!dri2_fill_context_attribs(dri2_ctx, dri2_dpy, ctx_attribs,
|
||||
&num_attribs))
|
||||
goto cleanup;
|
||||
|
||||
dri2_ctx->dri_context =
|
||||
dri2_dpy->image_driver->createContextAttribs(dri2_dpy->dri_screen,
|
||||
api,
|
||||
dri_config,
|
||||
shared,
|
||||
num_attribs / 2,
|
||||
ctx_attribs,
|
||||
& error,
|
||||
dri2_ctx);
|
||||
dri2_create_context_attribs_error(error);
|
||||
} else if (dri2_dpy->dri2) {
|
||||
if (dri2_dpy->dri2) {
|
||||
if (dri2_dpy->dri2->base.version >= 3) {
|
||||
unsigned error;
|
||||
unsigned num_attribs = 8;
|
||||
unsigned num_attribs = 0;
|
||||
uint32_t ctx_attribs[8];
|
||||
|
||||
if (!dri2_fill_context_attribs(dri2_ctx, dri2_dpy, ctx_attribs,
|
||||
&num_attribs))
|
||||
goto cleanup;
|
||||
ctx_attribs[num_attribs++] = __DRI_CTX_ATTRIB_MAJOR_VERSION;
|
||||
ctx_attribs[num_attribs++] = dri2_ctx->base.ClientMajorVersion;
|
||||
ctx_attribs[num_attribs++] = __DRI_CTX_ATTRIB_MINOR_VERSION;
|
||||
ctx_attribs[num_attribs++] = dri2_ctx->base.ClientMinorVersion;
|
||||
|
||||
if (dri2_ctx->base.Flags != 0) {
|
||||
/* If the implementation doesn't support the __DRI2_ROBUSTNESS
|
||||
* extension, don't even try to send it the robust-access flag.
|
||||
* It may explode. Instead, generate the required EGL error here.
|
||||
*/
|
||||
if ((dri2_ctx->base.Flags & EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR) != 0
|
||||
&& !dri2_dpy->robustness) {
|
||||
_eglError(EGL_BAD_MATCH, "eglCreateContext");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ctx_attribs[num_attribs++] = __DRI_CTX_ATTRIB_FLAGS;
|
||||
ctx_attribs[num_attribs++] = dri2_ctx->base.Flags;
|
||||
}
|
||||
|
||||
if (dri2_ctx->base.ResetNotificationStrategy != EGL_NO_RESET_NOTIFICATION_KHR) {
|
||||
/* If the implementation doesn't support the __DRI2_ROBUSTNESS
|
||||
* extension, don't even try to send it a reset strategy. It may
|
||||
* explode. Instead, generate the required EGL error here.
|
||||
*/
|
||||
if (!dri2_dpy->robustness) {
|
||||
_eglError(EGL_BAD_CONFIG, "eglCreateContext");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ctx_attribs[num_attribs++] = __DRI_CTX_ATTRIB_RESET_STRATEGY;
|
||||
ctx_attribs[num_attribs++] = __DRI_CTX_RESET_LOSE_CONTEXT;
|
||||
}
|
||||
|
||||
assert(num_attribs <= ARRAY_SIZE(ctx_attribs));
|
||||
|
||||
dri2_ctx->dri_context =
|
||||
dri2_dpy->dri2->createContextAttribs(dri2_dpy->dri_screen,
|
||||
@@ -1110,33 +1046,12 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
|
||||
}
|
||||
} else {
|
||||
assert(dri2_dpy->swrast);
|
||||
if (dri2_dpy->swrast->base.version >= 3) {
|
||||
unsigned error;
|
||||
unsigned num_attribs = 8;
|
||||
uint32_t ctx_attribs[8];
|
||||
|
||||
if (!dri2_fill_context_attribs(dri2_ctx, dri2_dpy, ctx_attribs,
|
||||
&num_attribs))
|
||||
goto cleanup;
|
||||
|
||||
dri2_ctx->dri_context =
|
||||
dri2_dpy->swrast->createContextAttribs(dri2_dpy->dri_screen,
|
||||
api,
|
||||
dri_config,
|
||||
shared,
|
||||
num_attribs / 2,
|
||||
ctx_attribs,
|
||||
& error,
|
||||
dri2_ctx);
|
||||
dri2_create_context_attribs_error(error);
|
||||
} else {
|
||||
dri2_ctx->dri_context =
|
||||
dri2_dpy->swrast->createNewContextForAPI(dri2_dpy->dri_screen,
|
||||
api,
|
||||
dri_config,
|
||||
shared,
|
||||
dri2_ctx);
|
||||
}
|
||||
dri2_ctx->dri_context =
|
||||
dri2_dpy->swrast->createNewContextForAPI(dri2_dpy->dri_screen,
|
||||
api,
|
||||
dri_config,
|
||||
shared,
|
||||
dri2_ctx);
|
||||
}
|
||||
|
||||
if (!dri2_ctx->dri_context)
|
||||
@@ -1175,10 +1090,11 @@ dri2_make_current(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
|
||||
{
|
||||
struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv);
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct dri2_egl_surface *dri2_dsurf = dri2_egl_surface(dsurf);
|
||||
struct dri2_egl_surface *dri2_rsurf = dri2_egl_surface(rsurf);
|
||||
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
|
||||
_EGLContext *old_ctx;
|
||||
_EGLSurface *old_dsurf, *old_rsurf;
|
||||
_EGLSurface *tmp_dsurf, *tmp_rsurf;
|
||||
__DRIdrawable *ddraw, *rdraw;
|
||||
__DRIcontext *cctx;
|
||||
|
||||
@@ -1190,8 +1106,8 @@ dri2_make_current(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
|
||||
if (old_ctx && dri2_drv->glFlush)
|
||||
dri2_drv->glFlush();
|
||||
|
||||
ddraw = (dsurf) ? dri2_dpy->vtbl->get_dri_drawable(dsurf) : NULL;
|
||||
rdraw = (rsurf) ? dri2_dpy->vtbl->get_dri_drawable(rsurf) : NULL;
|
||||
ddraw = (dri2_dsurf) ? dri2_dsurf->dri_drawable : NULL;
|
||||
rdraw = (dri2_rsurf) ? dri2_rsurf->dri_drawable : NULL;
|
||||
cctx = (dri2_ctx) ? dri2_ctx->dri_context : NULL;
|
||||
|
||||
if (old_ctx) {
|
||||
@@ -1211,10 +1127,10 @@ dri2_make_current(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
|
||||
return EGL_TRUE;
|
||||
} else {
|
||||
/* undo the previous _eglBindContext */
|
||||
_eglBindContext(old_ctx, old_dsurf, old_rsurf, &ctx, &tmp_dsurf, &tmp_rsurf);
|
||||
_eglBindContext(old_ctx, old_dsurf, old_rsurf, &ctx, &dsurf, &rsurf);
|
||||
assert(&dri2_ctx->base == ctx &&
|
||||
tmp_dsurf == dsurf &&
|
||||
tmp_rsurf == rsurf);
|
||||
&dri2_dsurf->base == dsurf &&
|
||||
&dri2_rsurf->base == rsurf);
|
||||
|
||||
_eglPutSurface(dsurf);
|
||||
_eglPutSurface(rsurf);
|
||||
@@ -1228,14 +1144,6 @@ dri2_make_current(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
|
||||
}
|
||||
}
|
||||
|
||||
__DRIdrawable *
|
||||
dri2_surface_get_dri_drawable(_EGLSurface *surf)
|
||||
{
|
||||
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
|
||||
|
||||
return dri2_surf->dri_drawable;
|
||||
}
|
||||
|
||||
/*
|
||||
* Called from eglGetProcAddress() via drv->API.GetProcAddress().
|
||||
*/
|
||||
@@ -1298,7 +1206,7 @@ void
|
||||
dri2_flush_drawable_for_swapbuffers(_EGLDisplay *disp, _EGLSurface *draw)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
__DRIdrawable *dri_drawable = dri2_dpy->vtbl->get_dri_drawable(draw);
|
||||
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
|
||||
|
||||
if (dri2_dpy->flush) {
|
||||
if (dri2_dpy->flush->base.version >= 4) {
|
||||
@@ -1316,12 +1224,12 @@ dri2_flush_drawable_for_swapbuffers(_EGLDisplay *disp, _EGLSurface *draw)
|
||||
* after calling eglSwapBuffers."
|
||||
*/
|
||||
dri2_dpy->flush->flush_with_flags(dri2_ctx->dri_context,
|
||||
dri_drawable,
|
||||
dri2_surf->dri_drawable,
|
||||
__DRI2_FLUSH_DRAWABLE |
|
||||
__DRI2_FLUSH_INVALIDATE_ANCILLARY,
|
||||
__DRI2_THROTTLE_SWAPBUFFER);
|
||||
} else {
|
||||
dri2_dpy->flush->flush(dri_drawable);
|
||||
dri2_dpy->flush->flush(dri2_surf->dri_drawable);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1378,8 +1286,7 @@ static EGLBoolean
|
||||
dri2_wait_client(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
_EGLSurface *surf = ctx->DrawSurface;
|
||||
__DRIdrawable *dri_drawable = dri2_dpy->vtbl->get_dri_drawable(surf);
|
||||
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(ctx->DrawSurface);
|
||||
|
||||
(void) drv;
|
||||
|
||||
@@ -1387,7 +1294,7 @@ dri2_wait_client(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx)
|
||||
* we need to copy fake to real here.*/
|
||||
|
||||
if (dri2_dpy->flush != NULL)
|
||||
dri2_dpy->flush->flush(dri_drawable);
|
||||
dri2_dpy->flush->flush(dri2_surf->dri_drawable);
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
@@ -1410,10 +1317,10 @@ dri2_bind_tex_image(_EGLDriver *drv,
|
||||
_EGLDisplay *disp, _EGLSurface *surf, EGLint buffer)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
|
||||
struct dri2_egl_context *dri2_ctx;
|
||||
_EGLContext *ctx;
|
||||
GLint format, target;
|
||||
__DRIdrawable *dri_drawable = dri2_dpy->vtbl->get_dri_drawable(surf);
|
||||
|
||||
ctx = _eglGetCurrentContext();
|
||||
dri2_ctx = dri2_egl_context(ctx);
|
||||
@@ -1421,7 +1328,7 @@ dri2_bind_tex_image(_EGLDriver *drv,
|
||||
if (!_eglBindTexImage(drv, disp, surf, buffer))
|
||||
return EGL_FALSE;
|
||||
|
||||
switch (surf->TextureFormat) {
|
||||
switch (dri2_surf->base.TextureFormat) {
|
||||
case EGL_TEXTURE_RGB:
|
||||
format = __DRI_TEXTURE_FORMAT_RGB;
|
||||
break;
|
||||
@@ -1433,7 +1340,7 @@ dri2_bind_tex_image(_EGLDriver *drv,
|
||||
format = __DRI_TEXTURE_FORMAT_RGBA;
|
||||
}
|
||||
|
||||
switch (surf->TextureTarget) {
|
||||
switch (dri2_surf->base.TextureTarget) {
|
||||
case EGL_TEXTURE_2D:
|
||||
target = GL_TEXTURE_2D;
|
||||
break;
|
||||
@@ -1444,7 +1351,7 @@ dri2_bind_tex_image(_EGLDriver *drv,
|
||||
|
||||
(*dri2_dpy->tex_buffer->setTexBuffer2)(dri2_ctx->dri_context,
|
||||
target, format,
|
||||
dri_drawable);
|
||||
dri2_surf->dri_drawable);
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
@@ -1454,10 +1361,10 @@ dri2_release_tex_image(_EGLDriver *drv,
|
||||
_EGLDisplay *disp, _EGLSurface *surf, EGLint buffer)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
|
||||
struct dri2_egl_context *dri2_ctx;
|
||||
_EGLContext *ctx;
|
||||
GLint target;
|
||||
__DRIdrawable *dri_drawable = dri2_dpy->vtbl->get_dri_drawable(surf);
|
||||
|
||||
ctx = _eglGetCurrentContext();
|
||||
dri2_ctx = dri2_egl_context(ctx);
|
||||
@@ -1465,7 +1372,7 @@ dri2_release_tex_image(_EGLDriver *drv,
|
||||
if (!_eglReleaseTexImage(drv, disp, surf, buffer))
|
||||
return EGL_FALSE;
|
||||
|
||||
switch (surf->TextureTarget) {
|
||||
switch (dri2_surf->base.TextureTarget) {
|
||||
case EGL_TEXTURE_2D:
|
||||
target = GL_TEXTURE_2D;
|
||||
break;
|
||||
@@ -1477,7 +1384,7 @@ dri2_release_tex_image(_EGLDriver *drv,
|
||||
dri2_dpy->tex_buffer->releaseTexBuffer != NULL) {
|
||||
(*dri2_dpy->tex_buffer->releaseTexBuffer)(dri2_ctx->dri_context,
|
||||
target,
|
||||
dri_drawable);
|
||||
dri2_surf->dri_drawable);
|
||||
}
|
||||
|
||||
return EGL_TRUE;
|
||||
@@ -2477,18 +2384,13 @@ dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
|
||||
unsigned wait_flags = 0;
|
||||
EGLint ret = EGL_CONDITION_SATISFIED_KHR;
|
||||
|
||||
/* The EGL_KHR_fence_sync spec states:
|
||||
*
|
||||
* "If no context is current for the bound API,
|
||||
* the EGL_SYNC_FLUSH_COMMANDS_BIT_KHR bit is ignored.
|
||||
*/
|
||||
if (dri2_ctx && flags & EGL_SYNC_FLUSH_COMMANDS_BIT_KHR)
|
||||
if (flags & EGL_SYNC_FLUSH_COMMANDS_BIT_KHR)
|
||||
wait_flags |= __DRI2_FENCE_FLAG_FLUSH_COMMANDS;
|
||||
|
||||
/* the sync object should take a reference while waiting */
|
||||
dri2_egl_ref_sync(dri2_sync);
|
||||
|
||||
if (dri2_dpy->fence->client_wait_sync(dri2_ctx ? dri2_ctx->dri_context : NULL,
|
||||
if (dri2_dpy->fence->client_wait_sync(dri2_ctx->dri_context,
|
||||
dri2_sync->fence, wait_flags,
|
||||
timeout))
|
||||
dri2_sync->base.SyncStatus = EGL_SIGNALED_KHR;
|
||||
|
||||
@@ -35,10 +35,6 @@
|
||||
#include <xcb/dri2.h>
|
||||
#include <xcb/xfixes.h>
|
||||
#include <X11/Xlib-xcb.h>
|
||||
|
||||
#ifdef HAVE_DRI3
|
||||
#include "loader_dri3_helper.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
@@ -149,8 +145,6 @@ struct dri2_egl_display_vtbl {
|
||||
EGLBoolean (*get_sync_values)(_EGLDisplay *display, _EGLSurface *surface,
|
||||
EGLuint64KHR *ust, EGLuint64KHR *msc,
|
||||
EGLuint64KHR *sbc);
|
||||
|
||||
__DRIdrawable *(*get_dri_drawable)(_EGLSurface *surf);
|
||||
};
|
||||
|
||||
struct dri2_egl_display
|
||||
@@ -164,7 +158,6 @@ struct dri2_egl_display
|
||||
const __DRIconfig **driver_configs;
|
||||
void *driver;
|
||||
const __DRIcoreExtension *core;
|
||||
const __DRIimageDriverExtension *image_driver;
|
||||
const __DRIdri2Extension *dri2;
|
||||
const __DRIswrastExtension *swrast;
|
||||
const __DRI2flushExtension *flush;
|
||||
@@ -197,9 +190,6 @@ struct dri2_egl_display
|
||||
#ifdef HAVE_X11_PLATFORM
|
||||
xcb_connection_t *conn;
|
||||
int screen;
|
||||
#ifdef HAVE_DRI3
|
||||
struct loader_dri3_extensions loader_dri3_ext;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
@@ -213,9 +203,8 @@ struct dri2_egl_display
|
||||
int formats;
|
||||
uint32_t capabilities;
|
||||
int is_render_node;
|
||||
#endif
|
||||
|
||||
int is_different_gpu;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct dri2_egl_context
|
||||
@@ -295,8 +284,10 @@ struct dri2_egl_surface
|
||||
struct dri2_egl_config
|
||||
{
|
||||
_EGLConfig base;
|
||||
const __DRIconfig *dri_single_config[2];
|
||||
const __DRIconfig *dri_double_config[2];
|
||||
const __DRIconfig *dri_single_config;
|
||||
const __DRIconfig *dri_double_config;
|
||||
const __DRIconfig *dri_srgb_single_config;
|
||||
const __DRIconfig *dri_srgb_double_config;
|
||||
};
|
||||
|
||||
struct dri2_egl_image
|
||||
@@ -335,15 +326,9 @@ dri2_setup_screen(_EGLDisplay *disp);
|
||||
EGLBoolean
|
||||
dri2_load_driver_swrast(_EGLDisplay *disp);
|
||||
|
||||
EGLBoolean
|
||||
dri2_load_driver_dri3(_EGLDisplay *disp);
|
||||
|
||||
EGLBoolean
|
||||
dri2_create_screen(_EGLDisplay *disp);
|
||||
|
||||
__DRIdrawable *
|
||||
dri2_surface_get_dri_drawable(_EGLSurface *surf);
|
||||
|
||||
__DRIimage *
|
||||
dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data);
|
||||
|
||||
|
||||
@@ -532,12 +532,7 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
|
||||
{ HAL_PIXEL_FORMAT_RGB_888, { 0xff, 0xff00, 0xff0000, 0x0 } },
|
||||
{ HAL_PIXEL_FORMAT_RGB_565, { 0xf800, 0x7e0, 0x1f, 0x0 } },
|
||||
{ HAL_PIXEL_FORMAT_BGRA_8888, { 0xff0000, 0xff00, 0xff, 0xff000000 } },
|
||||
{ 0, { 0, 0, 0, 0 } }
|
||||
};
|
||||
EGLint config_attrs[] = {
|
||||
EGL_NATIVE_VISUAL_ID, 0,
|
||||
EGL_NATIVE_VISUAL_TYPE, 0,
|
||||
EGL_NONE
|
||||
{ 0, 0, { 0, 0, 0, 0 } }
|
||||
};
|
||||
int count, i, j;
|
||||
|
||||
@@ -545,9 +540,6 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
|
||||
for (i = 0; visuals[i].format; i++) {
|
||||
int format_count = 0;
|
||||
|
||||
config_attrs[1] = visuals[i].format;
|
||||
config_attrs[3] = visuals[i].format;
|
||||
|
||||
for (j = 0; dri2_dpy->driver_configs[j]; j++) {
|
||||
const EGLint surface_type = EGL_WINDOW_BIT | EGL_PBUFFER_BIT;
|
||||
struct dri2_egl_config *dri2_conf;
|
||||
@@ -561,8 +553,10 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
|
||||
continue;
|
||||
|
||||
dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],
|
||||
count + 1, surface_type, config_attrs, visuals[i].rgba_masks);
|
||||
count + 1, surface_type, NULL, visuals[i].rgba_masks);
|
||||
if (dri2_conf) {
|
||||
dri2_conf->base.NativeVisualID = visuals[i].format;
|
||||
dri2_conf->base.NativeVisualType = visuals[i].format;
|
||||
count++;
|
||||
format_count++;
|
||||
}
|
||||
@@ -656,7 +650,6 @@ static struct dri2_egl_display_vtbl droid_display_vtbl = {
|
||||
.query_buffer_age = dri2_fallback_query_buffer_age,
|
||||
.create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
|
||||
.get_sync_values = dri2_fallback_get_sync_values,
|
||||
.get_dri_drawable = dri2_surface_get_dri_drawable,
|
||||
};
|
||||
|
||||
EGLBoolean
|
||||
|
||||
@@ -101,7 +101,6 @@ dri2_drm_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
|
||||
struct dri2_egl_surface *dri2_surf;
|
||||
struct gbm_surface *window = native_window;
|
||||
struct gbm_dri_surface *surf;
|
||||
const __DRIconfig *config;
|
||||
|
||||
(void) drv;
|
||||
|
||||
@@ -131,20 +130,21 @@ dri2_drm_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
|
||||
goto cleanup_surf;
|
||||
}
|
||||
|
||||
config = dri2_get_dri_config(dri2_conf, EGL_WINDOW_BIT,
|
||||
dri2_surf->base.GLColorspace);
|
||||
|
||||
if (dri2_dpy->dri2) {
|
||||
const __DRIconfig *config =
|
||||
dri2_get_dri_config(dri2_conf, EGL_WINDOW_BIT,
|
||||
dri2_surf->base.GLColorspace);
|
||||
|
||||
dri2_surf->dri_drawable =
|
||||
(*dri2_dpy->dri2->createNewDrawable)(dri2_dpy->dri_screen, config,
|
||||
dri2_surf->gbm_surf);
|
||||
|
||||
} else {
|
||||
assert(dri2_dpy->swrast != NULL);
|
||||
|
||||
dri2_surf->dri_drawable =
|
||||
(*dri2_dpy->swrast->createNewDrawable)(dri2_dpy->dri_screen, config,
|
||||
dri2_surf->gbm_surf);
|
||||
(*dri2_dpy->swrast->createNewDrawable) (dri2_dpy->dri_screen,
|
||||
dri2_conf->dri_double_config,
|
||||
dri2_surf->gbm_surf);
|
||||
|
||||
}
|
||||
if (dri2_surf->dri_drawable == NULL) {
|
||||
@@ -594,7 +594,6 @@ static struct dri2_egl_display_vtbl dri2_drm_display_vtbl = {
|
||||
.query_buffer_age = dri2_drm_query_buffer_age,
|
||||
.create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
|
||||
.get_sync_values = dri2_fallback_get_sync_values,
|
||||
.get_dri_drawable = dri2_surface_get_dri_drawable,
|
||||
};
|
||||
|
||||
EGLBoolean
|
||||
@@ -624,19 +623,27 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
dri2_dpy->own_device = 1;
|
||||
gbm = gbm_create_device(fd);
|
||||
if (gbm == NULL)
|
||||
goto cleanup;
|
||||
} else {
|
||||
fd = fcntl(gbm_device_get_fd(gbm), F_DUPFD_CLOEXEC, 3);
|
||||
if (fd < 0)
|
||||
goto cleanup;
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
if (strcmp(gbm_device_get_backend_name(gbm), "drm") != 0)
|
||||
goto cleanup;
|
||||
if (strcmp(gbm_device_get_backend_name(gbm), "drm") != 0) {
|
||||
free(dri2_dpy);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
dri2_dpy->gbm_dri = gbm_dri_device(gbm);
|
||||
if (dri2_dpy->gbm_dri->base.type != GBM_DRM_DRIVER_TYPE_DRI)
|
||||
goto cleanup;
|
||||
if (dri2_dpy->gbm_dri->base.type != GBM_DRM_DRIVER_TYPE_DRI) {
|
||||
free(dri2_dpy);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
if (fd < 0) {
|
||||
fd = fcntl(gbm_device_get_fd(gbm), F_DUPFD_CLOEXEC, 3);
|
||||
if (fd < 0) {
|
||||
free(dri2_dpy);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
dri2_dpy->fd = fd;
|
||||
dri2_dpy->device_name = loader_get_device_name_for_fd(dri2_dpy->fd);
|
||||
@@ -720,11 +727,4 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
dri2_dpy->vtbl = &dri2_drm_display_vtbl;
|
||||
|
||||
return EGL_TRUE;
|
||||
|
||||
cleanup:
|
||||
if (fd >= 0)
|
||||
close(fd);
|
||||
|
||||
free(dri2_dpy);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
@@ -653,37 +653,6 @@ create_wl_buffer(struct dri2_egl_surface *dri2_surf)
|
||||
&wl_buffer_listener, dri2_surf);
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
try_damage_buffer(struct dri2_egl_surface *dri2_surf,
|
||||
const EGLint *rects,
|
||||
EGLint n_rects)
|
||||
{
|
||||
/* The WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION macro and
|
||||
* wl_proxy_get_version() were both introduced in wayland 1.10.
|
||||
* Instead of bumping our wayland dependency we just make this
|
||||
* function conditional on the required 1.10 features, falling
|
||||
* back to old (correct but suboptimal) behaviour for older
|
||||
* wayland.
|
||||
*/
|
||||
#ifdef WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION
|
||||
int i;
|
||||
|
||||
if (wl_proxy_get_version((struct wl_proxy *) dri2_surf->wl_win->surface)
|
||||
< WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION)
|
||||
return EGL_FALSE;
|
||||
|
||||
for (i = 0; i < n_rects; i++) {
|
||||
const int *rect = &rects[i * 4];
|
||||
|
||||
wl_surface_damage_buffer(dri2_surf->wl_win->surface,
|
||||
rect[0],
|
||||
dri2_surf->base.Height - rect[1] - rect[3],
|
||||
rect[2], rect[3]);
|
||||
}
|
||||
return EGL_TRUE;
|
||||
#endif
|
||||
return EGL_FALSE;
|
||||
}
|
||||
/**
|
||||
* Called via eglSwapBuffers(), drv->API.SwapBuffers().
|
||||
*/
|
||||
@@ -734,12 +703,18 @@ dri2_wl_swap_buffers_with_damage(_EGLDriver *drv,
|
||||
dri2_surf->dx = 0;
|
||||
dri2_surf->dy = 0;
|
||||
|
||||
/* If the compositor doesn't support damage_buffer, we deliberately
|
||||
* ignore the damage region and post maximum damage, due to
|
||||
* https://bugs.freedesktop.org/78190 */
|
||||
if (!n_rects || !try_damage_buffer(dri2_surf, rects, n_rects))
|
||||
if (n_rects == 0) {
|
||||
wl_surface_damage(dri2_surf->wl_win->surface,
|
||||
0, 0, INT32_MAX, INT32_MAX);
|
||||
} else {
|
||||
for (i = 0; i < n_rects; i++) {
|
||||
const int *rect = &rects[i * 4];
|
||||
wl_surface_damage(dri2_surf->wl_win->surface,
|
||||
rect[0],
|
||||
dri2_surf->base.Height - rect[1] - rect[3],
|
||||
rect[2], rect[3]);
|
||||
}
|
||||
}
|
||||
|
||||
if (dri2_dpy->is_different_gpu) {
|
||||
_EGLContext *ctx = _eglGetCurrentContext();
|
||||
@@ -1058,7 +1033,6 @@ static struct dri2_egl_display_vtbl dri2_wl_display_vtbl = {
|
||||
.query_buffer_age = dri2_wl_query_buffer_age,
|
||||
.create_wayland_buffer_from_image = dri2_wl_create_wayland_buffer_from_image,
|
||||
.get_sync_values = dri2_fallback_get_sync_values,
|
||||
.get_dri_drawable = dri2_surface_get_dri_drawable,
|
||||
};
|
||||
|
||||
static EGLBoolean
|
||||
@@ -1671,7 +1645,6 @@ dri2_wl_swrast_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
|
||||
struct wl_egl_window *window = native_window;
|
||||
struct dri2_egl_surface *dri2_surf;
|
||||
const __DRIconfig *config;
|
||||
|
||||
(void) drv;
|
||||
|
||||
@@ -1696,12 +1669,10 @@ dri2_wl_swrast_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
dri2_surf->base.Width = -1;
|
||||
dri2_surf->base.Height = -1;
|
||||
|
||||
config = dri2_get_dri_config(dri2_conf, EGL_WINDOW_BIT,
|
||||
dri2_surf->base.GLColorspace);
|
||||
|
||||
dri2_surf->dri_drawable =
|
||||
(*dri2_dpy->swrast->createNewDrawable)(dri2_dpy->dri_screen,
|
||||
config, dri2_surf);
|
||||
(*dri2_dpy->swrast->createNewDrawable) (dri2_dpy->dri_screen,
|
||||
dri2_conf->dri_double_config,
|
||||
dri2_surf);
|
||||
if (dri2_surf->dri_drawable == NULL) {
|
||||
_eglError(EGL_BAD_ALLOC, "swrast->createNewDrawable");
|
||||
goto cleanup_dri_drawable;
|
||||
@@ -1786,7 +1757,6 @@ static struct dri2_egl_display_vtbl dri2_wl_swrast_display_vtbl = {
|
||||
.query_buffer_age = dri2_fallback_query_buffer_age,
|
||||
.create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
|
||||
.get_sync_values = dri2_fallback_get_sync_values,
|
||||
.get_dri_drawable = dri2_surface_get_dri_drawable,
|
||||
};
|
||||
|
||||
static EGLBoolean
|
||||
@@ -1834,7 +1804,6 @@ dri2_initialize_wayland_swrast(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
if (roundtrip(dri2_dpy) < 0 || dri2_dpy->formats == 0)
|
||||
goto cleanup_shm;
|
||||
|
||||
dri2_dpy->fd = -1;
|
||||
dri2_dpy->driver_name = strdup("swrast");
|
||||
if (!dri2_load_driver_swrast(disp))
|
||||
goto cleanup_shm;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user