forked from KolibriOS/kolibrios
delete libraries/mesa
git-svn-id: svn://kolibrios.org@4357 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
-1555
File diff suppressed because it is too large
Load Diff
-1685
File diff suppressed because it is too large
Load Diff
@@ -1,112 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
# A minimal replacement for 'install' that supports installing symbolic links.
|
||||
# Only a limited number of options are supported:
|
||||
# -d dir Create a directory
|
||||
# -m mode Sets a file's mode when installing
|
||||
|
||||
|
||||
# If these commands aren't portable, we'll need some "if (arch)" type stuff
|
||||
SYMLINK="ln -s"
|
||||
MKDIR="mkdir -p"
|
||||
RM="rm -f"
|
||||
|
||||
MODE=""
|
||||
|
||||
if [ "$1" = "-d" ] ; then
|
||||
# make a directory path
|
||||
$MKDIR "$2"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "-m" ] ; then
|
||||
# set file mode
|
||||
MODE=$2
|
||||
shift 2
|
||||
fi
|
||||
|
||||
# install file(s) into destination
|
||||
if [ $# -ge 2 ] ; then
|
||||
|
||||
# Last cmd line arg is the dest dir
|
||||
for FILE in $@ ; do
|
||||
DESTDIR="$FILE"
|
||||
done
|
||||
|
||||
# Loop over args, moving them to DEST directory
|
||||
I=1
|
||||
for FILE in $@ ; do
|
||||
if [ $I = $# ] ; then
|
||||
# stop, don't want to install $DEST into $DEST
|
||||
exit 0
|
||||
fi
|
||||
|
||||
DEST=$DESTDIR
|
||||
|
||||
# On CYGWIN, because DLLs are loaded by the native Win32 loader,
|
||||
# they are installed in the executable path. Stub libraries used
|
||||
# only for linking are installed in the library path
|
||||
case `uname` in
|
||||
CYGWIN*)
|
||||
case $FILE in
|
||||
*.dll)
|
||||
DEST="$DEST/../bin"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
PWDSAVE=`pwd`
|
||||
|
||||
# determine file's type
|
||||
if [ -h "$FILE" ] ; then
|
||||
#echo $FILE is a symlink
|
||||
# Unfortunately, cp -d isn't universal so we have to
|
||||
# use a work-around.
|
||||
|
||||
# Use ls -l to find the target that the link points to
|
||||
LL=`ls -l "$FILE"`
|
||||
for L in $LL ; do
|
||||
TARGET=$L
|
||||
done
|
||||
#echo $FILE is a symlink pointing to $TARGET
|
||||
|
||||
FILE=`basename "$FILE"`
|
||||
# Go to $DEST and make the link
|
||||
cd "$DEST" # pushd
|
||||
$RM "$FILE"
|
||||
$SYMLINK "$TARGET" "$FILE"
|
||||
cd "$PWDSAVE" # popd
|
||||
|
||||
elif [ -f "$FILE" ] ; then
|
||||
#echo "$FILE" is a regular file
|
||||
# Only copy if the files differ
|
||||
if ! cmp -s $FILE $DEST/`basename $FILE`; then
|
||||
$RM "$DEST/`basename $FILE`"
|
||||
cp "$FILE" "$DEST"
|
||||
fi
|
||||
if [ $MODE ] ; then
|
||||
FILE=`basename "$FILE"`
|
||||
chmod $MODE "$DEST/$FILE"
|
||||
fi
|
||||
else
|
||||
echo "Unknown type of argument: " "$FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
I=`expr $I + 1`
|
||||
done
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# If we get here, we didn't find anything to do
|
||||
echo "Usage:"
|
||||
echo " install -d dir Create named directory"
|
||||
echo " install [-m mode] file [...] dest Install files in destination"
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
# A minimal replacement for 'install' that supports installing symbolic links.
|
||||
# Only a limited number of options are supported:
|
||||
# -d dir Create a directory
|
||||
# -m mode Sets a file's mode when installing
|
||||
|
||||
|
||||
# If these commands aren't portable, we'll need some "if (arch)" type stuff
|
||||
SYMLINK="ln -s"
|
||||
MKDIR="mkdir -p"
|
||||
RM="rm -f"
|
||||
|
||||
MODE=""
|
||||
|
||||
if [ "$1" = "-d" ] ; then
|
||||
# make a directory path
|
||||
$MKDIR "$2"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "-m" ] ; then
|
||||
# set file mode
|
||||
MODE=$2
|
||||
shift 2
|
||||
fi
|
||||
|
||||
# install file(s) into destination
|
||||
if [ $# -ge 2 ] ; then
|
||||
|
||||
# Last cmd line arg is the dest dir
|
||||
for FILE in $@ ; do
|
||||
DESTDIR="$FILE"
|
||||
done
|
||||
|
||||
# Loop over args, moving them to DEST directory
|
||||
I=1
|
||||
for FILE in $@ ; do
|
||||
if [ $I = $# ] ; then
|
||||
# stop, don't want to install $DEST into $DEST
|
||||
exit 0
|
||||
fi
|
||||
|
||||
DEST=$DESTDIR
|
||||
|
||||
# On CYGWIN, because DLLs are loaded by the native Win32 loader,
|
||||
# they are installed in the executable path. Stub libraries used
|
||||
# only for linking are installed in the library path
|
||||
case `uname` in
|
||||
CYGWIN*)
|
||||
case $FILE in
|
||||
*.dll)
|
||||
DEST="$DEST/../bin"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
PWDSAVE=`pwd`
|
||||
|
||||
# determine file's type
|
||||
if [ -h "$FILE" ] ; then
|
||||
#echo $FILE is a symlink
|
||||
# Unfortunately, cp -d isn't universal so we have to
|
||||
# use a work-around.
|
||||
|
||||
# Use ls -l to find the target that the link points to
|
||||
LL=`ls -l "$FILE"`
|
||||
for L in $LL ; do
|
||||
TARGET=$L
|
||||
done
|
||||
#echo $FILE is a symlink pointing to $TARGET
|
||||
|
||||
FILE=`basename "$FILE"`
|
||||
# Go to $DEST and make the link
|
||||
cd "$DEST" # pushd
|
||||
$RM "$FILE"
|
||||
$SYMLINK "$TARGET" "$FILE"
|
||||
cd "$PWDSAVE" # popd
|
||||
|
||||
elif [ -f "$FILE" ] ; then
|
||||
#echo "$FILE" is a regular file
|
||||
# Only copy if the files differ
|
||||
if ! cmp -s $FILE $DEST/`basename $FILE`; then
|
||||
$RM "$DEST/`basename $FILE`"
|
||||
cp "$FILE" "$DEST"
|
||||
fi
|
||||
if [ $MODE ] ; then
|
||||
FILE=`basename "$FILE"`
|
||||
chmod $MODE "$DEST/$FILE"
|
||||
fi
|
||||
else
|
||||
echo "Unknown type of argument: " "$FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
I=`expr $I + 1`
|
||||
done
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# If we get here, we didn't find anything to do
|
||||
echo "Usage:"
|
||||
echo " install -d dir Create named directory"
|
||||
echo " install [-m mode] file [...] dest Install files in destination"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/make -sf
|
||||
# Print the various Mesa version fields. This is mostly used to add the
|
||||
# version to configure.
|
||||
|
||||
# This reflects that this script is usually called from the toplevel
|
||||
TOP = .
|
||||
|
||||
include $(TOP)/configs/default
|
||||
|
||||
version:
|
||||
@echo $(MESA_VERSION)
|
||||
major:
|
||||
@echo $(MESA_MAJOR)
|
||||
minor:
|
||||
@echo $(MESA_MINOR)
|
||||
tiny:
|
||||
@echo $(MESA_TINY)
|
||||
@@ -1,191 +0,0 @@
|
||||
#Pull in the defaults
|
||||
include $(TOP)/configs/default
|
||||
|
||||
# This is generated by configure
|
||||
CONFIG_NAME = autoconf
|
||||
|
||||
# Compiler and flags
|
||||
|
||||
AR = ar rc
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
OPT_FLAGS =
|
||||
ARCH_FLAGS =
|
||||
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_SSE_ASM
|
||||
PIC_FLAGS =
|
||||
DEFINES = -D_POSIX_C_SOURCE=199309L -UWIN32 -U_WIN32 -DSTDCALL_API
|
||||
API_DEFINES = -DFEATURE_GL=1
|
||||
GLES_OVERLAY = 0
|
||||
CFLAGS = -g -O2 -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \
|
||||
-I$(TOP)/../newlib/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) \
|
||||
$(DEFINES)
|
||||
CXXFLAGS = -g -O2 -Wall -fno-strict-aliasing \
|
||||
-I$(TOP)/../newlib/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
|
||||
LDFLAGS =
|
||||
EXTRA_LIB_PATH =
|
||||
RADEON_CFLAGS =
|
||||
RADEON_LDFLAGS =
|
||||
INTEL_LIBS =
|
||||
INTEL_CFLAGS =
|
||||
X11_LIBS = -lX11
|
||||
X11_CFLAGS =
|
||||
LLVM_CFLAGS =
|
||||
LLVM_LDFLAGS =
|
||||
LLVM_LIBS =
|
||||
GLW_CFLAGS =
|
||||
GLUT_CFLAGS =
|
||||
|
||||
# dlopen
|
||||
DLOPEN_LIBS = -ldl
|
||||
|
||||
# Source selection
|
||||
MESA_ASM_SOURCES = $(X86_SOURCES)
|
||||
GLAPI_ASM_SOURCES = $(X86_API)
|
||||
|
||||
# Misc tools and flags
|
||||
MAKE = make
|
||||
SHELL = /bin/bash
|
||||
MKLIB_OPTIONS = -static
|
||||
MKDEP = /usr/bin/makedepend
|
||||
MKDEP_OPTIONS = -fdepend -I/usr/lib/gcc/i686-linux-gnu/4.4.5/include -I/usr/lib/gcc/i686-linux-gnu/4.4.5/include-fixed
|
||||
INSTALL = /usr/bin/install -c
|
||||
|
||||
# Python and flags (generally only needed by the developers)
|
||||
PYTHON2 = python
|
||||
PYTHON_FLAGS = -t -O -O
|
||||
|
||||
# Library names (base name)
|
||||
GL_LIB = GL
|
||||
GLU_LIB = GLU
|
||||
GLUT_LIB = glut
|
||||
GLW_LIB = GLw
|
||||
OSMESA_LIB = OSMesa
|
||||
GLESv1_CM_LIB = GLESv1_CM
|
||||
GLESv2_LIB = GLESv2
|
||||
VG_LIB = OpenVG
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = lib$(GL_LIB).a
|
||||
GLU_LIB_NAME = lib$(GLU_LIB).a
|
||||
GLUT_LIB_NAME = lib$(GLUT_LIB).a
|
||||
GLW_LIB_NAME = lib$(GLW_LIB).a
|
||||
OSMESA_LIB_NAME = lib$(OSMESA_LIB).a
|
||||
EGL_LIB_NAME = lib$(EGL_LIB).a
|
||||
GLESv1_CM_LIB_NAME = lib$(GLESv1_CM_LIB).a
|
||||
GLESv2_LIB_NAME = lib$(GLESv2_LIB).a
|
||||
VG_LIB_NAME = lib$(VG_LIB).a
|
||||
|
||||
# Globs used to install the lib and all symlinks
|
||||
GL_LIB_GLOB = lib$(GL_LIB).*a*
|
||||
GLU_LIB_GLOB = lib$(GLU_LIB).*a*
|
||||
GLUT_LIB_GLOB = lib$(GLUT_LIB).*a*
|
||||
GLW_LIB_GLOB = lib$(GLW_LIB).*a*
|
||||
OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*a*
|
||||
EGL_LIB_GLOB = lib$(EGL_LIB).*a*
|
||||
GLESv1_CM_LIB_GLOB = lib$(GLESv1_CM_LIB).*a*
|
||||
GLESv2_LIB_GLOB = lib$(GLESv2_LIB).*a*
|
||||
VG_LIB_GLOB = lib$(VG_LIB).*a*
|
||||
|
||||
# Directories to build
|
||||
LIB_DIR = lib
|
||||
SRC_DIRS = mapi/glapi glsl mesa
|
||||
GLU_DIRS = sgi
|
||||
DRIVER_DIRS = osmesa
|
||||
EGL_DRIVERS_DIRS =
|
||||
GALLIUM_TARGET_DIRS =
|
||||
GALLIUM_STATE_TRACKERS_DIRS =
|
||||
|
||||
# Driver specific build vars
|
||||
EGL_PLATFORMS =
|
||||
EGL_CLIENT_APIS = $(GL_LIB)
|
||||
|
||||
# Dependencies
|
||||
X11_INCLUDES =
|
||||
|
||||
# GLw motif setup
|
||||
GLW_SOURCES =
|
||||
MOTIF_CFLAGS =
|
||||
|
||||
# Library/program dependencies
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH)
|
||||
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) \
|
||||
$(EXTRA_LIB_PATH)
|
||||
EGL_LIB_DEPS = $(EXTRA_LIB_PATH)
|
||||
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) \
|
||||
$(EXTRA_LIB_PATH)
|
||||
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) \
|
||||
$(EXTRA_LIB_PATH)
|
||||
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) \
|
||||
$(EXTRA_LIB_PATH)
|
||||
APP_LIB_DEPS = $(EXTRA_LIB_PATH) -lm
|
||||
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH)
|
||||
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH)
|
||||
VG_LIB_DEPS = $(EXTRA_LIB_PATH)
|
||||
|
||||
# DRI dependencies
|
||||
DRI_LIB_DEPS = $(EXTRA_LIB_PATH)
|
||||
LIBDRM_CFLAGS =
|
||||
LIBDRM_LIB =
|
||||
DRI2PROTO_CFLAGS =
|
||||
EXPAT_INCLUDES =
|
||||
|
||||
# Autoconf directories
|
||||
prefix = /usr/local
|
||||
exec_prefix = ${prefix}
|
||||
libdir = ${exec_prefix}/lib
|
||||
includedir = ${prefix}/include
|
||||
|
||||
# Installation directories (for make install)
|
||||
INSTALL_DIR = $(prefix)
|
||||
INSTALL_LIB_DIR = $(libdir)
|
||||
INSTALL_INC_DIR = $(includedir)
|
||||
|
||||
# DRI installation directories
|
||||
DRI_DRIVER_INSTALL_DIR = ${libdir}/dri
|
||||
|
||||
# Where libGL will look for DRI hardware drivers
|
||||
DRI_DRIVER_SEARCH_DIR = ${DRI_DRIVER_INSTALL_DIR}
|
||||
|
||||
# EGL driver install directory
|
||||
EGL_DRIVER_INSTALL_DIR = ${libdir}/egl
|
||||
|
||||
# Xorg driver install directory (for xorg state-tracker)
|
||||
XORG_DRIVER_INSTALL_DIR = ${exec_prefix}/lib/xorg/modules/drivers
|
||||
|
||||
# pkg-config substitutions
|
||||
GL_PC_REQ_PRIV =
|
||||
GL_PC_LIB_PRIV =
|
||||
GL_PC_CFLAGS =
|
||||
DRI_PC_REQ_PRIV =
|
||||
GLU_PC_REQ =
|
||||
GLU_PC_REQ_PRIV =
|
||||
GLU_PC_LIB_PRIV =
|
||||
GLU_PC_CFLAGS =
|
||||
GLUT_PC_REQ_PRIV =
|
||||
GLUT_PC_LIB_PRIV =
|
||||
GLUT_PC_CFLAGS =
|
||||
GLW_PC_REQ_PRIV =
|
||||
GLW_PC_LIB_PRIV =
|
||||
GLW_PC_CFLAGS =
|
||||
OSMESA_PC_REQ =
|
||||
OSMESA_PC_LIB_PRIV = -lm
|
||||
GLESv1_CM_PC_LIB_PRIV =
|
||||
GLESv2_PC_LIB_PRIV =
|
||||
EGL_PC_REQ_PRIV =
|
||||
EGL_PC_LIB_PRIV =
|
||||
EGL_PC_CFLAGS =
|
||||
|
||||
XCB_DRI2_CFLAGS =
|
||||
XCB_DRI2_LIBS =
|
||||
LIBUDEV_CFLAGS =
|
||||
LIBUDEV_LIBS =
|
||||
|
||||
MESA_LLVM = 0
|
||||
|
||||
LLVM_VERSION =
|
||||
ifneq ($(LLVM_VERSION),)
|
||||
HAVE_LLVM := 0x0$(subst .,0,$(LLVM_VERSION:svn=))
|
||||
DEFINES += -DHAVE_LLVM=$(HAVE_LLVM)
|
||||
endif
|
||||
|
||||
HAVE_XF86VIDMODE =
|
||||
@@ -1,161 +0,0 @@
|
||||
# Default/template configuration
|
||||
|
||||
# This is included by other config files which may override some
|
||||
# of these variables.
|
||||
# Think of this as a base class from which configs are derived.
|
||||
|
||||
|
||||
CONFIG_NAME = default
|
||||
|
||||
# Version info
|
||||
MESA_MAJOR=7
|
||||
MESA_MINOR=10
|
||||
MESA_TINY=0
|
||||
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
|
||||
|
||||
# external projects. This should be useless now that we use libdrm.
|
||||
DRM_SOURCE_PATH=$(TOP)/../drm
|
||||
|
||||
# Compiler and flags
|
||||
CC = cc
|
||||
CXX = CC
|
||||
HOST_CC = $(CC)
|
||||
CFLAGS = -O
|
||||
CXXFLAGS = -O
|
||||
LDFLAGS =
|
||||
HOST_CFLAGS = $(CFLAGS)
|
||||
GLU_CFLAGS =
|
||||
|
||||
# Compiler for building demos/tests/etc
|
||||
APP_CC = $(CC)
|
||||
APP_CXX = $(CXX)
|
||||
|
||||
# Misc tools and flags
|
||||
SHELL = /bin/sh
|
||||
MKLIB = $(SHELL) $(TOP)/bin/mklib
|
||||
MKLIB_OPTIONS =
|
||||
MKDEP = makedepend
|
||||
MKDEP_OPTIONS = -fdepend
|
||||
MAKE = make
|
||||
|
||||
# Use MINSTALL for installing libraries, INSTALL for everything else
|
||||
MINSTALL = $(SHELL) $(TOP)/bin/minstall
|
||||
INSTALL = $(MINSTALL)
|
||||
|
||||
# Tools for regenerating glapi (generally only needed by the developers)
|
||||
PYTHON2 = python
|
||||
PYTHON_FLAGS = -t -O -O
|
||||
INDENT = indent
|
||||
INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool
|
||||
|
||||
# Library names (base name)
|
||||
GL_LIB = GL
|
||||
GLU_LIB = GLU
|
||||
GLUT_LIB = glut
|
||||
GLW_LIB = GLw
|
||||
OSMESA_LIB = OSMesa
|
||||
EGL_LIB = EGL
|
||||
GLESv1_CM_LIB = GLESv1_CM
|
||||
GLESv2_LIB = GLESv2
|
||||
VG_LIB = OpenVG
|
||||
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = lib$(GL_LIB).so
|
||||
GLU_LIB_NAME = lib$(GLU_LIB).so
|
||||
GLUT_LIB_NAME = lib$(GLUT_LIB).so
|
||||
GLW_LIB_NAME = lib$(GLW_LIB).so
|
||||
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
|
||||
EGL_LIB_NAME = lib$(EGL_LIB).so
|
||||
GLESv1_CM_LIB_NAME = lib$(GLESv1_CM_LIB).so
|
||||
GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
|
||||
VG_LIB_NAME = lib$(VG_LIB).so
|
||||
|
||||
# globs used to install the lib and all symlinks
|
||||
GL_LIB_GLOB = $(GL_LIB_NAME)*
|
||||
GLU_LIB_GLOB = $(GLU_LIB_NAME)*
|
||||
GLUT_LIB_GLOB = $(GLUT_LIB_NAME)*
|
||||
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
|
||||
OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)*
|
||||
EGL_LIB_GLOB = $(EGL_LIB_NAME)*
|
||||
GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
|
||||
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
|
||||
VG_LIB_GLOB = $(VG_LIB_NAME)*
|
||||
|
||||
# Optional assembly language optimization files for libGL
|
||||
MESA_ASM_SOURCES =
|
||||
|
||||
# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in
|
||||
# order to build the Motif widget too)
|
||||
GLW_SOURCES = GLwDrawA.c
|
||||
MOTIF_CFLAGS = -I/usr/include/Motif1.2
|
||||
|
||||
|
||||
# Directories to build
|
||||
LIB_DIR = lib
|
||||
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
|
||||
gallium egl gallium/winsys gallium/targets glu glut/glx glw
|
||||
GLU_DIRS = sgi
|
||||
DRIVER_DIRS = x11 osmesa
|
||||
|
||||
DRIVER_DIRS = osmesa
|
||||
|
||||
|
||||
# Library dependencies
|
||||
#EXTRA_LIB_PATH ?=
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH)
|
||||
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -ldl -lpthread
|
||||
OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
|
||||
GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
|
||||
GLUT_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lm
|
||||
GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
|
||||
APP_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
||||
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
||||
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
||||
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
||||
|
||||
# Program dependencies - specific GL/glut libraries added in Makefiles
|
||||
APP_LIB_DEPS = -lm
|
||||
|
||||
|
||||
# Installation directories (for make install)
|
||||
INSTALL_DIR = /usr/local
|
||||
INSTALL_LIB_DIR = $(INSTALL_DIR)/$(LIB_DIR)
|
||||
INSTALL_INC_DIR = $(INSTALL_DIR)/include
|
||||
DRI_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/dri
|
||||
|
||||
# Where libGL will look for DRI hardware drivers
|
||||
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
|
||||
|
||||
# EGL driver install directory
|
||||
EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl
|
||||
|
||||
# Xorg driver install directory (for xorg state-tracker)
|
||||
XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
|
||||
|
||||
# pkg-config substitutions
|
||||
GL_PC_REQ_PRIV =
|
||||
GL_PC_LIB_PRIV =
|
||||
GL_PC_CFLAGS =
|
||||
DRI_PC_REQ_PRIV =
|
||||
GLU_PC_REQ = gl
|
||||
GLU_PC_REQ_PRIV =
|
||||
GLU_PC_LIB_PRIV =
|
||||
GLU_PC_CFLAGS =
|
||||
GLUT_PC_REQ_PRIV =
|
||||
GLUT_PC_LIB_PRIV =
|
||||
GLUT_PC_CFLAGS =
|
||||
GLW_PC_REQ_PRIV =
|
||||
GLW_PC_LIB_PRIV =
|
||||
GLW_PC_CFLAGS =
|
||||
OSMESA_PC_REQ =
|
||||
OSMESA_PC_LIB_PRIV =
|
||||
GLESv1_CM_PC_REQ_PRIV =
|
||||
GLESv1_CM_PC_LIB_PRIV =
|
||||
GLESv1_CM_PC_CFLAGS =
|
||||
GLESv2_PC_REQ_PRIV =
|
||||
GLESv2_PC_LIB_PRIV =
|
||||
GLESv2_PC_CFLAGS =
|
||||
VG_PC_REQ_PRIV =
|
||||
VG_PC_LIB_PRIV =
|
||||
VG_PC_CFLAGS =
|
||||
@@ -1,329 +0,0 @@
|
||||
/* -*- mode: c; tab-width: 8; -*- */
|
||||
/* vi: set sw=4 ts=8: */
|
||||
/* Reference version of egl.h for EGL 1.4.
|
||||
* $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
|
||||
*/
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2009 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
#ifndef __egl_h_
|
||||
#define __egl_h_
|
||||
|
||||
/* All platform-dependent types and macro boilerplate (such as EGLAPI
|
||||
* and EGLAPIENTRY) should go in eglplatform.h.
|
||||
*/
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* EGL Types */
|
||||
/* EGLint is defined in eglplatform.h */
|
||||
typedef unsigned int EGLBoolean;
|
||||
typedef unsigned int EGLenum;
|
||||
typedef void *EGLConfig;
|
||||
typedef void *EGLContext;
|
||||
typedef void *EGLDisplay;
|
||||
typedef void *EGLSurface;
|
||||
typedef void *EGLClientBuffer;
|
||||
|
||||
/* EGL Versioning */
|
||||
#define EGL_VERSION_1_0 1
|
||||
#define EGL_VERSION_1_1 1
|
||||
#define EGL_VERSION_1_2 1
|
||||
#define EGL_VERSION_1_3 1
|
||||
#define EGL_VERSION_1_4 1
|
||||
|
||||
/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
|
||||
* enums are assigned unique values starting at 0x3000.
|
||||
*/
|
||||
|
||||
/* EGL aliases */
|
||||
#define EGL_FALSE 0
|
||||
#define EGL_TRUE 1
|
||||
|
||||
/* Out-of-band handle values */
|
||||
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
|
||||
#define EGL_NO_CONTEXT ((EGLContext)0)
|
||||
#define EGL_NO_DISPLAY ((EGLDisplay)0)
|
||||
#define EGL_NO_SURFACE ((EGLSurface)0)
|
||||
|
||||
/* Out-of-band attribute value */
|
||||
#define EGL_DONT_CARE ((EGLint)-1)
|
||||
|
||||
/* Errors / GetError return values */
|
||||
#define EGL_SUCCESS 0x3000
|
||||
#define EGL_NOT_INITIALIZED 0x3001
|
||||
#define EGL_BAD_ACCESS 0x3002
|
||||
#define EGL_BAD_ALLOC 0x3003
|
||||
#define EGL_BAD_ATTRIBUTE 0x3004
|
||||
#define EGL_BAD_CONFIG 0x3005
|
||||
#define EGL_BAD_CONTEXT 0x3006
|
||||
#define EGL_BAD_CURRENT_SURFACE 0x3007
|
||||
#define EGL_BAD_DISPLAY 0x3008
|
||||
#define EGL_BAD_MATCH 0x3009
|
||||
#define EGL_BAD_NATIVE_PIXMAP 0x300A
|
||||
#define EGL_BAD_NATIVE_WINDOW 0x300B
|
||||
#define EGL_BAD_PARAMETER 0x300C
|
||||
#define EGL_BAD_SURFACE 0x300D
|
||||
#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */
|
||||
|
||||
/* Reserved 0x300F-0x301F for additional errors */
|
||||
|
||||
/* Config attributes */
|
||||
#define EGL_BUFFER_SIZE 0x3020
|
||||
#define EGL_ALPHA_SIZE 0x3021
|
||||
#define EGL_BLUE_SIZE 0x3022
|
||||
#define EGL_GREEN_SIZE 0x3023
|
||||
#define EGL_RED_SIZE 0x3024
|
||||
#define EGL_DEPTH_SIZE 0x3025
|
||||
#define EGL_STENCIL_SIZE 0x3026
|
||||
#define EGL_CONFIG_CAVEAT 0x3027
|
||||
#define EGL_CONFIG_ID 0x3028
|
||||
#define EGL_LEVEL 0x3029
|
||||
#define EGL_MAX_PBUFFER_HEIGHT 0x302A
|
||||
#define EGL_MAX_PBUFFER_PIXELS 0x302B
|
||||
#define EGL_MAX_PBUFFER_WIDTH 0x302C
|
||||
#define EGL_NATIVE_RENDERABLE 0x302D
|
||||
#define EGL_NATIVE_VISUAL_ID 0x302E
|
||||
#define EGL_NATIVE_VISUAL_TYPE 0x302F
|
||||
#define EGL_SAMPLES 0x3031
|
||||
#define EGL_SAMPLE_BUFFERS 0x3032
|
||||
#define EGL_SURFACE_TYPE 0x3033
|
||||
#define EGL_TRANSPARENT_TYPE 0x3034
|
||||
#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
|
||||
#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
|
||||
#define EGL_TRANSPARENT_RED_VALUE 0x3037
|
||||
#define EGL_NONE 0x3038 /* Attrib list terminator */
|
||||
#define EGL_BIND_TO_TEXTURE_RGB 0x3039
|
||||
#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
|
||||
#define EGL_MIN_SWAP_INTERVAL 0x303B
|
||||
#define EGL_MAX_SWAP_INTERVAL 0x303C
|
||||
#define EGL_LUMINANCE_SIZE 0x303D
|
||||
#define EGL_ALPHA_MASK_SIZE 0x303E
|
||||
#define EGL_COLOR_BUFFER_TYPE 0x303F
|
||||
#define EGL_RENDERABLE_TYPE 0x3040
|
||||
#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */
|
||||
#define EGL_CONFORMANT 0x3042
|
||||
|
||||
/* Reserved 0x3041-0x304F for additional config attributes */
|
||||
|
||||
/* Config attribute values */
|
||||
#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
|
||||
#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */
|
||||
#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
|
||||
#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */
|
||||
#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */
|
||||
|
||||
/* More config attribute values, for EGL_TEXTURE_FORMAT */
|
||||
#define EGL_NO_TEXTURE 0x305C
|
||||
#define EGL_TEXTURE_RGB 0x305D
|
||||
#define EGL_TEXTURE_RGBA 0x305E
|
||||
#define EGL_TEXTURE_2D 0x305F
|
||||
|
||||
/* Config attribute mask bits */
|
||||
#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */
|
||||
|
||||
#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */
|
||||
#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */
|
||||
#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */
|
||||
#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */
|
||||
|
||||
/* QueryString targets */
|
||||
#define EGL_VENDOR 0x3053
|
||||
#define EGL_VERSION 0x3054
|
||||
#define EGL_EXTENSIONS 0x3055
|
||||
#define EGL_CLIENT_APIS 0x308D
|
||||
|
||||
/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
|
||||
#define EGL_HEIGHT 0x3056
|
||||
#define EGL_WIDTH 0x3057
|
||||
#define EGL_LARGEST_PBUFFER 0x3058
|
||||
#define EGL_TEXTURE_FORMAT 0x3080
|
||||
#define EGL_TEXTURE_TARGET 0x3081
|
||||
#define EGL_MIPMAP_TEXTURE 0x3082
|
||||
#define EGL_MIPMAP_LEVEL 0x3083
|
||||
#define EGL_RENDER_BUFFER 0x3086
|
||||
#define EGL_VG_COLORSPACE 0x3087
|
||||
#define EGL_VG_ALPHA_FORMAT 0x3088
|
||||
#define EGL_HORIZONTAL_RESOLUTION 0x3090
|
||||
#define EGL_VERTICAL_RESOLUTION 0x3091
|
||||
#define EGL_PIXEL_ASPECT_RATIO 0x3092
|
||||
#define EGL_SWAP_BEHAVIOR 0x3093
|
||||
#define EGL_MULTISAMPLE_RESOLVE 0x3099
|
||||
|
||||
/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
|
||||
#define EGL_BACK_BUFFER 0x3084
|
||||
#define EGL_SINGLE_BUFFER 0x3085
|
||||
|
||||
/* OpenVG color spaces */
|
||||
#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */
|
||||
#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */
|
||||
|
||||
/* OpenVG alpha formats */
|
||||
#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */
|
||||
|
||||
/* Constant scale factor by which fractional display resolutions &
|
||||
* aspect ratio are scaled when queried as integer values.
|
||||
*/
|
||||
#define EGL_DISPLAY_SCALING 10000
|
||||
|
||||
/* Unknown display resolution/aspect ratio */
|
||||
#define EGL_UNKNOWN ((EGLint)-1)
|
||||
|
||||
/* Back buffer swap behaviors */
|
||||
#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */
|
||||
#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */
|
||||
|
||||
/* CreatePbufferFromClientBuffer buffer types */
|
||||
#define EGL_OPENVG_IMAGE 0x3096
|
||||
|
||||
/* QueryContext targets */
|
||||
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
|
||||
|
||||
/* CreateContext attributes */
|
||||
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
|
||||
|
||||
/* Multisample resolution behaviors */
|
||||
#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */
|
||||
#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */
|
||||
|
||||
/* BindAPI/QueryAPI targets */
|
||||
#define EGL_OPENGL_ES_API 0x30A0
|
||||
#define EGL_OPENVG_API 0x30A1
|
||||
#define EGL_OPENGL_API 0x30A2
|
||||
|
||||
/* GetCurrentSurface targets */
|
||||
#define EGL_DRAW 0x3059
|
||||
#define EGL_READ 0x305A
|
||||
|
||||
/* WaitNative engines */
|
||||
#define EGL_CORE_NATIVE_ENGINE 0x305B
|
||||
|
||||
/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */
|
||||
#define EGL_COLORSPACE EGL_VG_COLORSPACE
|
||||
#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT
|
||||
#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB
|
||||
#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR
|
||||
#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE
|
||||
#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE
|
||||
|
||||
/* EGL extensions must request enum blocks from the Khronos
|
||||
* API Registrar, who maintains the enumerant registry. Submit
|
||||
* a bug in Khronos Bugzilla against task "Registry".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* EGL Functions */
|
||||
|
||||
EGLAPI EGLint EGLAPIENTRY eglGetError(void);
|
||||
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
|
||||
|
||||
EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs,
|
||||
EGLint config_size, EGLint *num_config);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list,
|
||||
EGLConfig *configs, EGLint config_size,
|
||||
EGLint *num_config);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
|
||||
EGLint attribute, EGLint *value);
|
||||
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
|
||||
EGLNativeWindowType win,
|
||||
const EGLint *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
|
||||
const EGLint *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
|
||||
EGLNativePixmapType pixmap,
|
||||
const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface,
|
||||
EGLint attribute, EGLint *value);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api);
|
||||
EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void);
|
||||
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(
|
||||
EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
|
||||
EGLConfig config, const EGLint *attrib_list);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface,
|
||||
EGLint attribute, EGLint value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
|
||||
|
||||
|
||||
EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config,
|
||||
EGLContext share_context,
|
||||
const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw,
|
||||
EGLSurface read, EGLContext ctx);
|
||||
|
||||
EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx,
|
||||
EGLint attribute, EGLint *value);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
|
||||
EGLNativePixmapType target);
|
||||
|
||||
/* This is a generic function pointer type, whose name indicates it must
|
||||
* be cast to the proper type *and calling convention* before use.
|
||||
*/
|
||||
typedef void (*__eglMustCastToProperFunctionPointerType)(void);
|
||||
|
||||
/* Now, define eglGetProcAddress using the generic function ptr. type */
|
||||
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY
|
||||
eglGetProcAddress(const char *procname);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __egl_h_ */
|
||||
@@ -1,384 +0,0 @@
|
||||
#ifndef __eglext_h_
|
||||
#define __eglext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2010 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number */
|
||||
/* Current version at http://www.khronos.org/registry/egl/ */
|
||||
/* $Revision: 12124 $ on $Date: 2010-07-27 20:12:35 -0700 (Tue, 27 Jul 2010) $ */
|
||||
#define EGL_EGLEXT_VERSION 7
|
||||
|
||||
#ifndef EGL_KHR_config_attribs
|
||||
#define EGL_KHR_config_attribs 1
|
||||
#define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */
|
||||
#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_lock_surface
|
||||
#define EGL_KHR_lock_surface 1
|
||||
#define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
|
||||
#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
|
||||
#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */
|
||||
#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */
|
||||
#define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */
|
||||
#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */
|
||||
#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */
|
||||
#define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */
|
||||
#define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */
|
||||
#define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_image
|
||||
#define EGL_KHR_image 1
|
||||
#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */
|
||||
typedef void *EGLImageKHR;
|
||||
#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_vg_parent_image
|
||||
#define EGL_KHR_vg_parent_image 1
|
||||
#define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_texture_2D_image
|
||||
#define EGL_KHR_gl_texture_2D_image 1
|
||||
#define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_texture_cubemap_image
|
||||
#define EGL_KHR_gl_texture_cubemap_image 1
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_texture_3D_image
|
||||
#define EGL_KHR_gl_texture_3D_image 1
|
||||
#define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_renderbuffer_image
|
||||
#define EGL_KHR_gl_renderbuffer_image 1
|
||||
#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_MESA_drm_image
|
||||
#define EGL_MESA_drm_image 1
|
||||
#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 /* eglCreateImageKHR attribute */
|
||||
#define EGL_DRM_BUFFER_USE_MESA 0x31D1
|
||||
|
||||
/* EGL_DRM_BUFFER_FORMAT_MESA tokens */
|
||||
#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2
|
||||
|
||||
/* EGL_DRM_BUFFER_USE_MESA bits */
|
||||
#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001
|
||||
#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002
|
||||
|
||||
#define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */
|
||||
#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 /* eglCreateImageKHR attribute */
|
||||
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA(EGLDisplay dpy, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
|
||||
#endif
|
||||
typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESA) (EGLDisplay dpy, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESA) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */
|
||||
#ifndef EGL_KHR_reusable_sync
|
||||
#define EGL_KHR_reusable_sync 1
|
||||
|
||||
typedef void* EGLSyncKHR;
|
||||
typedef khronos_utime_nanoseconds_t EGLTimeKHR;
|
||||
|
||||
#define EGL_SYNC_STATUS_KHR 0x30F1
|
||||
#define EGL_SIGNALED_KHR 0x30F2
|
||||
#define EGL_UNSIGNALED_KHR 0x30F3
|
||||
#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5
|
||||
#define EGL_CONDITION_SATISFIED_KHR 0x30F6
|
||||
#define EGL_SYNC_TYPE_KHR 0x30F7
|
||||
#define EGL_SYNC_REUSABLE_KHR 0x30FA
|
||||
#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 /* eglClientWaitSyncKHR <flags> bitfield */
|
||||
#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull
|
||||
#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0)
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
|
||||
EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* EGL_MESA_screen extension >>> PRELIMINARY <<< */
|
||||
#ifndef EGL_MESA_screen_surface
|
||||
#define EGL_MESA_screen_surface 1
|
||||
|
||||
#define EGL_BAD_SCREEN_MESA 0x4000
|
||||
#define EGL_BAD_MODE_MESA 0x4001
|
||||
#define EGL_SCREEN_COUNT_MESA 0x4002
|
||||
#define EGL_SCREEN_POSITION_MESA 0x4003
|
||||
#define EGL_SCREEN_POSITION_GRANULARITY_MESA 0x4004
|
||||
#define EGL_MODE_ID_MESA 0x4005
|
||||
#define EGL_REFRESH_RATE_MESA 0x4006
|
||||
#define EGL_OPTIMAL_MESA 0x4007
|
||||
#define EGL_INTERLACED_MESA 0x4008
|
||||
#define EGL_SCREEN_BIT_MESA 0x08
|
||||
|
||||
typedef khronos_uint32_t EGLScreenMESA;
|
||||
typedef khronos_uint32_t EGLModeMESA;
|
||||
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
|
||||
EGLAPI const char * EGLAPIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSEMODEMESA) (EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETMODESMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGetModeATTRIBMESA) (EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSCRREENSMESA) (EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESCREENSURFACEMESA) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSHOWSCREENSURFACEMESA) (EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSCREENPOSIITONMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENSURFACEMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENMODEMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
|
||||
typedef const char * (EGLAPIENTRYP PFNEGLQUERYMODESTRINGMESA) (EGLDisplay dpy, EGLModeMESA mode);
|
||||
|
||||
#endif /* EGL_MESA_screen_surface */
|
||||
|
||||
|
||||
#ifndef EGL_MESA_copy_context
|
||||
#define EGL_MESA_copy_context 1
|
||||
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYCONTEXTMESA) (EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
|
||||
|
||||
#endif /* EGL_MESA_copy_context */
|
||||
|
||||
#ifndef EGL_MESA_drm_display
|
||||
#define EGL_MESA_drm_display 1
|
||||
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetDRMDisplayMESA(int fd);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
|
||||
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDRMDISPLAYMESA) (int fd);
|
||||
|
||||
#endif /* EGL_MESA_drm_display */
|
||||
|
||||
#ifndef EGL_KHR_image_base
|
||||
#define EGL_KHR_image_base 1
|
||||
/* Most interfaces defined by EGL_KHR_image_pixmap above */
|
||||
#define EGL_IMAGE_PRESERVED_KHR 0x30D2 /* eglCreateImageKHR attribute */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_image_pixmap
|
||||
#define EGL_KHR_image_pixmap 1
|
||||
/* Interfaces defined by EGL_KHR_image above */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_IMG_context_priority
|
||||
#define EGL_IMG_context_priority 1
|
||||
#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100
|
||||
#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101
|
||||
#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102
|
||||
#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_lock_surface2
|
||||
#define EGL_KHR_lock_surface2 1
|
||||
#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_coverage_sample
|
||||
#define EGL_NV_coverage_sample 1
|
||||
#define EGL_COVERAGE_BUFFERS_NV 0x30E0
|
||||
#define EGL_COVERAGE_SAMPLES_NV 0x30E1
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_depth_nonlinear
|
||||
#define EGL_NV_depth_nonlinear 1
|
||||
#define EGL_DEPTH_ENCODING_NV 0x30E2
|
||||
#define EGL_DEPTH_ENCODING_NONE_NV 0
|
||||
#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLTimeNV requires 64-bit uint support */
|
||||
#ifndef EGL_NV_sync
|
||||
#define EGL_NV_sync 1
|
||||
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6
|
||||
#define EGL_SYNC_STATUS_NV 0x30E7
|
||||
#define EGL_SIGNALED_NV 0x30E8
|
||||
#define EGL_UNSIGNALED_NV 0x30E9
|
||||
#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001
|
||||
#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull
|
||||
#define EGL_ALREADY_SIGNALED_NV 0x30EA
|
||||
#define EGL_TIMEOUT_EXPIRED_NV 0x30EB
|
||||
#define EGL_CONDITION_SATISFIED_NV 0x30EC
|
||||
#define EGL_SYNC_TYPE_NV 0x30ED
|
||||
#define EGL_SYNC_CONDITION_NV 0x30EE
|
||||
#define EGL_SYNC_FENCE_NV 0x30EF
|
||||
#define EGL_NO_SYNC_NV ((EGLSyncNV)0)
|
||||
typedef void* EGLSyncNV;
|
||||
typedef khronos_utime_nanoseconds_t EGLTimeNV;
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
|
||||
EGLBoolean eglDestroySyncNV (EGLSyncNV sync);
|
||||
EGLBoolean eglFenceNV (EGLSyncNV sync);
|
||||
EGLint eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
|
||||
EGLBoolean eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
|
||||
EGLBoolean eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */
|
||||
#ifndef EGL_KHR_fence_sync
|
||||
#define EGL_KHR_fence_sync 1
|
||||
/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */
|
||||
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
|
||||
#define EGL_SYNC_CONDITION_KHR 0x30F8
|
||||
#define EGL_SYNC_FENCE_KHR 0x30F9
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EGL_HI_clientpixmap
|
||||
#define EGL_HI_clientpixmap 1
|
||||
|
||||
/* Surface Attribute */
|
||||
#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74
|
||||
/*
|
||||
* Structure representing a client pixmap
|
||||
* (pixmap's data is in client-space memory).
|
||||
*/
|
||||
struct EGLClientPixmapHI
|
||||
{
|
||||
void* pData;
|
||||
EGLint iWidth;
|
||||
EGLint iHeight;
|
||||
EGLint iStride;
|
||||
};
|
||||
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
|
||||
#endif /* EGL_HI_clientpixmap */
|
||||
|
||||
#ifndef EGL_HI_colorformats
|
||||
#define EGL_HI_colorformats 1
|
||||
/* Config Attribute */
|
||||
#define EGL_COLOR_FORMAT_HI 0x8F70
|
||||
/* Color Formats */
|
||||
#define EGL_COLOR_RGB_HI 0x8F71
|
||||
#define EGL_COLOR_RGBA_HI 0x8F72
|
||||
#define EGL_COLOR_ARGB_HI 0x8F73
|
||||
#endif /* EGL_HI_colorformats */
|
||||
|
||||
#ifndef EGL_NOK_swap_region
|
||||
#define EGL_NOK_swap_region 1
|
||||
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects);
|
||||
#endif
|
||||
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef EGL_NOK_texture_from_pixmap
|
||||
#define EGL_NOK_texture_from_pixmap 1
|
||||
|
||||
#define EGL_Y_INVERTED_NOK 0x307F
|
||||
#endif /* EGL_NOK_texture_from_pixmap */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,120 +0,0 @@
|
||||
#ifndef __eglplatform_h_
|
||||
#define __eglplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2009 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for egl.h
|
||||
* $Revision: 9724 $ on $Date: 2009-12-02 02:05:33 -0800 (Wed, 02 Dec 2009) $
|
||||
*
|
||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||
* You are encouraged to submit all modifications to the Khronos group so that
|
||||
* they can be included in future versions of this file. Please submit changes
|
||||
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
|
||||
* by filing a bug against product "EGL" component "Registry".
|
||||
*/
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
/* Macros used in EGL function prototype declarations.
|
||||
*
|
||||
* EGL functions should be prototyped as:
|
||||
*
|
||||
* EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
|
||||
* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
|
||||
*
|
||||
* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
|
||||
*/
|
||||
|
||||
#ifndef EGLAPI
|
||||
#define EGLAPI KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
#ifndef EGLAPIENTRY
|
||||
#define EGLAPIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
#define EGLAPIENTRYP EGLAPIENTRY*
|
||||
|
||||
/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
|
||||
* are aliases of window-system-dependent types, such as X Display * or
|
||||
* Windows Device Context. They must be defined in platform-specific
|
||||
* code below. The EGL-prefixed versions of Native*Type are the same
|
||||
* types, renamed in EGL 1.3 so all types in the API start with "EGL".
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
typedef HDC EGLNativeDisplayType;
|
||||
typedef HBITMAP EGLNativePixmapType;
|
||||
typedef HWND EGLNativeWindowType;
|
||||
|
||||
#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
|
||||
|
||||
typedef int EGLNativeDisplayType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
typedef void *EGLNativePixmapType;
|
||||
|
||||
#elif defined(__unix__) || defined(__unix)
|
||||
|
||||
#ifdef MESA_EGL_NO_X11_HEADERS
|
||||
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef khronos_uint32_t EGLNativePixmapType;
|
||||
typedef khronos_uint32_t EGLNativeWindowType;
|
||||
|
||||
#else
|
||||
|
||||
/* X11 (tentative) */
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
typedef Display *EGLNativeDisplayType;
|
||||
typedef Pixmap EGLNativePixmapType;
|
||||
typedef Window EGLNativeWindowType;
|
||||
|
||||
#endif /* MESA_EGL_NO_X11_HEADERS */
|
||||
|
||||
#else
|
||||
#error "Platform not recognized"
|
||||
#endif
|
||||
|
||||
/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
|
||||
typedef EGLNativeDisplayType NativeDisplayType;
|
||||
typedef EGLNativePixmapType NativePixmapType;
|
||||
typedef EGLNativeWindowType NativeWindowType;
|
||||
|
||||
|
||||
/* Define EGLint. This must be a signed integral type large enough to contain
|
||||
* all legal attribute names and values passed into and out of EGL, whether
|
||||
* their type is boolean, bitmask, enumerant (symbolic constant), integer,
|
||||
* handle, or other. While in general a 32-bit integer will suffice, if
|
||||
* handles are 64 bit types, then EGLint should be defined as a signed 64-bit
|
||||
* integer type.
|
||||
*/
|
||||
typedef khronos_int32_t EGLint;
|
||||
|
||||
#endif /* __eglplatform_h */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,152 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GLFBDEV_H
|
||||
#define GLFBDEV_H
|
||||
|
||||
|
||||
/* for size_t */
|
||||
#include <stdlib.h>
|
||||
|
||||
/* avoid including linux/fb.h */
|
||||
struct fb_fix_screeninfo;
|
||||
struct fb_var_screeninfo;
|
||||
|
||||
|
||||
/* public types */
|
||||
typedef struct GLFBDevVisualRec *GLFBDevVisualPtr;
|
||||
typedef struct GLFBDevBufferRec *GLFBDevBufferPtr;
|
||||
typedef struct GLFBDevContextRec *GLFBDevContextPtr;
|
||||
|
||||
|
||||
/* API version */
|
||||
#define GLFBDEV_VERSION_1_0 1
|
||||
|
||||
|
||||
/* For glFBDevCreateVisual */
|
||||
#define GLFBDEV_DOUBLE_BUFFER 100
|
||||
#define GLFBDEV_COLOR_INDEX 101
|
||||
#define GLFBDEV_DEPTH_SIZE 102
|
||||
#define GLFBDEV_STENCIL_SIZE 103
|
||||
#define GLFBDEV_ACCUM_SIZE 104
|
||||
#define GLFBDEV_LEVEL 105
|
||||
#define GLFBDEV_MULTISAMPLE 106
|
||||
#define GLFBDEV_NONE 0
|
||||
|
||||
/* For glFBDevGetString */
|
||||
#define GLFBDEV_VERSION 200
|
||||
#define GLFBDEV_VENDOR 201
|
||||
|
||||
|
||||
/* Misc functions */
|
||||
|
||||
extern const char *
|
||||
glFBDevGetString( int str );
|
||||
|
||||
|
||||
typedef void (*GLFBDevProc)();
|
||||
|
||||
|
||||
extern GLFBDevProc
|
||||
glFBDevGetProcAddress( const char *procName );
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a GLFBDevVisual.
|
||||
* \param fixInfo - needed to get the visual types, etc.
|
||||
* \param varInfo - needed to get the bits_per_pixel, etc.
|
||||
* \param attribs - for requesting depth, stencil, accum buffers, etc.
|
||||
*/
|
||||
extern GLFBDevVisualPtr
|
||||
glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
|
||||
const struct fb_var_screeninfo *varInfo,
|
||||
const int *attribs );
|
||||
|
||||
extern void
|
||||
glFBDevDestroyVisual( GLFBDevVisualPtr visual );
|
||||
|
||||
extern int
|
||||
glFBDevGetVisualAttrib( const GLFBDevVisualPtr visual, int attrib);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a GLFBDevBuffer.
|
||||
* \param fixInfo, varInfo - needed in order to get the screen size
|
||||
* (resolution), etc.
|
||||
* \param visual - as returned by glFBDevCreateVisual()
|
||||
* \param frontBuffer - address of front color buffer
|
||||
* \param backBuffer - address of back color buffer (may be NULL)
|
||||
* \param size - size of the color buffer(s) in bytes.
|
||||
*/
|
||||
extern GLFBDevBufferPtr
|
||||
glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo,
|
||||
const struct fb_var_screeninfo *varInfo,
|
||||
const GLFBDevVisualPtr visual,
|
||||
void *frontBuffer, void *backBuffer, size_t size );
|
||||
|
||||
extern void
|
||||
glFBDevDestroyBuffer( GLFBDevBufferPtr buffer );
|
||||
|
||||
extern int
|
||||
glFBDevGetBufferAttrib( const GLFBDevBufferPtr buffer, int attrib);
|
||||
|
||||
extern GLFBDevBufferPtr
|
||||
glFBDevGetCurrentDrawBuffer( void );
|
||||
|
||||
extern GLFBDevBufferPtr
|
||||
glFBDevGetCurrentReadBuffer( void );
|
||||
|
||||
extern void
|
||||
glFBDevSwapBuffers( GLFBDevBufferPtr buffer );
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a GLFBDevContext.
|
||||
* \param visual - as created by glFBDevCreateVisual.
|
||||
* \param share - specifies another context with which to share textures,
|
||||
* display lists, etc. (may be NULL).
|
||||
*/
|
||||
extern GLFBDevContextPtr
|
||||
glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share );
|
||||
|
||||
extern void
|
||||
glFBDevDestroyContext( GLFBDevContextPtr context );
|
||||
|
||||
extern int
|
||||
glFBDevGetContextAttrib( const GLFBDevContextPtr context, int attrib);
|
||||
|
||||
extern GLFBDevContextPtr
|
||||
glFBDevGetCurrentContext( void );
|
||||
|
||||
extern int
|
||||
glFBDevMakeCurrent( GLFBDevContextPtr context,
|
||||
GLFBDevBufferPtr drawBuffer,
|
||||
GLFBDevBufferPtr readBuffer );
|
||||
|
||||
|
||||
#endif /* GLFBDEV_H */
|
||||
@@ -1,353 +0,0 @@
|
||||
/*
|
||||
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
|
||||
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice including the dates of first publication and
|
||||
* either this permission notice or a reference to
|
||||
* http://oss.sgi.com/projects/FreeB/
|
||||
* shall be included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* Except as contained in this notice, the name of Silicon Graphics, Inc.
|
||||
* shall not be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in this Software without prior written authorization from
|
||||
* Silicon Graphics, Inc.
|
||||
*/
|
||||
|
||||
#ifndef __glu_h__
|
||||
#define __glu_h__
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#include "glu_mangle.h"
|
||||
#endif
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#ifndef GLAPIENTRY
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#define GLAPIENTRY __stdcall
|
||||
#else
|
||||
#define GLAPIENTRY
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef GLAPIENTRYP
|
||||
#define GLAPIENTRYP GLAPIENTRY *
|
||||
#endif
|
||||
|
||||
#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
|
||||
# undef GLAPI
|
||||
# define GLAPI __declspec(dllexport)
|
||||
#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL)
|
||||
/* tag specifying we're building for DLL runtime support */
|
||||
# undef GLAPI
|
||||
# define GLAPI __declspec(dllimport)
|
||||
#elif !defined(GLAPI)
|
||||
/* for use with static link lib build of Win32 edition only */
|
||||
# define GLAPI extern
|
||||
#endif /* _STATIC_MESA support */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Extensions */
|
||||
#define GLU_EXT_object_space_tess 1
|
||||
#define GLU_EXT_nurbs_tessellator 1
|
||||
|
||||
/* Boolean */
|
||||
#define GLU_FALSE 0
|
||||
#define GLU_TRUE 1
|
||||
|
||||
/* Version */
|
||||
#define GLU_VERSION_1_1 1
|
||||
#define GLU_VERSION_1_2 1
|
||||
#define GLU_VERSION_1_3 1
|
||||
|
||||
/* StringName */
|
||||
#define GLU_VERSION 100800
|
||||
#define GLU_EXTENSIONS 100801
|
||||
|
||||
/* ErrorCode */
|
||||
#define GLU_INVALID_ENUM 100900
|
||||
#define GLU_INVALID_VALUE 100901
|
||||
#define GLU_OUT_OF_MEMORY 100902
|
||||
#define GLU_INCOMPATIBLE_GL_VERSION 100903
|
||||
#define GLU_INVALID_OPERATION 100904
|
||||
|
||||
/* NurbsDisplay */
|
||||
/* GLU_FILL */
|
||||
#define GLU_OUTLINE_POLYGON 100240
|
||||
#define GLU_OUTLINE_PATCH 100241
|
||||
|
||||
/* NurbsCallback */
|
||||
#define GLU_NURBS_ERROR 100103
|
||||
#define GLU_ERROR 100103
|
||||
#define GLU_NURBS_BEGIN 100164
|
||||
#define GLU_NURBS_BEGIN_EXT 100164
|
||||
#define GLU_NURBS_VERTEX 100165
|
||||
#define GLU_NURBS_VERTEX_EXT 100165
|
||||
#define GLU_NURBS_NORMAL 100166
|
||||
#define GLU_NURBS_NORMAL_EXT 100166
|
||||
#define GLU_NURBS_COLOR 100167
|
||||
#define GLU_NURBS_COLOR_EXT 100167
|
||||
#define GLU_NURBS_TEXTURE_COORD 100168
|
||||
#define GLU_NURBS_TEX_COORD_EXT 100168
|
||||
#define GLU_NURBS_END 100169
|
||||
#define GLU_NURBS_END_EXT 100169
|
||||
#define GLU_NURBS_BEGIN_DATA 100170
|
||||
#define GLU_NURBS_BEGIN_DATA_EXT 100170
|
||||
#define GLU_NURBS_VERTEX_DATA 100171
|
||||
#define GLU_NURBS_VERTEX_DATA_EXT 100171
|
||||
#define GLU_NURBS_NORMAL_DATA 100172
|
||||
#define GLU_NURBS_NORMAL_DATA_EXT 100172
|
||||
#define GLU_NURBS_COLOR_DATA 100173
|
||||
#define GLU_NURBS_COLOR_DATA_EXT 100173
|
||||
#define GLU_NURBS_TEXTURE_COORD_DATA 100174
|
||||
#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
|
||||
#define GLU_NURBS_END_DATA 100175
|
||||
#define GLU_NURBS_END_DATA_EXT 100175
|
||||
|
||||
/* NurbsError */
|
||||
#define GLU_NURBS_ERROR1 100251
|
||||
#define GLU_NURBS_ERROR2 100252
|
||||
#define GLU_NURBS_ERROR3 100253
|
||||
#define GLU_NURBS_ERROR4 100254
|
||||
#define GLU_NURBS_ERROR5 100255
|
||||
#define GLU_NURBS_ERROR6 100256
|
||||
#define GLU_NURBS_ERROR7 100257
|
||||
#define GLU_NURBS_ERROR8 100258
|
||||
#define GLU_NURBS_ERROR9 100259
|
||||
#define GLU_NURBS_ERROR10 100260
|
||||
#define GLU_NURBS_ERROR11 100261
|
||||
#define GLU_NURBS_ERROR12 100262
|
||||
#define GLU_NURBS_ERROR13 100263
|
||||
#define GLU_NURBS_ERROR14 100264
|
||||
#define GLU_NURBS_ERROR15 100265
|
||||
#define GLU_NURBS_ERROR16 100266
|
||||
#define GLU_NURBS_ERROR17 100267
|
||||
#define GLU_NURBS_ERROR18 100268
|
||||
#define GLU_NURBS_ERROR19 100269
|
||||
#define GLU_NURBS_ERROR20 100270
|
||||
#define GLU_NURBS_ERROR21 100271
|
||||
#define GLU_NURBS_ERROR22 100272
|
||||
#define GLU_NURBS_ERROR23 100273
|
||||
#define GLU_NURBS_ERROR24 100274
|
||||
#define GLU_NURBS_ERROR25 100275
|
||||
#define GLU_NURBS_ERROR26 100276
|
||||
#define GLU_NURBS_ERROR27 100277
|
||||
#define GLU_NURBS_ERROR28 100278
|
||||
#define GLU_NURBS_ERROR29 100279
|
||||
#define GLU_NURBS_ERROR30 100280
|
||||
#define GLU_NURBS_ERROR31 100281
|
||||
#define GLU_NURBS_ERROR32 100282
|
||||
#define GLU_NURBS_ERROR33 100283
|
||||
#define GLU_NURBS_ERROR34 100284
|
||||
#define GLU_NURBS_ERROR35 100285
|
||||
#define GLU_NURBS_ERROR36 100286
|
||||
#define GLU_NURBS_ERROR37 100287
|
||||
|
||||
/* NurbsProperty */
|
||||
#define GLU_AUTO_LOAD_MATRIX 100200
|
||||
#define GLU_CULLING 100201
|
||||
#define GLU_SAMPLING_TOLERANCE 100203
|
||||
#define GLU_DISPLAY_MODE 100204
|
||||
#define GLU_PARAMETRIC_TOLERANCE 100202
|
||||
#define GLU_SAMPLING_METHOD 100205
|
||||
#define GLU_U_STEP 100206
|
||||
#define GLU_V_STEP 100207
|
||||
#define GLU_NURBS_MODE 100160
|
||||
#define GLU_NURBS_MODE_EXT 100160
|
||||
#define GLU_NURBS_TESSELLATOR 100161
|
||||
#define GLU_NURBS_TESSELLATOR_EXT 100161
|
||||
#define GLU_NURBS_RENDERER 100162
|
||||
#define GLU_NURBS_RENDERER_EXT 100162
|
||||
|
||||
/* NurbsSampling */
|
||||
#define GLU_OBJECT_PARAMETRIC_ERROR 100208
|
||||
#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
|
||||
#define GLU_OBJECT_PATH_LENGTH 100209
|
||||
#define GLU_OBJECT_PATH_LENGTH_EXT 100209
|
||||
#define GLU_PATH_LENGTH 100215
|
||||
#define GLU_PARAMETRIC_ERROR 100216
|
||||
#define GLU_DOMAIN_DISTANCE 100217
|
||||
|
||||
/* NurbsTrim */
|
||||
#define GLU_MAP1_TRIM_2 100210
|
||||
#define GLU_MAP1_TRIM_3 100211
|
||||
|
||||
/* QuadricDrawStyle */
|
||||
#define GLU_POINT 100010
|
||||
#define GLU_LINE 100011
|
||||
#define GLU_FILL 100012
|
||||
#define GLU_SILHOUETTE 100013
|
||||
|
||||
/* QuadricCallback */
|
||||
/* GLU_ERROR */
|
||||
|
||||
/* QuadricNormal */
|
||||
#define GLU_SMOOTH 100000
|
||||
#define GLU_FLAT 100001
|
||||
#define GLU_NONE 100002
|
||||
|
||||
/* QuadricOrientation */
|
||||
#define GLU_OUTSIDE 100020
|
||||
#define GLU_INSIDE 100021
|
||||
|
||||
/* TessCallback */
|
||||
#define GLU_TESS_BEGIN 100100
|
||||
#define GLU_BEGIN 100100
|
||||
#define GLU_TESS_VERTEX 100101
|
||||
#define GLU_VERTEX 100101
|
||||
#define GLU_TESS_END 100102
|
||||
#define GLU_END 100102
|
||||
#define GLU_TESS_ERROR 100103
|
||||
#define GLU_TESS_EDGE_FLAG 100104
|
||||
#define GLU_EDGE_FLAG 100104
|
||||
#define GLU_TESS_COMBINE 100105
|
||||
#define GLU_TESS_BEGIN_DATA 100106
|
||||
#define GLU_TESS_VERTEX_DATA 100107
|
||||
#define GLU_TESS_END_DATA 100108
|
||||
#define GLU_TESS_ERROR_DATA 100109
|
||||
#define GLU_TESS_EDGE_FLAG_DATA 100110
|
||||
#define GLU_TESS_COMBINE_DATA 100111
|
||||
|
||||
/* TessContour */
|
||||
#define GLU_CW 100120
|
||||
#define GLU_CCW 100121
|
||||
#define GLU_INTERIOR 100122
|
||||
#define GLU_EXTERIOR 100123
|
||||
#define GLU_UNKNOWN 100124
|
||||
|
||||
/* TessProperty */
|
||||
#define GLU_TESS_WINDING_RULE 100140
|
||||
#define GLU_TESS_BOUNDARY_ONLY 100141
|
||||
#define GLU_TESS_TOLERANCE 100142
|
||||
|
||||
/* TessError */
|
||||
#define GLU_TESS_ERROR1 100151
|
||||
#define GLU_TESS_ERROR2 100152
|
||||
#define GLU_TESS_ERROR3 100153
|
||||
#define GLU_TESS_ERROR4 100154
|
||||
#define GLU_TESS_ERROR5 100155
|
||||
#define GLU_TESS_ERROR6 100156
|
||||
#define GLU_TESS_ERROR7 100157
|
||||
#define GLU_TESS_ERROR8 100158
|
||||
#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
|
||||
#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
|
||||
#define GLU_TESS_MISSING_END_POLYGON 100153
|
||||
#define GLU_TESS_MISSING_END_CONTOUR 100154
|
||||
#define GLU_TESS_COORD_TOO_LARGE 100155
|
||||
#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
|
||||
|
||||
/* TessWinding */
|
||||
#define GLU_TESS_WINDING_ODD 100130
|
||||
#define GLU_TESS_WINDING_NONZERO 100131
|
||||
#define GLU_TESS_WINDING_POSITIVE 100132
|
||||
#define GLU_TESS_WINDING_NEGATIVE 100133
|
||||
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
class GLUnurbs;
|
||||
class GLUquadric;
|
||||
class GLUtesselator;
|
||||
#else
|
||||
typedef struct GLUnurbs GLUnurbs;
|
||||
typedef struct GLUquadric GLUquadric;
|
||||
typedef struct GLUtesselator GLUtesselator;
|
||||
#endif
|
||||
|
||||
typedef GLUnurbs GLUnurbsObj;
|
||||
typedef GLUquadric GLUquadricObj;
|
||||
typedef GLUtesselator GLUtesselatorObj;
|
||||
typedef GLUtesselator GLUtriangulatorObj;
|
||||
|
||||
#define GLU_TESS_MAX_COORD 1.0e150
|
||||
|
||||
/* Internal convenience typedefs */
|
||||
typedef void (GLAPIENTRYP _GLUfuncptr)();
|
||||
|
||||
GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb);
|
||||
GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
|
||||
GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
|
||||
GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
|
||||
GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad);
|
||||
GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
|
||||
GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb);
|
||||
GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb);
|
||||
GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
|
||||
GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
|
||||
GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
|
||||
GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
|
||||
GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
|
||||
GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
|
||||
GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void);
|
||||
GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void);
|
||||
GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
|
||||
GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
|
||||
GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
|
||||
GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
|
||||
GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
|
||||
GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
|
||||
GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
|
||||
GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
|
||||
GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
|
||||
GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
|
||||
GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
|
||||
GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
|
||||
GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
|
||||
GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
|
||||
GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);
|
||||
GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
|
||||
GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);
|
||||
GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
|
||||
GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
|
||||
GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
|
||||
GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
|
||||
GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
|
||||
GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
|
||||
GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
|
||||
GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
|
||||
GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __glu_h__ */
|
||||
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.0
|
||||
* Copyright (C) 1995-1998 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GLU_MANGLE_H
|
||||
#define GLU_MANGLE_H
|
||||
|
||||
|
||||
#define gluLookAt mgluLookAt
|
||||
#define gluOrtho2D mgluOrtho2D
|
||||
#define gluPerspective mgluPerspective
|
||||
#define gluPickMatrix mgluPickMatrix
|
||||
#define gluProject mgluProject
|
||||
#define gluUnProject mgluUnProject
|
||||
#define gluErrorString mgluErrorString
|
||||
#define gluScaleImage mgluScaleImage
|
||||
#define gluBuild1DMipmaps mgluBuild1DMipmaps
|
||||
#define gluBuild2DMipmaps mgluBuild2DMipmaps
|
||||
#define gluNewQuadric mgluNewQuadric
|
||||
#define gluDeleteQuadric mgluDeleteQuadric
|
||||
#define gluQuadricDrawStyle mgluQuadricDrawStyle
|
||||
#define gluQuadricOrientation mgluQuadricOrientation
|
||||
#define gluQuadricNormals mgluQuadricNormals
|
||||
#define gluQuadricTexture mgluQuadricTexture
|
||||
#define gluQuadricCallback mgluQuadricCallback
|
||||
#define gluCylinder mgluCylinder
|
||||
#define gluSphere mgluSphere
|
||||
#define gluDisk mgluDisk
|
||||
#define gluPartialDisk mgluPartialDisk
|
||||
#define gluNewNurbsRenderer mgluNewNurbsRenderer
|
||||
#define gluDeleteNurbsRenderer mgluDeleteNurbsRenderer
|
||||
#define gluLoadSamplingMatrices mgluLoadSamplingMatrices
|
||||
#define gluNurbsProperty mgluNurbsProperty
|
||||
#define gluGetNurbsProperty mgluGetNurbsProperty
|
||||
#define gluBeginCurve mgluBeginCurve
|
||||
#define gluEndCurve mgluEndCurve
|
||||
#define gluNurbsCurve mgluNurbsCurve
|
||||
#define gluBeginSurface mgluBeginSurface
|
||||
#define gluEndSurface mgluEndSurface
|
||||
#define gluNurbsSurface mgluNurbsSurface
|
||||
#define gluBeginTrim mgluBeginTrim
|
||||
#define gluEndTrim mgluEndTrim
|
||||
#define gluPwlCurve mgluPwlCurve
|
||||
#define gluNurbsCallback mgluNurbsCallback
|
||||
#define gluNewTess mgluNewTess
|
||||
#define gluDeleteTess mgluDeleteTess
|
||||
#define gluTessBeginPolygon mgluTessBeginPolygon
|
||||
#define gluTessBeginContour mgluTessBeginContour
|
||||
#define gluTessVertex mgluTessVertex
|
||||
#define gluTessEndPolygon mgluTessEndPolygon
|
||||
#define gluTessEndContour mgluTessEndContour
|
||||
#define gluTessProperty mgluTessProperty
|
||||
#define gluTessNormal mgluTessNormal
|
||||
#define gluTessCallback mgluTessCallback
|
||||
#define gluGetTessProperty mgluGetTessProperty
|
||||
#define gluBeginPolygon mgluBeginPolygon
|
||||
#define gluNextContour mgluNextContour
|
||||
#define gluEndPolygon mgluEndPolygon
|
||||
#define gluGetString mgluGetString
|
||||
#define gluBuild1DMipmapLevels mgluBuild1DMipmapLevels
|
||||
#define gluBuild2DMipmapLevels mgluBuild2DMipmapLevels
|
||||
#define gluBuild3DMipmapLevels mgluBuild3DMipmapLevels
|
||||
#define gluBuild3DMipmaps mgluBuild3DMipmaps
|
||||
#define gluCheckExtension mgluCheckExtension
|
||||
#define gluUnProject4 mgluUnProject4
|
||||
#define gluNurbsCallbackData mgluNurbsCallbackData
|
||||
#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT
|
||||
|
||||
#endif
|
||||
@@ -1,526 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GLX_H
|
||||
#define GLX_H
|
||||
|
||||
|
||||
#ifdef __VMS
|
||||
#include <GL/vms_x_fix.h>
|
||||
# ifdef __cplusplus
|
||||
/* VMS Xlib.h gives problems with C++.
|
||||
* this avoids a bunch of trivial warnings */
|
||||
#pragma message disable nosimpint
|
||||
#endif
|
||||
#endif
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#ifdef __VMS
|
||||
# ifdef __cplusplus
|
||||
#pragma message enable nosimpint
|
||||
#endif
|
||||
#endif
|
||||
#include <GL/gl.h>
|
||||
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#include "glx_mangle.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define GLX_VERSION_1_1 1
|
||||
#define GLX_VERSION_1_2 1
|
||||
#define GLX_VERSION_1_3 1
|
||||
#define GLX_VERSION_1_4 1
|
||||
|
||||
#define GLX_EXTENSION_NAME "GLX"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Tokens for glXChooseVisual and glXGetConfig:
|
||||
*/
|
||||
#define GLX_USE_GL 1
|
||||
#define GLX_BUFFER_SIZE 2
|
||||
#define GLX_LEVEL 3
|
||||
#define GLX_RGBA 4
|
||||
#define GLX_DOUBLEBUFFER 5
|
||||
#define GLX_STEREO 6
|
||||
#define GLX_AUX_BUFFERS 7
|
||||
#define GLX_RED_SIZE 8
|
||||
#define GLX_GREEN_SIZE 9
|
||||
#define GLX_BLUE_SIZE 10
|
||||
#define GLX_ALPHA_SIZE 11
|
||||
#define GLX_DEPTH_SIZE 12
|
||||
#define GLX_STENCIL_SIZE 13
|
||||
#define GLX_ACCUM_RED_SIZE 14
|
||||
#define GLX_ACCUM_GREEN_SIZE 15
|
||||
#define GLX_ACCUM_BLUE_SIZE 16
|
||||
#define GLX_ACCUM_ALPHA_SIZE 17
|
||||
|
||||
|
||||
/*
|
||||
* Error codes returned by glXGetConfig:
|
||||
*/
|
||||
#define GLX_BAD_SCREEN 1
|
||||
#define GLX_BAD_ATTRIBUTE 2
|
||||
#define GLX_NO_EXTENSION 3
|
||||
#define GLX_BAD_VISUAL 4
|
||||
#define GLX_BAD_CONTEXT 5
|
||||
#define GLX_BAD_VALUE 6
|
||||
#define GLX_BAD_ENUM 7
|
||||
|
||||
|
||||
/*
|
||||
* GLX 1.1 and later:
|
||||
*/
|
||||
#define GLX_VENDOR 1
|
||||
#define GLX_VERSION 2
|
||||
#define GLX_EXTENSIONS 3
|
||||
|
||||
|
||||
/*
|
||||
* GLX 1.3 and later:
|
||||
*/
|
||||
#define GLX_CONFIG_CAVEAT 0x20
|
||||
#define GLX_DONT_CARE 0xFFFFFFFF
|
||||
#define GLX_X_VISUAL_TYPE 0x22
|
||||
#define GLX_TRANSPARENT_TYPE 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
#define GLX_PIXMAP_BIT 0x00000002
|
||||
#define GLX_PBUFFER_BIT 0x00000004
|
||||
#define GLX_AUX_BUFFERS_BIT 0x00000010
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
|
||||
#define GLX_DEPTH_BUFFER_BIT 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT 0x00000080
|
||||
#define GLX_NONE 0x8000
|
||||
#define GLX_SLOW_CONFIG 0x8001
|
||||
#define GLX_TRUE_COLOR 0x8002
|
||||
#define GLX_DIRECT_COLOR 0x8003
|
||||
#define GLX_PSEUDO_COLOR 0x8004
|
||||
#define GLX_STATIC_COLOR 0x8005
|
||||
#define GLX_GRAY_SCALE 0x8006
|
||||
#define GLX_STATIC_GRAY 0x8007
|
||||
#define GLX_TRANSPARENT_RGB 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX 0x8009
|
||||
#define GLX_VISUAL_ID 0x800B
|
||||
#define GLX_SCREEN 0x800C
|
||||
#define GLX_NON_CONFORMANT_CONFIG 0x800D
|
||||
#define GLX_DRAWABLE_TYPE 0x8010
|
||||
#define GLX_RENDER_TYPE 0x8011
|
||||
#define GLX_X_RENDERABLE 0x8012
|
||||
#define GLX_FBCONFIG_ID 0x8013
|
||||
#define GLX_RGBA_TYPE 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE 0x8015
|
||||
#define GLX_MAX_PBUFFER_WIDTH 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS 0x8018
|
||||
#define GLX_PRESERVED_CONTENTS 0x801B
|
||||
#define GLX_LARGEST_PBUFFER 0x801C
|
||||
#define GLX_WIDTH 0x801D
|
||||
#define GLX_HEIGHT 0x801E
|
||||
#define GLX_EVENT_MASK 0x801F
|
||||
#define GLX_DAMAGED 0x8020
|
||||
#define GLX_SAVED 0x8021
|
||||
#define GLX_WINDOW 0x8022
|
||||
#define GLX_PBUFFER 0x8023
|
||||
#define GLX_PBUFFER_HEIGHT 0x8040
|
||||
#define GLX_PBUFFER_WIDTH 0x8041
|
||||
#define GLX_RGBA_BIT 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT 0x00000002
|
||||
#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
|
||||
|
||||
|
||||
/*
|
||||
* GLX 1.4 and later:
|
||||
*/
|
||||
#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/
|
||||
#define GLX_SAMPLES 0x186a1 /*100001*/
|
||||
|
||||
|
||||
|
||||
typedef struct __GLXcontextRec *GLXContext;
|
||||
typedef XID GLXPixmap;
|
||||
typedef XID GLXDrawable;
|
||||
/* GLX 1.3 and later */
|
||||
typedef struct __GLXFBConfigRec *GLXFBConfig;
|
||||
typedef XID GLXFBConfigID;
|
||||
typedef XID GLXContextID;
|
||||
typedef XID GLXWindow;
|
||||
typedef XID GLXPbuffer;
|
||||
|
||||
|
||||
/*
|
||||
** Events.
|
||||
** __GLX_NUMBER_EVENTS is set to 17 to account for the BufferClobberSGIX
|
||||
** event - this helps initialization if the server supports the pbuffer
|
||||
** extension and the client doesn't.
|
||||
*/
|
||||
#define GLX_PbufferClobber 0
|
||||
#define GLX_BufferSwapComplete 1
|
||||
|
||||
#define __GLX_NUMBER_EVENTS 17
|
||||
|
||||
extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
|
||||
int *attribList );
|
||||
|
||||
extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
|
||||
GLXContext shareList, Bool direct );
|
||||
|
||||
extern void glXDestroyContext( Display *dpy, GLXContext ctx );
|
||||
|
||||
extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
|
||||
GLXContext ctx);
|
||||
|
||||
extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
|
||||
unsigned long mask );
|
||||
|
||||
extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
|
||||
|
||||
extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
|
||||
Pixmap pixmap );
|
||||
|
||||
extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
|
||||
|
||||
extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
|
||||
|
||||
extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
|
||||
|
||||
extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
|
||||
|
||||
extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
|
||||
int attrib, int *value );
|
||||
|
||||
extern GLXContext glXGetCurrentContext( void );
|
||||
|
||||
extern GLXDrawable glXGetCurrentDrawable( void );
|
||||
|
||||
extern void glXWaitGL( void );
|
||||
|
||||
extern void glXWaitX( void );
|
||||
|
||||
extern void glXUseXFont( Font font, int first, int count, int list );
|
||||
|
||||
|
||||
|
||||
/* GLX 1.1 and later */
|
||||
extern const char *glXQueryExtensionsString( Display *dpy, int screen );
|
||||
|
||||
extern const char *glXQueryServerString( Display *dpy, int screen, int name );
|
||||
|
||||
extern const char *glXGetClientString( Display *dpy, int name );
|
||||
|
||||
|
||||
/* GLX 1.2 and later */
|
||||
extern Display *glXGetCurrentDisplay( void );
|
||||
|
||||
|
||||
/* GLX 1.3 and later */
|
||||
extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
|
||||
const int *attribList, int *nitems );
|
||||
|
||||
extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
|
||||
int attribute, int *value );
|
||||
|
||||
extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
|
||||
int *nelements );
|
||||
|
||||
extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
|
||||
GLXFBConfig config );
|
||||
|
||||
extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
|
||||
Window win, const int *attribList );
|
||||
|
||||
extern void glXDestroyWindow( Display *dpy, GLXWindow window );
|
||||
|
||||
extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
|
||||
Pixmap pixmap, const int *attribList );
|
||||
|
||||
extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
|
||||
|
||||
extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
|
||||
const int *attribList );
|
||||
|
||||
extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
|
||||
|
||||
extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
|
||||
unsigned int *value );
|
||||
|
||||
extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
|
||||
int renderType, GLXContext shareList,
|
||||
Bool direct );
|
||||
|
||||
extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
|
||||
GLXDrawable read, GLXContext ctx );
|
||||
|
||||
extern GLXDrawable glXGetCurrentReadDrawable( void );
|
||||
|
||||
extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
|
||||
int *value );
|
||||
|
||||
extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
|
||||
unsigned long mask );
|
||||
|
||||
extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
|
||||
unsigned long *mask );
|
||||
|
||||
/* GLX 1.3 function pointer typedefs */
|
||||
typedef GLXFBConfig * (* PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef GLXFBConfig * (* PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
|
||||
typedef int (* PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
|
||||
typedef XVisualInfo * (* PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
|
||||
typedef GLXWindow (* PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
||||
typedef void (* PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
|
||||
typedef GLXPixmap (* PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
|
||||
typedef void (* PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
|
||||
typedef GLXPbuffer (* PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
|
||||
typedef void (* PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
|
||||
typedef void (* PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
||||
typedef GLXContext (* PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef Bool (* PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable (* PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
|
||||
typedef Display * (* PFNGLXGETCURRENTDISPLAYPROC) (void);
|
||||
typedef int (* PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
|
||||
typedef void (* PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
|
||||
typedef void (* PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
|
||||
|
||||
|
||||
/*
|
||||
* ARB 2. GLX_ARB_get_proc_address
|
||||
*/
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
#define GLX_ARB_get_proc_address 1
|
||||
|
||||
typedef void (*__GLXextFuncPtr)(void);
|
||||
extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
|
||||
|
||||
#endif /* GLX_ARB_get_proc_address */
|
||||
|
||||
|
||||
|
||||
/* GLX 1.4 and later */
|
||||
extern void (*glXGetProcAddress(const GLubyte *procname))( void );
|
||||
|
||||
/* GLX 1.4 function pointer typedefs */
|
||||
typedef __GLXextFuncPtr (* PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
|
||||
|
||||
|
||||
#ifndef GLX_GLXEXT_LEGACY
|
||||
|
||||
#include <GL/glxext.h>
|
||||
|
||||
#endif /* GLX_GLXEXT_LEGACY */
|
||||
|
||||
|
||||
/**
|
||||
** The following aren't in glxext.h yet.
|
||||
**/
|
||||
|
||||
|
||||
/*
|
||||
* ???. GLX_NV_vertex_array_range
|
||||
*/
|
||||
#ifndef GLX_NV_vertex_array_range
|
||||
#define GLX_NV_vertex_array_range
|
||||
|
||||
extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
extern void glXFreeMemoryNV(GLvoid *pointer);
|
||||
typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
|
||||
|
||||
#endif /* GLX_NV_vertex_array_range */
|
||||
|
||||
|
||||
/*
|
||||
* ARB ?. GLX_ARB_render_texture
|
||||
* XXX This was never finalized!
|
||||
*/
|
||||
#ifndef GLX_ARB_render_texture
|
||||
#define GLX_ARB_render_texture 1
|
||||
|
||||
extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
|
||||
extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
|
||||
extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList);
|
||||
|
||||
#endif /* GLX_ARB_render_texture */
|
||||
|
||||
|
||||
/*
|
||||
* Remove this when glxext.h is updated.
|
||||
*/
|
||||
#ifndef GLX_NV_float_buffer
|
||||
#define GLX_NV_float_buffer 1
|
||||
|
||||
#define GLX_FLOAT_COMPONENTS_NV 0x20B0
|
||||
|
||||
#endif /* GLX_NV_float_buffer */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* #?. GLX_MESA_swap_frame_usage
|
||||
*/
|
||||
#ifndef GLX_MESA_swap_frame_usage
|
||||
#define GLX_MESA_swap_frame_usage 1
|
||||
|
||||
extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
|
||||
extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
|
||||
extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
|
||||
extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
|
||||
|
||||
typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
|
||||
typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
|
||||
typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
|
||||
typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
|
||||
|
||||
#endif /* GLX_MESA_swap_frame_usage */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* #?. GLX_MESA_swap_control
|
||||
*/
|
||||
#ifndef GLX_MESA_swap_control
|
||||
#define GLX_MESA_swap_control 1
|
||||
|
||||
extern int glXSwapIntervalMESA(unsigned int interval);
|
||||
extern int glXGetSwapIntervalMESA(void);
|
||||
|
||||
typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
|
||||
typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
|
||||
|
||||
#endif /* GLX_MESA_swap_control */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* #?. GLX_EXT_texture_from_pixmap
|
||||
* XXX not finished?
|
||||
*/
|
||||
#ifndef GLX_EXT_texture_from_pixmap
|
||||
#define GLX_EXT_texture_from_pixmap 1
|
||||
|
||||
#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
|
||||
#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
|
||||
#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
|
||||
#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
|
||||
#define GLX_Y_INVERTED_EXT 0x20D4
|
||||
|
||||
#define GLX_TEXTURE_FORMAT_EXT 0x20D5
|
||||
#define GLX_TEXTURE_TARGET_EXT 0x20D6
|
||||
#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
|
||||
|
||||
#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
|
||||
#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
|
||||
#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
|
||||
|
||||
#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
|
||||
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
|
||||
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
|
||||
|
||||
#define GLX_TEXTURE_1D_EXT 0x20DB
|
||||
#define GLX_TEXTURE_2D_EXT 0x20DC
|
||||
#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
|
||||
|
||||
#define GLX_FRONT_LEFT_EXT 0x20DE
|
||||
#define GLX_FRONT_RIGHT_EXT 0x20DF
|
||||
#define GLX_BACK_LEFT_EXT 0x20E0
|
||||
#define GLX_BACK_RIGHT_EXT 0x20E1
|
||||
#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
|
||||
#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
|
||||
#define GLX_AUX0_EXT 0x20E2
|
||||
#define GLX_AUX1_EXT 0x20E3
|
||||
#define GLX_AUX2_EXT 0x20E4
|
||||
#define GLX_AUX3_EXT 0x20E5
|
||||
#define GLX_AUX4_EXT 0x20E6
|
||||
#define GLX_AUX5_EXT 0x20E7
|
||||
#define GLX_AUX6_EXT 0x20E8
|
||||
#define GLX_AUX7_EXT 0x20E9
|
||||
#define GLX_AUX8_EXT 0x20EA
|
||||
#define GLX_AUX9_EXT 0x20EB
|
||||
|
||||
extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
|
||||
extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
|
||||
|
||||
#endif /* GLX_EXT_texture_from_pixmap */
|
||||
|
||||
|
||||
|
||||
|
||||
/*** Should these go here, or in another header? */
|
||||
/*
|
||||
** GLX Events
|
||||
*/
|
||||
typedef struct {
|
||||
int event_type; /* GLX_DAMAGED or GLX_SAVED */
|
||||
int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
|
||||
unsigned long serial; /* # of last request processed by server */
|
||||
Bool send_event; /* true if this came for SendEvent request */
|
||||
Display *display; /* display the event was read from */
|
||||
GLXDrawable drawable; /* XID of Drawable */
|
||||
unsigned int buffer_mask; /* mask indicating which buffers are affected */
|
||||
unsigned int aux_buffer; /* which aux buffer was affected */
|
||||
int x, y;
|
||||
int width, height;
|
||||
int count; /* if nonzero, at least this many more */
|
||||
} GLXPbufferClobberEvent;
|
||||
|
||||
typedef struct {
|
||||
int type;
|
||||
unsigned long serial; /* # of last request processed by server */
|
||||
Bool send_event; /* true if this came from a SendEvent request */
|
||||
Display *display; /* Display the event was read from */
|
||||
GLXDrawable drawable; /* drawable on which event was requested in event mask */
|
||||
int event_type;
|
||||
int64_t ust;
|
||||
int64_t msc;
|
||||
int64_t sbc;
|
||||
} GLXBufferSwapComplete;
|
||||
|
||||
typedef union __GLXEvent {
|
||||
GLXPbufferClobberEvent glxpbufferclobber;
|
||||
GLXBufferSwapComplete glxbufferswapcomplete;
|
||||
long pad[24];
|
||||
} GLXEvent;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GLX_MANGLE_H
|
||||
#define GLX_MANGLE_H
|
||||
|
||||
#define glXChooseVisual mglXChooseVisual
|
||||
#define glXCreateContext mglXCreateContext
|
||||
#define glXDestroyContext mglXDestroyContext
|
||||
#define glXMakeCurrent mglXMakeCurrent
|
||||
#define glXCopyContext mglXCopyContext
|
||||
#define glXSwapBuffers mglXSwapBuffers
|
||||
#define glXCreateGLXPixmap mglXCreateGLXPixmap
|
||||
#define glXDestroyGLXPixmap mglXDestroyGLXPixmap
|
||||
#define glXQueryExtension mglXQueryExtension
|
||||
#define glXQueryVersion mglXQueryVersion
|
||||
#define glXIsDirect mglXIsDirect
|
||||
#define glXGetConfig mglXGetConfig
|
||||
#define glXGetCurrentContext mglXGetCurrentContext
|
||||
#define glXGetCurrentDrawable mglXGetCurrentDrawable
|
||||
#define glXWaitGL mglXWaitGL
|
||||
#define glXWaitX mglXWaitX
|
||||
#define glXUseXFont mglXUseXFont
|
||||
#define glXQueryExtensionsString mglXQueryExtensionsString
|
||||
#define glXQueryServerString mglXQueryServerString
|
||||
#define glXGetClientString mglXGetClientString
|
||||
#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA
|
||||
#define glXReleaseBuffersMESA mglXReleaseBuffersMESA
|
||||
#define glXCopySubBufferMESA mglXCopySubBufferMESA
|
||||
#define glXGetVideoSyncSGI mglXGetVideoSyncSGI
|
||||
#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
|
||||
|
||||
/* GLX 1.2 */
|
||||
#define glXGetCurrentDisplay mglXGetCurrentDisplay
|
||||
|
||||
/* GLX 1.3 */
|
||||
#define glXChooseFBConfig mglXChooseFBConfig
|
||||
#define glXGetFBConfigAttrib mglXGetFBConfigAttrib
|
||||
#define glXGetFBConfigs mglXGetFBConfigs
|
||||
#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig
|
||||
#define glXCreateWindow mglXCreateWindow
|
||||
#define glXDestroyWindow mglXDestroyWindow
|
||||
#define glXCreatePixmap mglXCreatePixmap
|
||||
#define glXDestroyPixmap mglXDestroyPixmap
|
||||
#define glXCreatePbuffer mglXCreatePbuffer
|
||||
#define glXDestroyPbuffer mglXDestroyPbuffer
|
||||
#define glXQueryDrawable mglXQueryDrawable
|
||||
#define glXCreateNewContext mglXCreateNewContext
|
||||
#define glXMakeContextCurrent mglXMakeContextCurrent
|
||||
#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable
|
||||
#define glXQueryContext mglXQueryContext
|
||||
#define glXSelectEvent mglXSelectEvent
|
||||
#define glXGetSelectedEvent mglXGetSelectedEvent
|
||||
|
||||
/* GLX 1.4 */
|
||||
#define glXGetProcAddress mglXGetProcAddress
|
||||
#define glXGetProcAddressARB mglXGetProcAddressARB
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,993 +0,0 @@
|
||||
#ifndef __glxext_h_
|
||||
#define __glxext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2010 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Function declaration macros - to move into glplatform.h */
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#ifndef APIENTRYP
|
||||
#define APIENTRYP APIENTRY *
|
||||
#endif
|
||||
#ifndef GLAPI
|
||||
#define GLAPI extern
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glxext.h last updated 2010/08/06 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define GLX_GLXEXT_VERSION 32
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
#define GLX_PIXMAP_BIT 0x00000002
|
||||
#define GLX_PBUFFER_BIT 0x00000004
|
||||
#define GLX_RGBA_BIT 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT 0x00000002
|
||||
#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
|
||||
#define GLX_AUX_BUFFERS_BIT 0x00000010
|
||||
#define GLX_DEPTH_BUFFER_BIT 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT 0x00000080
|
||||
#define GLX_CONFIG_CAVEAT 0x20
|
||||
#define GLX_X_VISUAL_TYPE 0x22
|
||||
#define GLX_TRANSPARENT_TYPE 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
|
||||
#define GLX_DONT_CARE 0xFFFFFFFF
|
||||
#define GLX_NONE 0x8000
|
||||
#define GLX_SLOW_CONFIG 0x8001
|
||||
#define GLX_TRUE_COLOR 0x8002
|
||||
#define GLX_DIRECT_COLOR 0x8003
|
||||
#define GLX_PSEUDO_COLOR 0x8004
|
||||
#define GLX_STATIC_COLOR 0x8005
|
||||
#define GLX_GRAY_SCALE 0x8006
|
||||
#define GLX_STATIC_GRAY 0x8007
|
||||
#define GLX_TRANSPARENT_RGB 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX 0x8009
|
||||
#define GLX_VISUAL_ID 0x800B
|
||||
#define GLX_SCREEN 0x800C
|
||||
#define GLX_NON_CONFORMANT_CONFIG 0x800D
|
||||
#define GLX_DRAWABLE_TYPE 0x8010
|
||||
#define GLX_RENDER_TYPE 0x8011
|
||||
#define GLX_X_RENDERABLE 0x8012
|
||||
#define GLX_FBCONFIG_ID 0x8013
|
||||
#define GLX_RGBA_TYPE 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE 0x8015
|
||||
#define GLX_MAX_PBUFFER_WIDTH 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS 0x8018
|
||||
#define GLX_PRESERVED_CONTENTS 0x801B
|
||||
#define GLX_LARGEST_PBUFFER 0x801C
|
||||
#define GLX_WIDTH 0x801D
|
||||
#define GLX_HEIGHT 0x801E
|
||||
#define GLX_EVENT_MASK 0x801F
|
||||
#define GLX_DAMAGED 0x8020
|
||||
#define GLX_SAVED 0x8021
|
||||
#define GLX_WINDOW 0x8022
|
||||
#define GLX_PBUFFER 0x8023
|
||||
#define GLX_PBUFFER_HEIGHT 0x8040
|
||||
#define GLX_PBUFFER_WIDTH 0x8041
|
||||
#endif
|
||||
|
||||
#ifndef GLX_VERSION_1_4
|
||||
#define GLX_SAMPLE_BUFFERS 100000
|
||||
#define GLX_SAMPLES 100001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_multisample
|
||||
#define GLX_SAMPLE_BUFFERS_ARB 100000
|
||||
#define GLX_SAMPLES_ARB 100001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_vertex_buffer_object
|
||||
#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_fbconfig_float
|
||||
#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
|
||||
#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_framebuffer_sRGB
|
||||
#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_create_context
|
||||
#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
|
||||
#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
|
||||
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||
#define GLX_CONTEXT_FLAGS_ARB 0x2094
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_create_context_profile
|
||||
#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
|
||||
#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
|
||||
#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_create_context_robustness
|
||||
#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
|
||||
#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252
|
||||
#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
|
||||
#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_multisample
|
||||
#define GLX_SAMPLE_BUFFERS_SGIS 100000
|
||||
#define GLX_SAMPLES_SGIS 100001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_info
|
||||
#define GLX_X_VISUAL_TYPE_EXT 0x22
|
||||
#define GLX_TRANSPARENT_TYPE_EXT 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
|
||||
#define GLX_NONE_EXT 0x8000
|
||||
#define GLX_TRUE_COLOR_EXT 0x8002
|
||||
#define GLX_DIRECT_COLOR_EXT 0x8003
|
||||
#define GLX_PSEUDO_COLOR_EXT 0x8004
|
||||
#define GLX_STATIC_COLOR_EXT 0x8005
|
||||
#define GLX_GRAY_SCALE_EXT 0x8006
|
||||
#define GLX_STATIC_GRAY_EXT 0x8007
|
||||
#define GLX_TRANSPARENT_RGB_EXT 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX_EXT 0x8009
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_swap_control
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_video_sync
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_make_current_read
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_source
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_rating
|
||||
#define GLX_VISUAL_CAVEAT_EXT 0x20
|
||||
#define GLX_SLOW_VISUAL_EXT 0x8001
|
||||
#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
|
||||
/* reuse GLX_NONE_EXT */
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_import_context
|
||||
#define GLX_SHARE_CONTEXT_EXT 0x800A
|
||||
#define GLX_VISUAL_ID_EXT 0x800B
|
||||
#define GLX_SCREEN_EXT 0x800C
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
#define GLX_WINDOW_BIT_SGIX 0x00000001
|
||||
#define GLX_PIXMAP_BIT_SGIX 0x00000002
|
||||
#define GLX_RGBA_BIT_SGIX 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
|
||||
#define GLX_DRAWABLE_TYPE_SGIX 0x8010
|
||||
#define GLX_RENDER_TYPE_SGIX 0x8011
|
||||
#define GLX_X_RENDERABLE_SGIX 0x8012
|
||||
#define GLX_FBCONFIG_ID_SGIX 0x8013
|
||||
#define GLX_RGBA_TYPE_SGIX 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
|
||||
/* reuse GLX_SCREEN_EXT */
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
#define GLX_PBUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
|
||||
#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
|
||||
#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
|
||||
#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
|
||||
#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
|
||||
#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
|
||||
#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
|
||||
#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
|
||||
#define GLX_LARGEST_PBUFFER_SGIX 0x801C
|
||||
#define GLX_WIDTH_SGIX 0x801D
|
||||
#define GLX_HEIGHT_SGIX 0x801E
|
||||
#define GLX_EVENT_MASK_SGIX 0x801F
|
||||
#define GLX_DAMAGED_SGIX 0x8020
|
||||
#define GLX_SAVED_SGIX 0x8021
|
||||
#define GLX_WINDOW_SGIX 0x8022
|
||||
#define GLX_PBUFFER_SGIX 0x8023
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_cushion
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_resize
|
||||
#define GLX_SYNC_FRAME_SGIX 0x00000000
|
||||
#define GLX_SYNC_SWAP_SGIX 0x00000001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_dmbuffer
|
||||
#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_group
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_barrier
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_blended_overlay
|
||||
#define GLX_BLENDED_RGBA_SGIS 0x8025
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_shared_multisample
|
||||
#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
|
||||
#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SUN_get_transparent_index
|
||||
#endif
|
||||
|
||||
#ifndef GLX_3DFX_multisample
|
||||
#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
|
||||
#define GLX_SAMPLES_3DFX 0x8051
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_copy_sub_buffer
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_pixmap_colormap
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_release_buffers
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_set_3dfx_mode
|
||||
#define GLX_3DFX_WINDOW_MODE_MESA 0x1
|
||||
#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_visual_select_group
|
||||
#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
|
||||
#endif
|
||||
|
||||
#ifndef GLX_OML_swap_method
|
||||
#define GLX_SWAP_METHOD_OML 0x8060
|
||||
#define GLX_SWAP_EXCHANGE_OML 0x8061
|
||||
#define GLX_SWAP_COPY_OML 0x8062
|
||||
#define GLX_SWAP_UNDEFINED_OML 0x8063
|
||||
#endif
|
||||
|
||||
#ifndef GLX_OML_sync_control
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_float_buffer
|
||||
#define GLX_FLOAT_COMPONENTS_NV 0x20B0
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_hyperpipe
|
||||
#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
|
||||
#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
|
||||
#define GLX_BAD_HYPERPIPE_SGIX 92
|
||||
#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
|
||||
#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
|
||||
#define GLX_PIPE_RECT_SGIX 0x00000001
|
||||
#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
|
||||
#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
|
||||
#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
|
||||
#define GLX_HYPERPIPE_ID_SGIX 0x8030
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_agp_offset
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_fbconfig_packed_float
|
||||
#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
|
||||
#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_framebuffer_sRGB
|
||||
#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_texture_from_pixmap
|
||||
#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
|
||||
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
|
||||
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
|
||||
#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
|
||||
#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
|
||||
#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
|
||||
#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
|
||||
#define GLX_Y_INVERTED_EXT 0x20D4
|
||||
#define GLX_TEXTURE_FORMAT_EXT 0x20D5
|
||||
#define GLX_TEXTURE_TARGET_EXT 0x20D6
|
||||
#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
|
||||
#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
|
||||
#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
|
||||
#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
|
||||
#define GLX_TEXTURE_1D_EXT 0x20DB
|
||||
#define GLX_TEXTURE_2D_EXT 0x20DC
|
||||
#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
|
||||
#define GLX_FRONT_LEFT_EXT 0x20DE
|
||||
#define GLX_FRONT_RIGHT_EXT 0x20DF
|
||||
#define GLX_BACK_LEFT_EXT 0x20E0
|
||||
#define GLX_BACK_RIGHT_EXT 0x20E1
|
||||
#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
|
||||
#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
|
||||
#define GLX_AUX0_EXT 0x20E2
|
||||
#define GLX_AUX1_EXT 0x20E3
|
||||
#define GLX_AUX2_EXT 0x20E4
|
||||
#define GLX_AUX3_EXT 0x20E5
|
||||
#define GLX_AUX4_EXT 0x20E6
|
||||
#define GLX_AUX5_EXT 0x20E7
|
||||
#define GLX_AUX6_EXT 0x20E8
|
||||
#define GLX_AUX7_EXT 0x20E9
|
||||
#define GLX_AUX8_EXT 0x20EA
|
||||
#define GLX_AUX9_EXT 0x20EB
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_present_video
|
||||
#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_video_out
|
||||
#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
|
||||
#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||
#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5
|
||||
#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
|
||||
#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
|
||||
#define GLX_VIDEO_OUT_FRAME_NV 0x20C8
|
||||
#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
|
||||
#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
|
||||
#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
|
||||
#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_swap_group
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_video_capture
|
||||
#define GLX_DEVICE_ID_NV 0x20CD
|
||||
#define GLX_UNIQUE_ID_NV 0x20CE
|
||||
#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_swap_control
|
||||
#define GLX_SWAP_INTERVAL_EXT 0x20F1
|
||||
#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_copy_image
|
||||
#endif
|
||||
|
||||
#ifndef GLX_INTEL_swap_event
|
||||
#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000
|
||||
#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180
|
||||
#define GLX_COPY_COMPLETE_INTEL 0x8181
|
||||
#define GLX_FLIP_COMPLETE_INTEL 0x8182
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_multisample_coverage
|
||||
#define GLX_COVERAGE_SAMPLES_NV 100001
|
||||
#define GLX_COLOR_SAMPLES_NV 0x20B3
|
||||
#endif
|
||||
|
||||
#ifndef GLX_AMD_gpu_association
|
||||
#define GLX_GPU_VENDOR_AMD 0x1F00
|
||||
#define GLX_GPU_RENDERER_STRING_AMD 0x1F01
|
||||
#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
|
||||
#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
|
||||
#define GLX_GPU_RAM_AMD 0x21A3
|
||||
#define GLX_GPU_CLOCK_AMD 0x21A4
|
||||
#define GLX_GPU_NUM_PIPES_AMD 0x21A5
|
||||
#define GLX_GPU_NUM_SIMD_AMD 0x21A6
|
||||
#define GLX_GPU_NUM_RB_AMD 0x21A7
|
||||
#define GLX_GPU_NUM_SPI_AMD 0x21A8
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_create_context_es2_profile
|
||||
#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
typedef void (*__GLXextFuncPtr)(void);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_source
|
||||
typedef XID GLXVideoSourceSGIX;
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
typedef XID GLXFBConfigIDSGIX;
|
||||
typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
typedef XID GLXPbufferSGIX;
|
||||
typedef struct {
|
||||
int type;
|
||||
unsigned long serial; /* # of last request processed by server */
|
||||
Bool send_event; /* true if this came for SendEvent request */
|
||||
Display *display; /* display the event was read from */
|
||||
GLXDrawable drawable; /* i.d. of Drawable */
|
||||
int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
|
||||
int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
|
||||
unsigned int mask; /* mask indicating which buffers are affected*/
|
||||
int x, y;
|
||||
int width, height;
|
||||
int count; /* if nonzero, at least this many more */
|
||||
} GLXBufferClobberEventSGIX;
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_video_output
|
||||
typedef unsigned int GLXVideoDeviceNV;
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_video_capture
|
||||
typedef XID GLXVideoCaptureDeviceNV;
|
||||
#endif
|
||||
|
||||
#ifndef GLEXT_64_TYPES_DEFINED
|
||||
/* This code block is duplicated in glext.h, so must be protected */
|
||||
#define GLEXT_64_TYPES_DEFINED
|
||||
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
|
||||
/* (as used in the GLX_OML_sync_control extension). */
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#include <inttypes.h>
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
#include <inttypes.h>
|
||||
#if defined(__STDC__)
|
||||
#if defined(__arch64__) || defined(_LP64)
|
||||
typedef long int int64_t;
|
||||
typedef unsigned long int uint64_t;
|
||||
#else
|
||||
typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#endif /* __STDC__ */
|
||||
#elif defined( __VMS ) || defined(__sgi)
|
||||
#include <inttypes.h>
|
||||
#elif defined(__SCO__) || defined(__USLC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(__UNIXOS2__) || defined(__SOL64__)
|
||||
typedef long int int32_t;
|
||||
typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#elif defined(_WIN32) && defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(_WIN32)
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
#include <inttypes.h> /* Fallback option */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_VERSION_1_3 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXFBConfig * glXGetFBConfigs (Display *dpy, int screen, int *nelements);
|
||||
extern GLXFBConfig * glXChooseFBConfig (Display *dpy, int screen, const int *attrib_list, int *nelements);
|
||||
extern int glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value);
|
||||
extern XVisualInfo * glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config);
|
||||
extern GLXWindow glXCreateWindow (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
||||
extern void glXDestroyWindow (Display *dpy, GLXWindow win);
|
||||
extern GLXPixmap glXCreatePixmap (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
|
||||
extern void glXDestroyPixmap (Display *dpy, GLXPixmap pixmap);
|
||||
extern GLXPbuffer glXCreatePbuffer (Display *dpy, GLXFBConfig config, const int *attrib_list);
|
||||
extern void glXDestroyPbuffer (Display *dpy, GLXPbuffer pbuf);
|
||||
extern void glXQueryDrawable (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
||||
extern GLXContext glXCreateNewContext (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
|
||||
extern Bool glXMakeContextCurrent (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
extern GLXDrawable glXGetCurrentReadDrawable (void);
|
||||
extern Display * glXGetCurrentDisplay (void);
|
||||
extern int glXQueryContext (Display *dpy, GLXContext ctx, int attribute, int *value);
|
||||
extern void glXSelectEvent (Display *dpy, GLXDrawable draw, unsigned long event_mask);
|
||||
extern void glXGetSelectedEvent (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
|
||||
typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
|
||||
typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
|
||||
typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
||||
typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
|
||||
typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
|
||||
typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
|
||||
typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
|
||||
typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
|
||||
typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
||||
typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
|
||||
typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
|
||||
typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
|
||||
typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
|
||||
typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_VERSION_1_4
|
||||
#define GLX_VERSION_1_4 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *procName);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
#define GLX_ARB_get_proc_address 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_multisample
|
||||
#define GLX_ARB_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_fbconfig_float
|
||||
#define GLX_ARB_fbconfig_float 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_framebuffer_sRGB
|
||||
#define GLX_ARB_framebuffer_sRGB 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_create_context
|
||||
#define GLX_ARB_create_context 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXContext glXCreateContextAttribsARB (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_create_context_profile
|
||||
#define GLX_ARB_create_context_profile 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_create_context_robustness
|
||||
#define GLX_ARB_create_context_robustness 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_multisample
|
||||
#define GLX_SGIS_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_info
|
||||
#define GLX_EXT_visual_info 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_swap_control
|
||||
#define GLX_SGI_swap_control 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXSwapIntervalSGI (int interval);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_video_sync
|
||||
#define GLX_SGI_video_sync 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXGetVideoSyncSGI (unsigned int *count);
|
||||
extern int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int *count);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
|
||||
typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_make_current_read
|
||||
#define GLX_SGI_make_current_read 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXMakeCurrentReadSGI (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_source
|
||||
#define GLX_SGIX_video_source 1
|
||||
#ifdef _VL_H
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
|
||||
extern void glXDestroyGLXVideoSourceSGIX (Display *dpy, GLXVideoSourceSGIX glxvideosource);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
|
||||
typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
|
||||
#endif /* _VL_H */
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_rating
|
||||
#define GLX_EXT_visual_rating 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_import_context
|
||||
#define GLX_EXT_import_context 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Display * glXGetCurrentDisplayEXT (void);
|
||||
extern int glXQueryContextInfoEXT (Display *dpy, GLXContext context, int attribute, int *value);
|
||||
extern GLXContextID glXGetContextIDEXT (const GLXContext context);
|
||||
extern GLXContext glXImportContextEXT (Display *dpy, GLXContextID contextID);
|
||||
extern void glXFreeContextEXT (Display *dpy, GLXContext context);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
|
||||
typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
|
||||
typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
|
||||
typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
|
||||
typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
#define GLX_SGIX_fbconfig 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXGetFBConfigAttribSGIX (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
|
||||
extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *dpy, int screen, int *attrib_list, int *nelements);
|
||||
extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
|
||||
extern GLXContext glXCreateContextWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
|
||||
extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *dpy, GLXFBConfigSGIX config);
|
||||
extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *dpy, XVisualInfo *vis);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
|
||||
typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
|
||||
typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
|
||||
typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
|
||||
typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
#define GLX_SGIX_pbuffer 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
|
||||
extern void glXDestroyGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf);
|
||||
extern int glXQueryGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
|
||||
extern void glXSelectEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long mask);
|
||||
extern void glXGetSelectedEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long *mask);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
|
||||
typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
|
||||
typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
|
||||
typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
|
||||
typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_cushion
|
||||
#define GLX_SGI_cushion 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXCushionSGI (Display *dpy, Window window, float cushion);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_resize
|
||||
#define GLX_SGIX_video_resize 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXBindChannelToWindowSGIX (Display *display, int screen, int channel, Window window);
|
||||
extern int glXChannelRectSGIX (Display *display, int screen, int channel, int x, int y, int w, int h);
|
||||
extern int glXQueryChannelRectSGIX (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
|
||||
extern int glXQueryChannelDeltasSGIX (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
|
||||
extern int glXChannelRectSyncSGIX (Display *display, int screen, int channel, GLenum synctype);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
|
||||
typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
|
||||
typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
|
||||
typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
|
||||
typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_dmbuffer
|
||||
#define GLX_SGIX_dmbuffer 1
|
||||
#ifdef _DM_BUFFER_H_
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXAssociateDMPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
|
||||
#endif /* _DM_BUFFER_H_ */
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_group
|
||||
#define GLX_SGIX_swap_group 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_barrier
|
||||
#define GLX_SGIX_swap_barrier 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier);
|
||||
extern Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
|
||||
typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SUN_get_transparent_index
|
||||
#define GLX_SUN_get_transparent_index 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_copy_sub_buffer
|
||||
#define GLX_MESA_copy_sub_buffer 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXCopySubBufferMESA (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_pixmap_colormap
|
||||
#define GLX_MESA_pixmap_colormap 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_release_buffers
|
||||
#define GLX_MESA_release_buffers 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXReleaseBuffersMESA (Display *dpy, GLXDrawable drawable);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_set_3dfx_mode
|
||||
#define GLX_MESA_set_3dfx_mode 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXSet3DfxModeMESA (int mode);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_visual_select_group
|
||||
#define GLX_SGIX_visual_select_group 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_OML_swap_method
|
||||
#define GLX_OML_swap_method 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_OML_sync_control
|
||||
#define GLX_OML_sync_control 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXGetSyncValuesOML (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
extern Bool glXGetMscRateOML (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
|
||||
extern int64_t glXSwapBuffersMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
|
||||
extern Bool glXWaitForMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
extern Bool glXWaitForSbcOML (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
|
||||
typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
|
||||
typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_float_buffer
|
||||
#define GLX_NV_float_buffer 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_hyperpipe
|
||||
#define GLX_SGIX_hyperpipe 1
|
||||
|
||||
typedef struct {
|
||||
char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
|
||||
int networkId;
|
||||
} GLXHyperpipeNetworkSGIX;
|
||||
|
||||
typedef struct {
|
||||
char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
|
||||
int channel;
|
||||
unsigned int
|
||||
participationType;
|
||||
int timeSlice;
|
||||
} GLXHyperpipeConfigSGIX;
|
||||
|
||||
typedef struct {
|
||||
char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
|
||||
int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
|
||||
int destXOrigin, destYOrigin, destWidth, destHeight;
|
||||
} GLXPipeRect;
|
||||
|
||||
typedef struct {
|
||||
char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
|
||||
int XOrigin, YOrigin, maxHeight, maxWidth;
|
||||
} GLXPipeRectLimits;
|
||||
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes);
|
||||
extern int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
|
||||
extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes);
|
||||
extern int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId);
|
||||
extern int glXBindHyperpipeSGIX (Display *dpy, int hpId);
|
||||
extern int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
|
||||
extern int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
|
||||
extern int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
|
||||
typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
|
||||
typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
|
||||
typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
|
||||
typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
|
||||
typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
|
||||
typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
|
||||
typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_agp_offset
|
||||
#define GLX_MESA_agp_offset 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern unsigned int glXGetAGPOffsetMESA (const void *pointer);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_fbconfig_packed_float
|
||||
#define GLX_EXT_fbconfig_packed_float 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_framebuffer_sRGB
|
||||
#define GLX_EXT_framebuffer_sRGB 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_texture_from_pixmap
|
||||
#define GLX_EXT_texture_from_pixmap 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXBindTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
|
||||
extern void glXReleaseTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
|
||||
typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_present_video
|
||||
#define GLX_NV_present_video 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern unsigned int * glXEnumerateVideoDevicesNV (Display *dpy, int screen, int *nelements);
|
||||
extern int glXBindVideoDeviceNV (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef unsigned int * ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_video_output
|
||||
#define GLX_NV_video_output 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXGetVideoDeviceNV (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
|
||||
extern int glXReleaseVideoDeviceNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
|
||||
extern int glXBindVideoImageNV (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
|
||||
extern int glXReleaseVideoImageNV (Display *dpy, GLXPbuffer pbuf);
|
||||
extern int glXSendPbufferToVideoNV (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
|
||||
extern int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
|
||||
typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
|
||||
typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
|
||||
typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display *dpy, GLXPbuffer pbuf);
|
||||
typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
|
||||
typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_swap_group
|
||||
#define GLX_NV_swap_group 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXJoinSwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint group);
|
||||
extern Bool glXBindSwapBarrierNV (Display *dpy, GLuint group, GLuint barrier);
|
||||
extern Bool glXQuerySwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
|
||||
extern Bool glXQueryMaxSwapGroupsNV (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
extern Bool glXQueryFrameCountNV (Display *dpy, int screen, GLuint *count);
|
||||
extern Bool glXResetFrameCountNV (Display *dpy, int screen);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint group);
|
||||
typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display *dpy, GLuint group, GLuint barrier);
|
||||
typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
|
||||
typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display *dpy, int screen, GLuint *count);
|
||||
typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display *dpy, int screen);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_video_capture
|
||||
#define GLX_NV_video_capture 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXBindVideoCaptureDeviceNV (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
|
||||
extern GLXVideoCaptureDeviceNV * glXEnumerateVideoCaptureDevicesNV (Display *dpy, int screen, int *nelements);
|
||||
extern void glXLockVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
|
||||
extern int glXQueryVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
|
||||
extern void glXReleaseVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
|
||||
typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
|
||||
typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
|
||||
typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_swap_control
|
||||
#define GLX_EXT_swap_control 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_copy_image
|
||||
#define GLX_NV_copy_image 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_INTEL_swap_event
|
||||
#define GLX_INTEL_swap_event 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_NV_multisample_coverage
|
||||
#define GLX_NV_multisample_coverage 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,862 +0,0 @@
|
||||
/*
|
||||
* Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* Copyright 2007-2008 Red Hat, Inc.
|
||||
* (C) Copyright IBM Corporation 2004
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
* license, and/or sell copies of the Software, and to permit persons to whom
|
||||
* the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file dri_interface.h
|
||||
*
|
||||
* This file contains all the types and functions that define the interface
|
||||
* between a DRI driver and driver loader. Currently, the most common driver
|
||||
* loader is the XFree86 libGL.so. However, other loaders do exist, and in
|
||||
* the future the server-side libglx.a will also be a loader.
|
||||
*
|
||||
* \author Kevin E. Martin <kevin@precisioninsight.com>
|
||||
* \author Ian Romanick <idr@us.ibm.com>
|
||||
* \author Kristian Høgsberg <krh@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef DRI_INTERFACE_H
|
||||
#define DRI_INTERFACE_H
|
||||
|
||||
/* For archs with no drm.h */
|
||||
#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__)
|
||||
#ifndef __NOT_HAVE_DRM_H
|
||||
#define __NOT_HAVE_DRM_H
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __NOT_HAVE_DRM_H
|
||||
#include <drm.h>
|
||||
#else
|
||||
typedef unsigned int drm_context_t;
|
||||
typedef unsigned int drm_drawable_t;
|
||||
typedef struct drm_clip_rect drm_clip_rect_t;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name DRI interface structures
|
||||
*
|
||||
* The following structures define the interface between the GLX client
|
||||
* side library and the DRI (direct rendering infrastructure).
|
||||
*/
|
||||
/*@{*/
|
||||
typedef struct __DRIdisplayRec __DRIdisplay;
|
||||
typedef struct __DRIscreenRec __DRIscreen;
|
||||
typedef struct __DRIcontextRec __DRIcontext;
|
||||
typedef struct __DRIdrawableRec __DRIdrawable;
|
||||
typedef struct __DRIconfigRec __DRIconfig;
|
||||
typedef struct __DRIframebufferRec __DRIframebuffer;
|
||||
typedef struct __DRIversionRec __DRIversion;
|
||||
|
||||
typedef struct __DRIcoreExtensionRec __DRIcoreExtension;
|
||||
typedef struct __DRIextensionRec __DRIextension;
|
||||
typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension;
|
||||
typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension;
|
||||
typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension;
|
||||
typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension;
|
||||
typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension;
|
||||
typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension;
|
||||
typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension;
|
||||
typedef struct __DRIswrastExtensionRec __DRIswrastExtension;
|
||||
typedef struct __DRIbufferRec __DRIbuffer;
|
||||
typedef struct __DRIdri2ExtensionRec __DRIdri2Extension;
|
||||
typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension;
|
||||
typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
||||
/**
|
||||
* Extension struct. Drivers 'inherit' from this struct by embedding
|
||||
* it as the first element in the extension struct.
|
||||
*
|
||||
* We never break API in for a DRI extension. If we need to change
|
||||
* the way things work in a non-backwards compatible manner, we
|
||||
* introduce a new extension. During a transition period, we can
|
||||
* leave both the old and the new extension in the driver, which
|
||||
* allows us to move to the new interface without having to update the
|
||||
* loader(s) in lock step.
|
||||
*
|
||||
* However, we can add entry points to an extension over time as long
|
||||
* as we don't break the old ones. As we add entry points to an
|
||||
* extension, we increase the version number. The corresponding
|
||||
* #define can be used to guard code that accesses the new entry
|
||||
* points at compile time and the version field in the extension
|
||||
* struct can be used at run-time to determine how to use the
|
||||
* extension.
|
||||
*/
|
||||
struct __DRIextensionRec {
|
||||
const char *name;
|
||||
int version;
|
||||
};
|
||||
|
||||
/**
|
||||
* The first set of extension are the screen extensions, returned by
|
||||
* __DRIcore::getExtensions(). This entry point will return a list of
|
||||
* extensions and the loader can use the ones it knows about by
|
||||
* casting them to more specific extensions and advertising any GLX
|
||||
* extensions the DRI extensions enables.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Used by drivers to indicate support for setting the read drawable.
|
||||
*/
|
||||
#define __DRI_READ_DRAWABLE "DRI_ReadDrawable"
|
||||
#define __DRI_READ_DRAWABLE_VERSION 1
|
||||
|
||||
/**
|
||||
* Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
|
||||
*/
|
||||
#define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"
|
||||
#define __DRI_COPY_SUB_BUFFER_VERSION 1
|
||||
struct __DRIcopySubBufferExtensionRec {
|
||||
__DRIextension base;
|
||||
void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h);
|
||||
};
|
||||
|
||||
/**
|
||||
* Used by drivers that implement the GLX_SGI_swap_control or
|
||||
* GLX_MESA_swap_control extension.
|
||||
*/
|
||||
#define __DRI_SWAP_CONTROL "DRI_SwapControl"
|
||||
#define __DRI_SWAP_CONTROL_VERSION 1
|
||||
struct __DRIswapControlExtensionRec {
|
||||
__DRIextension base;
|
||||
void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval);
|
||||
unsigned int (*getSwapInterval)(__DRIdrawable *drawable);
|
||||
};
|
||||
|
||||
/**
|
||||
* Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
|
||||
*/
|
||||
#define __DRI_FRAME_TRACKING "DRI_FrameTracking"
|
||||
#define __DRI_FRAME_TRACKING_VERSION 1
|
||||
struct __DRIframeTrackingExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
/**
|
||||
* Enable or disable frame usage tracking.
|
||||
*
|
||||
* \since Internal API version 20030317.
|
||||
*/
|
||||
int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable);
|
||||
|
||||
/**
|
||||
* Retrieve frame usage information.
|
||||
*
|
||||
* \since Internal API version 20030317.
|
||||
*/
|
||||
int (*queryFrameTracking)(__DRIdrawable *drawable,
|
||||
int64_t * sbc, int64_t * missedFrames,
|
||||
float * lastMissedUsage, float * usage);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Used by drivers that implement the GLX_SGI_video_sync extension.
|
||||
*/
|
||||
#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"
|
||||
#define __DRI_MEDIA_STREAM_COUNTER_VERSION 1
|
||||
struct __DRImediaStreamCounterExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
/**
|
||||
* Wait for the MSC to equal target_msc, or, if that has already passed,
|
||||
* the next time (MSC % divisor) is equal to remainder. If divisor is
|
||||
* zero, the function will return as soon as MSC is greater than or equal
|
||||
* to target_msc.
|
||||
*/
|
||||
int (*waitForMSC)(__DRIdrawable *drawable,
|
||||
int64_t target_msc, int64_t divisor, int64_t remainder,
|
||||
int64_t * msc, int64_t * sbc);
|
||||
|
||||
/**
|
||||
* Get the number of vertical refreshes since some point in time before
|
||||
* this function was first called (i.e., system start up).
|
||||
*/
|
||||
int (*getDrawableMSC)(__DRIscreen *screen, __DRIdrawable *drawable,
|
||||
int64_t *msc);
|
||||
};
|
||||
|
||||
|
||||
#define __DRI_TEX_OFFSET "DRI_TexOffset"
|
||||
#define __DRI_TEX_OFFSET_VERSION 1
|
||||
struct __DRItexOffsetExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
/**
|
||||
* Method to override base texture image with a driver specific 'offset'.
|
||||
* The depth passed in allows e.g. to ignore the alpha channel of texture
|
||||
* images where the non-alpha components don't occupy a whole texel.
|
||||
*
|
||||
* For GLX_EXT_texture_from_pixmap with AIGLX.
|
||||
*/
|
||||
void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
|
||||
unsigned long long offset, GLint depth, GLuint pitch);
|
||||
};
|
||||
|
||||
|
||||
/* Valid values for format in the setTexBuffer2 function below. These
|
||||
* values match the GLX tokens for compatibility reasons, but we
|
||||
* define them here since the DRI interface can't depend on GLX. */
|
||||
#define __DRI_TEXTURE_FORMAT_NONE 0x20D8
|
||||
#define __DRI_TEXTURE_FORMAT_RGB 0x20D9
|
||||
#define __DRI_TEXTURE_FORMAT_RGBA 0x20DA
|
||||
|
||||
#define __DRI_TEX_BUFFER "DRI_TexBuffer"
|
||||
#define __DRI_TEX_BUFFER_VERSION 2
|
||||
struct __DRItexBufferExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
/**
|
||||
* Method to override base texture image with the contents of a
|
||||
* __DRIdrawable.
|
||||
*
|
||||
* For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of
|
||||
* setTexBuffer2 in version 2 of this interface
|
||||
*/
|
||||
void (*setTexBuffer)(__DRIcontext *pDRICtx,
|
||||
GLint target,
|
||||
__DRIdrawable *pDraw);
|
||||
|
||||
/**
|
||||
* Method to override base texture image with the contents of a
|
||||
* __DRIdrawable, including the required texture format attribute.
|
||||
*
|
||||
* For GLX_EXT_texture_from_pixmap with AIGLX.
|
||||
*/
|
||||
void (*setTexBuffer2)(__DRIcontext *pDRICtx,
|
||||
GLint target,
|
||||
GLint format,
|
||||
__DRIdrawable *pDraw);
|
||||
};
|
||||
|
||||
/**
|
||||
* Used by drivers that implement DRI2
|
||||
*/
|
||||
#define __DRI2_FLUSH "DRI2_Flush"
|
||||
#define __DRI2_FLUSH_VERSION 3
|
||||
struct __DRI2flushExtensionRec {
|
||||
__DRIextension base;
|
||||
void (*flush)(__DRIdrawable *drawable);
|
||||
|
||||
/**
|
||||
* Ask the driver to call getBuffers/getBuffersWithFormat before
|
||||
* it starts rendering again.
|
||||
*
|
||||
* \param drawable the drawable to invalidate
|
||||
*
|
||||
* \since 3
|
||||
*/
|
||||
void (*invalidate)(__DRIdrawable *drawable);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* XML document describing the configuration options supported by the
|
||||
* driver.
|
||||
*/
|
||||
extern const char __driConfigOptions[];
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* The following extensions describe loader features that the DRI
|
||||
* driver can make use of. Some of these are mandatory, such as the
|
||||
* getDrawableInfo extension for DRI and the DRI Loader extensions for
|
||||
* DRI2, while others are optional, and if present allow the driver to
|
||||
* expose certain features. The loader pass in a NULL terminated
|
||||
* array of these extensions to the driver in the createNewScreen
|
||||
* constructor.
|
||||
*/
|
||||
|
||||
typedef struct __DRIgetDrawableInfoExtensionRec __DRIgetDrawableInfoExtension;
|
||||
typedef struct __DRIsystemTimeExtensionRec __DRIsystemTimeExtension;
|
||||
typedef struct __DRIdamageExtensionRec __DRIdamageExtension;
|
||||
typedef struct __DRIloaderExtensionRec __DRIloaderExtension;
|
||||
typedef struct __DRIswrastLoaderExtensionRec __DRIswrastLoaderExtension;
|
||||
|
||||
|
||||
/**
|
||||
* Callback to getDrawableInfo protocol
|
||||
*/
|
||||
#define __DRI_GET_DRAWABLE_INFO "DRI_GetDrawableInfo"
|
||||
#define __DRI_GET_DRAWABLE_INFO_VERSION 1
|
||||
struct __DRIgetDrawableInfoExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
/**
|
||||
* This function is used to get information about the position, size, and
|
||||
* clip rects of a drawable.
|
||||
*/
|
||||
GLboolean (* getDrawableInfo) ( __DRIdrawable *drawable,
|
||||
unsigned int * index, unsigned int * stamp,
|
||||
int * x, int * y, int * width, int * height,
|
||||
int * numClipRects, drm_clip_rect_t ** pClipRects,
|
||||
int * backX, int * backY,
|
||||
int * numBackClipRects, drm_clip_rect_t ** pBackClipRects,
|
||||
void *loaderPrivate);
|
||||
};
|
||||
|
||||
/**
|
||||
* Callback to get system time for media stream counter extensions.
|
||||
*/
|
||||
#define __DRI_SYSTEM_TIME "DRI_SystemTime"
|
||||
#define __DRI_SYSTEM_TIME_VERSION 1
|
||||
struct __DRIsystemTimeExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
/**
|
||||
* Get the 64-bit unadjusted system time (UST).
|
||||
*/
|
||||
int (*getUST)(int64_t * ust);
|
||||
|
||||
/**
|
||||
* Get the media stream counter (MSC) rate.
|
||||
*
|
||||
* Matching the definition in GLX_OML_sync_control, this function returns
|
||||
* the rate of the "media stream counter". In practical terms, this is
|
||||
* the frame refresh rate of the display.
|
||||
*/
|
||||
GLboolean (*getMSCRate)(__DRIdrawable *draw,
|
||||
int32_t * numerator, int32_t * denominator,
|
||||
void *loaderPrivate);
|
||||
};
|
||||
|
||||
/**
|
||||
* Damage reporting
|
||||
*/
|
||||
#define __DRI_DAMAGE "DRI_Damage"
|
||||
#define __DRI_DAMAGE_VERSION 1
|
||||
struct __DRIdamageExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
/**
|
||||
* Reports areas of the given drawable which have been modified by the
|
||||
* driver.
|
||||
*
|
||||
* \param drawable which the drawing was done to.
|
||||
* \param rects rectangles affected, with the drawable origin as the
|
||||
* origin.
|
||||
* \param x X offset of the drawable within the screen (used in the
|
||||
* front_buffer case)
|
||||
* \param y Y offset of the drawable within the screen.
|
||||
* \param front_buffer boolean flag for whether the drawing to the
|
||||
* drawable was actually done directly to the front buffer (instead
|
||||
* of backing storage, for example)
|
||||
* \param loaderPrivate the data passed in at createNewDrawable time
|
||||
*/
|
||||
void (*reportDamage)(__DRIdrawable *draw,
|
||||
int x, int y,
|
||||
drm_clip_rect_t *rects, int num_rects,
|
||||
GLboolean front_buffer,
|
||||
void *loaderPrivate);
|
||||
};
|
||||
|
||||
#define __DRI_SWRAST_IMAGE_OP_DRAW 1
|
||||
#define __DRI_SWRAST_IMAGE_OP_CLEAR 2
|
||||
#define __DRI_SWRAST_IMAGE_OP_SWAP 3
|
||||
|
||||
/**
|
||||
* SWRast Loader extension.
|
||||
*/
|
||||
#define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
|
||||
#define __DRI_SWRAST_LOADER_VERSION 1
|
||||
struct __DRIswrastLoaderExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
/*
|
||||
* Drawable position and size
|
||||
*/
|
||||
void (*getDrawableInfo)(__DRIdrawable *drawable,
|
||||
int *x, int *y, int *width, int *height,
|
||||
void *loaderPrivate);
|
||||
|
||||
/**
|
||||
* Put image to drawable
|
||||
*/
|
||||
void (*putImage)(__DRIdrawable *drawable, int op,
|
||||
int x, int y, int width, int height,
|
||||
char *data, void *loaderPrivate);
|
||||
|
||||
/**
|
||||
* Get image from readable
|
||||
*/
|
||||
void (*getImage)(__DRIdrawable *readable,
|
||||
int x, int y, int width, int height,
|
||||
char *data, void *loaderPrivate);
|
||||
};
|
||||
|
||||
/**
|
||||
* Invalidate loader extension. The presence of this extension
|
||||
* indicates to the DRI driver that the loader will call invalidate in
|
||||
* the __DRI2_FLUSH extension, whenever the needs to query for new
|
||||
* buffers. This means that the DRI driver can drop the polling in
|
||||
* glViewport().
|
||||
*
|
||||
* The extension doesn't provide any functionality, it's only use to
|
||||
* indicate to the driver that it can use the new semantics. A DRI
|
||||
* driver can use this to switch between the different semantics or
|
||||
* just refuse to initialize if this extension isn't present.
|
||||
*/
|
||||
#define __DRI_USE_INVALIDATE "DRI_UseInvalidate"
|
||||
#define __DRI_USE_INVALIDATE_VERSION 1
|
||||
|
||||
typedef struct __DRIuseInvalidateExtensionRec __DRIuseInvalidateExtension;
|
||||
struct __DRIuseInvalidateExtensionRec {
|
||||
__DRIextension base;
|
||||
};
|
||||
|
||||
/**
|
||||
* The remaining extensions describe driver extensions, immediately
|
||||
* available interfaces provided by the driver. To start using the
|
||||
* driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for
|
||||
* the extension you need in the array.
|
||||
*/
|
||||
#define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions"
|
||||
|
||||
/**
|
||||
* Tokens for __DRIconfig attribs. A number of attributes defined by
|
||||
* GLX or EGL standards are not in the table, as they must be provided
|
||||
* by the loader. For example, FBConfig ID or visual ID, drawable type.
|
||||
*/
|
||||
|
||||
#define __DRI_ATTRIB_BUFFER_SIZE 1
|
||||
#define __DRI_ATTRIB_LEVEL 2
|
||||
#define __DRI_ATTRIB_RED_SIZE 3
|
||||
#define __DRI_ATTRIB_GREEN_SIZE 4
|
||||
#define __DRI_ATTRIB_BLUE_SIZE 5
|
||||
#define __DRI_ATTRIB_LUMINANCE_SIZE 6
|
||||
#define __DRI_ATTRIB_ALPHA_SIZE 7
|
||||
#define __DRI_ATTRIB_ALPHA_MASK_SIZE 8
|
||||
#define __DRI_ATTRIB_DEPTH_SIZE 9
|
||||
#define __DRI_ATTRIB_STENCIL_SIZE 10
|
||||
#define __DRI_ATTRIB_ACCUM_RED_SIZE 11
|
||||
#define __DRI_ATTRIB_ACCUM_GREEN_SIZE 12
|
||||
#define __DRI_ATTRIB_ACCUM_BLUE_SIZE 13
|
||||
#define __DRI_ATTRIB_ACCUM_ALPHA_SIZE 14
|
||||
#define __DRI_ATTRIB_SAMPLE_BUFFERS 15
|
||||
#define __DRI_ATTRIB_SAMPLES 16
|
||||
#define __DRI_ATTRIB_RENDER_TYPE 17
|
||||
#define __DRI_ATTRIB_CONFIG_CAVEAT 18
|
||||
#define __DRI_ATTRIB_CONFORMANT 19
|
||||
#define __DRI_ATTRIB_DOUBLE_BUFFER 20
|
||||
#define __DRI_ATTRIB_STEREO 21
|
||||
#define __DRI_ATTRIB_AUX_BUFFERS 22
|
||||
#define __DRI_ATTRIB_TRANSPARENT_TYPE 23
|
||||
#define __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE 24
|
||||
#define __DRI_ATTRIB_TRANSPARENT_RED_VALUE 25
|
||||
#define __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE 26
|
||||
#define __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE 27
|
||||
#define __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE 28
|
||||
#define __DRI_ATTRIB_FLOAT_MODE 29
|
||||
#define __DRI_ATTRIB_RED_MASK 30
|
||||
#define __DRI_ATTRIB_GREEN_MASK 31
|
||||
#define __DRI_ATTRIB_BLUE_MASK 32
|
||||
#define __DRI_ATTRIB_ALPHA_MASK 33
|
||||
#define __DRI_ATTRIB_MAX_PBUFFER_WIDTH 34
|
||||
#define __DRI_ATTRIB_MAX_PBUFFER_HEIGHT 35
|
||||
#define __DRI_ATTRIB_MAX_PBUFFER_PIXELS 36
|
||||
#define __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH 37
|
||||
#define __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT 38
|
||||
#define __DRI_ATTRIB_VISUAL_SELECT_GROUP 39
|
||||
#define __DRI_ATTRIB_SWAP_METHOD 40
|
||||
#define __DRI_ATTRIB_MAX_SWAP_INTERVAL 41
|
||||
#define __DRI_ATTRIB_MIN_SWAP_INTERVAL 42
|
||||
#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGB 43
|
||||
#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA 44
|
||||
#define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45
|
||||
#define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46
|
||||
#define __DRI_ATTRIB_YINVERTED 47
|
||||
|
||||
/* __DRI_ATTRIB_RENDER_TYPE */
|
||||
#define __DRI_ATTRIB_RGBA_BIT 0x01
|
||||
#define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02
|
||||
#define __DRI_ATTRIB_LUMINANCE_BIT 0x04
|
||||
|
||||
/* __DRI_ATTRIB_CONFIG_CAVEAT */
|
||||
#define __DRI_ATTRIB_SLOW_BIT 0x01
|
||||
#define __DRI_ATTRIB_NON_CONFORMANT_CONFIG 0x02
|
||||
|
||||
/* __DRI_ATTRIB_TRANSPARENT_TYPE */
|
||||
#define __DRI_ATTRIB_TRANSPARENT_RGB 0x00
|
||||
#define __DRI_ATTRIB_TRANSPARENT_INDEX 0x01
|
||||
|
||||
/* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
|
||||
#define __DRI_ATTRIB_TEXTURE_1D_BIT 0x01
|
||||
#define __DRI_ATTRIB_TEXTURE_2D_BIT 0x02
|
||||
#define __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT 0x04
|
||||
|
||||
/**
|
||||
* This extension defines the core DRI functionality.
|
||||
*/
|
||||
#define __DRI_CORE "DRI_Core"
|
||||
#define __DRI_CORE_VERSION 1
|
||||
|
||||
struct __DRIcoreExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
__DRIscreen *(*createNewScreen)(int screen, int fd,
|
||||
unsigned int sarea_handle,
|
||||
const __DRIextension **extensions,
|
||||
const __DRIconfig ***driverConfigs,
|
||||
void *loaderPrivate);
|
||||
|
||||
void (*destroyScreen)(__DRIscreen *screen);
|
||||
|
||||
const __DRIextension **(*getExtensions)(__DRIscreen *screen);
|
||||
|
||||
int (*getConfigAttrib)(const __DRIconfig *config,
|
||||
unsigned int attrib,
|
||||
unsigned int *value);
|
||||
|
||||
int (*indexConfigAttrib)(const __DRIconfig *config, int index,
|
||||
unsigned int *attrib, unsigned int *value);
|
||||
|
||||
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
|
||||
const __DRIconfig *config,
|
||||
unsigned int drawable_id,
|
||||
unsigned int head,
|
||||
void *loaderPrivate);
|
||||
|
||||
void (*destroyDrawable)(__DRIdrawable *drawable);
|
||||
|
||||
void (*swapBuffers)(__DRIdrawable *drawable);
|
||||
|
||||
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
|
||||
const __DRIconfig *config,
|
||||
__DRIcontext *shared,
|
||||
void *loaderPrivate);
|
||||
|
||||
int (*copyContext)(__DRIcontext *dest,
|
||||
__DRIcontext *src,
|
||||
unsigned long mask);
|
||||
|
||||
void (*destroyContext)(__DRIcontext *context);
|
||||
|
||||
int (*bindContext)(__DRIcontext *ctx,
|
||||
__DRIdrawable *pdraw,
|
||||
__DRIdrawable *pread);
|
||||
|
||||
int (*unbindContext)(__DRIcontext *ctx);
|
||||
};
|
||||
|
||||
/**
|
||||
* Stored version of some component (i.e., server-side DRI module, kernel-side
|
||||
* DRM, etc.).
|
||||
*
|
||||
* \todo
|
||||
* There are several data structures that explicitly store a major version,
|
||||
* minor version, and patch level. These structures should be modified to
|
||||
* have a \c __DRIversionRec instead.
|
||||
*/
|
||||
struct __DRIversionRec {
|
||||
int major; /**< Major version number. */
|
||||
int minor; /**< Minor version number. */
|
||||
int patch; /**< Patch-level. */
|
||||
};
|
||||
|
||||
/**
|
||||
* Framebuffer information record. Used by libGL to communicate information
|
||||
* about the framebuffer to the driver's \c __driCreateNewScreen function.
|
||||
*
|
||||
* In XFree86, most of this information is derrived from data returned by
|
||||
* calling \c XF86DRIGetDeviceInfo.
|
||||
*
|
||||
* \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
|
||||
* __driUtilCreateNewScreen CallCreateNewScreen
|
||||
*
|
||||
* \bug This structure could be better named.
|
||||
*/
|
||||
struct __DRIframebufferRec {
|
||||
unsigned char *base; /**< Framebuffer base address in the CPU's
|
||||
* address space. This value is calculated by
|
||||
* calling \c drmMap on the framebuffer handle
|
||||
* returned by \c XF86DRIGetDeviceInfo (or a
|
||||
* similar function).
|
||||
*/
|
||||
int size; /**< Framebuffer size, in bytes. */
|
||||
int stride; /**< Number of bytes from one line to the next. */
|
||||
int width; /**< Pixel width of the framebuffer. */
|
||||
int height; /**< Pixel height of the framebuffer. */
|
||||
int dev_priv_size; /**< Size of the driver's dev-priv structure. */
|
||||
void *dev_priv; /**< Pointer to the driver's dev-priv structure. */
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* This extension provides alternative screen, drawable and context
|
||||
* constructors for legacy DRI functionality. This is used in
|
||||
* conjunction with the core extension.
|
||||
*/
|
||||
#define __DRI_LEGACY "DRI_Legacy"
|
||||
#define __DRI_LEGACY_VERSION 1
|
||||
|
||||
struct __DRIlegacyExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
__DRIscreen *(*createNewScreen)(int screen,
|
||||
const __DRIversion *ddx_version,
|
||||
const __DRIversion *dri_version,
|
||||
const __DRIversion *drm_version,
|
||||
const __DRIframebuffer *frame_buffer,
|
||||
void *pSAREA, int fd,
|
||||
const __DRIextension **extensions,
|
||||
const __DRIconfig ***driver_configs,
|
||||
void *loaderPrivate);
|
||||
|
||||
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
|
||||
const __DRIconfig *config,
|
||||
drm_drawable_t hwDrawable,
|
||||
int renderType, const int *attrs,
|
||||
void *loaderPrivate);
|
||||
|
||||
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
|
||||
const __DRIconfig *config,
|
||||
int render_type,
|
||||
__DRIcontext *shared,
|
||||
drm_context_t hwContext,
|
||||
void *loaderPrivate);
|
||||
};
|
||||
|
||||
/**
|
||||
* This extension provides alternative screen, drawable and context
|
||||
* constructors for swrast DRI functionality. This is used in
|
||||
* conjunction with the core extension.
|
||||
*/
|
||||
#define __DRI_SWRAST "DRI_SWRast"
|
||||
#define __DRI_SWRAST_VERSION 1
|
||||
|
||||
struct __DRIswrastExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
__DRIscreen *(*createNewScreen)(int screen,
|
||||
const __DRIextension **extensions,
|
||||
const __DRIconfig ***driver_configs,
|
||||
void *loaderPrivate);
|
||||
|
||||
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
|
||||
const __DRIconfig *config,
|
||||
void *loaderPrivate);
|
||||
};
|
||||
|
||||
/**
|
||||
* DRI2 Loader extension.
|
||||
*/
|
||||
#define __DRI_BUFFER_FRONT_LEFT 0
|
||||
#define __DRI_BUFFER_BACK_LEFT 1
|
||||
#define __DRI_BUFFER_FRONT_RIGHT 2
|
||||
#define __DRI_BUFFER_BACK_RIGHT 3
|
||||
#define __DRI_BUFFER_DEPTH 4
|
||||
#define __DRI_BUFFER_STENCIL 5
|
||||
#define __DRI_BUFFER_ACCUM 6
|
||||
#define __DRI_BUFFER_FAKE_FRONT_LEFT 7
|
||||
#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
|
||||
#define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
|
||||
|
||||
struct __DRIbufferRec {
|
||||
unsigned int attachment;
|
||||
unsigned int name;
|
||||
unsigned int pitch;
|
||||
unsigned int cpp;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
|
||||
#define __DRI_DRI2_LOADER_VERSION 3
|
||||
struct __DRIdri2LoaderExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
__DRIbuffer *(*getBuffers)(__DRIdrawable *driDrawable,
|
||||
int *width, int *height,
|
||||
unsigned int *attachments, int count,
|
||||
int *out_count, void *loaderPrivate);
|
||||
|
||||
/**
|
||||
* Flush pending front-buffer rendering
|
||||
*
|
||||
* Any rendering that has been performed to the
|
||||
* \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
|
||||
* \c __DRI_BUFFER_FRONT_LEFT.
|
||||
*
|
||||
* \param driDrawable Drawable whose front-buffer is to be flushed
|
||||
* \param loaderPrivate Loader's private data that was previously passed
|
||||
* into __DRIdri2ExtensionRec::createNewDrawable
|
||||
*/
|
||||
void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
|
||||
|
||||
|
||||
/**
|
||||
* Get list of buffers from the server
|
||||
*
|
||||
* Gets a list of buffer for the specified set of attachments. Unlike
|
||||
* \c ::getBuffers, this function takes a list of attachments paired with
|
||||
* opaque \c unsigned \c int value describing the format of the buffer.
|
||||
* It is the responsibility of the caller to know what the service that
|
||||
* allocates the buffers will expect to receive for the format.
|
||||
*
|
||||
* \param driDrawable Drawable whose buffers are being queried.
|
||||
* \param width Output where the width of the buffers is stored.
|
||||
* \param height Output where the height of the buffers is stored.
|
||||
* \param attachments List of pairs of attachment ID and opaque format
|
||||
* requested for the drawable.
|
||||
* \param count Number of attachment / format pairs stored in
|
||||
* \c attachments.
|
||||
* \param loaderPrivate Loader's private data that was previously passed
|
||||
* into __DRIdri2ExtensionRec::createNewDrawable.
|
||||
*/
|
||||
__DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
|
||||
int *width, int *height,
|
||||
unsigned int *attachments, int count,
|
||||
int *out_count, void *loaderPrivate);
|
||||
};
|
||||
|
||||
/**
|
||||
* This extension provides alternative screen, drawable and context
|
||||
* constructors for DRI2.
|
||||
*/
|
||||
#define __DRI_DRI2 "DRI_DRI2"
|
||||
#define __DRI_DRI2_VERSION 2
|
||||
|
||||
#define __DRI_API_OPENGL 0
|
||||
#define __DRI_API_GLES 1
|
||||
#define __DRI_API_GLES2 2
|
||||
|
||||
struct __DRIdri2ExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
__DRIscreen *(*createNewScreen)(int screen, int fd,
|
||||
const __DRIextension **extensions,
|
||||
const __DRIconfig ***driver_configs,
|
||||
void *loaderPrivate);
|
||||
|
||||
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
|
||||
const __DRIconfig *config,
|
||||
void *loaderPrivate);
|
||||
|
||||
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
|
||||
const __DRIconfig *config,
|
||||
__DRIcontext *shared,
|
||||
void *loaderPrivate);
|
||||
|
||||
/* Since version 2 */
|
||||
unsigned int (*getAPIMask)(__DRIscreen *screen);
|
||||
|
||||
__DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
|
||||
int api,
|
||||
const __DRIconfig *config,
|
||||
__DRIcontext *shared,
|
||||
void *data);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* This extension provides functionality to enable various EGLImage
|
||||
* extensions.
|
||||
*/
|
||||
#define __DRI_IMAGE "DRI_IMAGE"
|
||||
#define __DRI_IMAGE_VERSION 1
|
||||
|
||||
/**
|
||||
* These formats correspond to the similarly named MESA_FORMAT_*
|
||||
* tokens, except in the native endian of the CPU. For example, on
|
||||
* little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
|
||||
* MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian.
|
||||
*/
|
||||
#define __DRI_IMAGE_FORMAT_RGB565 0x1001
|
||||
#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
|
||||
#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
|
||||
|
||||
#define __DRI_IMAGE_USE_SHARE 0x0001
|
||||
#define __DRI_IMAGE_USE_SCANOUT 0x0002
|
||||
|
||||
/**
|
||||
* queryImage attributes
|
||||
*/
|
||||
|
||||
#define __DRI_IMAGE_ATTRIB_STRIDE 0x2000
|
||||
#define __DRI_IMAGE_ATTRIB_HANDLE 0x2001
|
||||
#define __DRI_IMAGE_ATTRIB_NAME 0x2002
|
||||
|
||||
typedef struct __DRIimageRec __DRIimage;
|
||||
typedef struct __DRIimageExtensionRec __DRIimageExtension;
|
||||
struct __DRIimageExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
__DRIimage *(*createImageFromName)(__DRIscreen *screen,
|
||||
int width, int height, int format,
|
||||
int name, int pitch,
|
||||
void *loaderPrivate);
|
||||
|
||||
__DRIimage *(*createImageFromRenderbuffer)(__DRIcontext *context,
|
||||
int renderbuffer,
|
||||
void *loaderPrivate);
|
||||
|
||||
void (*destroyImage)(__DRIimage *image);
|
||||
|
||||
__DRIimage *(*createImage)(__DRIscreen *screen,
|
||||
int width, int height, int format,
|
||||
unsigned int use,
|
||||
void *loaderPrivate);
|
||||
|
||||
GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* This extension must be implemented by the loader and passed to the
|
||||
* driver at screen creation time. The EGLImage entry points in the
|
||||
* various client APIs take opaque EGLImage handles and use this
|
||||
* extension to map them to a __DRIimage. At version 1, this
|
||||
* extensions allows mapping EGLImage pointers to __DRIimage pointers,
|
||||
* but future versions could support other EGLImage-like, opaque types
|
||||
* with new lookup functions.
|
||||
*/
|
||||
#define __DRI_IMAGE_LOOKUP "DRI_IMAGE_LOOKUP"
|
||||
#define __DRI_IMAGE_LOOKUP_VERSION 1
|
||||
|
||||
typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
|
||||
struct __DRIimageLookupExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
__DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
|
||||
void *loaderPrivate);
|
||||
};
|
||||
|
||||
/**
|
||||
* This extension allows for common DRI2 options
|
||||
*/
|
||||
#define __DRI2_CONFIG_QUERY "DRI_CONFIG_QUERY"
|
||||
#define __DRI2_CONFIG_QUERY_VERSION 1
|
||||
|
||||
typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
|
||||
struct __DRI2configQueryExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
|
||||
int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
|
||||
int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
|
||||
};
|
||||
#endif
|
||||
@@ -1,92 +0,0 @@
|
||||
/**
|
||||
* \file sarea.h
|
||||
* SAREA definitions.
|
||||
*
|
||||
* \author Kevin E. Martin <kevin@precisioninsight.com>
|
||||
* \author Jens Owen <jens@tungstengraphics.com>
|
||||
* \author Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* Copyright 2000 VA Linux Systems, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SAREA_H_
|
||||
#define _SAREA_H_
|
||||
|
||||
#include "xf86drm.h"
|
||||
|
||||
/* SAREA area needs to be at least a page */
|
||||
#if defined(__alpha__)
|
||||
#define SAREA_MAX 0x2000
|
||||
#elif defined(__ia64__)
|
||||
#define SAREA_MAX 0x10000 /* 64kB */
|
||||
#else
|
||||
/* Intel 830M driver needs at least 8k SAREA */
|
||||
#define SAREA_MAX 0x2000
|
||||
#endif
|
||||
|
||||
#define SAREA_MAX_DRAWABLES 256
|
||||
|
||||
#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
|
||||
|
||||
/**
|
||||
* SAREA per drawable information.
|
||||
*
|
||||
* \sa _XF86DRISAREA.
|
||||
*/
|
||||
typedef struct _XF86DRISAREADrawable {
|
||||
unsigned int stamp;
|
||||
unsigned int flags;
|
||||
} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
|
||||
|
||||
/**
|
||||
* SAREA frame information.
|
||||
*
|
||||
* \sa _XF86DRISAREA.
|
||||
*/
|
||||
typedef struct _XF86DRISAREAFrame {
|
||||
unsigned int x;
|
||||
unsigned int y;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
unsigned int fullscreen;
|
||||
} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
|
||||
|
||||
/**
|
||||
* SAREA definition.
|
||||
*/
|
||||
typedef struct _XF86DRISAREA {
|
||||
/** first thing is always the DRM locking structure */
|
||||
drmLock lock;
|
||||
/** \todo Use readers/writer lock for drawable_lock */
|
||||
drmLock drawable_lock;
|
||||
XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
|
||||
XF86DRISAREAFrameRec frame;
|
||||
drm_context_t dummy_context;
|
||||
} XF86DRISAREARec, *XF86DRISAREAPtr;
|
||||
|
||||
#endif
|
||||
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
/* prototypes for the Mesa WGL functions */
|
||||
/* relocated here so that I could make GLUT get them properly */
|
||||
|
||||
#ifndef _mesa_wgl_h_
|
||||
#define _mesa_wgl_h_
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
# define __W32API_USE_DLLIMPORT__
|
||||
#endif
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef WGLAPI
|
||||
#define WGLAPI GLAPI
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN 1
|
||||
# endif
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
|
||||
#ifndef _GNU_H_WINDOWS32_FUNCTIONS
|
||||
# ifdef UNICODE
|
||||
# define wglUseFontBitmaps wglUseFontBitmapsW
|
||||
# define wglUseFontOutlines wglUseFontOutlinesW
|
||||
# else
|
||||
# define wglUseFontBitmaps wglUseFontBitmapsA
|
||||
# define wglUseFontOutlines wglUseFontOutlinesA
|
||||
# endif /* !UNICODE */
|
||||
#endif /* _GNU_H_WINDOWS32_FUNCTIONS */
|
||||
typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
|
||||
typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
|
||||
typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning( disable : 4615 ) /* pragma warning : unknown user warning type*/
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
|
||||
#endif
|
||||
|
||||
|
||||
WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc);
|
||||
WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
|
||||
WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
|
||||
|
||||
WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
|
||||
WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
|
||||
WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
|
||||
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
|
||||
WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
|
||||
WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
|
||||
WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
|
||||
WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
|
||||
WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
|
||||
WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
|
||||
WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
|
||||
WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
|
||||
WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
|
||||
WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
|
||||
WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
|
||||
|
||||
#ifndef __MINGW32__
|
||||
WGLAPI int GLAPIENTRY SwapBuffers(HDC);
|
||||
WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
|
||||
WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
|
||||
WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _mesa_wgl_h_ */
|
||||
@@ -1,289 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Mesa Off-Screen rendering interface.
|
||||
*
|
||||
* This is an operating system and window system independent interface to
|
||||
* Mesa which allows one to render images into a client-supplied buffer in
|
||||
* main memory. Such images may manipulated or saved in whatever way the
|
||||
* client wants.
|
||||
*
|
||||
* These are the API functions:
|
||||
* OSMesaCreateContext - create a new Off-Screen Mesa rendering context
|
||||
* OSMesaMakeCurrent - bind an OSMesaContext to a client's image buffer
|
||||
* and make the specified context the current one.
|
||||
* OSMesaDestroyContext - destroy an OSMesaContext
|
||||
* OSMesaGetCurrentContext - return thread's current context ID
|
||||
* OSMesaPixelStore - controls how pixels are stored in image buffer
|
||||
* OSMesaGetIntegerv - return OSMesa state parameters
|
||||
*
|
||||
*
|
||||
* The limits on the width and height of an image buffer are MAX_WIDTH and
|
||||
* MAX_HEIGHT as defined in Mesa/src/config.h. Defaults are 1280 and 1024.
|
||||
* You can increase them as needed but beware that many temporary arrays in
|
||||
* Mesa are dimensioned by MAX_WIDTH or MAX_HEIGHT.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef OSMESA_H
|
||||
#define OSMESA_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
|
||||
#define OSMESA_MAJOR_VERSION 6
|
||||
#define OSMESA_MINOR_VERSION 5
|
||||
#define OSMESA_PATCH_VERSION 0
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Values for the format parameter of OSMesaCreateContext()
|
||||
* New in version 2.0.
|
||||
*/
|
||||
#define OSMESA_COLOR_INDEX GL_COLOR_INDEX
|
||||
#define OSMESA_RGBA GL_RGBA
|
||||
#define OSMESA_BGRA 0x1
|
||||
#define OSMESA_ARGB 0x2
|
||||
#define OSMESA_RGB GL_RGB
|
||||
#define OSMESA_BGR 0x4
|
||||
#define OSMESA_RGB_565 0x5
|
||||
|
||||
|
||||
/*
|
||||
* OSMesaPixelStore() parameters:
|
||||
* New in version 2.0.
|
||||
*/
|
||||
#define OSMESA_ROW_LENGTH 0x10
|
||||
#define OSMESA_Y_UP 0x11
|
||||
|
||||
|
||||
/*
|
||||
* Accepted by OSMesaGetIntegerv:
|
||||
*/
|
||||
#define OSMESA_WIDTH 0x20
|
||||
#define OSMESA_HEIGHT 0x21
|
||||
#define OSMESA_FORMAT 0x22
|
||||
#define OSMESA_TYPE 0x23
|
||||
#define OSMESA_MAX_WIDTH 0x24 /* new in 4.0 */
|
||||
#define OSMESA_MAX_HEIGHT 0x25 /* new in 4.0 */
|
||||
|
||||
|
||||
typedef struct osmesa_context *OSMesaContext;
|
||||
|
||||
|
||||
#if defined(__BEOS__) || defined(__QUICKDRAW__)
|
||||
#pragma export on
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Create an Off-Screen Mesa rendering context. The only attribute needed is
|
||||
* an RGBA vs Color-Index mode flag.
|
||||
*
|
||||
* Input: format - one of OSMESA_COLOR_INDEX, OSMESA_RGBA, OSMESA_BGRA,
|
||||
* OSMESA_ARGB, OSMESA_RGB, or OSMESA_BGR.
|
||||
* sharelist - specifies another OSMesaContext with which to share
|
||||
* display lists. NULL indicates no sharing.
|
||||
* Return: an OSMesaContext or 0 if error
|
||||
*/
|
||||
GLAPI OSMesaContext GLAPIENTRY
|
||||
OSMesaCreateContext( GLenum format, OSMesaContext sharelist );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Create an Off-Screen Mesa rendering context and specify desired
|
||||
* size of depth buffer, stencil buffer and accumulation buffer.
|
||||
* If you specify zero for depthBits, stencilBits, accumBits you
|
||||
* can save some memory.
|
||||
*
|
||||
* New in Mesa 3.5
|
||||
*/
|
||||
GLAPI OSMesaContext GLAPIENTRY
|
||||
OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
|
||||
GLint accumBits, OSMesaContext sharelist);
|
||||
|
||||
|
||||
/*
|
||||
* Destroy an Off-Screen Mesa rendering context.
|
||||
*
|
||||
* Input: ctx - the context to destroy
|
||||
*/
|
||||
GLAPI void GLAPIENTRY
|
||||
OSMesaDestroyContext( OSMesaContext ctx );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Bind an OSMesaContext to an image buffer. The image buffer is just a
|
||||
* block of memory which the client provides. Its size must be at least
|
||||
* as large as width*height*sizeof(type). Its address should be a multiple
|
||||
* of 4 if using RGBA mode.
|
||||
*
|
||||
* Image data is stored in the order of glDrawPixels: row-major order
|
||||
* with the lower-left image pixel stored in the first array position
|
||||
* (ie. bottom-to-top).
|
||||
*
|
||||
* Since the only type initially supported is GL_UNSIGNED_BYTE, if the
|
||||
* context is in RGBA mode, each pixel will be stored as a 4-byte RGBA
|
||||
* value. If the context is in color indexed mode, each pixel will be
|
||||
* stored as a 1-byte value.
|
||||
*
|
||||
* If the context's viewport hasn't been initialized yet, it will now be
|
||||
* initialized to (0,0,width,height).
|
||||
*
|
||||
* Input: ctx - the rendering context
|
||||
* buffer - the image buffer memory
|
||||
* type - data type for pixel components, only GL_UNSIGNED_BYTE
|
||||
* supported now
|
||||
* width, height - size of image buffer in pixels, at least 1
|
||||
* Return: GL_TRUE if success, GL_FALSE if error because of invalid ctx,
|
||||
* invalid buffer address, type!=GL_UNSIGNED_BYTE, width<1, height<1,
|
||||
* width>internal limit or height>internal limit.
|
||||
*/
|
||||
GLAPI GLboolean GLAPIENTRY
|
||||
OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type,
|
||||
GLsizei width, GLsizei height );
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Return the current Off-Screen Mesa rendering context handle.
|
||||
*/
|
||||
GLAPI OSMesaContext GLAPIENTRY
|
||||
OSMesaGetCurrentContext( void );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Set pixel store/packing parameters for the current context.
|
||||
* This is similar to glPixelStore.
|
||||
* Input: pname - OSMESA_ROW_LENGTH
|
||||
* specify actual pixels per row in image buffer
|
||||
* 0 = same as image width (default)
|
||||
* OSMESA_Y_UP
|
||||
* zero = Y coordinates increase downward
|
||||
* non-zero = Y coordinates increase upward (default)
|
||||
* value - the value for the parameter pname
|
||||
*
|
||||
* New in version 2.0.
|
||||
*/
|
||||
GLAPI void GLAPIENTRY
|
||||
OSMesaPixelStore( GLint pname, GLint value );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Return an integer value like glGetIntegerv.
|
||||
* Input: pname -
|
||||
* OSMESA_WIDTH return current image width
|
||||
* OSMESA_HEIGHT return current image height
|
||||
* OSMESA_FORMAT return image format
|
||||
* OSMESA_TYPE return color component data type
|
||||
* OSMESA_ROW_LENGTH return row length in pixels
|
||||
* OSMESA_Y_UP returns 1 or 0 to indicate Y axis direction
|
||||
* value - pointer to integer in which to return result.
|
||||
*/
|
||||
GLAPI void GLAPIENTRY
|
||||
OSMesaGetIntegerv( GLint pname, GLint *value );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Return the depth buffer associated with an OSMesa context.
|
||||
* Input: c - the OSMesa context
|
||||
* Output: width, height - size of buffer in pixels
|
||||
* bytesPerValue - bytes per depth value (2 or 4)
|
||||
* buffer - pointer to depth buffer values
|
||||
* Return: GL_TRUE or GL_FALSE to indicate success or failure.
|
||||
*
|
||||
* New in Mesa 2.4.
|
||||
*/
|
||||
GLAPI GLboolean GLAPIENTRY
|
||||
OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height,
|
||||
GLint *bytesPerValue, void **buffer );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Return the color buffer associated with an OSMesa context.
|
||||
* Input: c - the OSMesa context
|
||||
* Output: width, height - size of buffer in pixels
|
||||
* format - buffer format (OSMESA_FORMAT)
|
||||
* buffer - pointer to depth buffer values
|
||||
* Return: GL_TRUE or GL_FALSE to indicate success or failure.
|
||||
*
|
||||
* New in Mesa 3.3.
|
||||
*/
|
||||
GLAPI GLboolean GLAPIENTRY
|
||||
OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height,
|
||||
GLint *format, void **buffer );
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This typedef is new in Mesa 6.3.
|
||||
*/
|
||||
typedef void (*OSMESAproc)();
|
||||
|
||||
|
||||
/*
|
||||
* Return pointer to the named function.
|
||||
* New in Mesa 4.1
|
||||
* Return OSMESAproc in 6.3.
|
||||
*/
|
||||
GLAPI OSMESAproc GLAPIENTRY
|
||||
OSMesaGetProcAddress( const char *funcName );
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Enable/disable color clamping, off by default.
|
||||
* New in Mesa 6.4.2
|
||||
*/
|
||||
GLAPI void GLAPIENTRY
|
||||
OSMesaColorClamp(GLboolean enable);
|
||||
|
||||
|
||||
#if defined(__BEOS__) || defined(__QUICKDRAW__)
|
||||
#pragma export off
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,901 +0,0 @@
|
||||
#ifndef __wglext_h_
|
||||
#define __wglext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2010 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Function declaration macros - to move into glplatform.h */
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#ifndef APIENTRYP
|
||||
#define APIENTRYP APIENTRY *
|
||||
#endif
|
||||
#ifndef GLAPI
|
||||
#define GLAPI extern
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number */
|
||||
/* wglext.h last updated 2010/08/06 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define WGL_WGLEXT_VERSION 22
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
|
||||
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
|
||||
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
|
||||
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
|
||||
#define WGL_SAMPLES_ARB 0x2042
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
|
||||
#define WGL_ACCELERATION_ARB 0x2003
|
||||
#define WGL_NEED_PALETTE_ARB 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
|
||||
#define WGL_SWAP_METHOD_ARB 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
|
||||
#define WGL_TRANSPARENT_ARB 0x200A
|
||||
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
|
||||
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
|
||||
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
|
||||
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
|
||||
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
|
||||
#define WGL_SHARE_DEPTH_ARB 0x200C
|
||||
#define WGL_SHARE_STENCIL_ARB 0x200D
|
||||
#define WGL_SHARE_ACCUM_ARB 0x200E
|
||||
#define WGL_SUPPORT_GDI_ARB 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_ARB 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_ARB 0x2011
|
||||
#define WGL_STEREO_ARB 0x2012
|
||||
#define WGL_PIXEL_TYPE_ARB 0x2013
|
||||
#define WGL_COLOR_BITS_ARB 0x2014
|
||||
#define WGL_RED_BITS_ARB 0x2015
|
||||
#define WGL_RED_SHIFT_ARB 0x2016
|
||||
#define WGL_GREEN_BITS_ARB 0x2017
|
||||
#define WGL_GREEN_SHIFT_ARB 0x2018
|
||||
#define WGL_BLUE_BITS_ARB 0x2019
|
||||
#define WGL_BLUE_SHIFT_ARB 0x201A
|
||||
#define WGL_ALPHA_BITS_ARB 0x201B
|
||||
#define WGL_ALPHA_SHIFT_ARB 0x201C
|
||||
#define WGL_ACCUM_BITS_ARB 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_ARB 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
|
||||
#define WGL_DEPTH_BITS_ARB 0x2022
|
||||
#define WGL_STENCIL_BITS_ARB 0x2023
|
||||
#define WGL_AUX_BUFFERS_ARB 0x2024
|
||||
#define WGL_NO_ACCELERATION_ARB 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
|
||||
#define WGL_FULL_ACCELERATION_ARB 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_ARB 0x2028
|
||||
#define WGL_SWAP_COPY_ARB 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_ARB 0x202A
|
||||
#define WGL_TYPE_RGBA_ARB 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_ARB 0x202C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
|
||||
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
|
||||
#define WGL_PBUFFER_LARGEST_ARB 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_ARB 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
|
||||
#define WGL_PBUFFER_LOST_ARB 0x2036
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
|
||||
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
|
||||
#define WGL_TEXTURE_FORMAT_ARB 0x2072
|
||||
#define WGL_TEXTURE_TARGET_ARB 0x2073
|
||||
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
|
||||
#define WGL_TEXTURE_RGB_ARB 0x2075
|
||||
#define WGL_TEXTURE_RGBA_ARB 0x2076
|
||||
#define WGL_NO_TEXTURE_ARB 0x2077
|
||||
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
|
||||
#define WGL_TEXTURE_1D_ARB 0x2079
|
||||
#define WGL_TEXTURE_2D_ARB 0x207A
|
||||
#define WGL_MIPMAP_LEVEL_ARB 0x207B
|
||||
#define WGL_CUBE_MAP_FACE_ARB 0x207C
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
|
||||
#define WGL_FRONT_LEFT_ARB 0x2083
|
||||
#define WGL_FRONT_RIGHT_ARB 0x2084
|
||||
#define WGL_BACK_LEFT_ARB 0x2085
|
||||
#define WGL_BACK_RIGHT_ARB 0x2086
|
||||
#define WGL_AUX0_ARB 0x2087
|
||||
#define WGL_AUX1_ARB 0x2088
|
||||
#define WGL_AUX2_ARB 0x2089
|
||||
#define WGL_AUX3_ARB 0x208A
|
||||
#define WGL_AUX4_ARB 0x208B
|
||||
#define WGL_AUX5_ARB 0x208C
|
||||
#define WGL_AUX6_ARB 0x208D
|
||||
#define WGL_AUX7_ARB 0x208E
|
||||
#define WGL_AUX8_ARB 0x208F
|
||||
#define WGL_AUX9_ARB 0x2090
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format_float
|
||||
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_framebuffer_sRGB
|
||||
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context
|
||||
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
|
||||
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
|
||||
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
|
||||
#define WGL_CONTEXT_FLAGS_ARB 0x2094
|
||||
#define ERROR_INVALID_VERSION_ARB 0x2095
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context_profile
|
||||
#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
|
||||
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
|
||||
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
|
||||
#define ERROR_INVALID_PROFILE_ARB 0x2096
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context_robustness
|
||||
#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
|
||||
#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
|
||||
#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
|
||||
#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
|
||||
#define WGL_ACCELERATION_EXT 0x2003
|
||||
#define WGL_NEED_PALETTE_EXT 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
|
||||
#define WGL_SWAP_METHOD_EXT 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
|
||||
#define WGL_TRANSPARENT_EXT 0x200A
|
||||
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
|
||||
#define WGL_SHARE_DEPTH_EXT 0x200C
|
||||
#define WGL_SHARE_STENCIL_EXT 0x200D
|
||||
#define WGL_SHARE_ACCUM_EXT 0x200E
|
||||
#define WGL_SUPPORT_GDI_EXT 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_EXT 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_EXT 0x2011
|
||||
#define WGL_STEREO_EXT 0x2012
|
||||
#define WGL_PIXEL_TYPE_EXT 0x2013
|
||||
#define WGL_COLOR_BITS_EXT 0x2014
|
||||
#define WGL_RED_BITS_EXT 0x2015
|
||||
#define WGL_RED_SHIFT_EXT 0x2016
|
||||
#define WGL_GREEN_BITS_EXT 0x2017
|
||||
#define WGL_GREEN_SHIFT_EXT 0x2018
|
||||
#define WGL_BLUE_BITS_EXT 0x2019
|
||||
#define WGL_BLUE_SHIFT_EXT 0x201A
|
||||
#define WGL_ALPHA_BITS_EXT 0x201B
|
||||
#define WGL_ALPHA_SHIFT_EXT 0x201C
|
||||
#define WGL_ACCUM_BITS_EXT 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_EXT 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
|
||||
#define WGL_DEPTH_BITS_EXT 0x2022
|
||||
#define WGL_STENCIL_BITS_EXT 0x2023
|
||||
#define WGL_AUX_BUFFERS_EXT 0x2024
|
||||
#define WGL_NO_ACCELERATION_EXT 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
|
||||
#define WGL_FULL_ACCELERATION_EXT 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_EXT 0x2028
|
||||
#define WGL_SWAP_COPY_EXT 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_EXT 0x202A
|
||||
#define WGL_TYPE_RGBA_EXT 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_EXT 0x202C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
|
||||
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
|
||||
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
|
||||
#define WGL_PBUFFER_LARGEST_EXT 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_EXT 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_DEPTH_FLOAT_EXT 0x2040
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
|
||||
#define WGL_SAMPLES_3DFX 0x2061
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
|
||||
#define WGL_SAMPLES_EXT 0x2042
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
|
||||
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
|
||||
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
|
||||
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_render_depth_texture
|
||||
#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
|
||||
#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
|
||||
#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
|
||||
#define WGL_DEPTH_COMPONENT_NV 0x20A7
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_render_texture_rectangle
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
|
||||
#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ATI_pixel_format_float
|
||||
#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_float_buffer
|
||||
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
|
||||
#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
|
||||
#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
|
||||
#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
|
||||
#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DL_stereo_control
|
||||
#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
|
||||
#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
|
||||
#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
|
||||
#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format_packed_float
|
||||
#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_framebuffer_sRGB
|
||||
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_present_video
|
||||
#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_video_out
|
||||
#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
|
||||
#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
|
||||
#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
|
||||
#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
|
||||
#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||
#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
|
||||
#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
|
||||
#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
|
||||
#define WGL_VIDEO_OUT_FRAME 0x20C8
|
||||
#define WGL_VIDEO_OUT_FIELD_1 0x20C9
|
||||
#define WGL_VIDEO_OUT_FIELD_2 0x20CA
|
||||
#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
|
||||
#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_swap_group
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_gpu_affinity
|
||||
#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
|
||||
#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_AMD_gpu_association
|
||||
#define WGL_GPU_VENDOR_AMD 0x1F00
|
||||
#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
|
||||
#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
|
||||
#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
|
||||
#define WGL_GPU_RAM_AMD 0x21A3
|
||||
#define WGL_GPU_CLOCK_AMD 0x21A4
|
||||
#define WGL_GPU_NUM_PIPES_AMD 0x21A5
|
||||
#define WGL_GPU_NUM_SIMD_AMD 0x21A6
|
||||
#define WGL_GPU_NUM_RB_AMD 0x21A7
|
||||
#define WGL_GPU_NUM_SPI_AMD 0x21A8
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_video_capture
|
||||
#define WGL_UNIQUE_ID_NV 0x20CE
|
||||
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_copy_image
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_multisample_coverage
|
||||
#define WGL_COVERAGE_SAMPLES_NV 0x2042
|
||||
#define WGL_COLOR_SAMPLES_NV 0x20B9
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_create_context_es2_profile
|
||||
#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
DECLARE_HANDLE(HPBUFFERARB);
|
||||
#endif
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
DECLARE_HANDLE(HPBUFFEREXT);
|
||||
#endif
|
||||
#ifndef WGL_NV_present_video
|
||||
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
|
||||
#endif
|
||||
#ifndef WGL_NV_video_output
|
||||
DECLARE_HANDLE(HPVIDEODEV);
|
||||
#endif
|
||||
#ifndef WGL_NV_gpu_affinity
|
||||
DECLARE_HANDLE(HPGPUNV);
|
||||
DECLARE_HANDLE(HGPUNV);
|
||||
|
||||
typedef struct _GPU_DEVICE {
|
||||
DWORD cb;
|
||||
CHAR DeviceName[32];
|
||||
CHAR DeviceString[128];
|
||||
DWORD Flags;
|
||||
RECT rcVirtualScreen;
|
||||
} GPU_DEVICE, *PGPU_DEVICE;
|
||||
#endif
|
||||
#ifndef WGL_NV_video_capture
|
||||
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_ARB_buffer_region 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
|
||||
extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
|
||||
extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
|
||||
extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
|
||||
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
|
||||
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
|
||||
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_ARB_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#define WGL_ARB_extensions_string 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern const char * WINAPI wglGetExtensionsStringARB (HDC hdc);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_ARB_pixel_format 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
extern BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define WGL_ARB_make_current_read 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
extern HDC WINAPI wglGetCurrentReadDCARB (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_ARB_pbuffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
|
||||
extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
|
||||
extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_ARB_render_texture 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format_float
|
||||
#define WGL_ARB_pixel_format_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_framebuffer_sRGB
|
||||
#define WGL_ARB_framebuffer_sRGB 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context
|
||||
#define WGL_ARB_create_context 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context_profile
|
||||
#define WGL_ARB_create_context_profile 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context_robustness
|
||||
#define WGL_ARB_create_context_robustness 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_display_color_table
|
||||
#define WGL_EXT_display_color_table 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
|
||||
extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
|
||||
extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
|
||||
extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
|
||||
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_extensions_string
|
||||
#define WGL_EXT_extensions_string 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern const char * WINAPI wglGetExtensionsStringEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define WGL_EXT_make_current_read 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
extern HDC WINAPI wglGetCurrentReadDCEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_EXT_pbuffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
|
||||
extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
|
||||
extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_EXT_pixel_format 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
extern BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_swap_control
|
||||
#define WGL_EXT_swap_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglSwapIntervalEXT (int interval);
|
||||
extern int WINAPI wglGetSwapIntervalEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
||||
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_EXT_depth_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_vertex_array_range
|
||||
#define WGL_NV_vertex_array_range 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern void* WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
extern void WINAPI wglFreeMemoryNV (void *pointer);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_3DFX_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_EXT_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_OML_sync_control
|
||||
#define WGL_OML_sync_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
extern BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
extern INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
extern BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
extern BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_I3D_digital_video_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
|
||||
extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_I3D_gamma 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
|
||||
extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
|
||||
extern BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
extern BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_I3D_genlock 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
|
||||
extern BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
|
||||
extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
|
||||
extern BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
|
||||
extern BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
|
||||
extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
|
||||
extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
|
||||
extern BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
|
||||
extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
|
||||
extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
|
||||
extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
|
||||
extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_I3D_image_buffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
extern BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
|
||||
extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
|
||||
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#define WGL_I3D_swap_frame_lock 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnableFrameLockI3D (void);
|
||||
extern BOOL WINAPI wglDisableFrameLockI3D (void);
|
||||
extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
|
||||
extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_usage
|
||||
#define WGL_I3D_swap_frame_usage 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
|
||||
extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
|
||||
extern BOOL WINAPI wglEndFrameTrackingI3D (void);
|
||||
extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
|
||||
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ATI_pixel_format_float
|
||||
#define WGL_ATI_pixel_format_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_float_buffer
|
||||
#define WGL_NV_float_buffer 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DL_stereo_control
|
||||
#define WGL_3DL_stereo_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format_packed_float
|
||||
#define WGL_EXT_pixel_format_packed_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_framebuffer_sRGB
|
||||
#define WGL_EXT_framebuffer_sRGB 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_present_video
|
||||
#define WGL_NV_present_video 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
|
||||
extern BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
|
||||
extern BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_video_output
|
||||
#define WGL_NV_video_output 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
|
||||
extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
|
||||
extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
|
||||
extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
|
||||
typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_swap_group
|
||||
#define WGL_NV_swap_group 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
|
||||
extern BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
|
||||
extern BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
|
||||
extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
extern BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
|
||||
extern BOOL WINAPI wglResetFrameCountNV (HDC hDC);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
|
||||
typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_gpu_affinity
|
||||
#define WGL_NV_gpu_affinity 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
|
||||
extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
|
||||
extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||
extern BOOL WINAPI wglDeleteDCNV (HDC hdc);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_AMD_gpu_association
|
||||
#define WGL_AMD_gpu_association 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
|
||||
extern INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);
|
||||
extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
|
||||
extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
|
||||
extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
|
||||
extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
|
||||
extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
|
||||
extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
|
||||
extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
|
||||
typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
|
||||
typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
|
||||
typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
|
||||
typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_video_capture
|
||||
#define WGL_NV_video_capture 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||
extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_copy_image
|
||||
#define WGL_NV_copy_image 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_multisample_coverage
|
||||
#define WGL_NV_multisample_coverage 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,141 +0,0 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.0
|
||||
* Copyright (C) 1995-1998 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Windows driver by: Mark E. Peterson (markp@ic.mankato.mn.us)
|
||||
* Updated by Li Wei (liwei@aiar.xjtu.edu.cn)
|
||||
*
|
||||
*
|
||||
***************************************************************
|
||||
* WMesa *
|
||||
* version 2.3 *
|
||||
* *
|
||||
* By *
|
||||
* Li Wei *
|
||||
* Institute of Artificial Intelligence & Robotics *
|
||||
* Xi'an Jiaotong University *
|
||||
* Email: liwei@aiar.xjtu.edu.cn *
|
||||
* Web page: http://sun.aiar.xjtu.edu.cn *
|
||||
* *
|
||||
* July 7th, 1997 *
|
||||
***************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#ifndef WMESA_H
|
||||
#define WMESA_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "GL/gl.h"
|
||||
|
||||
#if defined(_MSV_VER) && !defined(__GNUC__)
|
||||
# pragma warning (disable:4273)
|
||||
# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
|
||||
# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
|
||||
# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
|
||||
# pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */
|
||||
# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
|
||||
# pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */
|
||||
# if (MESA_WARNQUIET>1)
|
||||
# pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is the WMesa context 'handle':
|
||||
*/
|
||||
typedef struct wmesa_context *WMesaContext;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Create a new WMesaContext for rendering into a window. You must
|
||||
* have already created the window of correct visual type and with an
|
||||
* appropriate colormap.
|
||||
*
|
||||
* Input:
|
||||
* hDC - Windows device or memory context
|
||||
* Pal - Palette to use
|
||||
* rgb_flag - GL_TRUE = RGB mode,
|
||||
* GL_FALSE = color index mode
|
||||
* db_flag - GL_TRUE = double-buffered,
|
||||
* GL_FALSE = single buffered
|
||||
* alpha_flag - GL_TRUE = create software alpha buffer,
|
||||
* GL_FALSE = no software alpha buffer
|
||||
*
|
||||
* Note: Indexed mode requires double buffering under Windows.
|
||||
*
|
||||
* Return: a WMesa_context or NULL if error.
|
||||
*/
|
||||
extern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal,
|
||||
GLboolean rgb_flag,
|
||||
GLboolean db_flag,
|
||||
GLboolean alpha_flag);
|
||||
|
||||
|
||||
/*
|
||||
* Destroy a rendering context as returned by WMesaCreateContext()
|
||||
*/
|
||||
extern void WMesaDestroyContext( WMesaContext ctx );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Make the specified context the current one.
|
||||
*/
|
||||
extern void WMesaMakeCurrent( WMesaContext ctx, HDC hdc );
|
||||
|
||||
|
||||
/*
|
||||
* Return a handle to the current context.
|
||||
*/
|
||||
extern WMesaContext WMesaGetCurrentContext( void );
|
||||
|
||||
|
||||
/*
|
||||
* Swap the front and back buffers for the current context. No action
|
||||
* taken if the context is not double buffered.
|
||||
*/
|
||||
extern void WMesaSwapBuffers(HDC hdc);
|
||||
|
||||
|
||||
/*
|
||||
* In indexed color mode we need to know when the palette changes.
|
||||
*/
|
||||
extern void WMesaPaletteChange(HPALETTE Pal);
|
||||
|
||||
extern void WMesaMove(void);
|
||||
|
||||
void WMesaShareLists(WMesaContext ctx_to_share, WMesaContext ctx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
* Skeleton egl.h to provide compatibility for early GLES 1.0
|
||||
* applications. Several early implementations included gl.h
|
||||
* in egl.h leading applications to include only egl.h
|
||||
*
|
||||
* $Revision: 6252 $ on $Date:: 2008-08-06 16:35:08 -0700 #$
|
||||
*/
|
||||
|
||||
#ifndef __legacy_egl_h_
|
||||
#define __legacy_egl_h_
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <GLES/gl.h>
|
||||
|
||||
#endif /* __legacy_egl_h_ */
|
||||
@@ -1,770 +0,0 @@
|
||||
#ifndef __gl_h_
|
||||
#define __gl_h_
|
||||
|
||||
/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
|
||||
|
||||
#include <GLES/glplatform.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This document is licensed under the SGI Free Software B License Version
|
||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
||||
*/
|
||||
|
||||
typedef void GLvoid;
|
||||
typedef char GLchar;
|
||||
typedef unsigned int GLenum;
|
||||
typedef unsigned char GLboolean;
|
||||
typedef unsigned int GLbitfield;
|
||||
typedef khronos_int8_t GLbyte;
|
||||
typedef short GLshort;
|
||||
typedef int GLint;
|
||||
typedef int GLsizei;
|
||||
typedef khronos_uint8_t GLubyte;
|
||||
typedef unsigned short GLushort;
|
||||
typedef unsigned int GLuint;
|
||||
typedef khronos_float_t GLfloat;
|
||||
typedef khronos_float_t GLclampf;
|
||||
typedef khronos_int32_t GLfixed;
|
||||
typedef khronos_int32_t GLclampx;
|
||||
|
||||
typedef khronos_intptr_t GLintptr;
|
||||
typedef khronos_ssize_t GLsizeiptr;
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* OpenGL ES core versions */
|
||||
#define GL_VERSION_ES_CM_1_0 1
|
||||
#define GL_VERSION_ES_CL_1_0 1
|
||||
#define GL_VERSION_ES_CM_1_1 1
|
||||
#define GL_VERSION_ES_CL_1_1 1
|
||||
|
||||
/* ClearBufferMask */
|
||||
#define GL_DEPTH_BUFFER_BIT 0x00000100
|
||||
#define GL_STENCIL_BUFFER_BIT 0x00000400
|
||||
#define GL_COLOR_BUFFER_BIT 0x00004000
|
||||
|
||||
/* Boolean */
|
||||
#define GL_FALSE 0
|
||||
#define GL_TRUE 1
|
||||
|
||||
/* BeginMode */
|
||||
#define GL_POINTS 0x0000
|
||||
#define GL_LINES 0x0001
|
||||
#define GL_LINE_LOOP 0x0002
|
||||
#define GL_LINE_STRIP 0x0003
|
||||
#define GL_TRIANGLES 0x0004
|
||||
#define GL_TRIANGLE_STRIP 0x0005
|
||||
#define GL_TRIANGLE_FAN 0x0006
|
||||
|
||||
/* AlphaFunction */
|
||||
#define GL_NEVER 0x0200
|
||||
#define GL_LESS 0x0201
|
||||
#define GL_EQUAL 0x0202
|
||||
#define GL_LEQUAL 0x0203
|
||||
#define GL_GREATER 0x0204
|
||||
#define GL_NOTEQUAL 0x0205
|
||||
#define GL_GEQUAL 0x0206
|
||||
#define GL_ALWAYS 0x0207
|
||||
|
||||
/* BlendingFactorDest */
|
||||
#define GL_ZERO 0
|
||||
#define GL_ONE 1
|
||||
#define GL_SRC_COLOR 0x0300
|
||||
#define GL_ONE_MINUS_SRC_COLOR 0x0301
|
||||
#define GL_SRC_ALPHA 0x0302
|
||||
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
|
||||
#define GL_DST_ALPHA 0x0304
|
||||
#define GL_ONE_MINUS_DST_ALPHA 0x0305
|
||||
|
||||
/* BlendingFactorSrc */
|
||||
/* GL_ZERO */
|
||||
/* GL_ONE */
|
||||
#define GL_DST_COLOR 0x0306
|
||||
#define GL_ONE_MINUS_DST_COLOR 0x0307
|
||||
#define GL_SRC_ALPHA_SATURATE 0x0308
|
||||
/* GL_SRC_ALPHA */
|
||||
/* GL_ONE_MINUS_SRC_ALPHA */
|
||||
/* GL_DST_ALPHA */
|
||||
/* GL_ONE_MINUS_DST_ALPHA */
|
||||
|
||||
/* ClipPlaneName */
|
||||
#define GL_CLIP_PLANE0 0x3000
|
||||
#define GL_CLIP_PLANE1 0x3001
|
||||
#define GL_CLIP_PLANE2 0x3002
|
||||
#define GL_CLIP_PLANE3 0x3003
|
||||
#define GL_CLIP_PLANE4 0x3004
|
||||
#define GL_CLIP_PLANE5 0x3005
|
||||
|
||||
/* ColorMaterialFace */
|
||||
/* GL_FRONT_AND_BACK */
|
||||
|
||||
/* ColorMaterialParameter */
|
||||
/* GL_AMBIENT_AND_DIFFUSE */
|
||||
|
||||
/* ColorPointerType */
|
||||
/* GL_UNSIGNED_BYTE */
|
||||
/* GL_FLOAT */
|
||||
/* GL_FIXED */
|
||||
|
||||
/* CullFaceMode */
|
||||
#define GL_FRONT 0x0404
|
||||
#define GL_BACK 0x0405
|
||||
#define GL_FRONT_AND_BACK 0x0408
|
||||
|
||||
/* DepthFunction */
|
||||
/* GL_NEVER */
|
||||
/* GL_LESS */
|
||||
/* GL_EQUAL */
|
||||
/* GL_LEQUAL */
|
||||
/* GL_GREATER */
|
||||
/* GL_NOTEQUAL */
|
||||
/* GL_GEQUAL */
|
||||
/* GL_ALWAYS */
|
||||
|
||||
/* EnableCap */
|
||||
#define GL_FOG 0x0B60
|
||||
#define GL_LIGHTING 0x0B50
|
||||
#define GL_TEXTURE_2D 0x0DE1
|
||||
#define GL_CULL_FACE 0x0B44
|
||||
#define GL_ALPHA_TEST 0x0BC0
|
||||
#define GL_BLEND 0x0BE2
|
||||
#define GL_COLOR_LOGIC_OP 0x0BF2
|
||||
#define GL_DITHER 0x0BD0
|
||||
#define GL_STENCIL_TEST 0x0B90
|
||||
#define GL_DEPTH_TEST 0x0B71
|
||||
/* GL_LIGHT0 */
|
||||
/* GL_LIGHT1 */
|
||||
/* GL_LIGHT2 */
|
||||
/* GL_LIGHT3 */
|
||||
/* GL_LIGHT4 */
|
||||
/* GL_LIGHT5 */
|
||||
/* GL_LIGHT6 */
|
||||
/* GL_LIGHT7 */
|
||||
#define GL_POINT_SMOOTH 0x0B10
|
||||
#define GL_LINE_SMOOTH 0x0B20
|
||||
#define GL_SCISSOR_TEST 0x0C11
|
||||
#define GL_COLOR_MATERIAL 0x0B57
|
||||
#define GL_NORMALIZE 0x0BA1
|
||||
#define GL_RESCALE_NORMAL 0x803A
|
||||
#define GL_POLYGON_OFFSET_FILL 0x8037
|
||||
#define GL_VERTEX_ARRAY 0x8074
|
||||
#define GL_NORMAL_ARRAY 0x8075
|
||||
#define GL_COLOR_ARRAY 0x8076
|
||||
#define GL_TEXTURE_COORD_ARRAY 0x8078
|
||||
#define GL_MULTISAMPLE 0x809D
|
||||
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
|
||||
#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
|
||||
#define GL_SAMPLE_COVERAGE 0x80A0
|
||||
|
||||
/* ErrorCode */
|
||||
#define GL_NO_ERROR 0
|
||||
#define GL_INVALID_ENUM 0x0500
|
||||
#define GL_INVALID_VALUE 0x0501
|
||||
#define GL_INVALID_OPERATION 0x0502
|
||||
#define GL_STACK_OVERFLOW 0x0503
|
||||
#define GL_STACK_UNDERFLOW 0x0504
|
||||
#define GL_OUT_OF_MEMORY 0x0505
|
||||
|
||||
/* FogMode */
|
||||
/* GL_LINEAR */
|
||||
#define GL_EXP 0x0800
|
||||
#define GL_EXP2 0x0801
|
||||
|
||||
/* FogParameter */
|
||||
#define GL_FOG_DENSITY 0x0B62
|
||||
#define GL_FOG_START 0x0B63
|
||||
#define GL_FOG_END 0x0B64
|
||||
#define GL_FOG_MODE 0x0B65
|
||||
#define GL_FOG_COLOR 0x0B66
|
||||
|
||||
/* FrontFaceDirection */
|
||||
#define GL_CW 0x0900
|
||||
#define GL_CCW 0x0901
|
||||
|
||||
/* GetPName */
|
||||
#define GL_CURRENT_COLOR 0x0B00
|
||||
#define GL_CURRENT_NORMAL 0x0B02
|
||||
#define GL_CURRENT_TEXTURE_COORDS 0x0B03
|
||||
#define GL_POINT_SIZE 0x0B11
|
||||
#define GL_POINT_SIZE_MIN 0x8126
|
||||
#define GL_POINT_SIZE_MAX 0x8127
|
||||
#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
|
||||
#define GL_POINT_DISTANCE_ATTENUATION 0x8129
|
||||
#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
|
||||
#define GL_LINE_WIDTH 0x0B21
|
||||
#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
|
||||
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
|
||||
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
|
||||
#define GL_CULL_FACE_MODE 0x0B45
|
||||
#define GL_FRONT_FACE 0x0B46
|
||||
#define GL_SHADE_MODEL 0x0B54
|
||||
#define GL_DEPTH_RANGE 0x0B70
|
||||
#define GL_DEPTH_WRITEMASK 0x0B72
|
||||
#define GL_DEPTH_CLEAR_VALUE 0x0B73
|
||||
#define GL_DEPTH_FUNC 0x0B74
|
||||
#define GL_STENCIL_CLEAR_VALUE 0x0B91
|
||||
#define GL_STENCIL_FUNC 0x0B92
|
||||
#define GL_STENCIL_VALUE_MASK 0x0B93
|
||||
#define GL_STENCIL_FAIL 0x0B94
|
||||
#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
|
||||
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
|
||||
#define GL_STENCIL_REF 0x0B97
|
||||
#define GL_STENCIL_WRITEMASK 0x0B98
|
||||
#define GL_MATRIX_MODE 0x0BA0
|
||||
#define GL_VIEWPORT 0x0BA2
|
||||
#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
|
||||
#define GL_PROJECTION_STACK_DEPTH 0x0BA4
|
||||
#define GL_TEXTURE_STACK_DEPTH 0x0BA5
|
||||
#define GL_MODELVIEW_MATRIX 0x0BA6
|
||||
#define GL_PROJECTION_MATRIX 0x0BA7
|
||||
#define GL_TEXTURE_MATRIX 0x0BA8
|
||||
#define GL_ALPHA_TEST_FUNC 0x0BC1
|
||||
#define GL_ALPHA_TEST_REF 0x0BC2
|
||||
#define GL_BLEND_DST 0x0BE0
|
||||
#define GL_BLEND_SRC 0x0BE1
|
||||
#define GL_LOGIC_OP_MODE 0x0BF0
|
||||
#define GL_SCISSOR_BOX 0x0C10
|
||||
#define GL_SCISSOR_TEST 0x0C11
|
||||
#define GL_COLOR_CLEAR_VALUE 0x0C22
|
||||
#define GL_COLOR_WRITEMASK 0x0C23
|
||||
#define GL_UNPACK_ALIGNMENT 0x0CF5
|
||||
#define GL_PACK_ALIGNMENT 0x0D05
|
||||
#define GL_MAX_LIGHTS 0x0D31
|
||||
#define GL_MAX_CLIP_PLANES 0x0D32
|
||||
#define GL_MAX_TEXTURE_SIZE 0x0D33
|
||||
#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
|
||||
#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
|
||||
#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
|
||||
#define GL_MAX_VIEWPORT_DIMS 0x0D3A
|
||||
#define GL_MAX_TEXTURE_UNITS 0x84E2
|
||||
#define GL_SUBPIXEL_BITS 0x0D50
|
||||
#define GL_RED_BITS 0x0D52
|
||||
#define GL_GREEN_BITS 0x0D53
|
||||
#define GL_BLUE_BITS 0x0D54
|
||||
#define GL_ALPHA_BITS 0x0D55
|
||||
#define GL_DEPTH_BITS 0x0D56
|
||||
#define GL_STENCIL_BITS 0x0D57
|
||||
#define GL_POLYGON_OFFSET_UNITS 0x2A00
|
||||
#define GL_POLYGON_OFFSET_FILL 0x8037
|
||||
#define GL_POLYGON_OFFSET_FACTOR 0x8038
|
||||
#define GL_TEXTURE_BINDING_2D 0x8069
|
||||
#define GL_VERTEX_ARRAY_SIZE 0x807A
|
||||
#define GL_VERTEX_ARRAY_TYPE 0x807B
|
||||
#define GL_VERTEX_ARRAY_STRIDE 0x807C
|
||||
#define GL_NORMAL_ARRAY_TYPE 0x807E
|
||||
#define GL_NORMAL_ARRAY_STRIDE 0x807F
|
||||
#define GL_COLOR_ARRAY_SIZE 0x8081
|
||||
#define GL_COLOR_ARRAY_TYPE 0x8082
|
||||
#define GL_COLOR_ARRAY_STRIDE 0x8083
|
||||
#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
|
||||
#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
|
||||
#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
|
||||
#define GL_VERTEX_ARRAY_POINTER 0x808E
|
||||
#define GL_NORMAL_ARRAY_POINTER 0x808F
|
||||
#define GL_COLOR_ARRAY_POINTER 0x8090
|
||||
#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
|
||||
#define GL_SAMPLE_BUFFERS 0x80A8
|
||||
#define GL_SAMPLES 0x80A9
|
||||
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
|
||||
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
|
||||
|
||||
/* GetTextureParameter */
|
||||
/* GL_TEXTURE_MAG_FILTER */
|
||||
/* GL_TEXTURE_MIN_FILTER */
|
||||
/* GL_TEXTURE_WRAP_S */
|
||||
/* GL_TEXTURE_WRAP_T */
|
||||
|
||||
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
|
||||
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
|
||||
|
||||
/* HintMode */
|
||||
#define GL_DONT_CARE 0x1100
|
||||
#define GL_FASTEST 0x1101
|
||||
#define GL_NICEST 0x1102
|
||||
|
||||
/* HintTarget */
|
||||
#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
|
||||
#define GL_POINT_SMOOTH_HINT 0x0C51
|
||||
#define GL_LINE_SMOOTH_HINT 0x0C52
|
||||
#define GL_FOG_HINT 0x0C54
|
||||
#define GL_GENERATE_MIPMAP_HINT 0x8192
|
||||
|
||||
/* LightModelParameter */
|
||||
#define GL_LIGHT_MODEL_AMBIENT 0x0B53
|
||||
#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
|
||||
|
||||
/* LightParameter */
|
||||
#define GL_AMBIENT 0x1200
|
||||
#define GL_DIFFUSE 0x1201
|
||||
#define GL_SPECULAR 0x1202
|
||||
#define GL_POSITION 0x1203
|
||||
#define GL_SPOT_DIRECTION 0x1204
|
||||
#define GL_SPOT_EXPONENT 0x1205
|
||||
#define GL_SPOT_CUTOFF 0x1206
|
||||
#define GL_CONSTANT_ATTENUATION 0x1207
|
||||
#define GL_LINEAR_ATTENUATION 0x1208
|
||||
#define GL_QUADRATIC_ATTENUATION 0x1209
|
||||
|
||||
/* DataType */
|
||||
#define GL_BYTE 0x1400
|
||||
#define GL_UNSIGNED_BYTE 0x1401
|
||||
#define GL_SHORT 0x1402
|
||||
#define GL_UNSIGNED_SHORT 0x1403
|
||||
#define GL_FLOAT 0x1406
|
||||
#define GL_FIXED 0x140C
|
||||
|
||||
/* LogicOp */
|
||||
#define GL_CLEAR 0x1500
|
||||
#define GL_AND 0x1501
|
||||
#define GL_AND_REVERSE 0x1502
|
||||
#define GL_COPY 0x1503
|
||||
#define GL_AND_INVERTED 0x1504
|
||||
#define GL_NOOP 0x1505
|
||||
#define GL_XOR 0x1506
|
||||
#define GL_OR 0x1507
|
||||
#define GL_NOR 0x1508
|
||||
#define GL_EQUIV 0x1509
|
||||
#define GL_INVERT 0x150A
|
||||
#define GL_OR_REVERSE 0x150B
|
||||
#define GL_COPY_INVERTED 0x150C
|
||||
#define GL_OR_INVERTED 0x150D
|
||||
#define GL_NAND 0x150E
|
||||
#define GL_SET 0x150F
|
||||
|
||||
/* MaterialFace */
|
||||
/* GL_FRONT_AND_BACK */
|
||||
|
||||
/* MaterialParameter */
|
||||
#define GL_EMISSION 0x1600
|
||||
#define GL_SHININESS 0x1601
|
||||
#define GL_AMBIENT_AND_DIFFUSE 0x1602
|
||||
/* GL_AMBIENT */
|
||||
/* GL_DIFFUSE */
|
||||
/* GL_SPECULAR */
|
||||
|
||||
/* MatrixMode */
|
||||
#define GL_MODELVIEW 0x1700
|
||||
#define GL_PROJECTION 0x1701
|
||||
#define GL_TEXTURE 0x1702
|
||||
|
||||
/* NormalPointerType */
|
||||
/* GL_BYTE */
|
||||
/* GL_SHORT */
|
||||
/* GL_FLOAT */
|
||||
/* GL_FIXED */
|
||||
|
||||
/* PixelFormat */
|
||||
#define GL_ALPHA 0x1906
|
||||
#define GL_RGB 0x1907
|
||||
#define GL_RGBA 0x1908
|
||||
#define GL_LUMINANCE 0x1909
|
||||
#define GL_LUMINANCE_ALPHA 0x190A
|
||||
|
||||
/* PixelStoreParameter */
|
||||
#define GL_UNPACK_ALIGNMENT 0x0CF5
|
||||
#define GL_PACK_ALIGNMENT 0x0D05
|
||||
|
||||
/* PixelType */
|
||||
/* GL_UNSIGNED_BYTE */
|
||||
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
|
||||
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
|
||||
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
|
||||
|
||||
/* ShadingModel */
|
||||
#define GL_FLAT 0x1D00
|
||||
#define GL_SMOOTH 0x1D01
|
||||
|
||||
/* StencilFunction */
|
||||
/* GL_NEVER */
|
||||
/* GL_LESS */
|
||||
/* GL_EQUAL */
|
||||
/* GL_LEQUAL */
|
||||
/* GL_GREATER */
|
||||
/* GL_NOTEQUAL */
|
||||
/* GL_GEQUAL */
|
||||
/* GL_ALWAYS */
|
||||
|
||||
/* StencilOp */
|
||||
/* GL_ZERO */
|
||||
#define GL_KEEP 0x1E00
|
||||
#define GL_REPLACE 0x1E01
|
||||
#define GL_INCR 0x1E02
|
||||
#define GL_DECR 0x1E03
|
||||
/* GL_INVERT */
|
||||
|
||||
/* StringName */
|
||||
#define GL_VENDOR 0x1F00
|
||||
#define GL_RENDERER 0x1F01
|
||||
#define GL_VERSION 0x1F02
|
||||
#define GL_EXTENSIONS 0x1F03
|
||||
|
||||
/* TexCoordPointerType */
|
||||
/* GL_SHORT */
|
||||
/* GL_FLOAT */
|
||||
/* GL_FIXED */
|
||||
/* GL_BYTE */
|
||||
|
||||
/* TextureEnvMode */
|
||||
#define GL_MODULATE 0x2100
|
||||
#define GL_DECAL 0x2101
|
||||
/* GL_BLEND */
|
||||
#define GL_ADD 0x0104
|
||||
/* GL_REPLACE */
|
||||
|
||||
/* TextureEnvParameter */
|
||||
#define GL_TEXTURE_ENV_MODE 0x2200
|
||||
#define GL_TEXTURE_ENV_COLOR 0x2201
|
||||
|
||||
/* TextureEnvTarget */
|
||||
#define GL_TEXTURE_ENV 0x2300
|
||||
|
||||
/* TextureMagFilter */
|
||||
#define GL_NEAREST 0x2600
|
||||
#define GL_LINEAR 0x2601
|
||||
|
||||
/* TextureMinFilter */
|
||||
/* GL_NEAREST */
|
||||
/* GL_LINEAR */
|
||||
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
|
||||
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
|
||||
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
|
||||
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
|
||||
|
||||
/* TextureParameterName */
|
||||
#define GL_TEXTURE_MAG_FILTER 0x2800
|
||||
#define GL_TEXTURE_MIN_FILTER 0x2801
|
||||
#define GL_TEXTURE_WRAP_S 0x2802
|
||||
#define GL_TEXTURE_WRAP_T 0x2803
|
||||
#define GL_GENERATE_MIPMAP 0x8191
|
||||
|
||||
/* TextureTarget */
|
||||
/* GL_TEXTURE_2D */
|
||||
|
||||
/* TextureUnit */
|
||||
#define GL_TEXTURE0 0x84C0
|
||||
#define GL_TEXTURE1 0x84C1
|
||||
#define GL_TEXTURE2 0x84C2
|
||||
#define GL_TEXTURE3 0x84C3
|
||||
#define GL_TEXTURE4 0x84C4
|
||||
#define GL_TEXTURE5 0x84C5
|
||||
#define GL_TEXTURE6 0x84C6
|
||||
#define GL_TEXTURE7 0x84C7
|
||||
#define GL_TEXTURE8 0x84C8
|
||||
#define GL_TEXTURE9 0x84C9
|
||||
#define GL_TEXTURE10 0x84CA
|
||||
#define GL_TEXTURE11 0x84CB
|
||||
#define GL_TEXTURE12 0x84CC
|
||||
#define GL_TEXTURE13 0x84CD
|
||||
#define GL_TEXTURE14 0x84CE
|
||||
#define GL_TEXTURE15 0x84CF
|
||||
#define GL_TEXTURE16 0x84D0
|
||||
#define GL_TEXTURE17 0x84D1
|
||||
#define GL_TEXTURE18 0x84D2
|
||||
#define GL_TEXTURE19 0x84D3
|
||||
#define GL_TEXTURE20 0x84D4
|
||||
#define GL_TEXTURE21 0x84D5
|
||||
#define GL_TEXTURE22 0x84D6
|
||||
#define GL_TEXTURE23 0x84D7
|
||||
#define GL_TEXTURE24 0x84D8
|
||||
#define GL_TEXTURE25 0x84D9
|
||||
#define GL_TEXTURE26 0x84DA
|
||||
#define GL_TEXTURE27 0x84DB
|
||||
#define GL_TEXTURE28 0x84DC
|
||||
#define GL_TEXTURE29 0x84DD
|
||||
#define GL_TEXTURE30 0x84DE
|
||||
#define GL_TEXTURE31 0x84DF
|
||||
#define GL_ACTIVE_TEXTURE 0x84E0
|
||||
#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
|
||||
|
||||
/* TextureWrapMode */
|
||||
#define GL_REPEAT 0x2901
|
||||
#define GL_CLAMP_TO_EDGE 0x812F
|
||||
|
||||
/* VertexPointerType */
|
||||
/* GL_SHORT */
|
||||
/* GL_FLOAT */
|
||||
/* GL_FIXED */
|
||||
/* GL_BYTE */
|
||||
|
||||
/* LightName */
|
||||
#define GL_LIGHT0 0x4000
|
||||
#define GL_LIGHT1 0x4001
|
||||
#define GL_LIGHT2 0x4002
|
||||
#define GL_LIGHT3 0x4003
|
||||
#define GL_LIGHT4 0x4004
|
||||
#define GL_LIGHT5 0x4005
|
||||
#define GL_LIGHT6 0x4006
|
||||
#define GL_LIGHT7 0x4007
|
||||
|
||||
/* Buffer Objects */
|
||||
#define GL_ARRAY_BUFFER 0x8892
|
||||
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
||||
|
||||
#define GL_ARRAY_BUFFER_BINDING 0x8894
|
||||
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
|
||||
#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
|
||||
#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
|
||||
#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
|
||||
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
|
||||
|
||||
#define GL_STATIC_DRAW 0x88E4
|
||||
#define GL_DYNAMIC_DRAW 0x88E8
|
||||
|
||||
#define GL_BUFFER_SIZE 0x8764
|
||||
#define GL_BUFFER_USAGE 0x8765
|
||||
|
||||
/* Texture combine + dot3 */
|
||||
#define GL_SUBTRACT 0x84E7
|
||||
#define GL_COMBINE 0x8570
|
||||
#define GL_COMBINE_RGB 0x8571
|
||||
#define GL_COMBINE_ALPHA 0x8572
|
||||
#define GL_RGB_SCALE 0x8573
|
||||
#define GL_ADD_SIGNED 0x8574
|
||||
#define GL_INTERPOLATE 0x8575
|
||||
#define GL_CONSTANT 0x8576
|
||||
#define GL_PRIMARY_COLOR 0x8577
|
||||
#define GL_PREVIOUS 0x8578
|
||||
#define GL_OPERAND0_RGB 0x8590
|
||||
#define GL_OPERAND1_RGB 0x8591
|
||||
#define GL_OPERAND2_RGB 0x8592
|
||||
#define GL_OPERAND0_ALPHA 0x8598
|
||||
#define GL_OPERAND1_ALPHA 0x8599
|
||||
#define GL_OPERAND2_ALPHA 0x859A
|
||||
|
||||
#define GL_ALPHA_SCALE 0x0D1C
|
||||
|
||||
#define GL_SRC0_RGB 0x8580
|
||||
#define GL_SRC1_RGB 0x8581
|
||||
#define GL_SRC2_RGB 0x8582
|
||||
#define GL_SRC0_ALPHA 0x8588
|
||||
#define GL_SRC1_ALPHA 0x8589
|
||||
#define GL_SRC2_ALPHA 0x858A
|
||||
|
||||
#define GL_DOT3_RGB 0x86AE
|
||||
#define GL_DOT3_RGBA 0x86AF
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* required OES extension tokens
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* OES_read_format */
|
||||
#ifndef GL_OES_read_format
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
|
||||
#endif
|
||||
|
||||
/* GL_OES_compressed_paletted_texture */
|
||||
#ifndef GL_OES_compressed_paletted_texture
|
||||
#define GL_PALETTE4_RGB8_OES 0x8B90
|
||||
#define GL_PALETTE4_RGBA8_OES 0x8B91
|
||||
#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
|
||||
#define GL_PALETTE4_RGBA4_OES 0x8B93
|
||||
#define GL_PALETTE4_RGB5_A1_OES 0x8B94
|
||||
#define GL_PALETTE8_RGB8_OES 0x8B95
|
||||
#define GL_PALETTE8_RGBA8_OES 0x8B96
|
||||
#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
|
||||
#define GL_PALETTE8_RGBA4_OES 0x8B98
|
||||
#define GL_PALETTE8_RGB5_A1_OES 0x8B99
|
||||
#endif
|
||||
|
||||
/* OES_point_size_array */
|
||||
#ifndef GL_OES_point_size_array
|
||||
#define GL_POINT_SIZE_ARRAY_OES 0x8B9C
|
||||
#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A
|
||||
#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B
|
||||
#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C
|
||||
#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F
|
||||
#endif
|
||||
|
||||
/* GL_OES_point_sprite */
|
||||
#ifndef GL_OES_point_sprite
|
||||
#define GL_POINT_SPRITE_OES 0x8861
|
||||
#define GL_COORD_REPLACE_OES 0x8862
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Available only in Common profile */
|
||||
GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref);
|
||||
GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
GL_API void GL_APIENTRY glClearDepthf (GLclampf depth);
|
||||
GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation);
|
||||
GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
|
||||
GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
|
||||
GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]);
|
||||
GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params);
|
||||
GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
|
||||
GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
|
||||
GL_API void GL_APIENTRY glGetTexEnvfv (GLenum env, GLenum pname, GLfloat *params);
|
||||
GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
|
||||
GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glLineWidth (GLfloat width);
|
||||
GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m);
|
||||
GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m);
|
||||
GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
|
||||
GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
|
||||
GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glPointSize (GLfloat size);
|
||||
GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
|
||||
GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
|
||||
GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
|
||||
|
||||
/* Available in both Common and Common-Lite profiles */
|
||||
GL_API void GL_APIENTRY glActiveTexture (GLenum texture);
|
||||
GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref);
|
||||
GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
|
||||
GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
|
||||
GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
|
||||
GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
|
||||
GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
|
||||
GL_API void GL_APIENTRY glClear (GLbitfield mask);
|
||||
GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
|
||||
GL_API void GL_APIENTRY glClearDepthx (GLclampx depth);
|
||||
GL_API void GL_APIENTRY glClearStencil (GLint s);
|
||||
GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture);
|
||||
GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation);
|
||||
GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
|
||||
GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
|
||||
GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_API void GL_APIENTRY glCullFace (GLenum mode);
|
||||
GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
|
||||
GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
|
||||
GL_API void GL_APIENTRY glDepthFunc (GLenum func);
|
||||
GL_API void GL_APIENTRY glDepthMask (GLboolean flag);
|
||||
GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar);
|
||||
GL_API void GL_APIENTRY glDisable (GLenum cap);
|
||||
GL_API void GL_APIENTRY glDisableClientState (GLenum array);
|
||||
GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
|
||||
GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
GL_API void GL_APIENTRY glEnable (GLenum cap);
|
||||
GL_API void GL_APIENTRY glEnableClientState (GLenum array);
|
||||
GL_API void GL_APIENTRY glFinish (void);
|
||||
GL_API void GL_APIENTRY glFlush (void);
|
||||
GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glFrontFace (GLenum mode);
|
||||
GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
|
||||
GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
|
||||
GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
|
||||
GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]);
|
||||
GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
|
||||
GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
|
||||
GL_API GLenum GL_APIENTRY glGetError (void);
|
||||
GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params);
|
||||
GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glGetPointerv (GLenum pname, GLvoid **params);
|
||||
GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name);
|
||||
GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params);
|
||||
GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
|
||||
GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode);
|
||||
GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
|
||||
GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
|
||||
GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture);
|
||||
GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glLineWidthx (GLfixed width);
|
||||
GL_API void GL_APIENTRY glLoadIdentity (void);
|
||||
GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m);
|
||||
GL_API void GL_APIENTRY glLogicOp (GLenum opcode);
|
||||
GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glMatrixMode (GLenum mode);
|
||||
GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m);
|
||||
GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
|
||||
GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz);
|
||||
GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
|
||||
GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
|
||||
GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glPointSizex (GLfixed size);
|
||||
GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units);
|
||||
GL_API void GL_APIENTRY glPopMatrix (void);
|
||||
GL_API void GL_APIENTRY glPushMatrix (void);
|
||||
GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
|
||||
GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
|
||||
GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
|
||||
GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert);
|
||||
GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z);
|
||||
GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_API void GL_APIENTRY glShadeModel (GLenum mode);
|
||||
GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
|
||||
GL_API void GL_APIENTRY glStencilMask (GLuint mask);
|
||||
GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
|
||||
GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
|
||||
GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
|
||||
GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
|
||||
GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
|
||||
GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z);
|
||||
GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* Required OES extension functions
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_OES_read_format */
|
||||
#ifndef GL_OES_read_format
|
||||
#define GL_OES_read_format 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_compressed_paletted_texture */
|
||||
#ifndef GL_OES_compressed_paletted_texture
|
||||
#define GL_OES_compressed_paletted_texture 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_point_size_array */
|
||||
#ifndef GL_OES_point_size_array
|
||||
#define GL_OES_point_size_array 1
|
||||
GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
#endif
|
||||
|
||||
/* GL_OES_point_sprite */
|
||||
#ifndef GL_OES_point_sprite
|
||||
#define GL_OES_point_sprite 1
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __gl_h_ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,30 +0,0 @@
|
||||
#ifndef __glplatform_h_
|
||||
#define __glplatform_h_
|
||||
|
||||
/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
|
||||
|
||||
/*
|
||||
* This document is licensed under the SGI Free Software B License Version
|
||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for OpenGL ES 1.X gl.h
|
||||
*
|
||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||
* You are encouraged to submit all modifications to the Khronos group so that
|
||||
* they can be included in future versions of this file. Please submit changes
|
||||
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
|
||||
* by filing a bug against product "OpenGL-ES" component "Registry".
|
||||
*/
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
#ifndef GL_API
|
||||
#define GL_API KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
#ifndef GL_APIENTRY
|
||||
#define GL_APIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
#endif /* __glplatform_h_ */
|
||||
@@ -1,621 +0,0 @@
|
||||
#ifndef __gl2_h_
|
||||
#define __gl2_h_
|
||||
|
||||
/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
|
||||
|
||||
#include <GLES2/gl2platform.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This document is licensed under the SGI Free Software B License Version
|
||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
||||
*/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Data type definitions
|
||||
*-----------------------------------------------------------------------*/
|
||||
|
||||
typedef void GLvoid;
|
||||
typedef char GLchar;
|
||||
typedef unsigned int GLenum;
|
||||
typedef unsigned char GLboolean;
|
||||
typedef unsigned int GLbitfield;
|
||||
typedef khronos_int8_t GLbyte;
|
||||
typedef short GLshort;
|
||||
typedef int GLint;
|
||||
typedef int GLsizei;
|
||||
typedef khronos_uint8_t GLubyte;
|
||||
typedef unsigned short GLushort;
|
||||
typedef unsigned int GLuint;
|
||||
typedef khronos_float_t GLfloat;
|
||||
typedef khronos_float_t GLclampf;
|
||||
typedef khronos_int32_t GLfixed;
|
||||
|
||||
/* GL types for handling large vertex buffer objects */
|
||||
typedef khronos_intptr_t GLintptr;
|
||||
typedef khronos_ssize_t GLsizeiptr;
|
||||
|
||||
/* OpenGL ES core versions */
|
||||
#define GL_ES_VERSION_2_0 1
|
||||
|
||||
/* ClearBufferMask */
|
||||
#define GL_DEPTH_BUFFER_BIT 0x00000100
|
||||
#define GL_STENCIL_BUFFER_BIT 0x00000400
|
||||
#define GL_COLOR_BUFFER_BIT 0x00004000
|
||||
|
||||
/* Boolean */
|
||||
#define GL_FALSE 0
|
||||
#define GL_TRUE 1
|
||||
|
||||
/* BeginMode */
|
||||
#define GL_POINTS 0x0000
|
||||
#define GL_LINES 0x0001
|
||||
#define GL_LINE_LOOP 0x0002
|
||||
#define GL_LINE_STRIP 0x0003
|
||||
#define GL_TRIANGLES 0x0004
|
||||
#define GL_TRIANGLE_STRIP 0x0005
|
||||
#define GL_TRIANGLE_FAN 0x0006
|
||||
|
||||
/* AlphaFunction (not supported in ES20) */
|
||||
/* GL_NEVER */
|
||||
/* GL_LESS */
|
||||
/* GL_EQUAL */
|
||||
/* GL_LEQUAL */
|
||||
/* GL_GREATER */
|
||||
/* GL_NOTEQUAL */
|
||||
/* GL_GEQUAL */
|
||||
/* GL_ALWAYS */
|
||||
|
||||
/* BlendingFactorDest */
|
||||
#define GL_ZERO 0
|
||||
#define GL_ONE 1
|
||||
#define GL_SRC_COLOR 0x0300
|
||||
#define GL_ONE_MINUS_SRC_COLOR 0x0301
|
||||
#define GL_SRC_ALPHA 0x0302
|
||||
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
|
||||
#define GL_DST_ALPHA 0x0304
|
||||
#define GL_ONE_MINUS_DST_ALPHA 0x0305
|
||||
|
||||
/* BlendingFactorSrc */
|
||||
/* GL_ZERO */
|
||||
/* GL_ONE */
|
||||
#define GL_DST_COLOR 0x0306
|
||||
#define GL_ONE_MINUS_DST_COLOR 0x0307
|
||||
#define GL_SRC_ALPHA_SATURATE 0x0308
|
||||
/* GL_SRC_ALPHA */
|
||||
/* GL_ONE_MINUS_SRC_ALPHA */
|
||||
/* GL_DST_ALPHA */
|
||||
/* GL_ONE_MINUS_DST_ALPHA */
|
||||
|
||||
/* BlendEquationSeparate */
|
||||
#define GL_FUNC_ADD 0x8006
|
||||
#define GL_BLEND_EQUATION 0x8009
|
||||
#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
|
||||
#define GL_BLEND_EQUATION_ALPHA 0x883D
|
||||
|
||||
/* BlendSubtract */
|
||||
#define GL_FUNC_SUBTRACT 0x800A
|
||||
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
|
||||
|
||||
/* Separate Blend Functions */
|
||||
#define GL_BLEND_DST_RGB 0x80C8
|
||||
#define GL_BLEND_SRC_RGB 0x80C9
|
||||
#define GL_BLEND_DST_ALPHA 0x80CA
|
||||
#define GL_BLEND_SRC_ALPHA 0x80CB
|
||||
#define GL_CONSTANT_COLOR 0x8001
|
||||
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
|
||||
#define GL_CONSTANT_ALPHA 0x8003
|
||||
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
|
||||
#define GL_BLEND_COLOR 0x8005
|
||||
|
||||
/* Buffer Objects */
|
||||
#define GL_ARRAY_BUFFER 0x8892
|
||||
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
||||
#define GL_ARRAY_BUFFER_BINDING 0x8894
|
||||
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
|
||||
|
||||
#define GL_STREAM_DRAW 0x88E0
|
||||
#define GL_STATIC_DRAW 0x88E4
|
||||
#define GL_DYNAMIC_DRAW 0x88E8
|
||||
|
||||
#define GL_BUFFER_SIZE 0x8764
|
||||
#define GL_BUFFER_USAGE 0x8765
|
||||
|
||||
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
|
||||
|
||||
/* CullFaceMode */
|
||||
#define GL_FRONT 0x0404
|
||||
#define GL_BACK 0x0405
|
||||
#define GL_FRONT_AND_BACK 0x0408
|
||||
|
||||
/* DepthFunction */
|
||||
/* GL_NEVER */
|
||||
/* GL_LESS */
|
||||
/* GL_EQUAL */
|
||||
/* GL_LEQUAL */
|
||||
/* GL_GREATER */
|
||||
/* GL_NOTEQUAL */
|
||||
/* GL_GEQUAL */
|
||||
/* GL_ALWAYS */
|
||||
|
||||
/* EnableCap */
|
||||
#define GL_TEXTURE_2D 0x0DE1
|
||||
#define GL_CULL_FACE 0x0B44
|
||||
#define GL_BLEND 0x0BE2
|
||||
#define GL_DITHER 0x0BD0
|
||||
#define GL_STENCIL_TEST 0x0B90
|
||||
#define GL_DEPTH_TEST 0x0B71
|
||||
#define GL_SCISSOR_TEST 0x0C11
|
||||
#define GL_POLYGON_OFFSET_FILL 0x8037
|
||||
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
|
||||
#define GL_SAMPLE_COVERAGE 0x80A0
|
||||
|
||||
/* ErrorCode */
|
||||
#define GL_NO_ERROR 0
|
||||
#define GL_INVALID_ENUM 0x0500
|
||||
#define GL_INVALID_VALUE 0x0501
|
||||
#define GL_INVALID_OPERATION 0x0502
|
||||
#define GL_OUT_OF_MEMORY 0x0505
|
||||
|
||||
/* FrontFaceDirection */
|
||||
#define GL_CW 0x0900
|
||||
#define GL_CCW 0x0901
|
||||
|
||||
/* GetPName */
|
||||
#define GL_LINE_WIDTH 0x0B21
|
||||
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
|
||||
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
|
||||
#define GL_CULL_FACE_MODE 0x0B45
|
||||
#define GL_FRONT_FACE 0x0B46
|
||||
#define GL_DEPTH_RANGE 0x0B70
|
||||
#define GL_DEPTH_WRITEMASK 0x0B72
|
||||
#define GL_DEPTH_CLEAR_VALUE 0x0B73
|
||||
#define GL_DEPTH_FUNC 0x0B74
|
||||
#define GL_STENCIL_CLEAR_VALUE 0x0B91
|
||||
#define GL_STENCIL_FUNC 0x0B92
|
||||
#define GL_STENCIL_FAIL 0x0B94
|
||||
#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
|
||||
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
|
||||
#define GL_STENCIL_REF 0x0B97
|
||||
#define GL_STENCIL_VALUE_MASK 0x0B93
|
||||
#define GL_STENCIL_WRITEMASK 0x0B98
|
||||
#define GL_STENCIL_BACK_FUNC 0x8800
|
||||
#define GL_STENCIL_BACK_FAIL 0x8801
|
||||
#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
|
||||
#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
|
||||
#define GL_STENCIL_BACK_REF 0x8CA3
|
||||
#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
|
||||
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
|
||||
#define GL_VIEWPORT 0x0BA2
|
||||
#define GL_SCISSOR_BOX 0x0C10
|
||||
/* GL_SCISSOR_TEST */
|
||||
#define GL_COLOR_CLEAR_VALUE 0x0C22
|
||||
#define GL_COLOR_WRITEMASK 0x0C23
|
||||
#define GL_UNPACK_ALIGNMENT 0x0CF5
|
||||
#define GL_PACK_ALIGNMENT 0x0D05
|
||||
#define GL_MAX_TEXTURE_SIZE 0x0D33
|
||||
#define GL_MAX_VIEWPORT_DIMS 0x0D3A
|
||||
#define GL_SUBPIXEL_BITS 0x0D50
|
||||
#define GL_RED_BITS 0x0D52
|
||||
#define GL_GREEN_BITS 0x0D53
|
||||
#define GL_BLUE_BITS 0x0D54
|
||||
#define GL_ALPHA_BITS 0x0D55
|
||||
#define GL_DEPTH_BITS 0x0D56
|
||||
#define GL_STENCIL_BITS 0x0D57
|
||||
#define GL_POLYGON_OFFSET_UNITS 0x2A00
|
||||
/* GL_POLYGON_OFFSET_FILL */
|
||||
#define GL_POLYGON_OFFSET_FACTOR 0x8038
|
||||
#define GL_TEXTURE_BINDING_2D 0x8069
|
||||
#define GL_SAMPLE_BUFFERS 0x80A8
|
||||
#define GL_SAMPLES 0x80A9
|
||||
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
|
||||
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
|
||||
|
||||
/* GetTextureParameter */
|
||||
/* GL_TEXTURE_MAG_FILTER */
|
||||
/* GL_TEXTURE_MIN_FILTER */
|
||||
/* GL_TEXTURE_WRAP_S */
|
||||
/* GL_TEXTURE_WRAP_T */
|
||||
|
||||
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
|
||||
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
|
||||
|
||||
/* HintMode */
|
||||
#define GL_DONT_CARE 0x1100
|
||||
#define GL_FASTEST 0x1101
|
||||
#define GL_NICEST 0x1102
|
||||
|
||||
/* HintTarget */
|
||||
#define GL_GENERATE_MIPMAP_HINT 0x8192
|
||||
|
||||
/* DataType */
|
||||
#define GL_BYTE 0x1400
|
||||
#define GL_UNSIGNED_BYTE 0x1401
|
||||
#define GL_SHORT 0x1402
|
||||
#define GL_UNSIGNED_SHORT 0x1403
|
||||
#define GL_INT 0x1404
|
||||
#define GL_UNSIGNED_INT 0x1405
|
||||
#define GL_FLOAT 0x1406
|
||||
#define GL_FIXED 0x140C
|
||||
|
||||
/* PixelFormat */
|
||||
#define GL_DEPTH_COMPONENT 0x1902
|
||||
#define GL_ALPHA 0x1906
|
||||
#define GL_RGB 0x1907
|
||||
#define GL_RGBA 0x1908
|
||||
#define GL_LUMINANCE 0x1909
|
||||
#define GL_LUMINANCE_ALPHA 0x190A
|
||||
|
||||
/* PixelType */
|
||||
/* GL_UNSIGNED_BYTE */
|
||||
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
|
||||
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
|
||||
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
|
||||
|
||||
/* Shaders */
|
||||
#define GL_FRAGMENT_SHADER 0x8B30
|
||||
#define GL_VERTEX_SHADER 0x8B31
|
||||
#define GL_MAX_VERTEX_ATTRIBS 0x8869
|
||||
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
|
||||
#define GL_MAX_VARYING_VECTORS 0x8DFC
|
||||
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
|
||||
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
|
||||
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
|
||||
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
|
||||
#define GL_SHADER_TYPE 0x8B4F
|
||||
#define GL_DELETE_STATUS 0x8B80
|
||||
#define GL_LINK_STATUS 0x8B82
|
||||
#define GL_VALIDATE_STATUS 0x8B83
|
||||
#define GL_ATTACHED_SHADERS 0x8B85
|
||||
#define GL_ACTIVE_UNIFORMS 0x8B86
|
||||
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
|
||||
#define GL_ACTIVE_ATTRIBUTES 0x8B89
|
||||
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
|
||||
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
|
||||
#define GL_CURRENT_PROGRAM 0x8B8D
|
||||
|
||||
/* StencilFunction */
|
||||
#define GL_NEVER 0x0200
|
||||
#define GL_LESS 0x0201
|
||||
#define GL_EQUAL 0x0202
|
||||
#define GL_LEQUAL 0x0203
|
||||
#define GL_GREATER 0x0204
|
||||
#define GL_NOTEQUAL 0x0205
|
||||
#define GL_GEQUAL 0x0206
|
||||
#define GL_ALWAYS 0x0207
|
||||
|
||||
/* StencilOp */
|
||||
/* GL_ZERO */
|
||||
#define GL_KEEP 0x1E00
|
||||
#define GL_REPLACE 0x1E01
|
||||
#define GL_INCR 0x1E02
|
||||
#define GL_DECR 0x1E03
|
||||
#define GL_INVERT 0x150A
|
||||
#define GL_INCR_WRAP 0x8507
|
||||
#define GL_DECR_WRAP 0x8508
|
||||
|
||||
/* StringName */
|
||||
#define GL_VENDOR 0x1F00
|
||||
#define GL_RENDERER 0x1F01
|
||||
#define GL_VERSION 0x1F02
|
||||
#define GL_EXTENSIONS 0x1F03
|
||||
|
||||
/* TextureMagFilter */
|
||||
#define GL_NEAREST 0x2600
|
||||
#define GL_LINEAR 0x2601
|
||||
|
||||
/* TextureMinFilter */
|
||||
/* GL_NEAREST */
|
||||
/* GL_LINEAR */
|
||||
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
|
||||
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
|
||||
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
|
||||
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
|
||||
|
||||
/* TextureParameterName */
|
||||
#define GL_TEXTURE_MAG_FILTER 0x2800
|
||||
#define GL_TEXTURE_MIN_FILTER 0x2801
|
||||
#define GL_TEXTURE_WRAP_S 0x2802
|
||||
#define GL_TEXTURE_WRAP_T 0x2803
|
||||
|
||||
/* TextureTarget */
|
||||
/* GL_TEXTURE_2D */
|
||||
#define GL_TEXTURE 0x1702
|
||||
|
||||
#define GL_TEXTURE_CUBE_MAP 0x8513
|
||||
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
|
||||
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
|
||||
|
||||
/* TextureUnit */
|
||||
#define GL_TEXTURE0 0x84C0
|
||||
#define GL_TEXTURE1 0x84C1
|
||||
#define GL_TEXTURE2 0x84C2
|
||||
#define GL_TEXTURE3 0x84C3
|
||||
#define GL_TEXTURE4 0x84C4
|
||||
#define GL_TEXTURE5 0x84C5
|
||||
#define GL_TEXTURE6 0x84C6
|
||||
#define GL_TEXTURE7 0x84C7
|
||||
#define GL_TEXTURE8 0x84C8
|
||||
#define GL_TEXTURE9 0x84C9
|
||||
#define GL_TEXTURE10 0x84CA
|
||||
#define GL_TEXTURE11 0x84CB
|
||||
#define GL_TEXTURE12 0x84CC
|
||||
#define GL_TEXTURE13 0x84CD
|
||||
#define GL_TEXTURE14 0x84CE
|
||||
#define GL_TEXTURE15 0x84CF
|
||||
#define GL_TEXTURE16 0x84D0
|
||||
#define GL_TEXTURE17 0x84D1
|
||||
#define GL_TEXTURE18 0x84D2
|
||||
#define GL_TEXTURE19 0x84D3
|
||||
#define GL_TEXTURE20 0x84D4
|
||||
#define GL_TEXTURE21 0x84D5
|
||||
#define GL_TEXTURE22 0x84D6
|
||||
#define GL_TEXTURE23 0x84D7
|
||||
#define GL_TEXTURE24 0x84D8
|
||||
#define GL_TEXTURE25 0x84D9
|
||||
#define GL_TEXTURE26 0x84DA
|
||||
#define GL_TEXTURE27 0x84DB
|
||||
#define GL_TEXTURE28 0x84DC
|
||||
#define GL_TEXTURE29 0x84DD
|
||||
#define GL_TEXTURE30 0x84DE
|
||||
#define GL_TEXTURE31 0x84DF
|
||||
#define GL_ACTIVE_TEXTURE 0x84E0
|
||||
|
||||
/* TextureWrapMode */
|
||||
#define GL_REPEAT 0x2901
|
||||
#define GL_CLAMP_TO_EDGE 0x812F
|
||||
#define GL_MIRRORED_REPEAT 0x8370
|
||||
|
||||
/* Uniform Types */
|
||||
#define GL_FLOAT_VEC2 0x8B50
|
||||
#define GL_FLOAT_VEC3 0x8B51
|
||||
#define GL_FLOAT_VEC4 0x8B52
|
||||
#define GL_INT_VEC2 0x8B53
|
||||
#define GL_INT_VEC3 0x8B54
|
||||
#define GL_INT_VEC4 0x8B55
|
||||
#define GL_BOOL 0x8B56
|
||||
#define GL_BOOL_VEC2 0x8B57
|
||||
#define GL_BOOL_VEC3 0x8B58
|
||||
#define GL_BOOL_VEC4 0x8B59
|
||||
#define GL_FLOAT_MAT2 0x8B5A
|
||||
#define GL_FLOAT_MAT3 0x8B5B
|
||||
#define GL_FLOAT_MAT4 0x8B5C
|
||||
#define GL_SAMPLER_2D 0x8B5E
|
||||
#define GL_SAMPLER_CUBE 0x8B60
|
||||
|
||||
/* Vertex Arrays */
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
|
||||
|
||||
/* Read Format */
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
|
||||
|
||||
/* Shader Source */
|
||||
#define GL_COMPILE_STATUS 0x8B81
|
||||
#define GL_INFO_LOG_LENGTH 0x8B84
|
||||
#define GL_SHADER_SOURCE_LENGTH 0x8B88
|
||||
#define GL_SHADER_COMPILER 0x8DFA
|
||||
|
||||
/* Shader Binary */
|
||||
#define GL_SHADER_BINARY_FORMATS 0x8DF8
|
||||
#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
|
||||
|
||||
/* Shader Precision-Specified Types */
|
||||
#define GL_LOW_FLOAT 0x8DF0
|
||||
#define GL_MEDIUM_FLOAT 0x8DF1
|
||||
#define GL_HIGH_FLOAT 0x8DF2
|
||||
#define GL_LOW_INT 0x8DF3
|
||||
#define GL_MEDIUM_INT 0x8DF4
|
||||
#define GL_HIGH_INT 0x8DF5
|
||||
|
||||
/* Framebuffer Object. */
|
||||
#define GL_FRAMEBUFFER 0x8D40
|
||||
#define GL_RENDERBUFFER 0x8D41
|
||||
|
||||
#define GL_RGBA4 0x8056
|
||||
#define GL_RGB5_A1 0x8057
|
||||
#define GL_RGB565 0x8D62
|
||||
#define GL_DEPTH_COMPONENT16 0x81A5
|
||||
#define GL_STENCIL_INDEX 0x1901
|
||||
#define GL_STENCIL_INDEX8 0x8D48
|
||||
|
||||
#define GL_RENDERBUFFER_WIDTH 0x8D42
|
||||
#define GL_RENDERBUFFER_HEIGHT 0x8D43
|
||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
|
||||
#define GL_RENDERBUFFER_RED_SIZE 0x8D50
|
||||
#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
|
||||
#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
|
||||
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
|
||||
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
|
||||
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
|
||||
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
|
||||
|
||||
#define GL_COLOR_ATTACHMENT0 0x8CE0
|
||||
#define GL_DEPTH_ATTACHMENT 0x8D00
|
||||
#define GL_STENCIL_ATTACHMENT 0x8D20
|
||||
|
||||
#define GL_NONE 0
|
||||
|
||||
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
|
||||
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
|
||||
|
||||
#define GL_FRAMEBUFFER_BINDING 0x8CA6
|
||||
#define GL_RENDERBUFFER_BINDING 0x8CA7
|
||||
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
|
||||
|
||||
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* GL core functions.
|
||||
*-----------------------------------------------------------------------*/
|
||||
|
||||
GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
|
||||
GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
|
||||
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name);
|
||||
GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
|
||||
GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
|
||||
GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
|
||||
GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
|
||||
GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode );
|
||||
GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
|
||||
GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
|
||||
GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
|
||||
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
|
||||
GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
|
||||
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
|
||||
GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
|
||||
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
|
||||
GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
|
||||
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
|
||||
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
|
||||
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
|
||||
GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
|
||||
GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
|
||||
GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
|
||||
GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
|
||||
GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
|
||||
GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
|
||||
GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
|
||||
GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
|
||||
GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
|
||||
GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
|
||||
GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
|
||||
GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
|
||||
GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
|
||||
GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
|
||||
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
|
||||
GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
|
||||
GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
|
||||
GL_APICALL void GL_APIENTRY glFinish (void);
|
||||
GL_APICALL void GL_APIENTRY glFlush (void);
|
||||
GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
|
||||
GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
|
||||
GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
|
||||
GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
|
||||
GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
|
||||
GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
|
||||
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
|
||||
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
|
||||
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
|
||||
GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
|
||||
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
|
||||
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
|
||||
GL_APICALL GLenum GL_APIENTRY glGetError (void);
|
||||
GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
|
||||
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
|
||||
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
|
||||
GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
|
||||
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
|
||||
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
|
||||
GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
|
||||
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
|
||||
GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
|
||||
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
|
||||
GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
|
||||
GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
|
||||
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
|
||||
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
|
||||
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
|
||||
GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
|
||||
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
|
||||
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
|
||||
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);
|
||||
GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
|
||||
GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
|
||||
GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
|
||||
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
|
||||
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
|
||||
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
|
||||
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
|
||||
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
|
||||
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
|
||||
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
|
||||
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
|
||||
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
|
||||
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
|
||||
GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
|
||||
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
|
||||
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
|
||||
GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
|
||||
GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
|
||||
GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
|
||||
GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
|
||||
GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
|
||||
GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
|
||||
GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
|
||||
GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
|
||||
GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
|
||||
GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
|
||||
GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
|
||||
GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
|
||||
GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
|
||||
GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
|
||||
GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
||||
GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
||||
GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
||||
GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
|
||||
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __gl2_h_ */
|
||||
@@ -1,803 +0,0 @@
|
||||
#ifndef __gl2ext_h_
|
||||
#define __gl2ext_h_
|
||||
|
||||
/* $Revision: 10969 $ on $Date:: 2010-04-09 02:27:15 -0700 #$ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This document is licensed under the SGI Free Software B License Version
|
||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
||||
*/
|
||||
|
||||
#ifndef GL_APIENTRYP
|
||||
# define GL_APIENTRYP GL_APIENTRY*
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* OES extension tokens
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_OES_compressed_ETC1_RGB8_texture */
|
||||
#ifndef GL_OES_compressed_ETC1_RGB8_texture
|
||||
#define GL_ETC1_RGB8_OES 0x8D64
|
||||
#endif
|
||||
|
||||
/* GL_OES_compressed_paletted_texture */
|
||||
#ifndef GL_OES_compressed_paletted_texture
|
||||
#define GL_PALETTE4_RGB8_OES 0x8B90
|
||||
#define GL_PALETTE4_RGBA8_OES 0x8B91
|
||||
#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
|
||||
#define GL_PALETTE4_RGBA4_OES 0x8B93
|
||||
#define GL_PALETTE4_RGB5_A1_OES 0x8B94
|
||||
#define GL_PALETTE8_RGB8_OES 0x8B95
|
||||
#define GL_PALETTE8_RGBA8_OES 0x8B96
|
||||
#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
|
||||
#define GL_PALETTE8_RGBA4_OES 0x8B98
|
||||
#define GL_PALETTE8_RGB5_A1_OES 0x8B99
|
||||
#endif
|
||||
|
||||
/* GL_OES_depth24 */
|
||||
#ifndef GL_OES_depth24
|
||||
#define GL_DEPTH_COMPONENT24_OES 0x81A6
|
||||
#endif
|
||||
|
||||
/* GL_OES_depth32 */
|
||||
#ifndef GL_OES_depth32
|
||||
#define GL_DEPTH_COMPONENT32_OES 0x81A7
|
||||
#endif
|
||||
|
||||
/* GL_OES_depth_texture */
|
||||
/* No new tokens introduced by this extension. */
|
||||
|
||||
/* GL_OES_EGL_image */
|
||||
#ifndef GL_OES_EGL_image
|
||||
typedef void* GLeglImageOES;
|
||||
#endif
|
||||
|
||||
/* GL_OES_element_index_uint */
|
||||
#ifndef GL_OES_element_index_uint
|
||||
#define GL_UNSIGNED_INT 0x1405
|
||||
#endif
|
||||
|
||||
/* GL_OES_get_program_binary */
|
||||
#ifndef GL_OES_get_program_binary
|
||||
#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
|
||||
#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE
|
||||
#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF
|
||||
#endif
|
||||
|
||||
/* GL_OES_mapbuffer */
|
||||
#ifndef GL_OES_mapbuffer
|
||||
#define GL_WRITE_ONLY_OES 0x88B9
|
||||
#define GL_BUFFER_ACCESS_OES 0x88BB
|
||||
#define GL_BUFFER_MAPPED_OES 0x88BC
|
||||
#define GL_BUFFER_MAP_POINTER_OES 0x88BD
|
||||
#endif
|
||||
|
||||
/* GL_OES_packed_depth_stencil */
|
||||
#ifndef GL_OES_packed_depth_stencil
|
||||
#define GL_DEPTH_STENCIL_OES 0x84F9
|
||||
#define GL_UNSIGNED_INT_24_8_OES 0x84FA
|
||||
#define GL_DEPTH24_STENCIL8_OES 0x88F0
|
||||
#endif
|
||||
|
||||
/* GL_OES_rgb8_rgba8 */
|
||||
#ifndef GL_OES_rgb8_rgba8
|
||||
#define GL_RGB8_OES 0x8051
|
||||
#define GL_RGBA8_OES 0x8058
|
||||
#endif
|
||||
|
||||
/* GL_OES_standard_derivatives */
|
||||
#ifndef GL_OES_standard_derivatives
|
||||
#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B
|
||||
#endif
|
||||
|
||||
/* GL_OES_stencil1 */
|
||||
#ifndef GL_OES_stencil1
|
||||
#define GL_STENCIL_INDEX1_OES 0x8D46
|
||||
#endif
|
||||
|
||||
/* GL_OES_stencil4 */
|
||||
#ifndef GL_OES_stencil4
|
||||
#define GL_STENCIL_INDEX4_OES 0x8D47
|
||||
#endif
|
||||
|
||||
/* GL_OES_texture_3D */
|
||||
#ifndef GL_OES_texture_3D
|
||||
#define GL_TEXTURE_WRAP_R_OES 0x8072
|
||||
#define GL_TEXTURE_3D_OES 0x806F
|
||||
#define GL_TEXTURE_BINDING_3D_OES 0x806A
|
||||
#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073
|
||||
#define GL_SAMPLER_3D_OES 0x8B5F
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4
|
||||
#endif
|
||||
|
||||
/* GL_OES_texture_float */
|
||||
/* No new tokens introduced by this extension. */
|
||||
|
||||
/* GL_OES_texture_float_linear */
|
||||
/* No new tokens introduced by this extension. */
|
||||
|
||||
/* GL_OES_texture_half_float */
|
||||
#ifndef GL_OES_texture_half_float
|
||||
#define GL_HALF_FLOAT_OES 0x8D61
|
||||
#endif
|
||||
|
||||
/* GL_OES_texture_half_float_linear */
|
||||
/* No new tokens introduced by this extension. */
|
||||
|
||||
/* GL_OES_texture_npot */
|
||||
/* No new tokens introduced by this extension. */
|
||||
|
||||
/* GL_OES_vertex_array_object */
|
||||
#ifndef GL_OES_vertex_array_object
|
||||
#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5
|
||||
#endif
|
||||
|
||||
/* GL_OES_vertex_half_float */
|
||||
/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */
|
||||
|
||||
/* GL_OES_vertex_type_10_10_10_2 */
|
||||
#ifndef GL_OES_vertex_type_10_10_10_2
|
||||
#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6
|
||||
#define GL_INT_10_10_10_2_OES 0x8DF7
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* AMD extension tokens
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_AMD_compressed_3DC_texture */
|
||||
#ifndef GL_AMD_compressed_3DC_texture
|
||||
#define GL_3DC_X_AMD 0x87F9
|
||||
#define GL_3DC_XY_AMD 0x87FA
|
||||
#endif
|
||||
|
||||
/* GL_AMD_compressed_ATC_texture */
|
||||
#ifndef GL_AMD_compressed_ATC_texture
|
||||
#define GL_ATC_RGB_AMD 0x8C92
|
||||
#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
|
||||
#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
|
||||
#endif
|
||||
|
||||
/* GL_AMD_performance_monitor */
|
||||
#ifndef GL_AMD_performance_monitor
|
||||
#define GL_COUNTER_TYPE_AMD 0x8BC0
|
||||
#define GL_COUNTER_RANGE_AMD 0x8BC1
|
||||
#define GL_UNSIGNED_INT64_AMD 0x8BC2
|
||||
#define GL_PERCENTAGE_AMD 0x8BC3
|
||||
#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
|
||||
#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
|
||||
#define GL_PERFMON_RESULT_AMD 0x8BC6
|
||||
#endif
|
||||
|
||||
/* GL_AMD_program_binary_Z400 */
|
||||
#ifndef GL_AMD_program_binary_Z400
|
||||
#define GL_Z400_BINARY_AMD 0x8740
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* EXT extension tokens
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_EXT_blend_minmax */
|
||||
#ifndef GL_EXT_blend_minmax
|
||||
#define GL_MIN_EXT 0x8007
|
||||
#define GL_MAX_EXT 0x8008
|
||||
#endif
|
||||
|
||||
/* GL_EXT_discard_framebuffer */
|
||||
#ifndef GL_EXT_discard_framebuffer
|
||||
#define GL_COLOR_EXT 0x1800
|
||||
#define GL_DEPTH_EXT 0x1801
|
||||
#define GL_STENCIL_EXT 0x1802
|
||||
#endif
|
||||
|
||||
/* GL_EXT_multi_draw_arrays */
|
||||
/* No new tokens introduced by this extension. */
|
||||
|
||||
/* GL_EXT_read_format_bgra */
|
||||
#ifndef GL_EXT_read_format_bgra
|
||||
#define GL_BGRA_EXT 0x80E1
|
||||
#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
|
||||
#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_filter_anisotropic */
|
||||
#ifndef GL_EXT_texture_filter_anisotropic
|
||||
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
|
||||
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_format_BGRA8888 */
|
||||
#ifndef GL_EXT_texture_format_BGRA8888
|
||||
#define GL_BGRA_EXT 0x80E1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_type_2_10_10_10_REV */
|
||||
#ifndef GL_EXT_texture_type_2_10_10_10_REV
|
||||
#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_compression_dxt1 */
|
||||
#ifndef GL_EXT_texture_compression_dxt1
|
||||
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* IMG extension tokens
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_IMG_program_binary */
|
||||
#ifndef GL_IMG_program_binary
|
||||
#define GL_SGX_PROGRAM_BINARY_IMG 0x9130
|
||||
#endif
|
||||
|
||||
/* GL_IMG_read_format */
|
||||
#ifndef GL_IMG_read_format
|
||||
#define GL_BGRA_IMG 0x80E1
|
||||
#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
|
||||
#endif
|
||||
|
||||
/* GL_IMG_shader_binary */
|
||||
#ifndef GL_IMG_shader_binary
|
||||
#define GL_SGX_BINARY_IMG 0x8C0A
|
||||
#endif
|
||||
|
||||
/* GL_IMG_texture_compression_pvrtc */
|
||||
#ifndef GL_IMG_texture_compression_pvrtc
|
||||
#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
|
||||
#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
|
||||
#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
|
||||
#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
|
||||
#endif
|
||||
|
||||
/* GL_IMG_multisampled_render_to_texture */
|
||||
#ifndef GL_IMG_multisampled_render_to_texture
|
||||
#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
|
||||
#define GL_MAX_SAMPLES_IMG 0x9135
|
||||
#define GL_TEXTURE_SAMPLES_IMG 0x9136
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* NV extension tokens
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_NV_fence */
|
||||
#ifndef GL_NV_fence
|
||||
#define GL_ALL_COMPLETED_NV 0x84F2
|
||||
#define GL_FENCE_STATUS_NV 0x84F3
|
||||
#define GL_FENCE_CONDITION_NV 0x84F4
|
||||
#endif
|
||||
|
||||
/* GL_NV_coverage_sample */
|
||||
#ifndef GL_NV_coverage_sample
|
||||
#define GL_COVERAGE_COMPONENT_NV 0x8ED0
|
||||
#define GL_COVERAGE_COMPONENT4_NV 0x8ED1
|
||||
#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2
|
||||
#define GL_COVERAGE_BUFFERS_NV 0x8ED3
|
||||
#define GL_COVERAGE_SAMPLES_NV 0x8ED4
|
||||
#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5
|
||||
#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6
|
||||
#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7
|
||||
#define GL_COVERAGE_BUFFER_BIT_NV 0x8000
|
||||
#endif
|
||||
|
||||
/* GL_NV_depth_nonlinear */
|
||||
#ifndef GL_NV_depth_nonlinear
|
||||
#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* QCOM extension tokens
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_QCOM_driver_control */
|
||||
/* No new tokens introduced by this extension. */
|
||||
|
||||
/* GL_QCOM_extended_get */
|
||||
#ifndef GL_QCOM_extended_get
|
||||
#define GL_TEXTURE_WIDTH_QCOM 0x8BD2
|
||||
#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3
|
||||
#define GL_TEXTURE_DEPTH_QCOM 0x8BD4
|
||||
#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5
|
||||
#define GL_TEXTURE_FORMAT_QCOM 0x8BD6
|
||||
#define GL_TEXTURE_TYPE_QCOM 0x8BD7
|
||||
#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8
|
||||
#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9
|
||||
#define GL_TEXTURE_TARGET_QCOM 0x8BDA
|
||||
#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB
|
||||
#define GL_STATE_RESTORE 0x8BDC
|
||||
#endif
|
||||
|
||||
/* GL_QCOM_extended_get2 */
|
||||
/* No new tokens introduced by this extension. */
|
||||
|
||||
/* GL_QCOM_perfmon_global_mode */
|
||||
#ifndef GL_QCOM_perfmon_global_mode
|
||||
#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
|
||||
#endif
|
||||
|
||||
/* GL_QCOM_writeonly_rendering */
|
||||
#ifndef GL_QCOM_writeonly_rendering
|
||||
#define GL_WRITEONLY_RENDERING_QCOM 0x8823
|
||||
#endif
|
||||
|
||||
/* GL_QCOM_tiled_rendering */
|
||||
#ifndef GL_QCOM_tiled_rendering
|
||||
#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
|
||||
#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002
|
||||
#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004
|
||||
#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008
|
||||
#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010
|
||||
#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020
|
||||
#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040
|
||||
#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080
|
||||
#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100
|
||||
#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200
|
||||
#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400
|
||||
#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800
|
||||
#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000
|
||||
#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000
|
||||
#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000
|
||||
#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000
|
||||
#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000
|
||||
#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000
|
||||
#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000
|
||||
#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000
|
||||
#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000
|
||||
#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000
|
||||
#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000
|
||||
#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* End of extension tokens, start of corresponding extension functions
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* OES extension functions
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_OES_compressed_ETC1_RGB8_texture */
|
||||
#ifndef GL_OES_compressed_ETC1_RGB8_texture
|
||||
#define GL_OES_compressed_ETC1_RGB8_texture 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_compressed_paletted_texture */
|
||||
#ifndef GL_OES_compressed_paletted_texture
|
||||
#define GL_OES_compressed_paletted_texture 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_depth24 */
|
||||
#ifndef GL_OES_depth24
|
||||
#define GL_OES_depth24 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_depth32 */
|
||||
#ifndef GL_OES_depth32
|
||||
#define GL_OES_depth32 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_depth_texture */
|
||||
#ifndef GL_OES_depth_texture
|
||||
#define GL_OES_depth_texture 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_EGL_image */
|
||||
#ifndef GL_OES_EGL_image
|
||||
#define GL_OES_EGL_image 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
|
||||
GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
|
||||
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
|
||||
#endif
|
||||
|
||||
/* GL_OES_element_index_uint */
|
||||
#ifndef GL_OES_element_index_uint
|
||||
#define GL_OES_element_index_uint 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_fbo_render_mipmap */
|
||||
#ifndef GL_OES_fbo_render_mipmap
|
||||
#define GL_OES_fbo_render_mipmap 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_fragment_precision_high */
|
||||
#ifndef GL_OES_fragment_precision_high
|
||||
#define GL_OES_fragment_precision_high 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_get_program_binary */
|
||||
#ifndef GL_OES_get_program_binary
|
||||
#define GL_OES_get_program_binary 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
|
||||
GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
|
||||
#endif
|
||||
|
||||
/* GL_OES_mapbuffer */
|
||||
#ifndef GL_OES_mapbuffer
|
||||
#define GL_OES_mapbuffer 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
|
||||
GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
|
||||
GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid** params);
|
||||
#endif
|
||||
typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
|
||||
typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid** params);
|
||||
#endif
|
||||
|
||||
/* GL_OES_packed_depth_stencil */
|
||||
#ifndef GL_OES_packed_depth_stencil
|
||||
#define GL_OES_packed_depth_stencil 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_rgb8_rgba8 */
|
||||
#ifndef GL_OES_rgb8_rgba8
|
||||
#define GL_OES_rgb8_rgba8 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_standard_derivatives */
|
||||
#ifndef GL_OES_standard_derivatives
|
||||
#define GL_OES_standard_derivatives 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_stencil1 */
|
||||
#ifndef GL_OES_stencil1
|
||||
#define GL_OES_stencil1 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_stencil4 */
|
||||
#ifndef GL_OES_stencil4
|
||||
#define GL_OES_stencil4 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_texture_3D */
|
||||
#ifndef GL_OES_texture_3D
|
||||
#define GL_OES_texture_3D 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
|
||||
GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
|
||||
GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
|
||||
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
|
||||
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
||||
#endif
|
||||
|
||||
/* GL_OES_texture_float */
|
||||
#ifndef GL_OES_texture_float
|
||||
#define GL_OES_texture_float 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_texture_float_linear */
|
||||
#ifndef GL_OES_texture_float_linear
|
||||
#define GL_OES_texture_float_linear 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_texture_half_float */
|
||||
#ifndef GL_OES_texture_half_float
|
||||
#define GL_OES_texture_half_float 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_texture_half_float_linear */
|
||||
#ifndef GL_OES_texture_half_float_linear
|
||||
#define GL_OES_texture_half_float_linear 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_texture_npot */
|
||||
#ifndef GL_OES_texture_npot
|
||||
#define GL_OES_texture_npot 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_vertex_array_object */
|
||||
#ifndef GL_OES_vertex_array_object
|
||||
#define GL_OES_vertex_array_object 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array);
|
||||
GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
|
||||
GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
|
||||
typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
|
||||
#endif
|
||||
|
||||
/* GL_OES_vertex_half_float */
|
||||
#ifndef GL_OES_vertex_half_float
|
||||
#define GL_OES_vertex_half_float 1
|
||||
#endif
|
||||
|
||||
/* GL_OES_vertex_type_10_10_10_2 */
|
||||
#ifndef GL_OES_vertex_type_10_10_10_2
|
||||
#define GL_OES_vertex_type_10_10_10_2 1
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* AMD extension functions
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_AMD_compressed_3DC_texture */
|
||||
#ifndef GL_AMD_compressed_3DC_texture
|
||||
#define GL_AMD_compressed_3DC_texture 1
|
||||
#endif
|
||||
|
||||
/* GL_AMD_compressed_ATC_texture */
|
||||
#ifndef GL_AMD_compressed_ATC_texture
|
||||
#define GL_AMD_compressed_ATC_texture 1
|
||||
#endif
|
||||
|
||||
/* AMD_performance_monitor */
|
||||
#ifndef GL_AMD_performance_monitor
|
||||
#define GL_AMD_performance_monitor 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
|
||||
GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
|
||||
GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
|
||||
GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
|
||||
GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
|
||||
GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
|
||||
GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
|
||||
GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
|
||||
GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
|
||||
GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor);
|
||||
GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
|
||||
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
|
||||
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
|
||||
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
|
||||
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
|
||||
typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
|
||||
typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
|
||||
typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
|
||||
typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
|
||||
typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
|
||||
#endif
|
||||
|
||||
/* GL_AMD_program_binary_Z400 */
|
||||
#ifndef GL_AMD_program_binary_Z400
|
||||
#define GL_AMD_program_binary_Z400 1
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* EXT extension functions
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_EXT_blend_minmax */
|
||||
#ifndef GL_EXT_blend_minmax
|
||||
#define GL_EXT_blend_minmax 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_discard_framebuffer */
|
||||
#ifndef GL_EXT_discard_framebuffer
|
||||
#define GL_EXT_discard_framebuffer 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_multi_draw_arrays
|
||||
#define GL_EXT_multi_draw_arrays 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
|
||||
GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
|
||||
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
|
||||
#endif
|
||||
|
||||
/* GL_EXT_read_format_bgra */
|
||||
#ifndef GL_EXT_read_format_bgra
|
||||
#define GL_EXT_read_format_bgra 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_filter_anisotropic */
|
||||
#ifndef GL_EXT_texture_filter_anisotropic
|
||||
#define GL_EXT_texture_filter_anisotropic 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_format_BGRA8888 */
|
||||
#ifndef GL_EXT_texture_format_BGRA8888
|
||||
#define GL_EXT_texture_format_BGRA8888 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_type_2_10_10_10_REV */
|
||||
#ifndef GL_EXT_texture_type_2_10_10_10_REV
|
||||
#define GL_EXT_texture_type_2_10_10_10_REV 1
|
||||
#endif
|
||||
|
||||
/* GL_EXT_texture_compression_dxt1 */
|
||||
#ifndef GL_EXT_texture_compression_dxt1
|
||||
#define GL_EXT_texture_compression_dxt1 1
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* IMG extension functions
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_IMG_program_binary */
|
||||
#ifndef GL_IMG_program_binary
|
||||
#define GL_IMG_program_binary 1
|
||||
#endif
|
||||
|
||||
/* GL_IMG_read_format */
|
||||
#ifndef GL_IMG_read_format
|
||||
#define GL_IMG_read_format 1
|
||||
#endif
|
||||
|
||||
/* GL_IMG_shader_binary */
|
||||
#ifndef GL_IMG_shader_binary
|
||||
#define GL_IMG_shader_binary 1
|
||||
#endif
|
||||
|
||||
/* GL_IMG_texture_compression_pvrtc */
|
||||
#ifndef GL_IMG_texture_compression_pvrtc
|
||||
#define GL_IMG_texture_compression_pvrtc 1
|
||||
#endif
|
||||
|
||||
/* GL_IMG_multisampled_render_to_texture */
|
||||
#ifndef GL_IMG_multisampled_render_to_texture
|
||||
#define GL_IMG_multisampled_render_to_texture 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
|
||||
GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* NV extension functions
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_NV_fence */
|
||||
#ifndef GL_NV_fence
|
||||
#define GL_NV_fence 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
|
||||
GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei, GLuint *);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint);
|
||||
GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint);
|
||||
GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
|
||||
GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint);
|
||||
GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint, GLenum);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
|
||||
typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
|
||||
typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
|
||||
typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
|
||||
#endif
|
||||
|
||||
/* GL_NV_coverage_sample */
|
||||
#ifndef GL_NV_coverage_sample
|
||||
#define GL_NV_coverage_sample 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
|
||||
GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
|
||||
typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
|
||||
#endif
|
||||
|
||||
/* GL_NV_depth_nonlinear */
|
||||
#ifndef GL_NV_depth_nonlinear
|
||||
#define GL_NV_depth_nonlinear 1
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* QCOM extension functions
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
/* GL_QCOM_driver_control */
|
||||
#ifndef GL_QCOM_driver_control
|
||||
#define GL_QCOM_driver_control 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
|
||||
GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
|
||||
GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
|
||||
GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
|
||||
typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
|
||||
typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
|
||||
typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
|
||||
#endif
|
||||
|
||||
/* GL_QCOM_extended_get */
|
||||
#ifndef GL_QCOM_extended_get
|
||||
#define GL_QCOM_extended_get 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
|
||||
GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
|
||||
GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
|
||||
GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
|
||||
GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
|
||||
GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
|
||||
GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params);
|
||||
#endif
|
||||
|
||||
/* GL_QCOM_extended_get2 */
|
||||
#ifndef GL_QCOM_extended_get2
|
||||
#define GL_QCOM_extended_get2 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
|
||||
GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
|
||||
GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
|
||||
#endif
|
||||
|
||||
/* GL_QCOM_perfmon_global_mode */
|
||||
#ifndef GL_QCOM_perfmon_global_mode
|
||||
#define GL_QCOM_perfmon_global_mode 1
|
||||
#endif
|
||||
|
||||
/* GL_QCOM_writeonly_rendering */
|
||||
#ifndef GL_QCOM_writeonly_rendering
|
||||
#define GL_QCOM_writeonly_rendering 1
|
||||
#endif
|
||||
|
||||
/* GL_QCOM_tiled_rendering */
|
||||
#ifndef GL_QCOM_tiled_rendering
|
||||
#define GL_QCOM_tiled_rendering 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
|
||||
GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
|
||||
#endif
|
||||
typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
|
||||
typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __gl2ext_h_ */
|
||||
@@ -1,30 +0,0 @@
|
||||
#ifndef __gl2platform_h_
|
||||
#define __gl2platform_h_
|
||||
|
||||
/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
|
||||
|
||||
/*
|
||||
* This document is licensed under the SGI Free Software B License Version
|
||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
|
||||
*
|
||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||
* You are encouraged to submit all modifications to the Khronos group so that
|
||||
* they can be included in future versions of this file. Please submit changes
|
||||
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
|
||||
* by filing a bug against product "OpenGL-ES" component "Registry".
|
||||
*/
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
#ifndef GL_APICALL
|
||||
#define GL_APICALL KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
#ifndef GL_APIENTRY
|
||||
#define GL_APIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
#endif /* __gl2platform_h_ */
|
||||
@@ -1,277 +0,0 @@
|
||||
#ifndef __khrplatform_h_
|
||||
#define __khrplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2008-2009 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Khronos platform-specific types and definitions.
|
||||
*
|
||||
* $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
|
||||
*
|
||||
* Adopters may modify this file to suit their platform. Adopters are
|
||||
* encouraged to submit platform specific modifications to the Khronos
|
||||
* group so that they can be included in future versions of this file.
|
||||
* Please submit changes by sending them to the public Khronos Bugzilla
|
||||
* (http://khronos.org/bugzilla) by filing a bug against product
|
||||
* "Khronos (general)" component "Registry".
|
||||
*
|
||||
* A predefined template which fills in some of the bug fields can be
|
||||
* reached using http://tinyurl.com/khrplatform-h-bugreport, but you
|
||||
* must create a Bugzilla login first.
|
||||
*
|
||||
*
|
||||
* See the Implementer's Guidelines for information about where this file
|
||||
* should be located on your system and for more details of its use:
|
||||
* http://www.khronos.org/registry/implementers_guide.pdf
|
||||
*
|
||||
* This file should be included as
|
||||
* #include <KHR/khrplatform.h>
|
||||
* by Khronos client API header files that use its types and defines.
|
||||
*
|
||||
* The types in khrplatform.h should only be used to define API-specific types.
|
||||
*
|
||||
* Types defined in khrplatform.h:
|
||||
* khronos_int8_t signed 8 bit
|
||||
* khronos_uint8_t unsigned 8 bit
|
||||
* khronos_int16_t signed 16 bit
|
||||
* khronos_uint16_t unsigned 16 bit
|
||||
* khronos_int32_t signed 32 bit
|
||||
* khronos_uint32_t unsigned 32 bit
|
||||
* khronos_int64_t signed 64 bit
|
||||
* khronos_uint64_t unsigned 64 bit
|
||||
* khronos_intptr_t signed same number of bits as a pointer
|
||||
* khronos_uintptr_t unsigned same number of bits as a pointer
|
||||
* khronos_ssize_t signed size
|
||||
* khronos_usize_t unsigned size
|
||||
* khronos_float_t signed 32 bit floating point
|
||||
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
|
||||
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
|
||||
* nanoseconds
|
||||
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
|
||||
* khronos_boolean_enum_t enumerated boolean type. This should
|
||||
* only be used as a base type when a client API's boolean type is
|
||||
* an enum. Client APIs which use an integer or other type for
|
||||
* booleans cannot use this as the base type for their boolean.
|
||||
*
|
||||
* Tokens defined in khrplatform.h:
|
||||
*
|
||||
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
|
||||
*
|
||||
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
|
||||
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
|
||||
*
|
||||
* Calling convention macros defined in this file:
|
||||
* KHRONOS_APICALL
|
||||
* KHRONOS_APIENTRY
|
||||
* KHRONOS_APIATTRIBUTES
|
||||
*
|
||||
* These may be used in function prototypes as:
|
||||
*
|
||||
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
|
||||
* int arg1,
|
||||
* int arg2) KHRONOS_APIATTRIBUTES;
|
||||
*/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APICALL
|
||||
*-------------------------------------------------------------------------
|
||||
* This precedes the return type of the function in the function prototype.
|
||||
*/
|
||||
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
||||
# if defined(KHRONOS_DLL_EXPORTS)
|
||||
# define KHRONOS_APICALL __declspec(dllexport)
|
||||
# else
|
||||
# define KHRONOS_APICALL __declspec(dllimport)
|
||||
# endif
|
||||
#elif defined (__SYMBIAN32__)
|
||||
# define KHRONOS_APICALL IMPORT_C
|
||||
#elif (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \
|
||||
|| (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
|
||||
/* KHRONOS_APIATTRIBUTES is not used by the client API headers yet */
|
||||
# define KHRONOS_APICALL __attribute__((visibility("default")))
|
||||
#else
|
||||
# define KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIENTRY
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the return type of the function and precedes the function
|
||||
* name in the function prototype.
|
||||
*/
|
||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
|
||||
/* Win32 but not WinCE */
|
||||
# define KHRONOS_APIENTRY __stdcall
|
||||
#else
|
||||
# define KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIATTRIBUTES
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the closing parenthesis of the function prototype arguments.
|
||||
*/
|
||||
#if defined (__ARMCC_2__)
|
||||
#define KHRONOS_APIATTRIBUTES __softfp
|
||||
#else
|
||||
#define KHRONOS_APIATTRIBUTES
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* basic type definitions
|
||||
*-----------------------------------------------------------------------*/
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
|
||||
|
||||
|
||||
/*
|
||||
* Using <stdint.h>
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(__VMS ) || defined(__sgi)
|
||||
|
||||
/*
|
||||
* Using <inttypes.h>
|
||||
*/
|
||||
#include <inttypes.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
||||
|
||||
/*
|
||||
* Win32
|
||||
*/
|
||||
typedef __int32 khronos_int32_t;
|
||||
typedef unsigned __int32 khronos_uint32_t;
|
||||
typedef __int64 khronos_int64_t;
|
||||
typedef unsigned __int64 khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
|
||||
/*
|
||||
* Sun or Digital
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#if defined(__arch64__) || defined(_LP64)
|
||||
typedef long int khronos_int64_t;
|
||||
typedef unsigned long int khronos_uint64_t;
|
||||
#else
|
||||
typedef long long int khronos_int64_t;
|
||||
typedef unsigned long long int khronos_uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif 0
|
||||
|
||||
/*
|
||||
* Hypothetical platform with no float or int64 support
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#define KHRONOS_SUPPORT_INT64 0
|
||||
#define KHRONOS_SUPPORT_FLOAT 0
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Generic fallback
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Types that are (so far) the same on all platforms
|
||||
*/
|
||||
typedef signed char khronos_int8_t;
|
||||
typedef unsigned char khronos_uint8_t;
|
||||
typedef signed short int khronos_int16_t;
|
||||
typedef unsigned short int khronos_uint16_t;
|
||||
typedef signed long int khronos_intptr_t;
|
||||
typedef unsigned long int khronos_uintptr_t;
|
||||
typedef signed long int khronos_ssize_t;
|
||||
typedef unsigned long int khronos_usize_t;
|
||||
|
||||
#if KHRONOS_SUPPORT_FLOAT
|
||||
/*
|
||||
* Float type
|
||||
*/
|
||||
typedef float khronos_float_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64
|
||||
/* Time types
|
||||
*
|
||||
* These types can be used to represent a time interval in nanoseconds or
|
||||
* an absolute Unadjusted System Time. Unadjusted System Time is the number
|
||||
* of nanoseconds since some arbitrary system event (e.g. since the last
|
||||
* time the system booted). The Unadjusted System Time is an unsigned
|
||||
* 64 bit value that wraps back to 0 every 584 years. Time intervals
|
||||
* may be either signed or unsigned.
|
||||
*/
|
||||
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
|
||||
typedef khronos_int64_t khronos_stime_nanoseconds_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Dummy value used to pad enum types to 32 bits.
|
||||
*/
|
||||
#ifndef KHRONOS_MAX_ENUM
|
||||
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Enumerated boolean type
|
||||
*
|
||||
* Values other than zero should be considered to be true. Therefore
|
||||
* comparisons should not be made against KHRONOS_TRUE.
|
||||
*/
|
||||
typedef enum {
|
||||
KHRONOS_FALSE = 0,
|
||||
KHRONOS_TRUE = 1,
|
||||
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
|
||||
} khronos_boolean_enum_t;
|
||||
|
||||
#endif /* __khrplatform_h_ */
|
||||
@@ -1,746 +0,0 @@
|
||||
/* $Revision: 9203 $ on $Date:: 2009-10-07 02:21:52 -0700 #$ */
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*
|
||||
* OpenVG 1.1 Reference Implementation
|
||||
* -------------------------------------
|
||||
*
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and /or associated documentation files
|
||||
* (the "Materials "), to deal in the Materials without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Materials,
|
||||
* and to permit persons to whom the Materials are furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Materials.
|
||||
*
|
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
|
||||
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*
|
||||
*//**
|
||||
* \file
|
||||
* \brief OpenVG 1.1 API.
|
||||
*//*-------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OPENVG_H
|
||||
#define _OPENVG_H
|
||||
|
||||
#include <VG/vgplatform.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OPENVG_VERSION_1_0 1
|
||||
#define OPENVG_VERSION_1_0_1 1
|
||||
#define OPENVG_VERSION_1_1 2
|
||||
|
||||
#ifndef VG_MAXSHORT
|
||||
#define VG_MAXSHORT 0x7FFF
|
||||
#endif
|
||||
|
||||
#ifndef VG_MAXINT
|
||||
#define VG_MAXINT 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
#ifndef VG_MAX_ENUM
|
||||
#define VG_MAX_ENUM 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
typedef VGuint VGHandle;
|
||||
|
||||
typedef VGHandle VGPath;
|
||||
typedef VGHandle VGImage;
|
||||
typedef VGHandle VGMaskLayer;
|
||||
typedef VGHandle VGFont;
|
||||
typedef VGHandle VGPaint;
|
||||
|
||||
#define VG_INVALID_HANDLE ((VGHandle)0)
|
||||
|
||||
typedef enum {
|
||||
VG_FALSE = 0,
|
||||
VG_TRUE = 1,
|
||||
|
||||
VG_BOOLEAN_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGboolean;
|
||||
|
||||
typedef enum {
|
||||
VG_NO_ERROR = 0,
|
||||
VG_BAD_HANDLE_ERROR = 0x1000,
|
||||
VG_ILLEGAL_ARGUMENT_ERROR = 0x1001,
|
||||
VG_OUT_OF_MEMORY_ERROR = 0x1002,
|
||||
VG_PATH_CAPABILITY_ERROR = 0x1003,
|
||||
VG_UNSUPPORTED_IMAGE_FORMAT_ERROR = 0x1004,
|
||||
VG_UNSUPPORTED_PATH_FORMAT_ERROR = 0x1005,
|
||||
VG_IMAGE_IN_USE_ERROR = 0x1006,
|
||||
VG_NO_CONTEXT_ERROR = 0x1007,
|
||||
|
||||
VG_ERROR_CODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGErrorCode;
|
||||
|
||||
typedef enum {
|
||||
/* Mode settings */
|
||||
VG_MATRIX_MODE = 0x1100,
|
||||
VG_FILL_RULE = 0x1101,
|
||||
VG_IMAGE_QUALITY = 0x1102,
|
||||
VG_RENDERING_QUALITY = 0x1103,
|
||||
VG_BLEND_MODE = 0x1104,
|
||||
VG_IMAGE_MODE = 0x1105,
|
||||
|
||||
/* Scissoring rectangles */
|
||||
VG_SCISSOR_RECTS = 0x1106,
|
||||
|
||||
/* Color Transformation */
|
||||
VG_COLOR_TRANSFORM = 0x1170,
|
||||
VG_COLOR_TRANSFORM_VALUES = 0x1171,
|
||||
|
||||
/* Stroke parameters */
|
||||
VG_STROKE_LINE_WIDTH = 0x1110,
|
||||
VG_STROKE_CAP_STYLE = 0x1111,
|
||||
VG_STROKE_JOIN_STYLE = 0x1112,
|
||||
VG_STROKE_MITER_LIMIT = 0x1113,
|
||||
VG_STROKE_DASH_PATTERN = 0x1114,
|
||||
VG_STROKE_DASH_PHASE = 0x1115,
|
||||
VG_STROKE_DASH_PHASE_RESET = 0x1116,
|
||||
|
||||
/* Edge fill color for VG_TILE_FILL tiling mode */
|
||||
VG_TILE_FILL_COLOR = 0x1120,
|
||||
|
||||
/* Color for vgClear */
|
||||
VG_CLEAR_COLOR = 0x1121,
|
||||
|
||||
/* Glyph origin */
|
||||
VG_GLYPH_ORIGIN = 0x1122,
|
||||
|
||||
/* Enable/disable alpha masking and scissoring */
|
||||
VG_MASKING = 0x1130,
|
||||
VG_SCISSORING = 0x1131,
|
||||
|
||||
/* Pixel layout information */
|
||||
VG_PIXEL_LAYOUT = 0x1140,
|
||||
VG_SCREEN_LAYOUT = 0x1141,
|
||||
|
||||
/* Source format selection for image filters */
|
||||
VG_FILTER_FORMAT_LINEAR = 0x1150,
|
||||
VG_FILTER_FORMAT_PREMULTIPLIED = 0x1151,
|
||||
|
||||
/* Destination write enable mask for image filters */
|
||||
VG_FILTER_CHANNEL_MASK = 0x1152,
|
||||
|
||||
/* Implementation limits (read-only) */
|
||||
VG_MAX_SCISSOR_RECTS = 0x1160,
|
||||
VG_MAX_DASH_COUNT = 0x1161,
|
||||
VG_MAX_KERNEL_SIZE = 0x1162,
|
||||
VG_MAX_SEPARABLE_KERNEL_SIZE = 0x1163,
|
||||
VG_MAX_COLOR_RAMP_STOPS = 0x1164,
|
||||
VG_MAX_IMAGE_WIDTH = 0x1165,
|
||||
VG_MAX_IMAGE_HEIGHT = 0x1166,
|
||||
VG_MAX_IMAGE_PIXELS = 0x1167,
|
||||
VG_MAX_IMAGE_BYTES = 0x1168,
|
||||
VG_MAX_FLOAT = 0x1169,
|
||||
VG_MAX_GAUSSIAN_STD_DEVIATION = 0x116A,
|
||||
|
||||
VG_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGParamType;
|
||||
|
||||
typedef enum {
|
||||
VG_RENDERING_QUALITY_NONANTIALIASED = 0x1200,
|
||||
VG_RENDERING_QUALITY_FASTER = 0x1201,
|
||||
VG_RENDERING_QUALITY_BETTER = 0x1202, /* Default */
|
||||
|
||||
VG_RENDERING_QUALITY_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGRenderingQuality;
|
||||
|
||||
typedef enum {
|
||||
VG_PIXEL_LAYOUT_UNKNOWN = 0x1300,
|
||||
VG_PIXEL_LAYOUT_RGB_VERTICAL = 0x1301,
|
||||
VG_PIXEL_LAYOUT_BGR_VERTICAL = 0x1302,
|
||||
VG_PIXEL_LAYOUT_RGB_HORIZONTAL = 0x1303,
|
||||
VG_PIXEL_LAYOUT_BGR_HORIZONTAL = 0x1304,
|
||||
|
||||
VG_PIXEL_LAYOUT_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPixelLayout;
|
||||
|
||||
typedef enum {
|
||||
VG_MATRIX_PATH_USER_TO_SURFACE = 0x1400,
|
||||
VG_MATRIX_IMAGE_USER_TO_SURFACE = 0x1401,
|
||||
VG_MATRIX_FILL_PAINT_TO_USER = 0x1402,
|
||||
VG_MATRIX_STROKE_PAINT_TO_USER = 0x1403,
|
||||
VG_MATRIX_GLYPH_USER_TO_SURFACE = 0x1404,
|
||||
|
||||
VG_MATRIX_MODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGMatrixMode;
|
||||
|
||||
typedef enum {
|
||||
VG_CLEAR_MASK = 0x1500,
|
||||
VG_FILL_MASK = 0x1501,
|
||||
VG_SET_MASK = 0x1502,
|
||||
VG_UNION_MASK = 0x1503,
|
||||
VG_INTERSECT_MASK = 0x1504,
|
||||
VG_SUBTRACT_MASK = 0x1505,
|
||||
|
||||
VG_MASK_OPERATION_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGMaskOperation;
|
||||
|
||||
#define VG_PATH_FORMAT_STANDARD 0
|
||||
|
||||
typedef enum {
|
||||
VG_PATH_DATATYPE_S_8 = 0,
|
||||
VG_PATH_DATATYPE_S_16 = 1,
|
||||
VG_PATH_DATATYPE_S_32 = 2,
|
||||
VG_PATH_DATATYPE_F = 3,
|
||||
|
||||
VG_PATH_DATATYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathDatatype;
|
||||
|
||||
typedef enum {
|
||||
VG_ABSOLUTE = 0,
|
||||
VG_RELATIVE = 1,
|
||||
|
||||
VG_PATH_ABS_REL_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathAbsRel;
|
||||
|
||||
typedef enum {
|
||||
VG_CLOSE_PATH = ( 0 << 1),
|
||||
VG_MOVE_TO = ( 1 << 1),
|
||||
VG_LINE_TO = ( 2 << 1),
|
||||
VG_HLINE_TO = ( 3 << 1),
|
||||
VG_VLINE_TO = ( 4 << 1),
|
||||
VG_QUAD_TO = ( 5 << 1),
|
||||
VG_CUBIC_TO = ( 6 << 1),
|
||||
VG_SQUAD_TO = ( 7 << 1),
|
||||
VG_SCUBIC_TO = ( 8 << 1),
|
||||
VG_SCCWARC_TO = ( 9 << 1),
|
||||
VG_SCWARC_TO = (10 << 1),
|
||||
VG_LCCWARC_TO = (11 << 1),
|
||||
VG_LCWARC_TO = (12 << 1),
|
||||
|
||||
VG_PATH_SEGMENT_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathSegment;
|
||||
|
||||
typedef enum {
|
||||
VG_MOVE_TO_ABS = VG_MOVE_TO | VG_ABSOLUTE,
|
||||
VG_MOVE_TO_REL = VG_MOVE_TO | VG_RELATIVE,
|
||||
VG_LINE_TO_ABS = VG_LINE_TO | VG_ABSOLUTE,
|
||||
VG_LINE_TO_REL = VG_LINE_TO | VG_RELATIVE,
|
||||
VG_HLINE_TO_ABS = VG_HLINE_TO | VG_ABSOLUTE,
|
||||
VG_HLINE_TO_REL = VG_HLINE_TO | VG_RELATIVE,
|
||||
VG_VLINE_TO_ABS = VG_VLINE_TO | VG_ABSOLUTE,
|
||||
VG_VLINE_TO_REL = VG_VLINE_TO | VG_RELATIVE,
|
||||
VG_QUAD_TO_ABS = VG_QUAD_TO | VG_ABSOLUTE,
|
||||
VG_QUAD_TO_REL = VG_QUAD_TO | VG_RELATIVE,
|
||||
VG_CUBIC_TO_ABS = VG_CUBIC_TO | VG_ABSOLUTE,
|
||||
VG_CUBIC_TO_REL = VG_CUBIC_TO | VG_RELATIVE,
|
||||
VG_SQUAD_TO_ABS = VG_SQUAD_TO | VG_ABSOLUTE,
|
||||
VG_SQUAD_TO_REL = VG_SQUAD_TO | VG_RELATIVE,
|
||||
VG_SCUBIC_TO_ABS = VG_SCUBIC_TO | VG_ABSOLUTE,
|
||||
VG_SCUBIC_TO_REL = VG_SCUBIC_TO | VG_RELATIVE,
|
||||
VG_SCCWARC_TO_ABS = VG_SCCWARC_TO | VG_ABSOLUTE,
|
||||
VG_SCCWARC_TO_REL = VG_SCCWARC_TO | VG_RELATIVE,
|
||||
VG_SCWARC_TO_ABS = VG_SCWARC_TO | VG_ABSOLUTE,
|
||||
VG_SCWARC_TO_REL = VG_SCWARC_TO | VG_RELATIVE,
|
||||
VG_LCCWARC_TO_ABS = VG_LCCWARC_TO | VG_ABSOLUTE,
|
||||
VG_LCCWARC_TO_REL = VG_LCCWARC_TO | VG_RELATIVE,
|
||||
VG_LCWARC_TO_ABS = VG_LCWARC_TO | VG_ABSOLUTE,
|
||||
VG_LCWARC_TO_REL = VG_LCWARC_TO | VG_RELATIVE,
|
||||
|
||||
VG_PATH_COMMAND_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathCommand;
|
||||
|
||||
typedef enum {
|
||||
VG_PATH_CAPABILITY_APPEND_FROM = (1 << 0),
|
||||
VG_PATH_CAPABILITY_APPEND_TO = (1 << 1),
|
||||
VG_PATH_CAPABILITY_MODIFY = (1 << 2),
|
||||
VG_PATH_CAPABILITY_TRANSFORM_FROM = (1 << 3),
|
||||
VG_PATH_CAPABILITY_TRANSFORM_TO = (1 << 4),
|
||||
VG_PATH_CAPABILITY_INTERPOLATE_FROM = (1 << 5),
|
||||
VG_PATH_CAPABILITY_INTERPOLATE_TO = (1 << 6),
|
||||
VG_PATH_CAPABILITY_PATH_LENGTH = (1 << 7),
|
||||
VG_PATH_CAPABILITY_POINT_ALONG_PATH = (1 << 8),
|
||||
VG_PATH_CAPABILITY_TANGENT_ALONG_PATH = (1 << 9),
|
||||
VG_PATH_CAPABILITY_PATH_BOUNDS = (1 << 10),
|
||||
VG_PATH_CAPABILITY_PATH_TRANSFORMED_BOUNDS = (1 << 11),
|
||||
VG_PATH_CAPABILITY_ALL = (1 << 12) - 1,
|
||||
|
||||
VG_PATH_CAPABILITIES_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathCapabilities;
|
||||
|
||||
typedef enum {
|
||||
VG_PATH_FORMAT = 0x1600,
|
||||
VG_PATH_DATATYPE = 0x1601,
|
||||
VG_PATH_SCALE = 0x1602,
|
||||
VG_PATH_BIAS = 0x1603,
|
||||
VG_PATH_NUM_SEGMENTS = 0x1604,
|
||||
VG_PATH_NUM_COORDS = 0x1605,
|
||||
|
||||
VG_PATH_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathParamType;
|
||||
|
||||
typedef enum {
|
||||
VG_CAP_BUTT = 0x1700,
|
||||
VG_CAP_ROUND = 0x1701,
|
||||
VG_CAP_SQUARE = 0x1702,
|
||||
|
||||
VG_CAP_STYLE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGCapStyle;
|
||||
|
||||
typedef enum {
|
||||
VG_JOIN_MITER = 0x1800,
|
||||
VG_JOIN_ROUND = 0x1801,
|
||||
VG_JOIN_BEVEL = 0x1802,
|
||||
|
||||
VG_JOIN_STYLE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGJoinStyle;
|
||||
|
||||
typedef enum {
|
||||
VG_EVEN_ODD = 0x1900,
|
||||
VG_NON_ZERO = 0x1901,
|
||||
|
||||
VG_FILL_RULE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGFillRule;
|
||||
|
||||
typedef enum {
|
||||
VG_STROKE_PATH = (1 << 0),
|
||||
VG_FILL_PATH = (1 << 1),
|
||||
|
||||
VG_PAINT_MODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPaintMode;
|
||||
|
||||
typedef enum {
|
||||
/* Color paint parameters */
|
||||
VG_PAINT_TYPE = 0x1A00,
|
||||
VG_PAINT_COLOR = 0x1A01,
|
||||
VG_PAINT_COLOR_RAMP_SPREAD_MODE = 0x1A02,
|
||||
VG_PAINT_COLOR_RAMP_PREMULTIPLIED = 0x1A07,
|
||||
VG_PAINT_COLOR_RAMP_STOPS = 0x1A03,
|
||||
|
||||
/* Linear gradient paint parameters */
|
||||
VG_PAINT_LINEAR_GRADIENT = 0x1A04,
|
||||
|
||||
/* Radial gradient paint parameters */
|
||||
VG_PAINT_RADIAL_GRADIENT = 0x1A05,
|
||||
|
||||
/* Pattern paint parameters */
|
||||
VG_PAINT_PATTERN_TILING_MODE = 0x1A06,
|
||||
|
||||
VG_PAINT_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPaintParamType;
|
||||
|
||||
typedef enum {
|
||||
VG_PAINT_TYPE_COLOR = 0x1B00,
|
||||
VG_PAINT_TYPE_LINEAR_GRADIENT = 0x1B01,
|
||||
VG_PAINT_TYPE_RADIAL_GRADIENT = 0x1B02,
|
||||
VG_PAINT_TYPE_PATTERN = 0x1B03,
|
||||
|
||||
VG_PAINT_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPaintType;
|
||||
|
||||
typedef enum {
|
||||
VG_COLOR_RAMP_SPREAD_PAD = 0x1C00,
|
||||
VG_COLOR_RAMP_SPREAD_REPEAT = 0x1C01,
|
||||
VG_COLOR_RAMP_SPREAD_REFLECT = 0x1C02,
|
||||
|
||||
VG_COLOR_RAMP_SPREAD_MODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGColorRampSpreadMode;
|
||||
|
||||
typedef enum {
|
||||
VG_TILE_FILL = 0x1D00,
|
||||
VG_TILE_PAD = 0x1D01,
|
||||
VG_TILE_REPEAT = 0x1D02,
|
||||
VG_TILE_REFLECT = 0x1D03,
|
||||
|
||||
VG_TILING_MODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGTilingMode;
|
||||
|
||||
typedef enum {
|
||||
/* RGB{A,X} channel ordering */
|
||||
VG_sRGBX_8888 = 0,
|
||||
VG_sRGBA_8888 = 1,
|
||||
VG_sRGBA_8888_PRE = 2,
|
||||
VG_sRGB_565 = 3,
|
||||
VG_sRGBA_5551 = 4,
|
||||
VG_sRGBA_4444 = 5,
|
||||
VG_sL_8 = 6,
|
||||
VG_lRGBX_8888 = 7,
|
||||
VG_lRGBA_8888 = 8,
|
||||
VG_lRGBA_8888_PRE = 9,
|
||||
VG_lL_8 = 10,
|
||||
VG_A_8 = 11,
|
||||
VG_BW_1 = 12,
|
||||
VG_A_1 = 13,
|
||||
VG_A_4 = 14,
|
||||
|
||||
/* {A,X}RGB channel ordering */
|
||||
VG_sXRGB_8888 = 0 | (1 << 6),
|
||||
VG_sARGB_8888 = 1 | (1 << 6),
|
||||
VG_sARGB_8888_PRE = 2 | (1 << 6),
|
||||
VG_sARGB_1555 = 4 | (1 << 6),
|
||||
VG_sARGB_4444 = 5 | (1 << 6),
|
||||
VG_lXRGB_8888 = 7 | (1 << 6),
|
||||
VG_lARGB_8888 = 8 | (1 << 6),
|
||||
VG_lARGB_8888_PRE = 9 | (1 << 6),
|
||||
|
||||
/* BGR{A,X} channel ordering */
|
||||
VG_sBGRX_8888 = 0 | (1 << 7),
|
||||
VG_sBGRA_8888 = 1 | (1 << 7),
|
||||
VG_sBGRA_8888_PRE = 2 | (1 << 7),
|
||||
VG_sBGR_565 = 3 | (1 << 7),
|
||||
VG_sBGRA_5551 = 4 | (1 << 7),
|
||||
VG_sBGRA_4444 = 5 | (1 << 7),
|
||||
VG_lBGRX_8888 = 7 | (1 << 7),
|
||||
VG_lBGRA_8888 = 8 | (1 << 7),
|
||||
VG_lBGRA_8888_PRE = 9 | (1 << 7),
|
||||
|
||||
/* {A,X}BGR channel ordering */
|
||||
VG_sXBGR_8888 = 0 | (1 << 6) | (1 << 7),
|
||||
VG_sABGR_8888 = 1 | (1 << 6) | (1 << 7),
|
||||
VG_sABGR_8888_PRE = 2 | (1 << 6) | (1 << 7),
|
||||
VG_sABGR_1555 = 4 | (1 << 6) | (1 << 7),
|
||||
VG_sABGR_4444 = 5 | (1 << 6) | (1 << 7),
|
||||
VG_lXBGR_8888 = 7 | (1 << 6) | (1 << 7),
|
||||
VG_lABGR_8888 = 8 | (1 << 6) | (1 << 7),
|
||||
VG_lABGR_8888_PRE = 9 | (1 << 6) | (1 << 7),
|
||||
|
||||
VG_IMAGE_FORMAT_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGImageFormat;
|
||||
|
||||
typedef enum {
|
||||
VG_IMAGE_QUALITY_NONANTIALIASED = (1 << 0),
|
||||
VG_IMAGE_QUALITY_FASTER = (1 << 1),
|
||||
VG_IMAGE_QUALITY_BETTER = (1 << 2),
|
||||
|
||||
VG_IMAGE_QUALITY_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGImageQuality;
|
||||
|
||||
typedef enum {
|
||||
VG_IMAGE_FORMAT = 0x1E00,
|
||||
VG_IMAGE_WIDTH = 0x1E01,
|
||||
VG_IMAGE_HEIGHT = 0x1E02,
|
||||
|
||||
VG_IMAGE_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGImageParamType;
|
||||
|
||||
typedef enum {
|
||||
VG_DRAW_IMAGE_NORMAL = 0x1F00,
|
||||
VG_DRAW_IMAGE_MULTIPLY = 0x1F01,
|
||||
VG_DRAW_IMAGE_STENCIL = 0x1F02,
|
||||
|
||||
VG_IMAGE_MODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGImageMode;
|
||||
|
||||
typedef enum {
|
||||
VG_RED = (1 << 3),
|
||||
VG_GREEN = (1 << 2),
|
||||
VG_BLUE = (1 << 1),
|
||||
VG_ALPHA = (1 << 0),
|
||||
|
||||
VG_IMAGE_CHANNEL_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGImageChannel;
|
||||
|
||||
typedef enum {
|
||||
VG_BLEND_SRC = 0x2000,
|
||||
VG_BLEND_SRC_OVER = 0x2001,
|
||||
VG_BLEND_DST_OVER = 0x2002,
|
||||
VG_BLEND_SRC_IN = 0x2003,
|
||||
VG_BLEND_DST_IN = 0x2004,
|
||||
VG_BLEND_MULTIPLY = 0x2005,
|
||||
VG_BLEND_SCREEN = 0x2006,
|
||||
VG_BLEND_DARKEN = 0x2007,
|
||||
VG_BLEND_LIGHTEN = 0x2008,
|
||||
VG_BLEND_ADDITIVE = 0x2009,
|
||||
|
||||
VG_BLEND_MODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGBlendMode;
|
||||
|
||||
typedef enum {
|
||||
VG_FONT_NUM_GLYPHS = 0x2F00,
|
||||
|
||||
VG_FONT_PARAM_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGFontParamType;
|
||||
|
||||
typedef enum {
|
||||
VG_IMAGE_FORMAT_QUERY = 0x2100,
|
||||
VG_PATH_DATATYPE_QUERY = 0x2101,
|
||||
|
||||
VG_HARDWARE_QUERY_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGHardwareQueryType;
|
||||
|
||||
typedef enum {
|
||||
VG_HARDWARE_ACCELERATED = 0x2200,
|
||||
VG_HARDWARE_UNACCELERATED = 0x2201,
|
||||
|
||||
VG_HARDWARE_QUERY_RESULT_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGHardwareQueryResult;
|
||||
|
||||
typedef enum {
|
||||
VG_VENDOR = 0x2300,
|
||||
VG_RENDERER = 0x2301,
|
||||
VG_VERSION = 0x2302,
|
||||
VG_EXTENSIONS = 0x2303,
|
||||
|
||||
VG_STRING_ID_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGStringID;
|
||||
|
||||
/* Function Prototypes */
|
||||
|
||||
#ifndef VG_API_CALL
|
||||
# error VG_API_CALL must be defined
|
||||
#endif
|
||||
|
||||
#ifndef VG_API_ENTRY
|
||||
# error VG_API_ENTRY must be defined
|
||||
#endif
|
||||
|
||||
#ifndef VG_API_EXIT
|
||||
# error VG_API_EXIT must be defined
|
||||
#endif
|
||||
|
||||
VG_API_CALL VGErrorCode VG_API_ENTRY vgGetError(void) VG_API_EXIT;
|
||||
|
||||
VG_API_CALL void VG_API_ENTRY vgFlush(void) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgFinish(void) VG_API_EXIT;
|
||||
|
||||
/* Getters and Setters */
|
||||
VG_API_CALL void VG_API_ENTRY vgSetf (VGParamType type, VGfloat value) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSeti (VGParamType type, VGint value) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetfv(VGParamType type, VGint count,
|
||||
const VGfloat * values) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetiv(VGParamType type, VGint count,
|
||||
const VGint * values) VG_API_EXIT;
|
||||
|
||||
VG_API_CALL VGfloat VG_API_ENTRY vgGetf(VGParamType type) VG_API_EXIT;
|
||||
VG_API_CALL VGint VG_API_ENTRY vgGeti(VGParamType type) VG_API_EXIT;
|
||||
VG_API_CALL VGint VG_API_ENTRY vgGetVectorSize(VGParamType type) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetfv(VGParamType type, VGint count, VGfloat * values) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetiv(VGParamType type, VGint count, VGint * values) VG_API_EXIT;
|
||||
|
||||
VG_API_CALL void VG_API_ENTRY vgSetParameterf(VGHandle object,
|
||||
VGint paramType,
|
||||
VGfloat value) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetParameteri(VGHandle object,
|
||||
VGint paramType,
|
||||
VGint value) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetParameterfv(VGHandle object,
|
||||
VGint paramType,
|
||||
VGint count, const VGfloat * values) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetParameteriv(VGHandle object,
|
||||
VGint paramType,
|
||||
VGint count, const VGint * values) VG_API_EXIT;
|
||||
|
||||
VG_API_CALL VGfloat VG_API_ENTRY vgGetParameterf(VGHandle object,
|
||||
VGint paramType) VG_API_EXIT;
|
||||
VG_API_CALL VGint VG_API_ENTRY vgGetParameteri(VGHandle object,
|
||||
VGint paramType);
|
||||
VG_API_CALL VGint VG_API_ENTRY vgGetParameterVectorSize(VGHandle object,
|
||||
VGint paramType) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetParameterfv(VGHandle object,
|
||||
VGint paramType,
|
||||
VGint count, VGfloat * values) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetParameteriv(VGHandle object,
|
||||
VGint paramType,
|
||||
VGint count, VGint * values) VG_API_EXIT;
|
||||
|
||||
/* Matrix Manipulation */
|
||||
VG_API_CALL void VG_API_ENTRY vgLoadIdentity(void) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgLoadMatrix(const VGfloat * m) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetMatrix(VGfloat * m) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgMultMatrix(const VGfloat * m) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgTranslate(VGfloat tx, VGfloat ty) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgScale(VGfloat sx, VGfloat sy) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgShear(VGfloat shx, VGfloat shy) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgRotate(VGfloat angle) VG_API_EXIT;
|
||||
|
||||
/* Masking and Clearing */
|
||||
VG_API_CALL void VG_API_ENTRY vgMask(VGHandle mask, VGMaskOperation operation,
|
||||
VGint x, VGint y,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgRenderToMask(VGPath path,
|
||||
VGbitfield paintModes,
|
||||
VGMaskOperation operation) VG_API_EXIT;
|
||||
VG_API_CALL VGMaskLayer VG_API_ENTRY vgCreateMaskLayer(VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDestroyMaskLayer(VGMaskLayer maskLayer) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgFillMaskLayer(VGMaskLayer maskLayer,
|
||||
VGint x, VGint y,
|
||||
VGint width, VGint height,
|
||||
VGfloat value) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgCopyMask(VGMaskLayer maskLayer,
|
||||
VGint dx, VGint dy,
|
||||
VGint sx, VGint sy,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgClear(VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
|
||||
|
||||
/* Paths */
|
||||
VG_API_CALL VGPath VG_API_ENTRY vgCreatePath(VGint pathFormat,
|
||||
VGPathDatatype datatype,
|
||||
VGfloat scale, VGfloat bias,
|
||||
VGint segmentCapacityHint,
|
||||
VGint coordCapacityHint,
|
||||
VGbitfield capabilities) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgClearPath(VGPath path, VGbitfield capabilities) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDestroyPath(VGPath path) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgRemovePathCapabilities(VGPath path,
|
||||
VGbitfield capabilities) VG_API_EXIT;
|
||||
VG_API_CALL VGbitfield VG_API_ENTRY vgGetPathCapabilities(VGPath path) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgAppendPath(VGPath dstPath, VGPath srcPath) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgAppendPathData(VGPath dstPath,
|
||||
VGint numSegments,
|
||||
const VGubyte * pathSegments,
|
||||
const void * pathData) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgModifyPathCoords(VGPath dstPath, VGint startIndex,
|
||||
VGint numSegments,
|
||||
const void * pathData) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgTransformPath(VGPath dstPath, VGPath srcPath) VG_API_EXIT;
|
||||
VG_API_CALL VGboolean VG_API_ENTRY vgInterpolatePath(VGPath dstPath,
|
||||
VGPath startPath,
|
||||
VGPath endPath,
|
||||
VGfloat amount) VG_API_EXIT;
|
||||
VG_API_CALL VGfloat VG_API_ENTRY vgPathLength(VGPath path,
|
||||
VGint startSegment, VGint numSegments) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgPointAlongPath(VGPath path,
|
||||
VGint startSegment, VGint numSegments,
|
||||
VGfloat distance,
|
||||
VGfloat * x, VGfloat * y,
|
||||
VGfloat * tangentX, VGfloat * tangentY) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgPathBounds(VGPath path,
|
||||
VGfloat * minX, VGfloat * minY,
|
||||
VGfloat * width, VGfloat * height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgPathTransformedBounds(VGPath path,
|
||||
VGfloat * minX, VGfloat * minY,
|
||||
VGfloat * width, VGfloat * height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDrawPath(VGPath path, VGbitfield paintModes) VG_API_EXIT;
|
||||
|
||||
/* Paint */
|
||||
VG_API_CALL VGPaint VG_API_ENTRY vgCreatePaint(void) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDestroyPaint(VGPaint paint) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetPaint(VGPaint paint, VGbitfield paintModes) VG_API_EXIT;
|
||||
VG_API_CALL VGPaint VG_API_ENTRY vgGetPaint(VGPaintMode paintMode) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetColor(VGPaint paint, VGuint rgba) VG_API_EXIT;
|
||||
VG_API_CALL VGuint VG_API_ENTRY vgGetColor(VGPaint paint) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgPaintPattern(VGPaint paint, VGImage pattern) VG_API_EXIT;
|
||||
|
||||
/* Images */
|
||||
VG_API_CALL VGImage VG_API_ENTRY vgCreateImage(VGImageFormat format,
|
||||
VGint width, VGint height,
|
||||
VGbitfield allowedQuality) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDestroyImage(VGImage image) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgClearImage(VGImage image,
|
||||
VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgImageSubData(VGImage image,
|
||||
const void * data, VGint dataStride,
|
||||
VGImageFormat dataFormat,
|
||||
VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetImageSubData(VGImage image,
|
||||
void * data, VGint dataStride,
|
||||
VGImageFormat dataFormat,
|
||||
VGint x, VGint y,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL VGImage VG_API_ENTRY vgChildImage(VGImage parent,
|
||||
VGint x, VGint y, VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL VGImage VG_API_ENTRY vgGetParent(VGImage image) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgCopyImage(VGImage dst, VGint dx, VGint dy,
|
||||
VGImage src, VGint sx, VGint sy,
|
||||
VGint width, VGint height,
|
||||
VGboolean dither) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDrawImage(VGImage image) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetPixels(VGint dx, VGint dy,
|
||||
VGImage src, VGint sx, VGint sy,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgWritePixels(const void * data, VGint dataStride,
|
||||
VGImageFormat dataFormat,
|
||||
VGint dx, VGint dy,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGetPixels(VGImage dst, VGint dx, VGint dy,
|
||||
VGint sx, VGint sy,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgReadPixels(void * data, VGint dataStride,
|
||||
VGImageFormat dataFormat,
|
||||
VGint sx, VGint sy,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgCopyPixels(VGint dx, VGint dy,
|
||||
VGint sx, VGint sy,
|
||||
VGint width, VGint height) VG_API_EXIT;
|
||||
|
||||
/* Text */
|
||||
VG_API_CALL VGFont VG_API_ENTRY vgCreateFont(VGint glyphCapacityHint) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDestroyFont(VGFont font) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetGlyphToPath(VGFont font,
|
||||
VGuint glyphIndex,
|
||||
VGPath path,
|
||||
VGboolean isHinted,
|
||||
const VGfloat glyphOrigin [2],
|
||||
const VGfloat escapement[2]) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSetGlyphToImage(VGFont font,
|
||||
VGuint glyphIndex,
|
||||
VGImage image,
|
||||
const VGfloat glyphOrigin [2],
|
||||
const VGfloat escapement[2]) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgClearGlyph(VGFont font,VGuint glyphIndex) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDrawGlyph(VGFont font,
|
||||
VGuint glyphIndex,
|
||||
VGbitfield paintModes,
|
||||
VGboolean allowAutoHinting) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgDrawGlyphs(VGFont font,
|
||||
VGint glyphCount,
|
||||
const VGuint *glyphIndices,
|
||||
const VGfloat *adjustments_x,
|
||||
const VGfloat *adjustments_y,
|
||||
VGbitfield paintModes,
|
||||
VGboolean allowAutoHinting) VG_API_EXIT;
|
||||
|
||||
/* Image Filters */
|
||||
VG_API_CALL void VG_API_ENTRY vgColorMatrix(VGImage dst, VGImage src,
|
||||
const VGfloat * matrix) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgConvolve(VGImage dst, VGImage src,
|
||||
VGint kernelWidth, VGint kernelHeight,
|
||||
VGint shiftX, VGint shiftY,
|
||||
const VGshort * kernel,
|
||||
VGfloat scale,
|
||||
VGfloat bias,
|
||||
VGTilingMode tilingMode) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgSeparableConvolve(VGImage dst, VGImage src,
|
||||
VGint kernelWidth,
|
||||
VGint kernelHeight,
|
||||
VGint shiftX, VGint shiftY,
|
||||
const VGshort * kernelX,
|
||||
const VGshort * kernelY,
|
||||
VGfloat scale,
|
||||
VGfloat bias,
|
||||
VGTilingMode tilingMode) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgGaussianBlur(VGImage dst, VGImage src,
|
||||
VGfloat stdDeviationX,
|
||||
VGfloat stdDeviationY,
|
||||
VGTilingMode tilingMode) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgLookup(VGImage dst, VGImage src,
|
||||
const VGubyte * redLUT,
|
||||
const VGubyte * greenLUT,
|
||||
const VGubyte * blueLUT,
|
||||
const VGubyte * alphaLUT,
|
||||
VGboolean outputLinear,
|
||||
VGboolean outputPremultiplied) VG_API_EXIT;
|
||||
VG_API_CALL void VG_API_ENTRY vgLookupSingle(VGImage dst, VGImage src,
|
||||
const VGuint * lookupTable,
|
||||
VGImageChannel sourceChannel,
|
||||
VGboolean outputLinear,
|
||||
VGboolean outputPremultiplied) VG_API_EXIT;
|
||||
|
||||
/* Hardware Queries */
|
||||
VG_API_CALL VGHardwareQueryResult VG_API_ENTRY vgHardwareQuery(VGHardwareQueryType key,
|
||||
VGint setting) VG_API_EXIT;
|
||||
|
||||
/* Renderer and Extension Information */
|
||||
VG_API_CALL const VGubyte * VG_API_ENTRY vgGetString(VGStringID name) VG_API_EXIT;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* _OPENVG_H */
|
||||
@@ -1,233 +0,0 @@
|
||||
/* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*
|
||||
* VG extensions Reference Implementation
|
||||
* -------------------------------------
|
||||
*
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and /or associated documentation files
|
||||
* (the "Materials "), to deal in the Materials without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Materials,
|
||||
* and to permit persons to whom the Materials are furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Materials.
|
||||
*
|
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
|
||||
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*
|
||||
*//**
|
||||
* \file
|
||||
* \brief VG extensions
|
||||
*//*-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
#ifndef _VGEXT_H
|
||||
#define _VGEXT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <VG/openvg.h>
|
||||
#include <VG/vgu.h>
|
||||
|
||||
#ifndef VG_API_ENTRYP
|
||||
# define VG_API_ENTRYP VG_API_ENTRY*
|
||||
#endif
|
||||
|
||||
#ifndef VGU_API_ENTRYP
|
||||
# define VGU_API_ENTRYP VGU_API_ENTRY*
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------------
|
||||
* KHR extensions
|
||||
*------------------------------------------------------------------------------*/
|
||||
|
||||
typedef enum {
|
||||
|
||||
#ifndef VG_KHR_iterative_average_blur
|
||||
VG_MAX_AVERAGE_BLUR_DIMENSION_KHR = 0x116B,
|
||||
VG_AVERAGE_BLUR_DIMENSION_RESOLUTION_KHR = 0x116C,
|
||||
VG_MAX_AVERAGE_BLUR_ITERATIONS_KHR = 0x116D,
|
||||
#endif
|
||||
|
||||
VG_PARAM_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGParamTypeKHR;
|
||||
|
||||
#ifndef VG_KHR_EGL_image
|
||||
#define VG_KHR_EGL_image 1
|
||||
/* VGEGLImageKHR is an opaque handle to an EGLImage */
|
||||
typedef void* VGeglImageKHR;
|
||||
|
||||
#ifdef VG_VGEXT_PROTOTYPES
|
||||
VG_API_CALL VGImage VG_API_ENTRY vgCreateEGLImageTargetKHR(VGeglImageKHR image);
|
||||
#endif
|
||||
typedef VGImage (VG_API_ENTRYP PFNVGCREATEEGLIMAGETARGETKHRPROC) (VGeglImageKHR image);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef VG_KHR_iterative_average_blur
|
||||
#define VG_KHR_iterative_average_blur 1
|
||||
|
||||
#ifdef VG_VGEXT_PROTOTYPES
|
||||
VG_API_CALL void vgIterativeAverageBlurKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
|
||||
#endif
|
||||
typedef void (VG_API_ENTRYP PFNVGITERATIVEAVERAGEBLURKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef VG_KHR_advanced_blending
|
||||
#define VG_KHR_advanced_blending 1
|
||||
|
||||
typedef enum {
|
||||
VG_BLEND_OVERLAY_KHR = 0x2010,
|
||||
VG_BLEND_HARDLIGHT_KHR = 0x2011,
|
||||
VG_BLEND_SOFTLIGHT_SVG_KHR = 0x2012,
|
||||
VG_BLEND_SOFTLIGHT_KHR = 0x2013,
|
||||
VG_BLEND_COLORDODGE_KHR = 0x2014,
|
||||
VG_BLEND_COLORBURN_KHR = 0x2015,
|
||||
VG_BLEND_DIFFERENCE_KHR = 0x2016,
|
||||
VG_BLEND_SUBTRACT_KHR = 0x2017,
|
||||
VG_BLEND_INVERT_KHR = 0x2018,
|
||||
VG_BLEND_EXCLUSION_KHR = 0x2019,
|
||||
VG_BLEND_LINEARDODGE_KHR = 0x201a,
|
||||
VG_BLEND_LINEARBURN_KHR = 0x201b,
|
||||
VG_BLEND_VIVIDLIGHT_KHR = 0x201c,
|
||||
VG_BLEND_LINEARLIGHT_KHR = 0x201d,
|
||||
VG_BLEND_PINLIGHT_KHR = 0x201e,
|
||||
VG_BLEND_HARDMIX_KHR = 0x201f,
|
||||
VG_BLEND_CLEAR_KHR = 0x2020,
|
||||
VG_BLEND_DST_KHR = 0x2021,
|
||||
VG_BLEND_SRC_OUT_KHR = 0x2022,
|
||||
VG_BLEND_DST_OUT_KHR = 0x2023,
|
||||
VG_BLEND_SRC_ATOP_KHR = 0x2024,
|
||||
VG_BLEND_DST_ATOP_KHR = 0x2025,
|
||||
VG_BLEND_XOR_KHR = 0x2026,
|
||||
|
||||
VG_BLEND_MODE_KHR_FORCE_SIZE= VG_MAX_ENUM
|
||||
} VGBlendModeKHR;
|
||||
#endif
|
||||
|
||||
#ifndef VG_KHR_parametric_filter
|
||||
#define VG_KHR_parametric_filter 1
|
||||
|
||||
typedef enum {
|
||||
VG_PF_OBJECT_VISIBLE_FLAG_KHR = (1 << 0),
|
||||
VG_PF_KNOCKOUT_FLAG_KHR = (1 << 1),
|
||||
VG_PF_OUTER_FLAG_KHR = (1 << 2),
|
||||
VG_PF_INNER_FLAG_KHR = (1 << 3),
|
||||
|
||||
VG_PF_TYPE_KHR_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPfTypeKHR;
|
||||
|
||||
typedef enum {
|
||||
VGU_IMAGE_IN_USE_ERROR = 0xF010,
|
||||
|
||||
VGU_ERROR_CODE_KHR_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGUErrorCodeKHR;
|
||||
|
||||
#ifdef VG_VGEXT_PROTOTYPES
|
||||
VG_API_CALL void VG_API_ENTRY vgParametricFilterKHR(VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguDropShadowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA) ;
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientGlowKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguGradientBevelKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
|
||||
#endif
|
||||
typedef void (VG_API_ENTRYP PFNVGPARAMETRICFILTERKHRPROC) (VGImage dst,VGImage src,VGImage blur,VGfloat strength,VGfloat offsetX,VGfloat offsetY,VGbitfield filterFlags,VGPaint highlightPaint,VGPaint shadowPaint);
|
||||
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUDROPSHADOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint shadowColorRGBA);
|
||||
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint glowColorRGBA);
|
||||
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint highlightColorRGBA,VGuint shadowColorRGBA);
|
||||
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTGLOWKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* glowColorRampStops);
|
||||
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTBEVELKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGfloat strength,VGfloat distance,VGfloat angle,VGbitfield filterFlags,VGbitfield allowedQuality,VGuint stopsCount,const VGfloat* bevelColorRampStops);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------------
|
||||
* NDS extensions
|
||||
*------------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef VG_NDS_paint_generation
|
||||
#define VG_NDS_paint_generation 1
|
||||
|
||||
typedef enum {
|
||||
VG_PAINT_COLOR_RAMP_LINEAR_NDS = 0x1A10,
|
||||
VG_COLOR_MATRIX_NDS = 0x1A11,
|
||||
VG_PAINT_COLOR_TRANSFORM_LINEAR_NDS = 0x1A12,
|
||||
|
||||
VG_PAINT_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPaintParamTypeNds;
|
||||
|
||||
typedef enum {
|
||||
VG_DRAW_IMAGE_COLOR_MATRIX_NDS = 0x1F10,
|
||||
|
||||
VG_IMAGE_MODE_NDS_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGImageModeNds;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef VG_NDS_projective_geometry
|
||||
#define VG_NDS_projective_geometry 1
|
||||
|
||||
typedef enum {
|
||||
VG_CLIP_MODE_NDS = 0x1180,
|
||||
VG_CLIP_LINES_NDS = 0x1181,
|
||||
VG_MAX_CLIP_LINES_NDS = 0x1182,
|
||||
|
||||
VG_PARAM_TYPE_NDS_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGParamTypeNds;
|
||||
|
||||
typedef enum {
|
||||
VG_CLIPMODE_NONE_NDS = 0x3000,
|
||||
VG_CLIPMODE_CLIP_CLOSED_NDS = 0x3001,
|
||||
VG_CLIPMODE_CLIP_OPEN_NDS = 0x3002,
|
||||
VG_CLIPMODE_CULL_NDS = 0x3003,
|
||||
|
||||
VG_CLIPMODE_NDS_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGClipModeNds;
|
||||
|
||||
typedef enum {
|
||||
VG_RQUAD_TO_NDS = ( 13 << 1 ),
|
||||
VG_RCUBIC_TO_NDS = ( 14 << 1 ),
|
||||
|
||||
VG_PATH_SEGMENT_NDS_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathSegmentNds;
|
||||
|
||||
typedef enum {
|
||||
VG_RQUAD_TO_ABS_NDS = (VG_RQUAD_TO_NDS | VG_ABSOLUTE),
|
||||
VG_RQUAD_TO_REL_NDS = (VG_RQUAD_TO_NDS | VG_RELATIVE),
|
||||
VG_RCUBIC_TO_ABS_NDS = (VG_RCUBIC_TO_NDS | VG_ABSOLUTE),
|
||||
VG_RCUBIC_TO_REL_NDS = (VG_RCUBIC_TO_NDS | VG_RELATIVE),
|
||||
|
||||
VG_PATH_COMMAND_NDS_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGPathCommandNds;
|
||||
|
||||
#ifdef VG_VGEXT_PROTOTYPES
|
||||
VG_API_CALL void VG_API_ENTRY vgProjectiveMatrixNDS(VGboolean enable) ;
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguTransformClipLineNDS(const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
|
||||
#endif
|
||||
typedef void (VG_API_ENTRYP PFNVGPROJECTIVEMATRIXNDSPROC) (VGboolean enable) ;
|
||||
typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUTRANSFORMCLIPLINENDSPROC) (const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* _VGEXT_H */
|
||||
@@ -1,92 +0,0 @@
|
||||
/* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*
|
||||
* VG platform specific header Reference Implementation
|
||||
* ----------------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and /or associated documentation files
|
||||
* (the "Materials "), to deal in the Materials without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Materials,
|
||||
* and to permit persons to whom the Materials are furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Materials.
|
||||
*
|
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
|
||||
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*
|
||||
*//**
|
||||
* \file
|
||||
* \brief VG platform specific header
|
||||
*//*-------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _VGPLATFORM_H
|
||||
#define _VGPLATFORM_H
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef VG_API_CALL
|
||||
#if defined(OPENVG_STATIC_LIBRARY)
|
||||
# define VG_API_CALL
|
||||
#else
|
||||
# define VG_API_CALL KHRONOS_APICALL
|
||||
#endif /* defined OPENVG_STATIC_LIBRARY */
|
||||
#endif /* ifndef VG_API_CALL */
|
||||
|
||||
#ifndef VGU_API_CALL
|
||||
#if defined(OPENVG_STATIC_LIBRARY)
|
||||
# define VGU_API_CALL
|
||||
#else
|
||||
# define VGU_API_CALL KHRONOS_APICALL
|
||||
#endif /* defined OPENVG_STATIC_LIBRARY */
|
||||
#endif /* ifndef VGU_API_CALL */
|
||||
|
||||
|
||||
#ifndef VG_API_ENTRY
|
||||
#define VG_API_ENTRY
|
||||
#endif
|
||||
|
||||
#ifndef VG_API_EXIT
|
||||
#define VG_API_EXIT
|
||||
#endif
|
||||
|
||||
#ifndef VGU_API_ENTRY
|
||||
#define VGU_API_ENTRY
|
||||
#endif
|
||||
|
||||
#ifndef VGU_API_EXIT
|
||||
#define VGU_API_EXIT
|
||||
#endif
|
||||
|
||||
typedef float VGfloat;
|
||||
typedef signed char VGbyte;
|
||||
typedef unsigned char VGubyte;
|
||||
typedef signed short VGshort;
|
||||
typedef signed int VGint;
|
||||
typedef unsigned int VGuint;
|
||||
typedef unsigned int VGbitfield;
|
||||
|
||||
#ifndef VG_VGEXT_PROTOTYPES
|
||||
#define VG_VGEXT_PROTOTYPES
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* _VGPLATFORM_H */
|
||||
@@ -1,131 +0,0 @@
|
||||
/* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
*
|
||||
* VGU 1.1 Reference Implementation
|
||||
* -------------------------------------
|
||||
*
|
||||
* Copyright (c) 2008 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and /or associated documentation files
|
||||
* (the "Materials "), to deal in the Materials without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Materials,
|
||||
* and to permit persons to whom the Materials are furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Materials.
|
||||
*
|
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
|
||||
* THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*
|
||||
*//**
|
||||
* \file
|
||||
* \brief VGU 1.1 API.
|
||||
*//*-------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _VGU_H
|
||||
#define _VGU_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <VG/openvg.h>
|
||||
|
||||
#define VGU_VERSION_1_0 1
|
||||
#define VGU_VERSION_1_1 2
|
||||
|
||||
#ifndef VGU_API_CALL
|
||||
# error VGU_API_CALL must be defined
|
||||
#endif
|
||||
|
||||
#ifndef VGU_API_ENTRY
|
||||
# error VGU_API_ENTRY must be defined
|
||||
#endif
|
||||
|
||||
#ifndef VGU_API_EXIT
|
||||
# error VGU_API_EXIT must be defined
|
||||
#endif
|
||||
|
||||
|
||||
typedef enum {
|
||||
VGU_NO_ERROR = 0,
|
||||
VGU_BAD_HANDLE_ERROR = 0xF000,
|
||||
VGU_ILLEGAL_ARGUMENT_ERROR = 0xF001,
|
||||
VGU_OUT_OF_MEMORY_ERROR = 0xF002,
|
||||
VGU_PATH_CAPABILITY_ERROR = 0xF003,
|
||||
VGU_BAD_WARP_ERROR = 0xF004,
|
||||
|
||||
VGU_ERROR_CODE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGUErrorCode;
|
||||
|
||||
typedef enum {
|
||||
VGU_ARC_OPEN = 0xF100,
|
||||
VGU_ARC_CHORD = 0xF101,
|
||||
VGU_ARC_PIE = 0xF102,
|
||||
|
||||
VGU_ARC_TYPE_FORCE_SIZE = VG_MAX_ENUM
|
||||
} VGUArcType;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguLine(VGPath path,
|
||||
VGfloat x0, VGfloat y0,
|
||||
VGfloat x1, VGfloat y1) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguPolygon(VGPath path,
|
||||
const VGfloat * points, VGint count,
|
||||
VGboolean closed) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRect(VGPath path,
|
||||
VGfloat x, VGfloat y,
|
||||
VGfloat width, VGfloat height) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRoundRect(VGPath path,
|
||||
VGfloat x, VGfloat y,
|
||||
VGfloat width, VGfloat height,
|
||||
VGfloat arcWidth, VGfloat arcHeight) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguEllipse(VGPath path,
|
||||
VGfloat cx, VGfloat cy,
|
||||
VGfloat width, VGfloat height) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguArc(VGPath path,
|
||||
VGfloat x, VGfloat y,
|
||||
VGfloat width, VGfloat height,
|
||||
VGfloat startAngle, VGfloat angleExtent,
|
||||
VGUArcType arcType) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToSquare(VGfloat sx0, VGfloat sy0,
|
||||
VGfloat sx1, VGfloat sy1,
|
||||
VGfloat sx2, VGfloat sy2,
|
||||
VGfloat sx3, VGfloat sy3,
|
||||
VGfloat * matrix) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpSquareToQuad(VGfloat dx0, VGfloat dy0,
|
||||
VGfloat dx1, VGfloat dy1,
|
||||
VGfloat dx2, VGfloat dy2,
|
||||
VGfloat dx3, VGfloat dy3,
|
||||
VGfloat * matrix) VGU_API_EXIT;
|
||||
|
||||
VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToQuad(VGfloat dx0, VGfloat dy0,
|
||||
VGfloat dx1, VGfloat dy1,
|
||||
VGfloat dx2, VGfloat dy2,
|
||||
VGfloat dx3, VGfloat dy3,
|
||||
VGfloat sx0, VGfloat sy0,
|
||||
VGfloat sx1, VGfloat sy1,
|
||||
VGfloat sx2, VGfloat sy2,
|
||||
VGfloat sx3, VGfloat sy3,
|
||||
VGfloat * matrix) VGU_API_EXIT;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef _VGU_H */
|
||||
@@ -1,40 +0,0 @@
|
||||
# src/Makefile
|
||||
|
||||
TOP = ..
|
||||
|
||||
include $(TOP)/configs/current
|
||||
|
||||
SUBDIRS = $(SRC_DIRS)
|
||||
|
||||
|
||||
default: message $(TOP)/$(LIB_DIR) subdirs
|
||||
|
||||
|
||||
message:
|
||||
@echo "Making sources for" $(CONFIG_NAME)
|
||||
|
||||
|
||||
subdirs:
|
||||
@for dir in $(SUBDIRS) ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
(cd $$dir && $(MAKE)) || exit 1; \
|
||||
fi \
|
||||
done
|
||||
|
||||
install: $(TOP)/$(LIB_DIR)
|
||||
@for dir in $(SUBDIRS) ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
(cd $$dir && $(MAKE) install) || exit 1 ; \
|
||||
fi \
|
||||
done
|
||||
|
||||
$(TOP)/$(LIB_DIR):
|
||||
-@test -d $(TOP)/$(LIB_DIR) || mkdir -p $(TOP)/$(LIB_DIR)
|
||||
|
||||
|
||||
clean:
|
||||
-@for dir in $(SUBDIRS) ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
(cd $$dir && $(MAKE) clean) ; \
|
||||
fi \
|
||||
done
|
||||
@@ -1,31 +0,0 @@
|
||||
# src/egl/Makefile
|
||||
|
||||
TOP = ../..
|
||||
include $(TOP)/configs/current
|
||||
|
||||
SUBDIRS = main drivers
|
||||
|
||||
|
||||
default: subdirs
|
||||
|
||||
|
||||
subdirs:
|
||||
@for dir in $(SUBDIRS) ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
(cd $$dir && $(MAKE)) || exit 1 ; \
|
||||
fi \
|
||||
done
|
||||
|
||||
install:
|
||||
@for dir in $(SUBDIRS) ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
(cd $$dir && $(MAKE) install) || exit 1 ; \
|
||||
fi \
|
||||
done
|
||||
|
||||
clean:
|
||||
-@for dir in $(SUBDIRS) ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
(cd $$dir && $(MAKE) clean) ; \
|
||||
fi \
|
||||
done
|
||||
@@ -1,185 +0,0 @@
|
||||
#src/glsl/pp/Makefile
|
||||
|
||||
TOP = ../..
|
||||
|
||||
include $(TOP)/configs/current
|
||||
|
||||
LIBNAME = glsl
|
||||
|
||||
LIBGLCPP_SOURCES = \
|
||||
glcpp/glcpp-lex.c \
|
||||
glcpp/glcpp-parse.c \
|
||||
glcpp/pp.c
|
||||
|
||||
GLCPP_SOURCES = \
|
||||
$(LIBGLCPP_SOURCES) \
|
||||
glcpp/glcpp.c
|
||||
|
||||
C_SOURCES = \
|
||||
strtod.c \
|
||||
ralloc.c \
|
||||
$(LIBGLCPP_SOURCES)
|
||||
|
||||
CXX_SOURCES = \
|
||||
ast_expr.cpp \
|
||||
ast_function.cpp \
|
||||
ast_to_hir.cpp \
|
||||
ast_type.cpp \
|
||||
builtin_function.cpp \
|
||||
glsl_lexer.cpp \
|
||||
glsl_parser.cpp \
|
||||
glsl_parser_extras.cpp \
|
||||
glsl_types.cpp \
|
||||
glsl_symbol_table.cpp \
|
||||
hir_field_selection.cpp \
|
||||
ir_basic_block.cpp \
|
||||
ir_clone.cpp \
|
||||
ir_constant_expression.cpp \
|
||||
ir.cpp \
|
||||
ir_expression_flattening.cpp \
|
||||
ir_function_can_inline.cpp \
|
||||
ir_function.cpp \
|
||||
ir_hierarchical_visitor.cpp \
|
||||
ir_hv_accept.cpp \
|
||||
ir_import_prototypes.cpp \
|
||||
ir_print_visitor.cpp \
|
||||
ir_reader.cpp \
|
||||
ir_rvalue_visitor.cpp \
|
||||
ir_set_program_inouts.cpp \
|
||||
ir_validate.cpp \
|
||||
ir_variable.cpp \
|
||||
ir_variable_refcount.cpp \
|
||||
linker.cpp \
|
||||
link_functions.cpp \
|
||||
loop_analysis.cpp \
|
||||
loop_controls.cpp \
|
||||
loop_unroll.cpp \
|
||||
lower_discard.cpp \
|
||||
lower_if_to_cond_assign.cpp \
|
||||
lower_instructions.cpp \
|
||||
lower_jumps.cpp \
|
||||
lower_mat_op_to_vec.cpp \
|
||||
lower_noise.cpp \
|
||||
lower_texture_projection.cpp \
|
||||
lower_variable_index_to_cond_assign.cpp \
|
||||
lower_vec_index_to_cond_assign.cpp \
|
||||
lower_vec_index_to_swizzle.cpp \
|
||||
lower_vector.cpp \
|
||||
opt_algebraic.cpp \
|
||||
opt_constant_folding.cpp \
|
||||
opt_constant_propagation.cpp \
|
||||
opt_constant_variable.cpp \
|
||||
opt_copy_propagation.cpp \
|
||||
opt_dead_code.cpp \
|
||||
opt_dead_code_local.cpp \
|
||||
opt_dead_functions.cpp \
|
||||
opt_discard_simplification.cpp \
|
||||
opt_function_inlining.cpp \
|
||||
opt_if_simplification.cpp \
|
||||
opt_noop_swizzle.cpp \
|
||||
opt_redundant_jumps.cpp \
|
||||
opt_structure_splitting.cpp \
|
||||
opt_swizzle_swizzle.cpp \
|
||||
opt_tree_grafting.cpp \
|
||||
s_expression.cpp
|
||||
|
||||
LIBS = \
|
||||
$(TOP)/src/glsl/libglsl.a
|
||||
|
||||
APPS = glsl_compiler glcpp/glcpp
|
||||
|
||||
GLSL2_C_SOURCES = \
|
||||
../mesa/program/hash_table.c \
|
||||
../mesa/program/symbol_table.c
|
||||
GLSL2_CXX_SOURCES = \
|
||||
main.cpp
|
||||
|
||||
GLSL2_OBJECTS = \
|
||||
$(GLSL2_C_SOURCES:.c=.o) \
|
||||
$(GLSL2_CXX_SOURCES:.cpp=.o)
|
||||
|
||||
### Basic defines ###
|
||||
|
||||
DEFINES += \
|
||||
$(LIBRARY_DEFINES) \
|
||||
$(API_DEFINES)
|
||||
|
||||
GLCPP_OBJECTS = \
|
||||
$(GLCPP_SOURCES:.c=.o) \
|
||||
../mesa/program/hash_table.o
|
||||
|
||||
OBJECTS = \
|
||||
$(C_SOURCES:.c=.o) \
|
||||
$(CXX_SOURCES:.cpp=.o)
|
||||
|
||||
INCLUDES = \
|
||||
-I. \
|
||||
-I../mesa \
|
||||
-I../mapi \
|
||||
-I../../include \
|
||||
$(LIBRARY_INCLUDES)
|
||||
|
||||
ALL_SOURCES = \
|
||||
$(C_SOURCES) \
|
||||
$(CXX_SOURCES) \
|
||||
$(GLSL2_CXX_SOURCES) \
|
||||
$(GLSL2_C_SOURCES)
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
default: depend lib$(LIBNAME).a
|
||||
|
||||
lib$(LIBNAME).a: $(OBJECTS) Makefile $(TOP)/src/glsl/Makefile.template
|
||||
$(MKLIB) -cplusplus -o $(LIBNAME) -static $(OBJECTS)
|
||||
|
||||
depend: $(ALL_SOURCES) Makefile
|
||||
rm -f depend
|
||||
touch depend
|
||||
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(ALL_SOURCES) 2> /dev/null
|
||||
|
||||
# Remove .o and backup files
|
||||
clean:
|
||||
rm -f $(GLCPP_OBJECTS) $(GLSL2_OBJECTS) $(OBJECTS) lib$(LIBNAME).a depend depend.bak
|
||||
-rm -f $(APPS)
|
||||
|
||||
# Dummy target
|
||||
install:
|
||||
@echo -n ""
|
||||
|
||||
|
||||
##### RULES #####
|
||||
|
||||
glsl_compiler: $(GLSL2_OBJECTS) libglsl.a
|
||||
$(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLSL2_OBJECTS) $(LIBS) -o $@
|
||||
|
||||
glcpp/glcpp: $(GLCPP_OBJECTS) libglsl.a
|
||||
$(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLCPP_OBJECTS) $(LIBS) -o $@
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
glsl_lexer.cpp: glsl_lexer.lpp
|
||||
flex --nounistd -o$@ $<
|
||||
|
||||
glsl_parser.cpp: glsl_parser.ypp
|
||||
bison -v -o "$@" -p "_mesa_glsl_" --defines=glsl_parser.h $<
|
||||
|
||||
glcpp/glcpp-lex.c: glcpp/glcpp-lex.l
|
||||
flex --nounistd -o$@ $<
|
||||
|
||||
glcpp/glcpp-parse.c: glcpp/glcpp-parse.y
|
||||
bison -v -o "$@" --defines=glcpp/glcpp-parse.h $<
|
||||
|
||||
builtins: builtin_function.cpp builtins/profiles/* builtins/ir/* builtins/tools/generate_builtins.py builtins/tools/texture_builtins.py
|
||||
@echo Bootstrapping the compiler...
|
||||
cp builtins/tools/builtin_function.cpp .
|
||||
make glsl_compiler
|
||||
@echo Regenerating builtin_function.cpp...
|
||||
$(PYTHON2) $(PYTHON_FLAGS) builtins/tools/generate_builtins.py > builtin_function.cpp
|
||||
@echo Rebuilding the real compiler...
|
||||
make glsl_compiler
|
||||
|
||||
-include depend
|
||||
@@ -1,50 +0,0 @@
|
||||
# src/glsl/Makefile.template
|
||||
|
||||
# Template makefile for glsl libraries.
|
||||
#
|
||||
# Usage:
|
||||
# The minimum that the including makefile needs to define
|
||||
# is TOP, LIBNAME and one of of the *_SOURCES.
|
||||
#
|
||||
# Optional defines:
|
||||
# LIBRARY_INCLUDES are appended to the list of includes directories.
|
||||
# LIBRARY_DEFINES is not used for makedepend, but for compilation.
|
||||
|
||||
|
||||
### Basic defines ###
|
||||
|
||||
OBJECTS = $(C_SOURCES:.c=.o)
|
||||
|
||||
INCLUDES = \
|
||||
-I. \
|
||||
$(LIBRARY_INCLUDES)
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
default: depend lib$(LIBNAME).a
|
||||
|
||||
lib$(LIBNAME).a: $(OBJECTS) Makefile $(TOP)/src/glsl/Makefile.template
|
||||
$(MKLIB) -o $(LIBNAME) -static $(OBJECTS)
|
||||
|
||||
depend: $(C_SOURCES)
|
||||
rm -f depend
|
||||
touch depend
|
||||
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) 2> /dev/null
|
||||
|
||||
# Remove .o and backup files
|
||||
clean:
|
||||
rm -f $(OBJECTS) lib$(LIBNAME).a depend depend.bak
|
||||
|
||||
# Dummy target
|
||||
install:
|
||||
@echo -n ""
|
||||
|
||||
|
||||
##### RULES #####
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
|
||||
|
||||
-include depend
|
||||
|
||||
@@ -1,229 +0,0 @@
|
||||
Welcome to Mesa's GLSL compiler. A brief overview of how things flow:
|
||||
|
||||
1) lex and yacc-based preprocessor takes the incoming shader string
|
||||
and produces a new string containing the preprocessed shader. This
|
||||
takes care of things like #if, #ifdef, #define, and preprocessor macro
|
||||
invocations. Note that #version, #extension, and some others are
|
||||
passed straight through. See glcpp/*
|
||||
|
||||
2) lex and yacc-based parser takes the preprocessed string and
|
||||
generates the AST (abstract syntax tree). Almost no checking is
|
||||
performed in this stage. See glsl_lexer.lpp and glsl_parser.ypp.
|
||||
|
||||
3) The AST is converted to "HIR". This is the intermediate
|
||||
representation of the compiler. Constructors are generated, function
|
||||
calls are resolved to particular function signatures, and all the
|
||||
semantic checking is performed. See ast_*.cpp for the conversion, and
|
||||
ir.h for the IR structures.
|
||||
|
||||
4) The driver (Mesa, or main.cpp for the standalone binary) performs
|
||||
optimizations. These include copy propagation, dead code elimination,
|
||||
constant folding, and others. Generally the driver will call
|
||||
optimizations in a loop, as each may open up opportunities for other
|
||||
optimizations to do additional work. See most files called ir_*.cpp
|
||||
|
||||
5) linking is performed. This does checking to ensure that the
|
||||
outputs of the vertex shader match the inputs of the fragment shader,
|
||||
and assigns locations to uniforms, attributes, and varyings. See
|
||||
linker.cpp.
|
||||
|
||||
6) The driver may perform additional optimization at this point, as
|
||||
for example dead code elimination previously couldn't remove functions
|
||||
or global variable usage when we didn't know what other code would be
|
||||
linked in.
|
||||
|
||||
7) The driver performs code generation out of the IR, taking a linked
|
||||
shader program and producing a compiled program for each stage. See
|
||||
ir_to_mesa.cpp for Mesa IR code generation.
|
||||
|
||||
FAQ:
|
||||
|
||||
Q: What is HIR versus IR versus LIR?
|
||||
|
||||
A: The idea behind the naming was that ast_to_hir would produce a
|
||||
high-level IR ("HIR"), with things like matrix operations, structure
|
||||
assignments, etc., present. A series of lowering passes would occur
|
||||
that do things like break matrix multiplication into a series of dot
|
||||
products/MADs, make structure assignment be a series of assignment of
|
||||
components, flatten if statements into conditional moves, and such,
|
||||
producing a low level IR ("LIR").
|
||||
|
||||
However, it now appears that each driver will have different
|
||||
requirements from a LIR. A 915-generation chipset wants all functions
|
||||
inlined, all loops unrolled, all ifs flattened, no variable array
|
||||
accesses, and matrix multiplication broken down. The Mesa IR backend
|
||||
for swrast would like matrices and structure assignment broken down,
|
||||
but it can support function calls and dynamic branching. A 965 vertex
|
||||
shader IR backend could potentially even handle some matrix operations
|
||||
without breaking them down, but the 965 fragment shader IR backend
|
||||
would want to break to have (almost) all operations down channel-wise
|
||||
and perform optimization on that. As a result, there's no single
|
||||
low-level IR that will make everyone happy. So that usage has fallen
|
||||
out of favor, and each driver will perform a series of lowering passes
|
||||
to take the HIR down to whatever restrictions it wants to impose
|
||||
before doing codegen.
|
||||
|
||||
Q: How is the IR structured?
|
||||
|
||||
A: The best way to get started seeing it would be to run the
|
||||
standalone compiler against a shader:
|
||||
|
||||
./glsl_compiler --dump-lir \
|
||||
~/src/piglit/tests/shaders/glsl-orangebook-ch06-bump.frag
|
||||
|
||||
So for example one of the ir_instructions in main() contains:
|
||||
|
||||
(assign (constant bool (1)) (var_ref litColor) (expression vec3 * (var_ref Surf
|
||||
aceColor) (var_ref __retval) ) )
|
||||
|
||||
Or more visually:
|
||||
(assign)
|
||||
/ | \
|
||||
(var_ref) (expression *) (constant bool 1)
|
||||
/ / \
|
||||
(litColor) (var_ref) (var_ref)
|
||||
/ \
|
||||
(SurfaceColor) (__retval)
|
||||
|
||||
which came from:
|
||||
|
||||
litColor = SurfaceColor * max(dot(normDelta, LightDir), 0.0);
|
||||
|
||||
(the max call is not represented in this expression tree, as it was a
|
||||
function call that got inlined but not brought into this expression
|
||||
tree)
|
||||
|
||||
Each of those nodes is a subclass of ir_instruction. A particular
|
||||
ir_instruction instance may only appear once in the whole IR tree with
|
||||
the exception of ir_variables, which appear once as variable
|
||||
declarations:
|
||||
|
||||
(declare () vec3 normDelta)
|
||||
|
||||
and multiple times as the targets of variable dereferences:
|
||||
...
|
||||
(assign (constant bool (1)) (var_ref __retval) (expression float dot
|
||||
(var_ref normDelta) (var_ref LightDir) ) )
|
||||
...
|
||||
(assign (constant bool (1)) (var_ref __retval) (expression vec3 -
|
||||
(var_ref LightDir) (expression vec3 * (constant float (2.000000))
|
||||
(expression vec3 * (expression float dot (var_ref normDelta) (var_ref
|
||||
LightDir) ) (var_ref normDelta) ) ) ) )
|
||||
...
|
||||
|
||||
Each node has a type. Expressions may involve several different types:
|
||||
(declare (uniform ) mat4 gl_ModelViewMatrix)
|
||||
((assign (constant bool (1)) (var_ref constructor_tmp) (expression
|
||||
vec4 * (var_ref gl_ModelViewMatrix) (var_ref gl_Vertex) ) )
|
||||
|
||||
An expression tree can be arbitrarily deep, and the compiler tries to
|
||||
keep them structured like that so that things like algebraic
|
||||
optimizations ((color * 1.0 == color) and ((mat1 * mat2) * vec == mat1
|
||||
* (mat2 * vec))) or recognizing operation patterns for code generation
|
||||
(vec1 * vec2 + vec3 == mad(vec1, vec2, vec3)) are easier. This comes
|
||||
at the expense of additional trickery in implementing some
|
||||
optimizations like CSE where one must navigate an expression tree.
|
||||
|
||||
Q: Why no SSA representation?
|
||||
|
||||
A: Converting an IR tree to SSA form makes dead code elmimination,
|
||||
common subexpression elimination, and many other optimizations much
|
||||
easier. However, in our primarily vector-based language, there's some
|
||||
major questions as to how it would work. Do we do SSA on the scalar
|
||||
or vector level? If we do it at the vector level, we're going to end
|
||||
up with many different versions of the variable when encountering code
|
||||
like:
|
||||
|
||||
(assign (constant bool (1)) (swiz x (var_ref __retval) ) (var_ref a) )
|
||||
(assign (constant bool (1)) (swiz y (var_ref __retval) ) (var_ref b) )
|
||||
(assign (constant bool (1)) (swiz z (var_ref __retval) ) (var_ref c) )
|
||||
|
||||
If every masked update of a component relies on the previous value of
|
||||
the variable, then we're probably going to be quite limited in our
|
||||
dead code elimination wins, and recognizing common expressions may
|
||||
just not happen. On the other hand, if we operate channel-wise, then
|
||||
we'll be prone to optimizing the operation on one of the channels at
|
||||
the expense of making its instruction flow different from the other
|
||||
channels, and a vector-based GPU would end up with worse code than if
|
||||
we didn't optimize operations on that channel!
|
||||
|
||||
Once again, it appears that our optimization requirements are driven
|
||||
significantly by the target architecture. For now, targeting the Mesa
|
||||
IR backend, SSA does not appear to be that important to producing
|
||||
excellent code, but we do expect to do some SSA-based optimizations
|
||||
for the 965 fragment shader backend when that is developed.
|
||||
|
||||
Q: How should I expand instructions that take multiple backend instructions?
|
||||
|
||||
Sometimes you'll have to do the expansion in your code generation --
|
||||
see, for example, ir_to_mesa.cpp's handling of ir_unop_sqrt. However,
|
||||
in many cases you'll want to do a pass over the IR to convert
|
||||
non-native instructions to a series of native instructions. For
|
||||
example, for the Mesa backend we have ir_div_to_mul_rcp.cpp because
|
||||
Mesa IR (and many hardware backends) only have a reciprocal
|
||||
instruction, not a divide. Implementing non-native instructions this
|
||||
way gives the chance for constant folding to occur, so (a / 2.0)
|
||||
becomes (a * 0.5) after codegen instead of (a * (1.0 / 2.0))
|
||||
|
||||
Q: How shoud I handle my special hardware instructions with respect to IR?
|
||||
|
||||
Our current theory is that if multiple targets have an instruction for
|
||||
some operation, then we should probably be able to represent that in
|
||||
the IR. Generally this is in the form of an ir_{bin,un}op expression
|
||||
type. For example, we initially implemented fract() using (a -
|
||||
floor(a)), but both 945 and 965 have instructions to give that result,
|
||||
and it would also simplify the implementation of mod(), so
|
||||
ir_unop_fract was added. The following areas need updating to add a
|
||||
new expression type:
|
||||
|
||||
ir.h (new enum)
|
||||
ir.cpp:get_num_operands() (used for ir_reader)
|
||||
ir.cpp:operator_strs (used for ir_reader)
|
||||
ir_constant_expression.cpp (you probably want to be able to constant fold)
|
||||
ir_validate.cpp (check users have the right types)
|
||||
|
||||
You may also need to update the backends if they will see the new expr type:
|
||||
|
||||
../mesa/shaders/ir_to_mesa.cpp
|
||||
|
||||
You can then use the new expression from builtins (if all backends
|
||||
would rather see it), or scan the IR and convert to use your new
|
||||
expression type (see ir_mod_to_fract, for example).
|
||||
|
||||
Q: How is memory management handled in the compiler?
|
||||
|
||||
The hierarchical memory allocator "talloc" developed for the Samba
|
||||
project is used, so that things like optimization passes don't have to
|
||||
worry about their garbage collection so much. It has a few nice
|
||||
features, including low performance overhead and good debugging
|
||||
support that's trivially available.
|
||||
|
||||
Generally, each stage of the compile creates a talloc context and
|
||||
allocates its memory out of that or children of it. At the end of the
|
||||
stage, the pieces still live are stolen to a new context and the old
|
||||
one freed, or the whole context is kept for use by the next stage.
|
||||
|
||||
For IR transformations, a temporary context is used, then at the end
|
||||
of all transformations, reparent_ir reparents all live nodes under the
|
||||
shader's IR list, and the old context full of dead nodes is freed.
|
||||
When developing a single IR transformation pass, this means that you
|
||||
want to allocate instruction nodes out of the temporary context, so if
|
||||
it becomes dead it doesn't live on as the child of a live node. At
|
||||
the moment, optimization passes aren't passed that temporary context,
|
||||
so they find it by calling talloc_parent() on a nearby IR node. The
|
||||
talloc_parent() call is expensive, so many passes will cache the
|
||||
result of the first talloc_parent(). Cleaning up all the optimization
|
||||
passes to take a context argument and not call talloc_parent() is left
|
||||
as an exercise.
|
||||
|
||||
Q: What is the file naming convention in this directory?
|
||||
|
||||
Initially, there really wasn't one. We have since adopted one:
|
||||
|
||||
- Files that implement code lowering passes should be named lower_*
|
||||
(e.g., lower_noise.cpp).
|
||||
- Files that implement optimization passes should be named opt_*.
|
||||
- Files that implement a class that is used throught the code should
|
||||
take the name of that class (e.g., ir_hierarchical_visitor.cpp).
|
||||
- Files that contain code not fitting in one of the previous
|
||||
categories should have a sensible name (e.g., glsl_parser.ypp).
|
||||
@@ -1,110 +0,0 @@
|
||||
import common
|
||||
|
||||
Import('*')
|
||||
|
||||
env = env.Clone()
|
||||
|
||||
env.Prepend(CPPPATH = [
|
||||
'#src/mapi',
|
||||
'#src/mesa',
|
||||
'#src/glsl',
|
||||
])
|
||||
|
||||
sources = [
|
||||
'glcpp/glcpp-lex.c',
|
||||
'glcpp/glcpp-parse.c',
|
||||
'glcpp/pp.c',
|
||||
'ast_expr.cpp',
|
||||
'ast_function.cpp',
|
||||
'ast_to_hir.cpp',
|
||||
'ast_type.cpp',
|
||||
'builtin_function.cpp',
|
||||
'glsl_lexer.cpp',
|
||||
'glsl_parser.cpp',
|
||||
'glsl_parser_extras.cpp',
|
||||
'glsl_types.cpp',
|
||||
'glsl_symbol_table.cpp',
|
||||
'hir_field_selection.cpp',
|
||||
'ir_basic_block.cpp',
|
||||
'ir_clone.cpp',
|
||||
'ir_constant_expression.cpp',
|
||||
'ir.cpp',
|
||||
'ir_expression_flattening.cpp',
|
||||
'ir_function_can_inline.cpp',
|
||||
'ir_function.cpp',
|
||||
'ir_hierarchical_visitor.cpp',
|
||||
'ir_hv_accept.cpp',
|
||||
'ir_import_prototypes.cpp',
|
||||
'ir_print_visitor.cpp',
|
||||
'ir_reader.cpp',
|
||||
'ir_rvalue_visitor.cpp',
|
||||
'ir_set_program_inouts.cpp',
|
||||
'ir_validate.cpp',
|
||||
'ir_variable.cpp',
|
||||
'ir_variable_refcount.cpp',
|
||||
'linker.cpp',
|
||||
'link_functions.cpp',
|
||||
'loop_analysis.cpp',
|
||||
'loop_controls.cpp',
|
||||
'loop_unroll.cpp',
|
||||
'lower_discard.cpp',
|
||||
'lower_if_to_cond_assign.cpp',
|
||||
'lower_instructions.cpp',
|
||||
'lower_jumps.cpp',
|
||||
'lower_mat_op_to_vec.cpp',
|
||||
'lower_noise.cpp',
|
||||
'lower_variable_index_to_cond_assign.cpp',
|
||||
'lower_vec_index_to_cond_assign.cpp',
|
||||
'lower_vec_index_to_swizzle.cpp',
|
||||
'lower_vector.cpp',
|
||||
'opt_algebraic.cpp',
|
||||
'opt_constant_folding.cpp',
|
||||
'opt_constant_propagation.cpp',
|
||||
'opt_constant_variable.cpp',
|
||||
'opt_copy_propagation.cpp',
|
||||
'opt_dead_code.cpp',
|
||||
'opt_dead_code_local.cpp',
|
||||
'opt_dead_functions.cpp',
|
||||
'opt_discard_simplification.cpp',
|
||||
'opt_function_inlining.cpp',
|
||||
'opt_if_simplification.cpp',
|
||||
'opt_noop_swizzle.cpp',
|
||||
'opt_redundant_jumps.cpp',
|
||||
'opt_structure_splitting.cpp',
|
||||
'opt_swizzle_swizzle.cpp',
|
||||
'opt_tree_grafting.cpp',
|
||||
'ralloc.c',
|
||||
's_expression.cpp',
|
||||
'strtod.c',
|
||||
]
|
||||
|
||||
glsl = env.ConvenienceLibrary(
|
||||
target = 'glsl',
|
||||
source = sources,
|
||||
)
|
||||
|
||||
Export('glsl')
|
||||
|
||||
# FIXME: We can't build the programs because there's a cyclic dependency between tis directory and src/mesa
|
||||
Return()
|
||||
|
||||
env = env.Clone()
|
||||
|
||||
if env['platform'] == 'windows':
|
||||
env.PrependUnique(LIBS = [
|
||||
'user32',
|
||||
])
|
||||
|
||||
env.Prepend(LIBS = [glsl])
|
||||
|
||||
env.Program(
|
||||
target = 'glsl2',
|
||||
source = [
|
||||
'main.cpp',
|
||||
]
|
||||
)
|
||||
|
||||
env.Program(
|
||||
target = 'glcpp',
|
||||
source = ['glcpp/glcpp.c'],
|
||||
)
|
||||
@@ -1,726 +0,0 @@
|
||||
/* -*- c++ -*- */
|
||||
/*
|
||||
* Copyright © 2009 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef AST_H
|
||||
#define AST_H
|
||||
|
||||
#include "list.h"
|
||||
#include "glsl_parser_extras.h"
|
||||
|
||||
struct _mesa_glsl_parse_state;
|
||||
|
||||
struct YYLTYPE;
|
||||
|
||||
/**
|
||||
* \defgroup AST Abstract syntax tree node definitions
|
||||
*
|
||||
* An abstract syntax tree is generated by the parser. This is a fairly
|
||||
* direct representation of the gramma derivation for the source program.
|
||||
* No symantic checking is done during the generation of the AST. Only
|
||||
* syntactic checking is done. Symantic checking is performed by a later
|
||||
* stage that converts the AST to a more generic intermediate representation.
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
/**
|
||||
* Base class of all abstract syntax tree nodes
|
||||
*/
|
||||
class ast_node {
|
||||
public:
|
||||
/* Callers of this ralloc-based new need not call delete. It's
|
||||
* easier to just ralloc_free 'ctx' (or any of its ancestors). */
|
||||
static void* operator new(size_t size, void *ctx)
|
||||
{
|
||||
void *node;
|
||||
|
||||
node = rzalloc_size(ctx, size);
|
||||
assert(node != NULL);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
/* If the user *does* call delete, that's OK, we will just
|
||||
* ralloc_free in that case. */
|
||||
static void operator delete(void *table)
|
||||
{
|
||||
ralloc_free(table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Print an AST node in something approximating the original GLSL code
|
||||
*/
|
||||
virtual void print(void) const;
|
||||
|
||||
/**
|
||||
* Convert the AST node to the high-level intermediate representation
|
||||
*/
|
||||
virtual ir_rvalue *hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
/**
|
||||
* Retrieve the source location of an AST node
|
||||
*
|
||||
* This function is primarily used to get the source position of an AST node
|
||||
* into a form that can be passed to \c _mesa_glsl_error.
|
||||
*
|
||||
* \sa _mesa_glsl_error, ast_node::set_location
|
||||
*/
|
||||
struct YYLTYPE get_location(void) const
|
||||
{
|
||||
struct YYLTYPE locp;
|
||||
|
||||
locp.source = this->location.source;
|
||||
locp.first_line = this->location.line;
|
||||
locp.first_column = this->location.column;
|
||||
locp.last_line = locp.first_line;
|
||||
locp.last_column = locp.first_column;
|
||||
|
||||
return locp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the source location of an AST node from a parser location
|
||||
*
|
||||
* \sa ast_node::get_location
|
||||
*/
|
||||
void set_location(const struct YYLTYPE &locp)
|
||||
{
|
||||
this->location.source = locp.source;
|
||||
this->location.line = locp.first_line;
|
||||
this->location.column = locp.first_column;
|
||||
}
|
||||
|
||||
/**
|
||||
* Source location of the AST node.
|
||||
*/
|
||||
struct {
|
||||
unsigned source; /**< GLSL source number. */
|
||||
unsigned line; /**< Line number within the source string. */
|
||||
unsigned column; /**< Column in the line. */
|
||||
} location;
|
||||
|
||||
exec_node link;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* The only constructor is protected so that only derived class objects can
|
||||
* be created.
|
||||
*/
|
||||
ast_node(void);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Operators for AST expression nodes.
|
||||
*/
|
||||
enum ast_operators {
|
||||
ast_assign,
|
||||
ast_plus, /**< Unary + operator. */
|
||||
ast_neg,
|
||||
ast_add,
|
||||
ast_sub,
|
||||
ast_mul,
|
||||
ast_div,
|
||||
ast_mod,
|
||||
ast_lshift,
|
||||
ast_rshift,
|
||||
ast_less,
|
||||
ast_greater,
|
||||
ast_lequal,
|
||||
ast_gequal,
|
||||
ast_equal,
|
||||
ast_nequal,
|
||||
ast_bit_and,
|
||||
ast_bit_xor,
|
||||
ast_bit_or,
|
||||
ast_bit_not,
|
||||
ast_logic_and,
|
||||
ast_logic_xor,
|
||||
ast_logic_or,
|
||||
ast_logic_not,
|
||||
|
||||
ast_mul_assign,
|
||||
ast_div_assign,
|
||||
ast_mod_assign,
|
||||
ast_add_assign,
|
||||
ast_sub_assign,
|
||||
ast_ls_assign,
|
||||
ast_rs_assign,
|
||||
ast_and_assign,
|
||||
ast_xor_assign,
|
||||
ast_or_assign,
|
||||
|
||||
ast_conditional,
|
||||
|
||||
ast_pre_inc,
|
||||
ast_pre_dec,
|
||||
ast_post_inc,
|
||||
ast_post_dec,
|
||||
ast_field_selection,
|
||||
ast_array_index,
|
||||
|
||||
ast_function_call,
|
||||
|
||||
ast_identifier,
|
||||
ast_int_constant,
|
||||
ast_uint_constant,
|
||||
ast_float_constant,
|
||||
ast_bool_constant,
|
||||
|
||||
ast_sequence
|
||||
};
|
||||
|
||||
/**
|
||||
* Representation of any sort of expression.
|
||||
*/
|
||||
class ast_expression : public ast_node {
|
||||
public:
|
||||
ast_expression(int oper, ast_expression *,
|
||||
ast_expression *, ast_expression *);
|
||||
|
||||
ast_expression(const char *identifier) :
|
||||
oper(ast_identifier)
|
||||
{
|
||||
subexpressions[0] = NULL;
|
||||
subexpressions[1] = NULL;
|
||||
subexpressions[2] = NULL;
|
||||
primary_expression.identifier = (char *) identifier;
|
||||
}
|
||||
|
||||
static const char *operator_string(enum ast_operators op);
|
||||
|
||||
virtual ir_rvalue *hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
virtual void print(void) const;
|
||||
|
||||
enum ast_operators oper;
|
||||
|
||||
ast_expression *subexpressions[3];
|
||||
|
||||
union {
|
||||
char *identifier;
|
||||
int int_constant;
|
||||
float float_constant;
|
||||
unsigned uint_constant;
|
||||
int bool_constant;
|
||||
} primary_expression;
|
||||
|
||||
|
||||
/**
|
||||
* List of expressions for an \c ast_sequence or parameters for an
|
||||
* \c ast_function_call
|
||||
*/
|
||||
exec_list expressions;
|
||||
};
|
||||
|
||||
class ast_expression_bin : public ast_expression {
|
||||
public:
|
||||
ast_expression_bin(int oper, ast_expression *, ast_expression *);
|
||||
|
||||
virtual void print(void) const;
|
||||
};
|
||||
|
||||
/**
|
||||
* Subclass of expressions for function calls
|
||||
*/
|
||||
class ast_function_expression : public ast_expression {
|
||||
public:
|
||||
ast_function_expression(ast_expression *callee)
|
||||
: ast_expression(ast_function_call, callee,
|
||||
NULL, NULL),
|
||||
cons(false)
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
|
||||
ast_function_expression(class ast_type_specifier *type)
|
||||
: ast_expression(ast_function_call, (ast_expression *) type,
|
||||
NULL, NULL),
|
||||
cons(true)
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
|
||||
bool is_constructor() const
|
||||
{
|
||||
return cons;
|
||||
}
|
||||
|
||||
virtual ir_rvalue *hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Is this function call actually a constructor?
|
||||
*/
|
||||
bool cons;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Number of possible operators for an ast_expression
|
||||
*
|
||||
* This is done as a define instead of as an additional value in the enum so
|
||||
* that the compiler won't generate spurious messages like "warning:
|
||||
* enumeration value ‘ast_num_operators’ not handled in switch"
|
||||
*/
|
||||
#define AST_NUM_OPERATORS (ast_sequence + 1)
|
||||
|
||||
|
||||
class ast_compound_statement : public ast_node {
|
||||
public:
|
||||
ast_compound_statement(int new_scope, ast_node *statements);
|
||||
virtual void print(void) const;
|
||||
|
||||
virtual ir_rvalue *hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
int new_scope;
|
||||
exec_list statements;
|
||||
};
|
||||
|
||||
class ast_declaration : public ast_node {
|
||||
public:
|
||||
ast_declaration(char *identifier, int is_array, ast_expression *array_size,
|
||||
ast_expression *initializer);
|
||||
virtual void print(void) const;
|
||||
|
||||
char *identifier;
|
||||
|
||||
int is_array;
|
||||
ast_expression *array_size;
|
||||
|
||||
ast_expression *initializer;
|
||||
};
|
||||
|
||||
|
||||
enum {
|
||||
ast_precision_none = 0, /**< Absence of precision qualifier. */
|
||||
ast_precision_high,
|
||||
ast_precision_medium,
|
||||
ast_precision_low
|
||||
};
|
||||
|
||||
struct ast_type_qualifier {
|
||||
union {
|
||||
struct {
|
||||
unsigned invariant:1;
|
||||
unsigned constant:1;
|
||||
unsigned attribute:1;
|
||||
unsigned varying:1;
|
||||
unsigned in:1;
|
||||
unsigned out:1;
|
||||
unsigned centroid:1;
|
||||
unsigned uniform:1;
|
||||
unsigned smooth:1;
|
||||
unsigned flat:1;
|
||||
unsigned noperspective:1;
|
||||
|
||||
/** \name Layout qualifiers for GL_ARB_fragment_coord_conventions */
|
||||
/*@{*/
|
||||
unsigned origin_upper_left:1;
|
||||
unsigned pixel_center_integer:1;
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* Flag set if GL_ARB_explicit_attrib_location "location" layout
|
||||
* qualifier is used.
|
||||
*/
|
||||
unsigned explicit_location:1;
|
||||
} q;
|
||||
unsigned i;
|
||||
} flags;
|
||||
|
||||
/**
|
||||
* Location specified via GL_ARB_explicit_attrib_location layout
|
||||
*
|
||||
* \note
|
||||
* This field is only valid if \c explicit_location is set.
|
||||
*/
|
||||
unsigned location;
|
||||
};
|
||||
|
||||
class ast_struct_specifier : public ast_node {
|
||||
public:
|
||||
ast_struct_specifier(char *identifier, ast_node *declarator_list);
|
||||
virtual void print(void) const;
|
||||
|
||||
virtual ir_rvalue *hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
char *name;
|
||||
exec_list declarations;
|
||||
};
|
||||
|
||||
|
||||
enum ast_types {
|
||||
ast_void,
|
||||
ast_float,
|
||||
ast_int,
|
||||
ast_uint,
|
||||
ast_bool,
|
||||
ast_vec2,
|
||||
ast_vec3,
|
||||
ast_vec4,
|
||||
ast_bvec2,
|
||||
ast_bvec3,
|
||||
ast_bvec4,
|
||||
ast_ivec2,
|
||||
ast_ivec3,
|
||||
ast_ivec4,
|
||||
ast_uvec2,
|
||||
ast_uvec3,
|
||||
ast_uvec4,
|
||||
ast_mat2,
|
||||
ast_mat2x3,
|
||||
ast_mat2x4,
|
||||
ast_mat3x2,
|
||||
ast_mat3,
|
||||
ast_mat3x4,
|
||||
ast_mat4x2,
|
||||
ast_mat4x3,
|
||||
ast_mat4,
|
||||
ast_sampler1d,
|
||||
ast_sampler2d,
|
||||
ast_sampler2drect,
|
||||
ast_sampler3d,
|
||||
ast_samplercube,
|
||||
ast_sampler1dshadow,
|
||||
ast_sampler2dshadow,
|
||||
ast_sampler2drectshadow,
|
||||
ast_samplercubeshadow,
|
||||
ast_sampler1darray,
|
||||
ast_sampler2darray,
|
||||
ast_sampler1darrayshadow,
|
||||
ast_sampler2darrayshadow,
|
||||
ast_isampler1d,
|
||||
ast_isampler2d,
|
||||
ast_isampler3d,
|
||||
ast_isamplercube,
|
||||
ast_isampler1darray,
|
||||
ast_isampler2darray,
|
||||
ast_usampler1d,
|
||||
ast_usampler2d,
|
||||
ast_usampler3d,
|
||||
ast_usamplercube,
|
||||
ast_usampler1darray,
|
||||
ast_usampler2darray,
|
||||
|
||||
ast_struct,
|
||||
ast_type_name
|
||||
};
|
||||
|
||||
|
||||
class ast_type_specifier : public ast_node {
|
||||
public:
|
||||
ast_type_specifier(int specifier);
|
||||
|
||||
/** Construct a type specifier from a type name */
|
||||
ast_type_specifier(const char *name)
|
||||
: type_specifier(ast_type_name), type_name(name), structure(NULL),
|
||||
is_array(false), array_size(NULL), precision(ast_precision_none),
|
||||
is_precision_statement(false)
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
|
||||
/** Construct a type specifier from a structure definition */
|
||||
ast_type_specifier(ast_struct_specifier *s)
|
||||
: type_specifier(ast_struct), type_name(s->name), structure(s),
|
||||
is_array(false), array_size(NULL), precision(ast_precision_none),
|
||||
is_precision_statement(false)
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
|
||||
const struct glsl_type *glsl_type(const char **name,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
const;
|
||||
|
||||
virtual void print(void) const;
|
||||
|
||||
ir_rvalue *hir(exec_list *, struct _mesa_glsl_parse_state *);
|
||||
|
||||
enum ast_types type_specifier;
|
||||
|
||||
const char *type_name;
|
||||
ast_struct_specifier *structure;
|
||||
|
||||
int is_array;
|
||||
ast_expression *array_size;
|
||||
|
||||
unsigned precision:2;
|
||||
|
||||
bool is_precision_statement;
|
||||
};
|
||||
|
||||
|
||||
class ast_fully_specified_type : public ast_node {
|
||||
public:
|
||||
virtual void print(void) const;
|
||||
bool has_qualifiers() const;
|
||||
|
||||
ast_type_qualifier qualifier;
|
||||
ast_type_specifier *specifier;
|
||||
};
|
||||
|
||||
|
||||
class ast_declarator_list : public ast_node {
|
||||
public:
|
||||
ast_declarator_list(ast_fully_specified_type *);
|
||||
virtual void print(void) const;
|
||||
|
||||
virtual ir_rvalue *hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
ast_fully_specified_type *type;
|
||||
exec_list declarations;
|
||||
|
||||
/**
|
||||
* Special flag for vertex shader "invariant" declarations.
|
||||
*
|
||||
* Vertex shaders can contain "invariant" variable redeclarations that do
|
||||
* not include a type. For example, "invariant gl_Position;". This flag
|
||||
* is used to note these cases when no type is specified.
|
||||
*/
|
||||
int invariant;
|
||||
};
|
||||
|
||||
|
||||
class ast_parameter_declarator : public ast_node {
|
||||
public:
|
||||
ast_parameter_declarator()
|
||||
{
|
||||
this->identifier = NULL;
|
||||
this->is_array = false;
|
||||
this->array_size = 0;
|
||||
}
|
||||
|
||||
virtual void print(void) const;
|
||||
|
||||
virtual ir_rvalue *hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
ast_fully_specified_type *type;
|
||||
char *identifier;
|
||||
int is_array;
|
||||
ast_expression *array_size;
|
||||
|
||||
static void parameters_to_hir(exec_list *ast_parameters,
|
||||
bool formal, exec_list *ir_parameters,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
private:
|
||||
/** Is this parameter declaration part of a formal parameter list? */
|
||||
bool formal_parameter;
|
||||
|
||||
/**
|
||||
* Is this parameter 'void' type?
|
||||
*
|
||||
* This field is set by \c ::hir.
|
||||
*/
|
||||
bool is_void;
|
||||
};
|
||||
|
||||
|
||||
class ast_function : public ast_node {
|
||||
public:
|
||||
ast_function(void);
|
||||
|
||||
virtual void print(void) const;
|
||||
|
||||
virtual ir_rvalue *hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
ast_fully_specified_type *return_type;
|
||||
char *identifier;
|
||||
|
||||
exec_list parameters;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Is this prototype part of the function definition?
|
||||
*
|
||||
* Used by ast_function_definition::hir to process the parameters, etc.
|
||||
* of the function.
|
||||
*
|
||||
* \sa ::hir
|
||||
*/
|
||||
bool is_definition;
|
||||
|
||||
/**
|
||||
* Function signature corresponding to this function prototype instance
|
||||
*
|
||||
* Used by ast_function_definition::hir to process the parameters, etc.
|
||||
* of the function.
|
||||
*
|
||||
* \sa ::hir
|
||||
*/
|
||||
class ir_function_signature *signature;
|
||||
|
||||
friend class ast_function_definition;
|
||||
};
|
||||
|
||||
|
||||
class ast_declaration_statement : public ast_node {
|
||||
public:
|
||||
ast_declaration_statement(void);
|
||||
|
||||
enum {
|
||||
ast_function,
|
||||
ast_declaration,
|
||||
ast_precision
|
||||
} mode;
|
||||
|
||||
union {
|
||||
class ast_function *function;
|
||||
ast_declarator_list *declarator;
|
||||
ast_type_specifier *type;
|
||||
ast_node *node;
|
||||
} declaration;
|
||||
};
|
||||
|
||||
|
||||
class ast_expression_statement : public ast_node {
|
||||
public:
|
||||
ast_expression_statement(ast_expression *);
|
||||
virtual void print(void) const;
|
||||
|
||||
virtual ir_rvalue *hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
ast_expression *expression;
|
||||
};
|
||||
|
||||
|
||||
class ast_case_label : public ast_node {
|
||||
public:
|
||||
|
||||
/**
|
||||
* An expression of NULL means 'default'.
|
||||
*/
|
||||
ast_expression *expression;
|
||||
};
|
||||
|
||||
class ast_selection_statement : public ast_node {
|
||||
public:
|
||||
ast_selection_statement(ast_expression *condition,
|
||||
ast_node *then_statement,
|
||||
ast_node *else_statement);
|
||||
virtual void print(void) const;
|
||||
|
||||
virtual ir_rvalue *hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
ast_expression *condition;
|
||||
ast_node *then_statement;
|
||||
ast_node *else_statement;
|
||||
};
|
||||
|
||||
|
||||
class ast_switch_statement : public ast_node {
|
||||
public:
|
||||
ast_expression *expression;
|
||||
exec_list statements;
|
||||
};
|
||||
|
||||
class ast_iteration_statement : public ast_node {
|
||||
public:
|
||||
ast_iteration_statement(int mode, ast_node *init, ast_node *condition,
|
||||
ast_expression *rest_expression, ast_node *body);
|
||||
|
||||
virtual void print(void) const;
|
||||
|
||||
virtual ir_rvalue *hir(exec_list *, struct _mesa_glsl_parse_state *);
|
||||
|
||||
enum ast_iteration_modes {
|
||||
ast_for,
|
||||
ast_while,
|
||||
ast_do_while
|
||||
} mode;
|
||||
|
||||
|
||||
ast_node *init_statement;
|
||||
ast_node *condition;
|
||||
ast_expression *rest_expression;
|
||||
|
||||
ast_node *body;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Generate IR from the condition of a loop
|
||||
*
|
||||
* This is factored out of ::hir because some loops have the condition
|
||||
* test at the top (for and while), and others have it at the end (do-while).
|
||||
*/
|
||||
void condition_to_hir(class ir_loop *, struct _mesa_glsl_parse_state *);
|
||||
};
|
||||
|
||||
|
||||
class ast_jump_statement : public ast_node {
|
||||
public:
|
||||
ast_jump_statement(int mode, ast_expression *return_value);
|
||||
virtual void print(void) const;
|
||||
|
||||
virtual ir_rvalue *hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
enum ast_jump_modes {
|
||||
ast_continue,
|
||||
ast_break,
|
||||
ast_return,
|
||||
ast_discard
|
||||
} mode;
|
||||
|
||||
ast_expression *opt_return_value;
|
||||
};
|
||||
|
||||
|
||||
class ast_function_definition : public ast_node {
|
||||
public:
|
||||
virtual void print(void) const;
|
||||
|
||||
virtual ir_rvalue *hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
ast_function *prototype;
|
||||
ast_compound_statement *body;
|
||||
};
|
||||
/*@}*/
|
||||
|
||||
extern void
|
||||
_mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state);
|
||||
|
||||
extern ir_rvalue *
|
||||
_mesa_ast_field_selection_to_hir(const ast_expression *expr,
|
||||
exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
void
|
||||
emit_function(_mesa_glsl_parse_state *state, exec_list *instructions,
|
||||
ir_function *f);
|
||||
|
||||
#endif /* AST_H */
|
||||
@@ -1,96 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 <stdio.h>
|
||||
#include <assert.h>
|
||||
#include "ast.h"
|
||||
|
||||
const char *
|
||||
ast_expression::operator_string(enum ast_operators op)
|
||||
{
|
||||
static const char *const operators[] = {
|
||||
"=",
|
||||
"+",
|
||||
"-",
|
||||
"+",
|
||||
"-",
|
||||
"*",
|
||||
"/",
|
||||
"%",
|
||||
"<<",
|
||||
">>",
|
||||
"<",
|
||||
">",
|
||||
"<=",
|
||||
">=",
|
||||
"==",
|
||||
"!=",
|
||||
"&",
|
||||
"^",
|
||||
"|",
|
||||
"~",
|
||||
"&&",
|
||||
"^^",
|
||||
"||",
|
||||
"!",
|
||||
|
||||
"*=",
|
||||
"/=",
|
||||
"%=",
|
||||
"+=",
|
||||
"-=",
|
||||
"<<=",
|
||||
">>=",
|
||||
"&=",
|
||||
"^=",
|
||||
"|=",
|
||||
|
||||
"?:",
|
||||
|
||||
"++",
|
||||
"--",
|
||||
"++",
|
||||
"--",
|
||||
".",
|
||||
};
|
||||
|
||||
assert((unsigned int)op < sizeof(operators) / sizeof(operators[0]));
|
||||
|
||||
return operators[op];
|
||||
}
|
||||
|
||||
|
||||
ast_expression_bin::ast_expression_bin(int oper, ast_expression *ex0,
|
||||
ast_expression *ex1) :
|
||||
ast_expression(oper, ex0, ex1, NULL)
|
||||
{
|
||||
assert((oper >= ast_plus) && (oper <= ast_logic_not));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_expression_bin::print(void) const
|
||||
{
|
||||
subexpressions[0]->print();
|
||||
printf("%s ", operator_string(oper));
|
||||
subexpressions[1]->print();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,119 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 <stdio.h>
|
||||
#include "ast.h"
|
||||
extern "C" {
|
||||
#include "program/symbol_table.h"
|
||||
}
|
||||
|
||||
void
|
||||
ast_type_specifier::print(void) const
|
||||
{
|
||||
if (type_specifier == ast_struct) {
|
||||
structure->print();
|
||||
} else {
|
||||
printf("%s ", type_name);
|
||||
}
|
||||
|
||||
if (is_array) {
|
||||
printf("[ ");
|
||||
|
||||
if (array_size) {
|
||||
array_size->print();
|
||||
}
|
||||
|
||||
printf("] ");
|
||||
}
|
||||
}
|
||||
|
||||
ast_type_specifier::ast_type_specifier(int specifier)
|
||||
: type_specifier(ast_types(specifier)), type_name(NULL), structure(NULL),
|
||||
is_array(false), array_size(NULL), precision(ast_precision_none),
|
||||
is_precision_statement(false)
|
||||
{
|
||||
static const char *const names[] = {
|
||||
"void",
|
||||
"float",
|
||||
"int",
|
||||
"uint",
|
||||
"bool",
|
||||
"vec2",
|
||||
"vec3",
|
||||
"vec4",
|
||||
"bvec2",
|
||||
"bvec3",
|
||||
"bvec4",
|
||||
"ivec2",
|
||||
"ivec3",
|
||||
"ivec4",
|
||||
"uvec2",
|
||||
"uvec3",
|
||||
"uvec4",
|
||||
"mat2",
|
||||
"mat2x3",
|
||||
"mat2x4",
|
||||
"mat3x2",
|
||||
"mat3",
|
||||
"mat3x4",
|
||||
"mat4x2",
|
||||
"mat4x3",
|
||||
"mat4",
|
||||
"sampler1D",
|
||||
"sampler2D",
|
||||
"sampler2DRect",
|
||||
"sampler3D",
|
||||
"samplerCube",
|
||||
"sampler1DShadow",
|
||||
"sampler2DShadow",
|
||||
"sampler2DRectShadow",
|
||||
"samplerCubeShadow",
|
||||
"sampler1DArray",
|
||||
"sampler2DArray",
|
||||
"sampler1DArrayShadow",
|
||||
"sampler2DArrayShadow",
|
||||
"isampler1D",
|
||||
"isampler2D",
|
||||
"isampler3D",
|
||||
"isamplerCube",
|
||||
"isampler1DArray",
|
||||
"isampler2DArray",
|
||||
"usampler1D",
|
||||
"usampler2D",
|
||||
"usampler3D",
|
||||
"usamplerCube",
|
||||
"usampler1DArray",
|
||||
"usampler2DArray",
|
||||
|
||||
NULL, /* ast_struct */
|
||||
NULL /* ast_type_name */
|
||||
};
|
||||
|
||||
type_name = names[specifier];
|
||||
}
|
||||
|
||||
bool
|
||||
ast_fully_specified_type::has_qualifiers() const
|
||||
{
|
||||
return this->qualifier.flags.i != 0;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,300 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2009 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.
|
||||
*/
|
||||
|
||||
const glsl_type glsl_type::_error_type =
|
||||
glsl_type(GL_INVALID_ENUM, GLSL_TYPE_ERROR, 0, 0, "");
|
||||
|
||||
const glsl_type glsl_type::_void_type =
|
||||
glsl_type(GL_INVALID_ENUM, GLSL_TYPE_VOID, 0, 0, "void");
|
||||
|
||||
const glsl_type *const glsl_type::error_type = & glsl_type::_error_type;
|
||||
const glsl_type *const glsl_type::void_type = & glsl_type::_void_type;
|
||||
|
||||
/** \name Core built-in types
|
||||
*
|
||||
* These types exist in all versions of GLSL.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
const glsl_type glsl_type::builtin_core_types[] = {
|
||||
glsl_type(GL_BOOL, GLSL_TYPE_BOOL, 1, 1, "bool"),
|
||||
glsl_type(GL_BOOL_VEC2, GLSL_TYPE_BOOL, 2, 1, "bvec2"),
|
||||
glsl_type(GL_BOOL_VEC3, GLSL_TYPE_BOOL, 3, 1, "bvec3"),
|
||||
glsl_type(GL_BOOL_VEC4, GLSL_TYPE_BOOL, 4, 1, "bvec4"),
|
||||
glsl_type(GL_INT, GLSL_TYPE_INT, 1, 1, "int"),
|
||||
glsl_type(GL_INT_VEC2, GLSL_TYPE_INT, 2, 1, "ivec2"),
|
||||
glsl_type(GL_INT_VEC3, GLSL_TYPE_INT, 3, 1, "ivec3"),
|
||||
glsl_type(GL_INT_VEC4, GLSL_TYPE_INT, 4, 1, "ivec4"),
|
||||
glsl_type(GL_FLOAT, GLSL_TYPE_FLOAT, 1, 1, "float"),
|
||||
glsl_type(GL_FLOAT_VEC2, GLSL_TYPE_FLOAT, 2, 1, "vec2"),
|
||||
glsl_type(GL_FLOAT_VEC3, GLSL_TYPE_FLOAT, 3, 1, "vec3"),
|
||||
glsl_type(GL_FLOAT_VEC4, GLSL_TYPE_FLOAT, 4, 1, "vec4"),
|
||||
glsl_type(GL_FLOAT_MAT2, GLSL_TYPE_FLOAT, 2, 2, "mat2"),
|
||||
glsl_type(GL_FLOAT_MAT3, GLSL_TYPE_FLOAT, 3, 3, "mat3"),
|
||||
glsl_type(GL_FLOAT_MAT4, GLSL_TYPE_FLOAT, 4, 4, "mat4"),
|
||||
glsl_type(GL_SAMPLER_2D, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler2D"),
|
||||
glsl_type(GL_SAMPLER_CUBE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_FLOAT,
|
||||
"samplerCube"),
|
||||
};
|
||||
|
||||
const glsl_type *const glsl_type::bool_type = & builtin_core_types[0];
|
||||
const glsl_type *const glsl_type::int_type = & builtin_core_types[4];
|
||||
const glsl_type *const glsl_type::ivec4_type = & builtin_core_types[7];
|
||||
const glsl_type *const glsl_type::float_type = & builtin_core_types[8];
|
||||
const glsl_type *const glsl_type::vec2_type = & builtin_core_types[9];
|
||||
const glsl_type *const glsl_type::vec3_type = & builtin_core_types[10];
|
||||
const glsl_type *const glsl_type::vec4_type = & builtin_core_types[11];
|
||||
const glsl_type *const glsl_type::mat2_type = & builtin_core_types[12];
|
||||
const glsl_type *const glsl_type::mat3_type = & builtin_core_types[13];
|
||||
const glsl_type *const glsl_type::mat4_type = & builtin_core_types[14];
|
||||
/*@}*/
|
||||
|
||||
/** \name GLSL structures that have not been deprecated.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
static const struct glsl_struct_field gl_DepthRangeParameters_fields[] = {
|
||||
{ glsl_type::float_type, "near" },
|
||||
{ glsl_type::float_type, "far" },
|
||||
{ glsl_type::float_type, "diff" },
|
||||
};
|
||||
|
||||
const glsl_type glsl_type::builtin_structure_types[] = {
|
||||
glsl_type(gl_DepthRangeParameters_fields,
|
||||
Elements(gl_DepthRangeParameters_fields),
|
||||
"gl_DepthRangeParameters"),
|
||||
};
|
||||
/*@}*/
|
||||
|
||||
/** \name GLSL 1.00 / 1.10 structures that are deprecated in GLSL 1.30
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
static const struct glsl_struct_field gl_PointParameters_fields[] = {
|
||||
{ glsl_type::float_type, "size" },
|
||||
{ glsl_type::float_type, "sizeMin" },
|
||||
{ glsl_type::float_type, "sizeMax" },
|
||||
{ glsl_type::float_type, "fadeThresholdSize" },
|
||||
{ glsl_type::float_type, "distanceConstantAttenuation" },
|
||||
{ glsl_type::float_type, "distanceLinearAttenuation" },
|
||||
{ glsl_type::float_type, "distanceQuadraticAttenuation" },
|
||||
};
|
||||
|
||||
static const struct glsl_struct_field gl_MaterialParameters_fields[] = {
|
||||
{ glsl_type::vec4_type, "emission" },
|
||||
{ glsl_type::vec4_type, "ambient" },
|
||||
{ glsl_type::vec4_type, "diffuse" },
|
||||
{ glsl_type::vec4_type, "specular" },
|
||||
{ glsl_type::float_type, "shininess" },
|
||||
};
|
||||
|
||||
static const struct glsl_struct_field gl_LightSourceParameters_fields[] = {
|
||||
{ glsl_type::vec4_type, "ambient" },
|
||||
{ glsl_type::vec4_type, "diffuse" },
|
||||
{ glsl_type::vec4_type, "specular" },
|
||||
{ glsl_type::vec4_type, "position" },
|
||||
{ glsl_type::vec4_type, "halfVector" },
|
||||
{ glsl_type::vec3_type, "spotDirection" },
|
||||
{ glsl_type::float_type, "spotExponent" },
|
||||
{ glsl_type::float_type, "spotCutoff" },
|
||||
{ glsl_type::float_type, "spotCosCutoff" },
|
||||
{ glsl_type::float_type, "constantAttenuation" },
|
||||
{ glsl_type::float_type, "linearAttenuation" },
|
||||
{ glsl_type::float_type, "quadraticAttenuation" },
|
||||
};
|
||||
|
||||
static const struct glsl_struct_field gl_LightModelParameters_fields[] = {
|
||||
{ glsl_type::vec4_type, "ambient" },
|
||||
};
|
||||
|
||||
static const struct glsl_struct_field gl_LightModelProducts_fields[] = {
|
||||
{ glsl_type::vec4_type, "sceneColor" },
|
||||
};
|
||||
|
||||
static const struct glsl_struct_field gl_LightProducts_fields[] = {
|
||||
{ glsl_type::vec4_type, "ambient" },
|
||||
{ glsl_type::vec4_type, "diffuse" },
|
||||
{ glsl_type::vec4_type, "specular" },
|
||||
};
|
||||
|
||||
static const struct glsl_struct_field gl_FogParameters_fields[] = {
|
||||
{ glsl_type::vec4_type, "color" },
|
||||
{ glsl_type::float_type, "density" },
|
||||
{ glsl_type::float_type, "start" },
|
||||
{ glsl_type::float_type, "end" },
|
||||
{ glsl_type::float_type, "scale" },
|
||||
};
|
||||
|
||||
const glsl_type glsl_type::builtin_110_deprecated_structure_types[] = {
|
||||
glsl_type(gl_PointParameters_fields,
|
||||
Elements(gl_PointParameters_fields),
|
||||
"gl_PointParameters"),
|
||||
glsl_type(gl_MaterialParameters_fields,
|
||||
Elements(gl_MaterialParameters_fields),
|
||||
"gl_MaterialParameters"),
|
||||
glsl_type(gl_LightSourceParameters_fields,
|
||||
Elements(gl_LightSourceParameters_fields),
|
||||
"gl_LightSourceParameters"),
|
||||
glsl_type(gl_LightModelParameters_fields,
|
||||
Elements(gl_LightModelParameters_fields),
|
||||
"gl_LightModelParameters"),
|
||||
glsl_type(gl_LightModelProducts_fields,
|
||||
Elements(gl_LightModelProducts_fields),
|
||||
"gl_LightModelProducts"),
|
||||
glsl_type(gl_LightProducts_fields,
|
||||
Elements(gl_LightProducts_fields),
|
||||
"gl_LightProducts"),
|
||||
glsl_type(gl_FogParameters_fields,
|
||||
Elements(gl_FogParameters_fields),
|
||||
"gl_FogParameters"),
|
||||
};
|
||||
/*@}*/
|
||||
|
||||
/** \name Types in GLSL 1.10 (but not GLSL ES 1.00)
|
||||
*/
|
||||
/*@{*/
|
||||
const glsl_type glsl_type::builtin_110_types[] = {
|
||||
glsl_type(GL_SAMPLER_1D, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler1D"),
|
||||
glsl_type(GL_SAMPLER_1D_SHADOW, GLSL_SAMPLER_DIM_1D, 1, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler1DShadow"),
|
||||
glsl_type(GL_SAMPLER_2D_SHADOW, GLSL_SAMPLER_DIM_2D, 1, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler2DShadow"),
|
||||
glsl_type(GL_SAMPLER_3D, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler3D"),
|
||||
};
|
||||
/*@}*/
|
||||
|
||||
/** \name Types added in GLSL 1.20
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
const glsl_type glsl_type::builtin_120_types[] = {
|
||||
glsl_type(GL_FLOAT_MAT2x3, GLSL_TYPE_FLOAT, 3, 2, "mat2x3"),
|
||||
glsl_type(GL_FLOAT_MAT2x4, GLSL_TYPE_FLOAT, 4, 2, "mat2x4"),
|
||||
glsl_type(GL_FLOAT_MAT3x2, GLSL_TYPE_FLOAT, 2, 3, "mat3x2"),
|
||||
glsl_type(GL_FLOAT_MAT3x4, GLSL_TYPE_FLOAT, 4, 3, "mat3x4"),
|
||||
glsl_type(GL_FLOAT_MAT4x2, GLSL_TYPE_FLOAT, 2, 4, "mat4x2"),
|
||||
glsl_type(GL_FLOAT_MAT4x3, GLSL_TYPE_FLOAT, 3, 4, "mat4x3"),
|
||||
};
|
||||
const glsl_type *const glsl_type::mat2x3_type = & builtin_120_types[0];
|
||||
const glsl_type *const glsl_type::mat2x4_type = & builtin_120_types[1];
|
||||
const glsl_type *const glsl_type::mat3x2_type = & builtin_120_types[2];
|
||||
const glsl_type *const glsl_type::mat3x4_type = & builtin_120_types[3];
|
||||
const glsl_type *const glsl_type::mat4x2_type = & builtin_120_types[4];
|
||||
const glsl_type *const glsl_type::mat4x3_type = & builtin_120_types[5];
|
||||
/*@}*/
|
||||
|
||||
/** \name Types added in GLSL 1.30
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
const glsl_type glsl_type::builtin_130_types[] = {
|
||||
glsl_type(GL_UNSIGNED_INT, GLSL_TYPE_UINT, 1, 1, "uint"),
|
||||
glsl_type(GL_UNSIGNED_INT_VEC2, GLSL_TYPE_UINT, 2, 1, "uvec2"),
|
||||
glsl_type(GL_UNSIGNED_INT_VEC3, GLSL_TYPE_UINT, 3, 1, "uvec3"),
|
||||
glsl_type(GL_UNSIGNED_INT_VEC4, GLSL_TYPE_UINT, 4, 1, "uvec4"),
|
||||
|
||||
/* 1D and 2D texture arrays - several of these are included only in
|
||||
* builtin_EXT_texture_array_types.
|
||||
*/
|
||||
glsl_type(GL_INT_SAMPLER_1D_ARRAY,
|
||||
GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_INT, "isampler1DArray"),
|
||||
glsl_type(GL_UNSIGNED_INT_SAMPLER_1D_ARRAY,
|
||||
GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_UINT, "usampler1DArray"),
|
||||
glsl_type(GL_INT_SAMPLER_2D_ARRAY,
|
||||
GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_INT, "isampler2DArray"),
|
||||
glsl_type(GL_UNSIGNED_INT_SAMPLER_2D_ARRAY,
|
||||
GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_UINT, "usampler2DArray"),
|
||||
|
||||
/* cube shadow samplers */
|
||||
glsl_type(GL_SAMPLER_CUBE_SHADOW,
|
||||
GLSL_SAMPLER_DIM_CUBE, 1, 0, GLSL_TYPE_FLOAT, "samplerCubeShadow"),
|
||||
|
||||
/* signed and unsigned integer samplers */
|
||||
glsl_type(GL_INT_SAMPLER_1D,
|
||||
GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_INT, "isampler1D"),
|
||||
glsl_type(GL_UNSIGNED_INT_SAMPLER_1D,
|
||||
GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_UINT, "usampler1D"),
|
||||
glsl_type(GL_INT_SAMPLER_2D,
|
||||
GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_INT, "isampler2D"),
|
||||
glsl_type(GL_UNSIGNED_INT_SAMPLER_2D,
|
||||
GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_UINT, "usampler2D"),
|
||||
glsl_type(GL_INT_SAMPLER_3D,
|
||||
GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_INT, "isampler3D"),
|
||||
glsl_type(GL_UNSIGNED_INT_SAMPLER_3D,
|
||||
GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_UINT, "usampler3D"),
|
||||
glsl_type(GL_INT_SAMPLER_CUBE,
|
||||
GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_INT, "isamplerCube"),
|
||||
glsl_type(GL_INT_SAMPLER_CUBE,
|
||||
GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_UINT, "usamplerCube"),
|
||||
};
|
||||
|
||||
const glsl_type *const glsl_type::uint_type = & builtin_130_types[0];
|
||||
const glsl_type *const glsl_type::uvec2_type = & builtin_130_types[1];
|
||||
const glsl_type *const glsl_type::uvec3_type = & builtin_130_types[2];
|
||||
const glsl_type *const glsl_type::uvec4_type = & builtin_130_types[3];
|
||||
/*@}*/
|
||||
|
||||
/** \name Sampler types added by GL_ARB_texture_rectangle
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
const glsl_type glsl_type::builtin_ARB_texture_rectangle_types[] = {
|
||||
glsl_type(GL_SAMPLER_2D_RECT,
|
||||
GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_FLOAT, "sampler2DRect"),
|
||||
glsl_type(GL_SAMPLER_2D_RECT_SHADOW,
|
||||
GLSL_SAMPLER_DIM_RECT, 1, 0, GLSL_TYPE_FLOAT, "sampler2DRectShadow"),
|
||||
};
|
||||
/*@}*/
|
||||
|
||||
/** \name Sampler types added by GL_EXT_texture_array
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
const glsl_type glsl_type::builtin_EXT_texture_array_types[] = {
|
||||
glsl_type(GL_SAMPLER_1D_ARRAY,
|
||||
GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_FLOAT, "sampler1DArray"),
|
||||
glsl_type(GL_SAMPLER_2D_ARRAY,
|
||||
GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_FLOAT, "sampler2DArray"),
|
||||
glsl_type(GL_SAMPLER_1D_ARRAY_SHADOW,
|
||||
GLSL_SAMPLER_DIM_1D, 1, 1, GLSL_TYPE_FLOAT, "sampler1DArrayShadow"),
|
||||
glsl_type(GL_SAMPLER_2D_ARRAY_SHADOW,
|
||||
GLSL_SAMPLER_DIM_2D, 1, 1, GLSL_TYPE_FLOAT, "sampler2DArrayShadow"),
|
||||
};
|
||||
/*@}*/
|
||||
|
||||
/** \name Sampler types added by GL_EXT_texture_buffer_object
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
const glsl_type glsl_type::builtin_EXT_texture_buffer_object_types[] = {
|
||||
glsl_type(GL_SAMPLER_BUFFER,
|
||||
GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_FLOAT, "samplerBuffer"),
|
||||
glsl_type(GL_INT_SAMPLER_BUFFER,
|
||||
GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_INT, "isamplerBuffer"),
|
||||
glsl_type(GL_UNSIGNED_INT_SAMPLER_BUFFER,
|
||||
GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_UINT, "usamplerBuffer"),
|
||||
};
|
||||
/*@}*/
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 "main/core.h" /* for slot numbers */
|
||||
|
||||
struct builtin_variable {
|
||||
enum ir_variable_mode mode;
|
||||
int slot;
|
||||
const char *type;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
static const builtin_variable builtin_core_vs_variables[] = {
|
||||
{ ir_var_out, VERT_RESULT_HPOS, "vec4", "gl_Position" },
|
||||
{ ir_var_out, VERT_RESULT_PSIZ, "float", "gl_PointSize" },
|
||||
};
|
||||
|
||||
static const builtin_variable builtin_core_fs_variables[] = {
|
||||
{ ir_var_in, FRAG_ATTRIB_WPOS, "vec4", "gl_FragCoord" },
|
||||
{ ir_var_in, FRAG_ATTRIB_FACE, "bool", "gl_FrontFacing" },
|
||||
{ ir_var_out, FRAG_RESULT_COLOR, "vec4", "gl_FragColor" },
|
||||
};
|
||||
|
||||
static const builtin_variable builtin_100ES_fs_variables[] = {
|
||||
{ ir_var_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord" },
|
||||
};
|
||||
|
||||
static const builtin_variable builtin_110_fs_variables[] = {
|
||||
{ ir_var_out, FRAG_RESULT_DEPTH, "float", "gl_FragDepth" },
|
||||
};
|
||||
|
||||
static const builtin_variable builtin_110_deprecated_fs_variables[] = {
|
||||
{ ir_var_in, FRAG_ATTRIB_COL0, "vec4", "gl_Color" },
|
||||
{ ir_var_in, FRAG_ATTRIB_COL1, "vec4", "gl_SecondaryColor" },
|
||||
{ ir_var_in, FRAG_ATTRIB_FOGC, "float", "gl_FogFragCoord" },
|
||||
};
|
||||
|
||||
static const builtin_variable builtin_110_deprecated_vs_variables[] = {
|
||||
{ ir_var_in, VERT_ATTRIB_POS, "vec4", "gl_Vertex" },
|
||||
{ ir_var_in, VERT_ATTRIB_NORMAL, "vec3", "gl_Normal" },
|
||||
{ ir_var_in, VERT_ATTRIB_COLOR0, "vec4", "gl_Color" },
|
||||
{ ir_var_in, VERT_ATTRIB_COLOR1, "vec4", "gl_SecondaryColor" },
|
||||
{ ir_var_in, VERT_ATTRIB_TEX0, "vec4", "gl_MultiTexCoord0" },
|
||||
{ ir_var_in, VERT_ATTRIB_TEX1, "vec4", "gl_MultiTexCoord1" },
|
||||
{ ir_var_in, VERT_ATTRIB_TEX2, "vec4", "gl_MultiTexCoord2" },
|
||||
{ ir_var_in, VERT_ATTRIB_TEX3, "vec4", "gl_MultiTexCoord3" },
|
||||
{ ir_var_in, VERT_ATTRIB_TEX4, "vec4", "gl_MultiTexCoord4" },
|
||||
{ ir_var_in, VERT_ATTRIB_TEX5, "vec4", "gl_MultiTexCoord5" },
|
||||
{ ir_var_in, VERT_ATTRIB_TEX6, "vec4", "gl_MultiTexCoord6" },
|
||||
{ ir_var_in, VERT_ATTRIB_TEX7, "vec4", "gl_MultiTexCoord7" },
|
||||
{ ir_var_in, VERT_ATTRIB_FOG, "float", "gl_FogCoord" },
|
||||
{ ir_var_out, VERT_RESULT_HPOS, "vec4", "gl_ClipVertex" },
|
||||
{ ir_var_out, VERT_RESULT_COL0, "vec4", "gl_FrontColor" },
|
||||
{ ir_var_out, VERT_RESULT_BFC0, "vec4", "gl_BackColor" },
|
||||
{ ir_var_out, VERT_RESULT_COL1, "vec4", "gl_FrontSecondaryColor" },
|
||||
{ ir_var_out, VERT_RESULT_BFC1, "vec4", "gl_BackSecondaryColor" },
|
||||
{ ir_var_out, VERT_RESULT_FOGC, "float", "gl_FogFragCoord" },
|
||||
};
|
||||
|
||||
static const builtin_variable builtin_120_fs_variables[] = {
|
||||
{ ir_var_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord" },
|
||||
};
|
||||
|
||||
static const builtin_variable builtin_130_vs_variables[] = {
|
||||
{ ir_var_in, -1, "int", "gl_VertexID" },
|
||||
};
|
||||
|
||||
static const builtin_variable builtin_110_deprecated_uniforms[] = {
|
||||
{ ir_var_uniform, -1, "mat4", "gl_ModelViewMatrix" },
|
||||
{ ir_var_uniform, -1, "mat4", "gl_ProjectionMatrix" },
|
||||
{ ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrix" },
|
||||
{ ir_var_uniform, -1, "mat3", "gl_NormalMatrix" },
|
||||
{ ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixInverse" },
|
||||
{ ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixInverse" },
|
||||
{ ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixInverse" },
|
||||
{ ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixTranspose" },
|
||||
{ ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixTranspose" },
|
||||
{ ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixTranspose" },
|
||||
{ ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixInverseTranspose" },
|
||||
{ ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixInverseTranspose" },
|
||||
{ ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixInverseTranspose" },
|
||||
{ ir_var_uniform, -1, "float", "gl_NormalScale" },
|
||||
{ ir_var_uniform, -1, "gl_LightModelParameters", "gl_LightModel"},
|
||||
};
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
glcpp -- GLSL "C" preprocessor
|
||||
|
||||
This is a simple preprocessor designed to provide the preprocessing
|
||||
needs of the GLSL language. The requirements for this preprocessor are
|
||||
specified in the GLSL 1.30 specification availble from:
|
||||
|
||||
http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.30.10.pdf
|
||||
|
||||
This specification is not precise on some semantics, (for example,
|
||||
#define and #if), defining these merely "as is standard for C++
|
||||
preprocessors". To fill in these details, I've been using a draft of
|
||||
the C99 standard as available from:
|
||||
|
||||
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
|
||||
|
||||
Any downstream compiler accepting output from glcpp should be prepared
|
||||
to encounter and deal with the following preprocessor macros:
|
||||
|
||||
#line
|
||||
#pragma
|
||||
#extension
|
||||
|
||||
All other macros will be handles according to the GLSL specification
|
||||
and will not appear in the output.
|
||||
|
||||
Known limitations
|
||||
-----------------
|
||||
The __LINE__ and __FILE__ macros are not yet supported.
|
||||
|
||||
A file that ends with a function-like macro name as the last
|
||||
non-whitespace token will result in a parse error, (where it should be
|
||||
passed through as is).
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,325 +0,0 @@
|
||||
%{
|
||||
/*
|
||||
* Copyright © 2010 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 <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "glcpp.h"
|
||||
#include "glcpp-parse.h"
|
||||
|
||||
/* Flex annoyingly generates some functions without making them
|
||||
* static. Let's declare them here. */
|
||||
int glcpp_get_column (yyscan_t yyscanner);
|
||||
void glcpp_set_column (int column_no , yyscan_t yyscanner);
|
||||
|
||||
#define YY_NO_INPUT
|
||||
|
||||
#define YY_USER_ACTION \
|
||||
do { \
|
||||
yylloc->first_column = yycolumn + 1; \
|
||||
yylloc->first_line = yylineno; \
|
||||
yycolumn += yyleng; \
|
||||
} while(0);
|
||||
|
||||
#define YY_USER_INIT \
|
||||
do { \
|
||||
yylineno = 1; \
|
||||
yycolumn = 1; \
|
||||
yylloc->source = 0; \
|
||||
} while(0)
|
||||
%}
|
||||
|
||||
%option bison-bridge bison-locations reentrant noyywrap
|
||||
%option extra-type="glcpp_parser_t *"
|
||||
%option prefix="glcpp_"
|
||||
%option stack
|
||||
%option never-interactive
|
||||
|
||||
%x DONE COMMENT UNREACHABLE
|
||||
|
||||
SPACE [[:space:]]
|
||||
NONSPACE [^[:space:]]
|
||||
NEWLINE [\n]
|
||||
HSPACE [ \t]
|
||||
HASH ^{HSPACE}*#{HSPACE}*
|
||||
IDENTIFIER [_a-zA-Z][_a-zA-Z0-9]*
|
||||
PUNCTUATION [][(){}.&*~!/%<>^|;,=+-]
|
||||
OTHER [^][(){}.&*~!/%<>^|;,=#[:space:]+-]+
|
||||
|
||||
DIGITS [0-9][0-9]*
|
||||
DECIMAL_INTEGER [1-9][0-9]*[uU]?
|
||||
OCTAL_INTEGER 0[0-7]*[uU]?
|
||||
HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
|
||||
|
||||
%%
|
||||
|
||||
/* Single-line comments */
|
||||
"//"[^\n]* {
|
||||
}
|
||||
|
||||
/* Multi-line comments */
|
||||
"/*" { yy_push_state(COMMENT, yyscanner); }
|
||||
<COMMENT>[^*\n]*
|
||||
<COMMENT>[^*\n]*\n { yylineno++; yycolumn = 0; return NEWLINE; }
|
||||
<COMMENT>"*"+[^*/\n]*
|
||||
<COMMENT>"*"+[^*/\n]*\n { yylineno++; yycolumn = 0; return NEWLINE; }
|
||||
<COMMENT>"*"+"/" {
|
||||
yy_pop_state(yyscanner);
|
||||
if (yyextra->space_tokens)
|
||||
return SPACE;
|
||||
}
|
||||
|
||||
{HASH}version {
|
||||
yylval->str = ralloc_strdup (yyextra, yytext);
|
||||
yyextra->space_tokens = 0;
|
||||
return HASH_VERSION;
|
||||
}
|
||||
|
||||
/* glcpp doesn't handle #extension, #version, or #pragma directives.
|
||||
* Simply pass them through to the main compiler's lexer/parser. */
|
||||
{HASH}(extension|pragma)[^\n]+ {
|
||||
yylval->str = ralloc_strdup (yyextra, yytext);
|
||||
yylineno++;
|
||||
yycolumn = 0;
|
||||
return OTHER;
|
||||
}
|
||||
|
||||
{HASH}line{HSPACE}+{DIGITS}{HSPACE}+{DIGITS}{HSPACE}*$ {
|
||||
/* Eat characters until the first digit is
|
||||
* encountered
|
||||
*/
|
||||
char *ptr = yytext;
|
||||
while (!isdigit(*ptr))
|
||||
ptr++;
|
||||
|
||||
/* Subtract one from the line number because
|
||||
* yylineno is zero-based instead of
|
||||
* one-based.
|
||||
*/
|
||||
yylineno = strtol(ptr, &ptr, 0) - 1;
|
||||
yylloc->source = strtol(ptr, NULL, 0);
|
||||
}
|
||||
|
||||
{HASH}line{HSPACE}+{DIGITS}{HSPACE}*$ {
|
||||
/* Eat characters until the first digit is
|
||||
* encountered
|
||||
*/
|
||||
char *ptr = yytext;
|
||||
while (!isdigit(*ptr))
|
||||
ptr++;
|
||||
|
||||
/* Subtract one from the line number because
|
||||
* yylineno is zero-based instead of
|
||||
* one-based.
|
||||
*/
|
||||
yylineno = strtol(ptr, &ptr, 0) - 1;
|
||||
}
|
||||
|
||||
{HASH}ifdef/.*\n {
|
||||
yyextra->lexing_if = 1;
|
||||
yyextra->space_tokens = 0;
|
||||
return HASH_IFDEF;
|
||||
}
|
||||
|
||||
{HASH}ifndef/.*\n {
|
||||
yyextra->lexing_if = 1;
|
||||
yyextra->space_tokens = 0;
|
||||
return HASH_IFNDEF;
|
||||
}
|
||||
|
||||
{HASH}if/[^_a-zA-Z0-9].*\n {
|
||||
yyextra->lexing_if = 1;
|
||||
yyextra->space_tokens = 0;
|
||||
return HASH_IF;
|
||||
}
|
||||
|
||||
{HASH}elif/.*\n {
|
||||
yyextra->lexing_if = 1;
|
||||
yyextra->space_tokens = 0;
|
||||
return HASH_ELIF;
|
||||
}
|
||||
|
||||
{HASH}else/.*\n {
|
||||
yyextra->space_tokens = 0;
|
||||
return HASH_ELSE;
|
||||
}
|
||||
|
||||
{HASH}endif/.*\n {
|
||||
yyextra->space_tokens = 0;
|
||||
return HASH_ENDIF;
|
||||
}
|
||||
|
||||
/* When skipping (due to an #if 0 or similar) consume anything
|
||||
* up to a newline. We do this with less priority than any
|
||||
* #if-related directive (#if, #elif, #else, #endif), but with
|
||||
* more priority than any other directive or token to avoid
|
||||
* any side-effects from skipped content.
|
||||
*
|
||||
* We use the lexing_if flag to avoid skipping any part of an
|
||||
* if conditional expression. */
|
||||
[^\n]+/\n {
|
||||
/* Since this rule always matches, YY_USER_ACTION gets called for it,
|
||||
* wrongly incrementing yycolumn. We undo that effect here. */
|
||||
yycolumn -= yyleng;
|
||||
if (yyextra->lexing_if ||
|
||||
yyextra->skip_stack == NULL ||
|
||||
yyextra->skip_stack->type == SKIP_NO_SKIP)
|
||||
{
|
||||
REJECT;
|
||||
}
|
||||
}
|
||||
|
||||
{HASH}error.* {
|
||||
char *p;
|
||||
for (p = yytext; !isalpha(p[0]); p++); /* skip " # " */
|
||||
p += 5; /* skip "error" */
|
||||
glcpp_error(yylloc, yyextra, "#error%s", p);
|
||||
}
|
||||
|
||||
{HASH}define{HSPACE}+/{IDENTIFIER}"(" {
|
||||
yyextra->space_tokens = 0;
|
||||
return HASH_DEFINE_FUNC;
|
||||
}
|
||||
|
||||
{HASH}define {
|
||||
yyextra->space_tokens = 0;
|
||||
return HASH_DEFINE_OBJ;
|
||||
}
|
||||
|
||||
{HASH}undef {
|
||||
yyextra->space_tokens = 0;
|
||||
return HASH_UNDEF;
|
||||
}
|
||||
|
||||
{HASH} {
|
||||
yyextra->space_tokens = 0;
|
||||
return HASH;
|
||||
}
|
||||
|
||||
{DECIMAL_INTEGER} {
|
||||
yylval->str = ralloc_strdup (yyextra, yytext);
|
||||
return INTEGER_STRING;
|
||||
}
|
||||
|
||||
{OCTAL_INTEGER} {
|
||||
yylval->str = ralloc_strdup (yyextra, yytext);
|
||||
return INTEGER_STRING;
|
||||
}
|
||||
|
||||
{HEXADECIMAL_INTEGER} {
|
||||
yylval->str = ralloc_strdup (yyextra, yytext);
|
||||
return INTEGER_STRING;
|
||||
}
|
||||
|
||||
"<<" {
|
||||
return LEFT_SHIFT;
|
||||
}
|
||||
|
||||
">>" {
|
||||
return RIGHT_SHIFT;
|
||||
}
|
||||
|
||||
"<=" {
|
||||
return LESS_OR_EQUAL;
|
||||
}
|
||||
|
||||
">=" {
|
||||
return GREATER_OR_EQUAL;
|
||||
}
|
||||
|
||||
"==" {
|
||||
return EQUAL;
|
||||
}
|
||||
|
||||
"!=" {
|
||||
return NOT_EQUAL;
|
||||
}
|
||||
|
||||
"&&" {
|
||||
return AND;
|
||||
}
|
||||
|
||||
"||" {
|
||||
return OR;
|
||||
}
|
||||
|
||||
"##" {
|
||||
return PASTE;
|
||||
}
|
||||
|
||||
"defined" {
|
||||
return DEFINED;
|
||||
}
|
||||
|
||||
{IDENTIFIER} {
|
||||
yylval->str = ralloc_strdup (yyextra, yytext);
|
||||
return IDENTIFIER;
|
||||
}
|
||||
|
||||
{PUNCTUATION} {
|
||||
return yytext[0];
|
||||
}
|
||||
|
||||
{OTHER}+ {
|
||||
yylval->str = ralloc_strdup (yyextra, yytext);
|
||||
return OTHER;
|
||||
}
|
||||
|
||||
{HSPACE}+ {
|
||||
if (yyextra->space_tokens) {
|
||||
return SPACE;
|
||||
}
|
||||
}
|
||||
|
||||
\n {
|
||||
yyextra->lexing_if = 0;
|
||||
yylineno++;
|
||||
yycolumn = 0;
|
||||
return NEWLINE;
|
||||
}
|
||||
|
||||
/* Handle missing newline at EOF. */
|
||||
<INITIAL><<EOF>> {
|
||||
BEGIN DONE; /* Don't keep matching this rule forever. */
|
||||
yyextra->lexing_if = 0;
|
||||
return NEWLINE;
|
||||
}
|
||||
|
||||
/* We don't actually use the UNREACHABLE start condition. We
|
||||
only have this action here so that we can pretend to call some
|
||||
generated functions, (to avoid "defined but not used"
|
||||
warnings. */
|
||||
<UNREACHABLE>. {
|
||||
unput('.');
|
||||
yy_top_state(yyextra);
|
||||
}
|
||||
|
||||
%%
|
||||
|
||||
void
|
||||
glcpp_lex_set_source_string(glcpp_parser_t *parser, const char *shader)
|
||||
{
|
||||
yy_scan_string(shader, parser->scanner);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,100 +0,0 @@
|
||||
/* A Bison parser, made by GNU Bison 2.4.3. */
|
||||
|
||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
2009, 2010 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
under terms of your choice, so long as that work isn't itself a
|
||||
parser generator using the skeleton or a modified version thereof
|
||||
as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
the parser skeleton itself, you may (at your option) remove this
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||
know about them. */
|
||||
enum yytokentype {
|
||||
COMMA_FINAL = 258,
|
||||
DEFINED = 259,
|
||||
ELIF_EXPANDED = 260,
|
||||
HASH = 261,
|
||||
HASH_DEFINE_FUNC = 262,
|
||||
HASH_DEFINE_OBJ = 263,
|
||||
HASH_ELIF = 264,
|
||||
HASH_ELSE = 265,
|
||||
HASH_ENDIF = 266,
|
||||
HASH_IF = 267,
|
||||
HASH_IFDEF = 268,
|
||||
HASH_IFNDEF = 269,
|
||||
HASH_UNDEF = 270,
|
||||
HASH_VERSION = 271,
|
||||
IDENTIFIER = 272,
|
||||
IF_EXPANDED = 273,
|
||||
INTEGER = 274,
|
||||
INTEGER_STRING = 275,
|
||||
NEWLINE = 276,
|
||||
OTHER = 277,
|
||||
PLACEHOLDER = 278,
|
||||
SPACE = 279,
|
||||
PASTE = 280,
|
||||
OR = 281,
|
||||
AND = 282,
|
||||
NOT_EQUAL = 283,
|
||||
EQUAL = 284,
|
||||
GREATER_OR_EQUAL = 285,
|
||||
LESS_OR_EQUAL = 286,
|
||||
RIGHT_SHIFT = 287,
|
||||
LEFT_SHIFT = 288,
|
||||
UNARY = 289
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
||||
typedef struct YYLTYPE
|
||||
{
|
||||
int first_line;
|
||||
int first_column;
|
||||
int last_line;
|
||||
int last_column;
|
||||
} YYLTYPE;
|
||||
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYLTYPE_IS_DECLARED 1
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,131 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include "glcpp.h"
|
||||
#include "main/mtypes.h"
|
||||
#include "main/shaderobj.h"
|
||||
|
||||
extern int yydebug;
|
||||
|
||||
void
|
||||
_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
|
||||
struct gl_shader *sh)
|
||||
{
|
||||
*ptr = sh;
|
||||
}
|
||||
|
||||
/* Read from fd until EOF and return a string of everything read.
|
||||
*/
|
||||
static char *
|
||||
load_text_fd (void *ctx, int fd)
|
||||
{
|
||||
#define CHUNK 4096
|
||||
char *text = NULL;
|
||||
ssize_t text_size = 0;
|
||||
ssize_t total_read = 0;
|
||||
ssize_t bytes;
|
||||
|
||||
while (1) {
|
||||
if (total_read + CHUNK + 1 > text_size) {
|
||||
text_size = text_size ? text_size * 2 : CHUNK + 1;
|
||||
text = reralloc_size (ctx, text, text_size);
|
||||
if (text == NULL) {
|
||||
fprintf (stderr, "Out of memory\n");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
bytes = read (fd, text + total_read, CHUNK);
|
||||
if (bytes < 0) {
|
||||
fprintf (stderr, "Error while reading: %s\n",
|
||||
strerror (errno));
|
||||
ralloc_free (text);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (bytes == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
total_read += bytes;
|
||||
}
|
||||
|
||||
text[total_read] = '\0';
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
static char *
|
||||
load_text_file(void *ctx, const char *filename)
|
||||
{
|
||||
char *text;
|
||||
int fd;
|
||||
|
||||
if (filename == NULL || strcmp (filename, "-") == 0)
|
||||
return load_text_fd (ctx, STDIN_FILENO);
|
||||
|
||||
fd = open (filename, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
fprintf (stderr, "Failed to open file %s: %s\n",
|
||||
filename, strerror (errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
text = load_text_fd (ctx, fd);
|
||||
|
||||
close(fd);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
char *filename = NULL;
|
||||
void *ctx = ralloc(NULL, void*);
|
||||
char *info_log = ralloc_strdup(ctx, "");
|
||||
const char *shader;
|
||||
int ret;
|
||||
|
||||
if (argc) {
|
||||
filename = argv[1];
|
||||
}
|
||||
|
||||
shader = load_text_file (ctx, filename);
|
||||
if (shader == NULL)
|
||||
return 1;
|
||||
|
||||
ret = preprocess(ctx, &shader, &info_log, NULL, API_OPENGL);
|
||||
|
||||
printf("%s", shader);
|
||||
fprintf(stderr, "%s", info_log);
|
||||
|
||||
ralloc_free(ctx);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1,222 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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.
|
||||
*/
|
||||
|
||||
#ifndef GLCPP_H
|
||||
#define GLCPP_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "../ralloc.h"
|
||||
|
||||
#include "program/hash_table.h"
|
||||
|
||||
#define yyscan_t void*
|
||||
|
||||
/* Some data types used for parser values. */
|
||||
|
||||
typedef struct string_node {
|
||||
const char *str;
|
||||
struct string_node *next;
|
||||
} string_node_t;
|
||||
|
||||
typedef struct string_list {
|
||||
string_node_t *head;
|
||||
string_node_t *tail;
|
||||
} string_list_t;
|
||||
|
||||
typedef struct token token_t;
|
||||
typedef struct token_list token_list_t;
|
||||
|
||||
typedef union YYSTYPE
|
||||
{
|
||||
intmax_t ival;
|
||||
char *str;
|
||||
string_list_t *string_list;
|
||||
token_t *token;
|
||||
token_list_t *token_list;
|
||||
} YYSTYPE;
|
||||
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
|
||||
typedef struct YYLTYPE {
|
||||
int first_line;
|
||||
int first_column;
|
||||
int last_line;
|
||||
int last_column;
|
||||
unsigned source;
|
||||
} YYLTYPE;
|
||||
# define YYLTYPE_IS_DECLARED 1
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do { \
|
||||
if (N) \
|
||||
{ \
|
||||
(Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
|
||||
(Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
|
||||
(Current).last_line = YYRHSLOC(Rhs, N).last_line; \
|
||||
(Current).last_column = YYRHSLOC(Rhs, N).last_column; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).first_line = (Current).last_line = \
|
||||
YYRHSLOC(Rhs, 0).last_line; \
|
||||
(Current).first_column = (Current).last_column = \
|
||||
YYRHSLOC(Rhs, 0).last_column; \
|
||||
} \
|
||||
(Current).source = 0; \
|
||||
} while (0)
|
||||
|
||||
struct token {
|
||||
int type;
|
||||
YYSTYPE value;
|
||||
YYLTYPE location;
|
||||
};
|
||||
|
||||
typedef struct token_node {
|
||||
token_t *token;
|
||||
struct token_node *next;
|
||||
} token_node_t;
|
||||
|
||||
struct token_list {
|
||||
token_node_t *head;
|
||||
token_node_t *tail;
|
||||
token_node_t *non_space_tail;
|
||||
};
|
||||
|
||||
typedef struct argument_node {
|
||||
token_list_t *argument;
|
||||
struct argument_node *next;
|
||||
} argument_node_t;
|
||||
|
||||
typedef struct argument_list {
|
||||
argument_node_t *head;
|
||||
argument_node_t *tail;
|
||||
} argument_list_t;
|
||||
|
||||
typedef struct glcpp_parser glcpp_parser_t;
|
||||
|
||||
typedef enum {
|
||||
TOKEN_CLASS_IDENTIFIER,
|
||||
TOKEN_CLASS_IDENTIFIER_FINALIZED,
|
||||
TOKEN_CLASS_FUNC_MACRO,
|
||||
TOKEN_CLASS_OBJ_MACRO
|
||||
} token_class_t;
|
||||
|
||||
token_class_t
|
||||
glcpp_parser_classify_token (glcpp_parser_t *parser,
|
||||
const char *identifier,
|
||||
int *parameter_index);
|
||||
|
||||
typedef struct {
|
||||
int is_function;
|
||||
string_list_t *parameters;
|
||||
const char *identifier;
|
||||
token_list_t *replacements;
|
||||
} macro_t;
|
||||
|
||||
typedef struct expansion_node {
|
||||
macro_t *macro;
|
||||
token_node_t *replacements;
|
||||
struct expansion_node *next;
|
||||
} expansion_node_t;
|
||||
|
||||
typedef enum skip_type {
|
||||
SKIP_NO_SKIP,
|
||||
SKIP_TO_ELSE,
|
||||
SKIP_TO_ENDIF
|
||||
} skip_type_t;
|
||||
|
||||
typedef struct skip_node {
|
||||
skip_type_t type;
|
||||
YYLTYPE loc; /* location of the initial #if/#elif/... */
|
||||
struct skip_node *next;
|
||||
} skip_node_t;
|
||||
|
||||
typedef struct active_list {
|
||||
const char *identifier;
|
||||
token_node_t *marker;
|
||||
struct active_list *next;
|
||||
} active_list_t;
|
||||
|
||||
struct glcpp_parser {
|
||||
yyscan_t scanner;
|
||||
struct hash_table *defines;
|
||||
active_list_t *active;
|
||||
int lexing_if;
|
||||
int space_tokens;
|
||||
int newline_as_space;
|
||||
int in_control_line;
|
||||
int paren_count;
|
||||
skip_node_t *skip_stack;
|
||||
token_list_t *lex_from_list;
|
||||
token_node_t *lex_from_node;
|
||||
char *output;
|
||||
char *info_log;
|
||||
int error;
|
||||
};
|
||||
|
||||
struct gl_extensions;
|
||||
|
||||
glcpp_parser_t *
|
||||
glcpp_parser_create (const struct gl_extensions *extensions, int api);
|
||||
|
||||
int
|
||||
glcpp_parser_parse (glcpp_parser_t *parser);
|
||||
|
||||
void
|
||||
glcpp_parser_destroy (glcpp_parser_t *parser);
|
||||
|
||||
int
|
||||
preprocess(void *ralloc_ctx, const char **shader, char **info_log,
|
||||
const struct gl_extensions *extensions, int api);
|
||||
|
||||
/* Functions for writing to the info log */
|
||||
|
||||
void
|
||||
glcpp_error (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...);
|
||||
|
||||
void
|
||||
glcpp_warning (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...);
|
||||
|
||||
/* Generated by glcpp-lex.l to glcpp-lex.c */
|
||||
|
||||
int
|
||||
glcpp_lex_init_extra (glcpp_parser_t *parser, yyscan_t* scanner);
|
||||
|
||||
void
|
||||
glcpp_lex_set_source_string(glcpp_parser_t *parser, const char *shader);
|
||||
|
||||
int
|
||||
glcpp_lex (YYSTYPE *lvalp, YYLTYPE *llocp, yyscan_t scanner);
|
||||
|
||||
int
|
||||
glcpp_lex_destroy (yyscan_t scanner);
|
||||
|
||||
/* Generated by glcpp-parse.y to glcpp-parse.c */
|
||||
|
||||
int
|
||||
yyparse (glcpp_parser_t *parser);
|
||||
|
||||
#endif
|
||||
@@ -1,165 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 <assert.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "glcpp.h"
|
||||
#include "main/core.h" /* for isblank() on MSVC */
|
||||
|
||||
void
|
||||
glcpp_error (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
parser->error = 1;
|
||||
ralloc_asprintf_append(&parser->info_log, "%u:%u(%u): "
|
||||
"preprocessor error: ",
|
||||
locp->source,
|
||||
locp->first_line,
|
||||
locp->first_column);
|
||||
va_start(ap, fmt);
|
||||
ralloc_vasprintf_append(&parser->info_log, fmt, ap);
|
||||
va_end(ap);
|
||||
ralloc_strcat(&parser->info_log, "\n");
|
||||
}
|
||||
|
||||
void
|
||||
glcpp_warning (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
ralloc_asprintf_append(&parser->info_log, "%u:%u(%u): "
|
||||
"preprocessor warning: ",
|
||||
locp->source,
|
||||
locp->first_line,
|
||||
locp->first_column);
|
||||
va_start(ap, fmt);
|
||||
ralloc_vasprintf_append(&parser->info_log, fmt, ap);
|
||||
va_end(ap);
|
||||
ralloc_strcat(&parser->info_log, "\n");
|
||||
}
|
||||
|
||||
/* Searches backwards for '^ *#' from a given starting point. */
|
||||
static int
|
||||
in_directive(const char *shader, const char *ptr)
|
||||
{
|
||||
assert(ptr >= shader);
|
||||
|
||||
/* Search backwards for '#'. If we find a \n first, it doesn't count */
|
||||
for (; ptr >= shader && *ptr != '#'; ptr--) {
|
||||
if (*ptr == '\n')
|
||||
return 0;
|
||||
}
|
||||
if (ptr >= shader) {
|
||||
/* Found '#'...look for spaces preceded by a newline */
|
||||
for (ptr--; ptr >= shader && isblank(*ptr); ptr--);
|
||||
// FIXME: I don't think the '\n' case can happen
|
||||
if (ptr < shader || *ptr == '\n')
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Remove any line continuation characters in preprocessing directives.
|
||||
* However, ignore any in GLSL code, as "There is no line continuation
|
||||
* character" (1.30 page 9) in GLSL.
|
||||
*/
|
||||
static char *
|
||||
remove_line_continuations(glcpp_parser_t *ctx, const char *shader)
|
||||
{
|
||||
int in_continued_line = 0;
|
||||
int extra_newlines = 0;
|
||||
char *clean = ralloc_strdup(ctx, "");
|
||||
const char *search_start = shader;
|
||||
const char *newline;
|
||||
while ((newline = strchr(search_start, '\n')) != NULL) {
|
||||
const char *backslash = NULL;
|
||||
|
||||
/* # of characters preceding the newline. */
|
||||
int n = newline - shader;
|
||||
|
||||
/* Find the preceding '\', if it exists */
|
||||
if (n >= 1 && newline[-1] == '\\')
|
||||
backslash = newline - 1;
|
||||
else if (n >= 2 && newline[-1] == '\r' && newline[-2] == '\\')
|
||||
backslash = newline - 2;
|
||||
|
||||
/* Double backslashes don't count (the backslash is escaped) */
|
||||
if (backslash != NULL && backslash[-1] == '\\') {
|
||||
backslash = NULL;
|
||||
}
|
||||
|
||||
if (backslash != NULL) {
|
||||
/* We found a line continuation, but do we care? */
|
||||
if (!in_continued_line) {
|
||||
if (in_directive(shader, backslash)) {
|
||||
in_continued_line = 1;
|
||||
extra_newlines = 0;
|
||||
}
|
||||
}
|
||||
if (in_continued_line) {
|
||||
/* Copy everything before the \ */
|
||||
ralloc_strncat(&clean, shader, backslash - shader);
|
||||
shader = newline + 1;
|
||||
extra_newlines++;
|
||||
}
|
||||
} else if (in_continued_line) {
|
||||
/* Copy everything up to and including the \n */
|
||||
ralloc_strncat(&clean, shader, newline - shader + 1);
|
||||
shader = newline + 1;
|
||||
/* Output extra newlines to make line numbers match */
|
||||
for (; extra_newlines > 0; extra_newlines--)
|
||||
ralloc_strcat(&clean, "\n");
|
||||
in_continued_line = 0;
|
||||
}
|
||||
search_start = newline + 1;
|
||||
}
|
||||
ralloc_strcat(&clean, shader);
|
||||
return clean;
|
||||
}
|
||||
|
||||
int
|
||||
preprocess(void *ralloc_ctx, const char **shader, char **info_log,
|
||||
const struct gl_extensions *extensions, int api)
|
||||
{
|
||||
int errors;
|
||||
glcpp_parser_t *parser = glcpp_parser_create (extensions, api);
|
||||
*shader = remove_line_continuations(parser, *shader);
|
||||
|
||||
glcpp_lex_set_source_string (parser, *shader);
|
||||
|
||||
glcpp_parser_parse (parser);
|
||||
|
||||
if (parser->skip_stack)
|
||||
glcpp_error (&parser->skip_stack->loc, parser, "Unterminated #if\n");
|
||||
|
||||
ralloc_strcat(info_log, parser->info_log);
|
||||
|
||||
ralloc_steal(ralloc_ctx, parser->output);
|
||||
*shader = parser->output;
|
||||
|
||||
errors = parser->error;
|
||||
glcpp_parser_destroy (parser);
|
||||
return errors;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,452 +0,0 @@
|
||||
%{
|
||||
/*
|
||||
* Copyright © 2008, 2009 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 <ctype.h>
|
||||
#include "strtod.h"
|
||||
#include "ast.h"
|
||||
#include "glsl_parser_extras.h"
|
||||
#include "glsl_parser.h"
|
||||
|
||||
static int classify_identifier(struct _mesa_glsl_parse_state *, const char *);
|
||||
|
||||
#define YY_USER_ACTION \
|
||||
do { \
|
||||
yylloc->source = 0; \
|
||||
yylloc->first_column = yycolumn + 1; \
|
||||
yylloc->first_line = yylineno + 1; \
|
||||
yycolumn += yyleng; \
|
||||
} while(0);
|
||||
|
||||
#define YY_USER_INIT yylineno = 0; yycolumn = 0;
|
||||
|
||||
#define IS_UINT (yytext[yyleng - 1] == 'u' || yytext[yyleng - 1] == 'U')
|
||||
|
||||
/* A macro for handling reserved words and keywords across language versions.
|
||||
*
|
||||
* Certain words start out as identifiers, become reserved words in
|
||||
* later language revisions, and finally become language keywords.
|
||||
*
|
||||
* For example, consider the following lexer rule:
|
||||
* samplerBuffer KEYWORD(130, 140, SAMPLERBUFFER)
|
||||
*
|
||||
* This means that "samplerBuffer" will be treated as:
|
||||
* - a keyword (SAMPLERBUFFER token) ...in GLSL >= 1.40
|
||||
* - a reserved word - error ...in GLSL >= 1.30
|
||||
* - an identifier ...in GLSL < 1.30
|
||||
*/
|
||||
#define KEYWORD(reserved_version, allowed_version, token) \
|
||||
do { \
|
||||
if (yyextra->language_version >= allowed_version) { \
|
||||
return token; \
|
||||
} else if (yyextra->language_version >= reserved_version) { \
|
||||
_mesa_glsl_error(yylloc, yyextra, \
|
||||
"Illegal use of reserved word `%s'", yytext); \
|
||||
return ERROR_TOK; \
|
||||
} else { \
|
||||
yylval->identifier = strdup(yytext); \
|
||||
return classify_identifier(yyextra, yytext); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* The ES macro can be used in KEYWORD checks:
|
||||
*
|
||||
* word KEYWORD(110 || ES, 400, TOKEN)
|
||||
* ...means the word is reserved in GLSL ES 1.00, while
|
||||
*
|
||||
* word KEYWORD(110, 130 || ES, TOKEN)
|
||||
* ...means the word is a legal keyword in GLSL ES 1.00.
|
||||
*/
|
||||
#define ES yyextra->es_shader
|
||||
%}
|
||||
|
||||
%option bison-bridge bison-locations reentrant noyywrap
|
||||
%option nounput noyy_top_state
|
||||
%option never-interactive
|
||||
%option prefix="_mesa_glsl_"
|
||||
%option extra-type="struct _mesa_glsl_parse_state *"
|
||||
|
||||
%x PP PRAGMA
|
||||
|
||||
DEC_INT [1-9][0-9]*
|
||||
HEX_INT 0[xX][0-9a-fA-F]+
|
||||
OCT_INT 0[0-7]*
|
||||
INT ({DEC_INT}|{HEX_INT}|{OCT_INT})
|
||||
SPC [ \t]*
|
||||
SPCP [ \t]+
|
||||
HASH ^{SPC}#{SPC}
|
||||
%%
|
||||
|
||||
[ \r\t]+ ;
|
||||
|
||||
/* Preprocessor tokens. */
|
||||
^[ \t]*#[ \t]*$ ;
|
||||
^[ \t]*#[ \t]*version { BEGIN PP; return VERSION; }
|
||||
^[ \t]*#[ \t]*extension { BEGIN PP; return EXTENSION; }
|
||||
{HASH}line{SPCP}{INT}{SPCP}{INT}{SPC}$ {
|
||||
/* Eat characters until the first digit is
|
||||
* encountered
|
||||
*/
|
||||
char *ptr = yytext;
|
||||
while (!isdigit(*ptr))
|
||||
ptr++;
|
||||
|
||||
/* Subtract one from the line number because
|
||||
* yylineno is zero-based instead of
|
||||
* one-based.
|
||||
*/
|
||||
yylineno = strtol(ptr, &ptr, 0) - 1;
|
||||
yylloc->source = strtol(ptr, NULL, 0);
|
||||
}
|
||||
{HASH}line{SPCP}{INT}{SPC}$ {
|
||||
/* Eat characters until the first digit is
|
||||
* encountered
|
||||
*/
|
||||
char *ptr = yytext;
|
||||
while (!isdigit(*ptr))
|
||||
ptr++;
|
||||
|
||||
/* Subtract one from the line number because
|
||||
* yylineno is zero-based instead of
|
||||
* one-based.
|
||||
*/
|
||||
yylineno = strtol(ptr, &ptr, 0) - 1;
|
||||
}
|
||||
^{SPC}#{SPC}pragma{SPCP}debug{SPC}\({SPC}on{SPC}\) {
|
||||
BEGIN PP;
|
||||
return PRAGMA_DEBUG_ON;
|
||||
}
|
||||
^{SPC}#{SPC}pragma{SPCP}debug{SPC}\({SPC}off{SPC}\) {
|
||||
BEGIN PP;
|
||||
return PRAGMA_DEBUG_OFF;
|
||||
}
|
||||
^{SPC}#{SPC}pragma{SPCP}optimize{SPC}\({SPC}on{SPC}\) {
|
||||
BEGIN PP;
|
||||
return PRAGMA_OPTIMIZE_ON;
|
||||
}
|
||||
^{SPC}#{SPC}pragma{SPCP}optimize{SPC}\({SPC}off{SPC}\) {
|
||||
BEGIN PP;
|
||||
return PRAGMA_OPTIMIZE_OFF;
|
||||
}
|
||||
^{SPC}#{SPC}pragma{SPCP}STDGL{SPCP}invariant{SPC}\({SPC}all{SPC}\) {
|
||||
BEGIN PP;
|
||||
return PRAGMA_INVARIANT_ALL;
|
||||
}
|
||||
^{SPC}#{SPC}pragma{SPCP} { BEGIN PRAGMA; }
|
||||
|
||||
<PRAGMA>\n { BEGIN 0; yylineno++; yycolumn = 0; }
|
||||
<PRAGMA>. { }
|
||||
|
||||
<PP>\/\/[^\n]* { }
|
||||
<PP>[ \t\r]* { }
|
||||
<PP>: return COLON;
|
||||
<PP>[_a-zA-Z][_a-zA-Z0-9]* {
|
||||
yylval->identifier = strdup(yytext);
|
||||
return IDENTIFIER;
|
||||
}
|
||||
<PP>[1-9][0-9]* {
|
||||
yylval->n = strtol(yytext, NULL, 10);
|
||||
return INTCONSTANT;
|
||||
}
|
||||
<PP>\n { BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
|
||||
|
||||
\n { yylineno++; yycolumn = 0; }
|
||||
|
||||
attribute return ATTRIBUTE;
|
||||
const return CONST_TOK;
|
||||
bool return BOOL_TOK;
|
||||
float return FLOAT_TOK;
|
||||
int return INT_TOK;
|
||||
uint KEYWORD(130, 130, UINT_TOK);
|
||||
|
||||
break return BREAK;
|
||||
continue return CONTINUE;
|
||||
do return DO;
|
||||
while return WHILE;
|
||||
else return ELSE;
|
||||
for return FOR;
|
||||
if return IF;
|
||||
discard return DISCARD;
|
||||
return return RETURN;
|
||||
|
||||
bvec2 return BVEC2;
|
||||
bvec3 return BVEC3;
|
||||
bvec4 return BVEC4;
|
||||
ivec2 return IVEC2;
|
||||
ivec3 return IVEC3;
|
||||
ivec4 return IVEC4;
|
||||
uvec2 KEYWORD(130, 130, UVEC2);
|
||||
uvec3 KEYWORD(130, 130, UVEC3);
|
||||
uvec4 KEYWORD(130, 130, UVEC4);
|
||||
vec2 return VEC2;
|
||||
vec3 return VEC3;
|
||||
vec4 return VEC4;
|
||||
mat2 return MAT2X2;
|
||||
mat3 return MAT3X3;
|
||||
mat4 return MAT4X4;
|
||||
mat2x2 KEYWORD(120, 120, MAT2X2);
|
||||
mat2x3 KEYWORD(120, 120, MAT2X3);
|
||||
mat2x4 KEYWORD(120, 120, MAT2X4);
|
||||
mat3x2 KEYWORD(120, 120, MAT3X2);
|
||||
mat3x3 KEYWORD(120, 120, MAT3X3);
|
||||
mat3x4 KEYWORD(120, 120, MAT3X4);
|
||||
mat4x2 KEYWORD(120, 120, MAT4X2);
|
||||
mat4x3 KEYWORD(120, 120, MAT4X3);
|
||||
mat4x4 KEYWORD(120, 120, MAT4X4);
|
||||
|
||||
in return IN_TOK;
|
||||
out return OUT_TOK;
|
||||
inout return INOUT_TOK;
|
||||
uniform return UNIFORM;
|
||||
varying return VARYING;
|
||||
centroid KEYWORD(120, 120, CENTROID);
|
||||
invariant KEYWORD(120 || ES, 120 || ES, INVARIANT);
|
||||
flat KEYWORD(130 || ES, 130, FLAT);
|
||||
smooth KEYWORD(130, 130, SMOOTH);
|
||||
noperspective KEYWORD(130, 130, NOPERSPECTIVE);
|
||||
|
||||
sampler1D return SAMPLER1D;
|
||||
sampler2D return SAMPLER2D;
|
||||
sampler3D return SAMPLER3D;
|
||||
samplerCube return SAMPLERCUBE;
|
||||
sampler1DArray KEYWORD(130, 130, SAMPLER1DARRAY);
|
||||
sampler2DArray KEYWORD(130, 130, SAMPLER2DARRAY);
|
||||
sampler1DShadow return SAMPLER1DSHADOW;
|
||||
sampler2DShadow return SAMPLER2DSHADOW;
|
||||
samplerCubeShadow KEYWORD(130, 130, SAMPLERCUBESHADOW);
|
||||
sampler1DArrayShadow KEYWORD(130, 130, SAMPLER1DARRAYSHADOW);
|
||||
sampler2DArrayShadow KEYWORD(130, 130, SAMPLER2DARRAYSHADOW);
|
||||
isampler1D KEYWORD(130, 130, ISAMPLER1D);
|
||||
isampler2D KEYWORD(130, 130, ISAMPLER2D);
|
||||
isampler3D KEYWORD(130, 130, ISAMPLER3D);
|
||||
isamplerCube KEYWORD(130, 130, ISAMPLERCUBE);
|
||||
isampler1DArray KEYWORD(130, 130, ISAMPLER1DARRAY);
|
||||
isampler2DArray KEYWORD(130, 130, ISAMPLER2DARRAY);
|
||||
usampler1D KEYWORD(130, 130, USAMPLER1D);
|
||||
usampler2D KEYWORD(130, 130, USAMPLER2D);
|
||||
usampler3D KEYWORD(130, 130, USAMPLER3D);
|
||||
usamplerCube KEYWORD(130, 130, USAMPLERCUBE);
|
||||
usampler1DArray KEYWORD(130, 130, USAMPLER1DARRAY);
|
||||
usampler2DArray KEYWORD(130, 130, USAMPLER2DARRAY);
|
||||
|
||||
|
||||
struct return STRUCT;
|
||||
void return VOID_TOK;
|
||||
|
||||
layout {
|
||||
if ((yyextra->language_version >= 140)
|
||||
|| yyextra->ARB_explicit_attrib_location_enable
|
||||
|| (yyextra->ARB_fragment_coord_conventions_enable)){
|
||||
return LAYOUT_TOK;
|
||||
} else {
|
||||
yylval->identifier = strdup(yytext);
|
||||
return IDENTIFIER;
|
||||
}
|
||||
}
|
||||
|
||||
\+\+ return INC_OP;
|
||||
-- return DEC_OP;
|
||||
\<= return LE_OP;
|
||||
>= return GE_OP;
|
||||
== return EQ_OP;
|
||||
!= return NE_OP;
|
||||
&& return AND_OP;
|
||||
\|\| return OR_OP;
|
||||
"^^" return XOR_OP;
|
||||
"<<" return LEFT_OP;
|
||||
">>" return RIGHT_OP;
|
||||
|
||||
\*= return MUL_ASSIGN;
|
||||
\/= return DIV_ASSIGN;
|
||||
\+= return ADD_ASSIGN;
|
||||
\%= return MOD_ASSIGN;
|
||||
\<\<= return LEFT_ASSIGN;
|
||||
>>= return RIGHT_ASSIGN;
|
||||
&= return AND_ASSIGN;
|
||||
"^=" return XOR_ASSIGN;
|
||||
\|= return OR_ASSIGN;
|
||||
-= return SUB_ASSIGN;
|
||||
|
||||
[1-9][0-9]*[uU]? {
|
||||
yylval->n = strtol(yytext, NULL, 10);
|
||||
return IS_UINT ? UINTCONSTANT : INTCONSTANT;
|
||||
}
|
||||
0[xX][0-9a-fA-F]+[uU]? {
|
||||
yylval->n = strtol(yytext + 2, NULL, 16);
|
||||
return IS_UINT ? UINTCONSTANT : INTCONSTANT;
|
||||
}
|
||||
0[0-7]*[uU]? {
|
||||
yylval->n = strtol(yytext, NULL, 8);
|
||||
return IS_UINT ? UINTCONSTANT : INTCONSTANT;
|
||||
}
|
||||
|
||||
[0-9]+\.[0-9]+([eE][+-]?[0-9]+)?[fF]? {
|
||||
yylval->real = glsl_strtod(yytext, NULL);
|
||||
return FLOATCONSTANT;
|
||||
}
|
||||
\.[0-9]+([eE][+-]?[0-9]+)?[fF]? {
|
||||
yylval->real = glsl_strtod(yytext, NULL);
|
||||
return FLOATCONSTANT;
|
||||
}
|
||||
[0-9]+\.([eE][+-]?[0-9]+)?[fF]? {
|
||||
yylval->real = glsl_strtod(yytext, NULL);
|
||||
return FLOATCONSTANT;
|
||||
}
|
||||
[0-9]+[eE][+-]?[0-9]+[fF]? {
|
||||
yylval->real = glsl_strtod(yytext, NULL);
|
||||
return FLOATCONSTANT;
|
||||
}
|
||||
[0-9]+[fF] {
|
||||
yylval->real = glsl_strtod(yytext, NULL);
|
||||
return FLOATCONSTANT;
|
||||
}
|
||||
|
||||
true {
|
||||
yylval->n = 1;
|
||||
return BOOLCONSTANT;
|
||||
}
|
||||
false {
|
||||
yylval->n = 0;
|
||||
return BOOLCONSTANT;
|
||||
}
|
||||
|
||||
|
||||
/* Reserved words in GLSL 1.10. */
|
||||
asm KEYWORD(110 || ES, 999, ASM);
|
||||
class KEYWORD(110 || ES, 999, CLASS);
|
||||
union KEYWORD(110 || ES, 999, UNION);
|
||||
enum KEYWORD(110 || ES, 999, ENUM);
|
||||
typedef KEYWORD(110 || ES, 999, TYPEDEF);
|
||||
template KEYWORD(110 || ES, 999, TEMPLATE);
|
||||
this KEYWORD(110 || ES, 999, THIS);
|
||||
packed KEYWORD(110 || ES, 999, PACKED_TOK);
|
||||
goto KEYWORD(110 || ES, 999, GOTO);
|
||||
switch KEYWORD(110 || ES, 130, SWITCH);
|
||||
default KEYWORD(110 || ES, 130, DEFAULT);
|
||||
inline KEYWORD(110 || ES, 999, INLINE_TOK);
|
||||
noinline KEYWORD(110 || ES, 999, NOINLINE);
|
||||
volatile KEYWORD(110 || ES, 999, VOLATILE);
|
||||
public KEYWORD(110 || ES, 999, PUBLIC_TOK);
|
||||
static KEYWORD(110 || ES, 999, STATIC);
|
||||
extern KEYWORD(110 || ES, 999, EXTERN);
|
||||
external KEYWORD(110 || ES, 999, EXTERNAL);
|
||||
interface KEYWORD(110 || ES, 999, INTERFACE);
|
||||
long KEYWORD(110 || ES, 999, LONG_TOK);
|
||||
short KEYWORD(110 || ES, 999, SHORT_TOK);
|
||||
double KEYWORD(110 || ES, 400, DOUBLE_TOK);
|
||||
half KEYWORD(110 || ES, 999, HALF);
|
||||
fixed KEYWORD(110 || ES, 999, FIXED_TOK);
|
||||
unsigned KEYWORD(110 || ES, 999, UNSIGNED);
|
||||
input KEYWORD(110 || ES, 999, INPUT_TOK);
|
||||
output KEYWORD(110 || ES, 999, OUTPUT);
|
||||
hvec2 KEYWORD(110 || ES, 999, HVEC2);
|
||||
hvec3 KEYWORD(110 || ES, 999, HVEC3);
|
||||
hvec4 KEYWORD(110 || ES, 999, HVEC4);
|
||||
dvec2 KEYWORD(110 || ES, 400, DVEC2);
|
||||
dvec3 KEYWORD(110 || ES, 400, DVEC3);
|
||||
dvec4 KEYWORD(110 || ES, 400, DVEC4);
|
||||
fvec2 KEYWORD(110 || ES, 999, FVEC2);
|
||||
fvec3 KEYWORD(110 || ES, 999, FVEC3);
|
||||
fvec4 KEYWORD(110 || ES, 999, FVEC4);
|
||||
sampler2DRect return SAMPLER2DRECT;
|
||||
sampler3DRect KEYWORD(110 || ES, 999, SAMPLER3DRECT);
|
||||
sampler2DRectShadow return SAMPLER2DRECTSHADOW;
|
||||
sizeof KEYWORD(110 || ES, 999, SIZEOF);
|
||||
cast KEYWORD(110 || ES, 999, CAST);
|
||||
namespace KEYWORD(110 || ES, 999, NAMESPACE);
|
||||
using KEYWORD(110 || ES, 999, USING);
|
||||
|
||||
/* Additional reserved words in GLSL 1.20. */
|
||||
lowp KEYWORD(120, 130 || ES, LOWP);
|
||||
mediump KEYWORD(120, 130 || ES, MEDIUMP);
|
||||
highp KEYWORD(120, 130 || ES, HIGHP);
|
||||
precision KEYWORD(120, 130 || ES, PRECISION);
|
||||
|
||||
/* Additional reserved words in GLSL 1.30. */
|
||||
case KEYWORD(130, 130, CASE);
|
||||
common KEYWORD(130, 999, COMMON);
|
||||
partition KEYWORD(130, 999, PARTITION);
|
||||
active KEYWORD(130, 999, ACTIVE);
|
||||
superp KEYWORD(130 || ES, 999, SUPERP);
|
||||
samplerBuffer KEYWORD(130, 140, SAMPLERBUFFER);
|
||||
filter KEYWORD(130, 999, FILTER);
|
||||
image1D KEYWORD(130, 999, IMAGE1D);
|
||||
image2D KEYWORD(130, 999, IMAGE2D);
|
||||
image3D KEYWORD(130, 999, IMAGE3D);
|
||||
imageCube KEYWORD(130, 999, IMAGECUBE);
|
||||
iimage1D KEYWORD(130, 999, IIMAGE1D);
|
||||
iimage2D KEYWORD(130, 999, IIMAGE2D);
|
||||
iimage3D KEYWORD(130, 999, IIMAGE3D);
|
||||
iimageCube KEYWORD(130, 999, IIMAGECUBE);
|
||||
uimage1D KEYWORD(130, 999, UIMAGE1D);
|
||||
uimage2D KEYWORD(130, 999, UIMAGE2D);
|
||||
uimage3D KEYWORD(130, 999, UIMAGE3D);
|
||||
uimageCube KEYWORD(130, 999, UIMAGECUBE);
|
||||
image1DArray KEYWORD(130, 999, IMAGE1DARRAY);
|
||||
image2DArray KEYWORD(130, 999, IMAGE2DARRAY);
|
||||
iimage1DArray KEYWORD(130, 999, IIMAGE1DARRAY);
|
||||
iimage2DArray KEYWORD(130, 999, IIMAGE2DARRAY);
|
||||
uimage1DArray KEYWORD(130, 999, UIMAGE1DARRAY);
|
||||
uimage2DArray KEYWORD(130, 999, UIMAGE2DARRAY);
|
||||
image1DShadow KEYWORD(130, 999, IMAGE1DSHADOW);
|
||||
image2DShadow KEYWORD(130, 999, IMAGE2DSHADOW);
|
||||
image1DArrayShadow KEYWORD(130, 999, IMAGE1DARRAYSHADOW);
|
||||
image2DArrayShadow KEYWORD(130, 999, IMAGE2DARRAYSHADOW);
|
||||
imageBuffer KEYWORD(130, 999, IMAGEBUFFER);
|
||||
iimageBuffer KEYWORD(130, 999, IIMAGEBUFFER);
|
||||
uimageBuffer KEYWORD(130, 999, UIMAGEBUFFER);
|
||||
row_major KEYWORD(130, 999, ROW_MAJOR);
|
||||
|
||||
[_a-zA-Z][_a-zA-Z0-9]* {
|
||||
struct _mesa_glsl_parse_state *state = yyextra;
|
||||
void *ctx = state;
|
||||
yylval->identifier = ralloc_strdup(ctx, yytext);
|
||||
return classify_identifier(state, yytext);
|
||||
}
|
||||
|
||||
. { return yytext[0]; }
|
||||
|
||||
%%
|
||||
|
||||
int
|
||||
classify_identifier(struct _mesa_glsl_parse_state *state, const char *name)
|
||||
{
|
||||
if (state->symbols->get_variable(name) || state->symbols->get_function(name))
|
||||
return IDENTIFIER;
|
||||
else if (state->symbols->get_type(name))
|
||||
return TYPE_IDENTIFIER;
|
||||
else
|
||||
return NEW_IDENTIFIER;
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)
|
||||
{
|
||||
yylex_init_extra(state, & state->scanner);
|
||||
yy_scan_string(string, state->scanner);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
yylex_destroy(state->scanner);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,300 +0,0 @@
|
||||
/* A Bison parser, made by GNU Bison 2.4.3. */
|
||||
|
||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
2009, 2010 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
under terms of your choice, so long as that work isn't itself a
|
||||
parser generator using the skeleton or a modified version thereof
|
||||
as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
the parser skeleton itself, you may (at your option) remove this
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||
know about them. */
|
||||
enum yytokentype {
|
||||
ATTRIBUTE = 258,
|
||||
CONST_TOK = 259,
|
||||
BOOL_TOK = 260,
|
||||
FLOAT_TOK = 261,
|
||||
INT_TOK = 262,
|
||||
UINT_TOK = 263,
|
||||
BREAK = 264,
|
||||
CONTINUE = 265,
|
||||
DO = 266,
|
||||
ELSE = 267,
|
||||
FOR = 268,
|
||||
IF = 269,
|
||||
DISCARD = 270,
|
||||
RETURN = 271,
|
||||
SWITCH = 272,
|
||||
CASE = 273,
|
||||
DEFAULT = 274,
|
||||
BVEC2 = 275,
|
||||
BVEC3 = 276,
|
||||
BVEC4 = 277,
|
||||
IVEC2 = 278,
|
||||
IVEC3 = 279,
|
||||
IVEC4 = 280,
|
||||
UVEC2 = 281,
|
||||
UVEC3 = 282,
|
||||
UVEC4 = 283,
|
||||
VEC2 = 284,
|
||||
VEC3 = 285,
|
||||
VEC4 = 286,
|
||||
CENTROID = 287,
|
||||
IN_TOK = 288,
|
||||
OUT_TOK = 289,
|
||||
INOUT_TOK = 290,
|
||||
UNIFORM = 291,
|
||||
VARYING = 292,
|
||||
NOPERSPECTIVE = 293,
|
||||
FLAT = 294,
|
||||
SMOOTH = 295,
|
||||
MAT2X2 = 296,
|
||||
MAT2X3 = 297,
|
||||
MAT2X4 = 298,
|
||||
MAT3X2 = 299,
|
||||
MAT3X3 = 300,
|
||||
MAT3X4 = 301,
|
||||
MAT4X2 = 302,
|
||||
MAT4X3 = 303,
|
||||
MAT4X4 = 304,
|
||||
SAMPLER1D = 305,
|
||||
SAMPLER2D = 306,
|
||||
SAMPLER3D = 307,
|
||||
SAMPLERCUBE = 308,
|
||||
SAMPLER1DSHADOW = 309,
|
||||
SAMPLER2DSHADOW = 310,
|
||||
SAMPLERCUBESHADOW = 311,
|
||||
SAMPLER1DARRAY = 312,
|
||||
SAMPLER2DARRAY = 313,
|
||||
SAMPLER1DARRAYSHADOW = 314,
|
||||
SAMPLER2DARRAYSHADOW = 315,
|
||||
ISAMPLER1D = 316,
|
||||
ISAMPLER2D = 317,
|
||||
ISAMPLER3D = 318,
|
||||
ISAMPLERCUBE = 319,
|
||||
ISAMPLER1DARRAY = 320,
|
||||
ISAMPLER2DARRAY = 321,
|
||||
USAMPLER1D = 322,
|
||||
USAMPLER2D = 323,
|
||||
USAMPLER3D = 324,
|
||||
USAMPLERCUBE = 325,
|
||||
USAMPLER1DARRAY = 326,
|
||||
USAMPLER2DARRAY = 327,
|
||||
STRUCT = 328,
|
||||
VOID_TOK = 329,
|
||||
WHILE = 330,
|
||||
IDENTIFIER = 331,
|
||||
TYPE_IDENTIFIER = 332,
|
||||
NEW_IDENTIFIER = 333,
|
||||
FLOATCONSTANT = 334,
|
||||
INTCONSTANT = 335,
|
||||
UINTCONSTANT = 336,
|
||||
BOOLCONSTANT = 337,
|
||||
FIELD_SELECTION = 338,
|
||||
LEFT_OP = 339,
|
||||
RIGHT_OP = 340,
|
||||
INC_OP = 341,
|
||||
DEC_OP = 342,
|
||||
LE_OP = 343,
|
||||
GE_OP = 344,
|
||||
EQ_OP = 345,
|
||||
NE_OP = 346,
|
||||
AND_OP = 347,
|
||||
OR_OP = 348,
|
||||
XOR_OP = 349,
|
||||
MUL_ASSIGN = 350,
|
||||
DIV_ASSIGN = 351,
|
||||
ADD_ASSIGN = 352,
|
||||
MOD_ASSIGN = 353,
|
||||
LEFT_ASSIGN = 354,
|
||||
RIGHT_ASSIGN = 355,
|
||||
AND_ASSIGN = 356,
|
||||
XOR_ASSIGN = 357,
|
||||
OR_ASSIGN = 358,
|
||||
SUB_ASSIGN = 359,
|
||||
INVARIANT = 360,
|
||||
LOWP = 361,
|
||||
MEDIUMP = 362,
|
||||
HIGHP = 363,
|
||||
SUPERP = 364,
|
||||
PRECISION = 365,
|
||||
VERSION = 366,
|
||||
EXTENSION = 367,
|
||||
LINE = 368,
|
||||
COLON = 369,
|
||||
EOL = 370,
|
||||
INTERFACE = 371,
|
||||
OUTPUT = 372,
|
||||
PRAGMA_DEBUG_ON = 373,
|
||||
PRAGMA_DEBUG_OFF = 374,
|
||||
PRAGMA_OPTIMIZE_ON = 375,
|
||||
PRAGMA_OPTIMIZE_OFF = 376,
|
||||
PRAGMA_INVARIANT_ALL = 377,
|
||||
LAYOUT_TOK = 378,
|
||||
ASM = 379,
|
||||
CLASS = 380,
|
||||
UNION = 381,
|
||||
ENUM = 382,
|
||||
TYPEDEF = 383,
|
||||
TEMPLATE = 384,
|
||||
THIS = 385,
|
||||
PACKED_TOK = 386,
|
||||
GOTO = 387,
|
||||
INLINE_TOK = 388,
|
||||
NOINLINE = 389,
|
||||
VOLATILE = 390,
|
||||
PUBLIC_TOK = 391,
|
||||
STATIC = 392,
|
||||
EXTERN = 393,
|
||||
EXTERNAL = 394,
|
||||
LONG_TOK = 395,
|
||||
SHORT_TOK = 396,
|
||||
DOUBLE_TOK = 397,
|
||||
HALF = 398,
|
||||
FIXED_TOK = 399,
|
||||
UNSIGNED = 400,
|
||||
INPUT_TOK = 401,
|
||||
OUPTUT = 402,
|
||||
HVEC2 = 403,
|
||||
HVEC3 = 404,
|
||||
HVEC4 = 405,
|
||||
DVEC2 = 406,
|
||||
DVEC3 = 407,
|
||||
DVEC4 = 408,
|
||||
FVEC2 = 409,
|
||||
FVEC3 = 410,
|
||||
FVEC4 = 411,
|
||||
SAMPLER2DRECT = 412,
|
||||
SAMPLER3DRECT = 413,
|
||||
SAMPLER2DRECTSHADOW = 414,
|
||||
SIZEOF = 415,
|
||||
CAST = 416,
|
||||
NAMESPACE = 417,
|
||||
USING = 418,
|
||||
ERROR_TOK = 419,
|
||||
COMMON = 420,
|
||||
PARTITION = 421,
|
||||
ACTIVE = 422,
|
||||
SAMPLERBUFFER = 423,
|
||||
FILTER = 424,
|
||||
IMAGE1D = 425,
|
||||
IMAGE2D = 426,
|
||||
IMAGE3D = 427,
|
||||
IMAGECUBE = 428,
|
||||
IMAGE1DARRAY = 429,
|
||||
IMAGE2DARRAY = 430,
|
||||
IIMAGE1D = 431,
|
||||
IIMAGE2D = 432,
|
||||
IIMAGE3D = 433,
|
||||
IIMAGECUBE = 434,
|
||||
IIMAGE1DARRAY = 435,
|
||||
IIMAGE2DARRAY = 436,
|
||||
UIMAGE1D = 437,
|
||||
UIMAGE2D = 438,
|
||||
UIMAGE3D = 439,
|
||||
UIMAGECUBE = 440,
|
||||
UIMAGE1DARRAY = 441,
|
||||
UIMAGE2DARRAY = 442,
|
||||
IMAGE1DSHADOW = 443,
|
||||
IMAGE2DSHADOW = 444,
|
||||
IMAGEBUFFER = 445,
|
||||
IIMAGEBUFFER = 446,
|
||||
UIMAGEBUFFER = 447,
|
||||
IMAGE1DARRAYSHADOW = 448,
|
||||
IMAGE2DARRAYSHADOW = 449,
|
||||
ROW_MAJOR = 450
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
{
|
||||
|
||||
/* Line 1685 of yacc.c */
|
||||
#line 52 "glsl_parser.ypp"
|
||||
|
||||
int n;
|
||||
float real;
|
||||
char *identifier;
|
||||
|
||||
struct ast_type_qualifier type_qualifier;
|
||||
|
||||
ast_node *node;
|
||||
ast_type_specifier *type_specifier;
|
||||
ast_fully_specified_type *fully_specified_type;
|
||||
ast_function *function;
|
||||
ast_parameter_declarator *parameter_declarator;
|
||||
ast_function_definition *function_definition;
|
||||
ast_compound_statement *compound_statement;
|
||||
ast_expression *expression;
|
||||
ast_declarator_list *declarator_list;
|
||||
ast_struct_specifier *struct_specifier;
|
||||
ast_declaration *declaration;
|
||||
|
||||
struct {
|
||||
ast_node *cond;
|
||||
ast_expression *rest;
|
||||
} for_rest_statement;
|
||||
|
||||
struct {
|
||||
ast_node *then_statement;
|
||||
ast_node *else_statement;
|
||||
} selection_rest_statement;
|
||||
|
||||
|
||||
|
||||
/* Line 1685 of yacc.c */
|
||||
#line 278 "glsl_parser.h"
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
||||
typedef struct YYLTYPE
|
||||
{
|
||||
int first_line;
|
||||
int first_column;
|
||||
int last_line;
|
||||
int last_column;
|
||||
} YYLTYPE;
|
||||
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYLTYPE_IS_DECLARED 1
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,807 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2008, 2009 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 <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
extern "C" {
|
||||
#include "main/core.h" /* for struct gl_context */
|
||||
}
|
||||
|
||||
#include "ralloc.h"
|
||||
#include "ast.h"
|
||||
#include "glsl_parser_extras.h"
|
||||
#include "glsl_parser.h"
|
||||
#include "ir_optimization.h"
|
||||
#include "loop_analysis.h"
|
||||
|
||||
_mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *ctx,
|
||||
GLenum target, void *mem_ctx)
|
||||
{
|
||||
switch (target) {
|
||||
case GL_VERTEX_SHADER: this->target = vertex_shader; break;
|
||||
case GL_FRAGMENT_SHADER: this->target = fragment_shader; break;
|
||||
case GL_GEOMETRY_SHADER: this->target = geometry_shader; break;
|
||||
}
|
||||
|
||||
this->scanner = NULL;
|
||||
this->translation_unit.make_empty();
|
||||
this->symbols = new(mem_ctx) glsl_symbol_table;
|
||||
this->info_log = ralloc_strdup(mem_ctx, "");
|
||||
this->error = false;
|
||||
this->loop_or_switch_nesting = NULL;
|
||||
|
||||
/* Set default language version and extensions */
|
||||
this->language_version = 110;
|
||||
this->es_shader = false;
|
||||
this->ARB_texture_rectangle_enable = true;
|
||||
|
||||
/* OpenGL ES 2.0 has different defaults from desktop GL. */
|
||||
if (ctx->API == API_OPENGLES2) {
|
||||
this->language_version = 100;
|
||||
this->es_shader = true;
|
||||
this->ARB_texture_rectangle_enable = false;
|
||||
}
|
||||
|
||||
this->extensions = &ctx->Extensions;
|
||||
|
||||
this->Const.MaxLights = ctx->Const.MaxLights;
|
||||
this->Const.MaxClipPlanes = ctx->Const.MaxClipPlanes;
|
||||
this->Const.MaxTextureUnits = ctx->Const.MaxTextureUnits;
|
||||
this->Const.MaxTextureCoords = ctx->Const.MaxTextureCoordUnits;
|
||||
this->Const.MaxVertexAttribs = ctx->Const.VertexProgram.MaxAttribs;
|
||||
this->Const.MaxVertexUniformComponents = ctx->Const.VertexProgram.MaxUniformComponents;
|
||||
this->Const.MaxVaryingFloats = ctx->Const.MaxVarying * 4;
|
||||
this->Const.MaxVertexTextureImageUnits = ctx->Const.MaxVertexTextureImageUnits;
|
||||
this->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits;
|
||||
this->Const.MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits;
|
||||
this->Const.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents;
|
||||
|
||||
this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
|
||||
|
||||
/* Note: Once the OpenGL 3.0 'forward compatible' context or the OpenGL 3.2
|
||||
* Core context is supported, this logic will need change. Older versions of
|
||||
* GLSL are no longer supported outside the compatibility contexts of 3.x.
|
||||
*/
|
||||
this->Const.GLSL_100ES = (ctx->API == API_OPENGLES2)
|
||||
|| ctx->Extensions.ARB_ES2_compatibility;
|
||||
this->Const.GLSL_110 = (ctx->API == API_OPENGL);
|
||||
this->Const.GLSL_120 = (ctx->API == API_OPENGL)
|
||||
&& (ctx->Const.GLSLVersion >= 120);
|
||||
this->Const.GLSL_130 = (ctx->API == API_OPENGL)
|
||||
&& (ctx->Const.GLSLVersion >= 130);
|
||||
|
||||
const unsigned lowest_version =
|
||||
(ctx->API == API_OPENGLES2) || ctx->Extensions.ARB_ES2_compatibility
|
||||
? 100 : 110;
|
||||
const unsigned highest_version =
|
||||
(ctx->API == API_OPENGL) ? ctx->Const.GLSLVersion : 100;
|
||||
char *supported = (char *) ralloc_context(this);
|
||||
|
||||
for (unsigned ver = lowest_version; ver <= highest_version; ver += 10) {
|
||||
const char *const prefix = (ver == lowest_version)
|
||||
? ""
|
||||
: ((ver == highest_version) ? ", and " : ", ");
|
||||
|
||||
ralloc_asprintf_append(& supported, "%s%d.%02d%s",
|
||||
prefix,
|
||||
ver / 100, ver % 100,
|
||||
(ver == 100) ? " ES" : "");
|
||||
}
|
||||
|
||||
this->supported_version_string = supported;
|
||||
}
|
||||
|
||||
const char *
|
||||
_mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target)
|
||||
{
|
||||
switch (target) {
|
||||
case vertex_shader: return "vertex";
|
||||
case fragment_shader: return "fragment";
|
||||
case geometry_shader: return "geometry";
|
||||
}
|
||||
|
||||
assert(!"Should not get here.");
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
state->error = true;
|
||||
|
||||
assert(state->info_log != NULL);
|
||||
ralloc_asprintf_append(&state->info_log, "%u:%u(%u): error: ",
|
||||
locp->source,
|
||||
locp->first_line,
|
||||
locp->first_column);
|
||||
va_start(ap, fmt);
|
||||
ralloc_vasprintf_append(&state->info_log, fmt, ap);
|
||||
va_end(ap);
|
||||
ralloc_strcat(&state->info_log, "\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_glsl_warning(const YYLTYPE *locp, _mesa_glsl_parse_state *state,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
assert(state->info_log != NULL);
|
||||
ralloc_asprintf_append(&state->info_log, "%u:%u(%u): warning: ",
|
||||
locp->source,
|
||||
locp->first_line,
|
||||
locp->first_column);
|
||||
va_start(ap, fmt);
|
||||
ralloc_vasprintf_append(&state->info_log, fmt, ap);
|
||||
va_end(ap);
|
||||
ralloc_strcat(&state->info_log, "\n");
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
_mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp,
|
||||
const char *behavior, YYLTYPE *behavior_locp,
|
||||
_mesa_glsl_parse_state *state)
|
||||
{
|
||||
enum {
|
||||
extension_disable,
|
||||
extension_enable,
|
||||
extension_require,
|
||||
extension_warn
|
||||
} ext_mode;
|
||||
|
||||
if (strcmp(behavior, "warn") == 0) {
|
||||
ext_mode = extension_warn;
|
||||
} else if (strcmp(behavior, "require") == 0) {
|
||||
ext_mode = extension_require;
|
||||
} else if (strcmp(behavior, "enable") == 0) {
|
||||
ext_mode = extension_enable;
|
||||
} else if (strcmp(behavior, "disable") == 0) {
|
||||
ext_mode = extension_disable;
|
||||
} else {
|
||||
_mesa_glsl_error(behavior_locp, state,
|
||||
"Unknown extension behavior `%s'",
|
||||
behavior);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool unsupported = false;
|
||||
|
||||
if (strcmp(name, "all") == 0) {
|
||||
if ((ext_mode == extension_enable) || (ext_mode == extension_require)) {
|
||||
_mesa_glsl_error(name_locp, state, "Cannot %s all extensions",
|
||||
(ext_mode == extension_enable)
|
||||
? "enable" : "require");
|
||||
return false;
|
||||
}
|
||||
} else if (strcmp(name, "GL_ARB_draw_buffers") == 0) {
|
||||
/* This extension is only supported in fragment shaders.
|
||||
*/
|
||||
if (state->target != fragment_shader) {
|
||||
unsupported = true;
|
||||
} else {
|
||||
state->ARB_draw_buffers_enable = (ext_mode != extension_disable);
|
||||
state->ARB_draw_buffers_warn = (ext_mode == extension_warn);
|
||||
}
|
||||
} else if (strcmp(name, "GL_ARB_explicit_attrib_location") == 0) {
|
||||
state->ARB_explicit_attrib_location_enable =
|
||||
(ext_mode != extension_disable);
|
||||
state->ARB_explicit_attrib_location_warn =
|
||||
(ext_mode == extension_warn);
|
||||
|
||||
unsupported = !state->extensions->ARB_explicit_attrib_location;
|
||||
} else if (strcmp(name, "GL_ARB_fragment_coord_conventions") == 0) {
|
||||
state->ARB_fragment_coord_conventions_enable =
|
||||
(ext_mode != extension_disable);
|
||||
state->ARB_fragment_coord_conventions_warn =
|
||||
(ext_mode == extension_warn);
|
||||
|
||||
unsupported = !state->extensions->ARB_fragment_coord_conventions;
|
||||
} else if (strcmp(name, "GL_ARB_texture_rectangle") == 0) {
|
||||
state->ARB_texture_rectangle_enable = (ext_mode != extension_disable);
|
||||
state->ARB_texture_rectangle_warn = (ext_mode == extension_warn);
|
||||
} else if (strcmp(name, "GL_EXT_texture_array") == 0) {
|
||||
state->EXT_texture_array_enable = (ext_mode != extension_disable);
|
||||
state->EXT_texture_array_warn = (ext_mode == extension_warn);
|
||||
|
||||
unsupported = !state->extensions->EXT_texture_array;
|
||||
} else if (strcmp(name, "GL_ARB_shader_stencil_export") == 0) {
|
||||
if (state->target != fragment_shader) {
|
||||
unsupported = true;
|
||||
} else {
|
||||
state->ARB_shader_stencil_export_enable = (ext_mode != extension_disable);
|
||||
state->ARB_shader_stencil_export_warn = (ext_mode == extension_warn);
|
||||
unsupported = !state->extensions->ARB_shader_stencil_export;
|
||||
}
|
||||
} else {
|
||||
unsupported = true;
|
||||
}
|
||||
|
||||
if (unsupported) {
|
||||
static const char *const fmt = "extension `%s' unsupported in %s shader";
|
||||
|
||||
if (ext_mode == extension_require) {
|
||||
_mesa_glsl_error(name_locp, state, fmt,
|
||||
name, _mesa_glsl_shader_target_name(state->target));
|
||||
return false;
|
||||
} else {
|
||||
_mesa_glsl_warning(name_locp, state, fmt,
|
||||
name, _mesa_glsl_shader_target_name(state->target));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_ast_type_qualifier_print(const struct ast_type_qualifier *q)
|
||||
{
|
||||
if (q->flags.q.constant)
|
||||
printf("const ");
|
||||
|
||||
if (q->flags.q.invariant)
|
||||
printf("invariant ");
|
||||
|
||||
if (q->flags.q.attribute)
|
||||
printf("attribute ");
|
||||
|
||||
if (q->flags.q.varying)
|
||||
printf("varying ");
|
||||
|
||||
if (q->flags.q.in && q->flags.q.out)
|
||||
printf("inout ");
|
||||
else {
|
||||
if (q->flags.q.in)
|
||||
printf("in ");
|
||||
|
||||
if (q->flags.q.out)
|
||||
printf("out ");
|
||||
}
|
||||
|
||||
if (q->flags.q.centroid)
|
||||
printf("centroid ");
|
||||
if (q->flags.q.uniform)
|
||||
printf("uniform ");
|
||||
if (q->flags.q.smooth)
|
||||
printf("smooth ");
|
||||
if (q->flags.q.flat)
|
||||
printf("flat ");
|
||||
if (q->flags.q.noperspective)
|
||||
printf("noperspective ");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_node::print(void) const
|
||||
{
|
||||
printf("unhandled node ");
|
||||
}
|
||||
|
||||
|
||||
ast_node::ast_node(void)
|
||||
{
|
||||
this->location.source = 0;
|
||||
this->location.line = 0;
|
||||
this->location.column = 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ast_opt_array_size_print(bool is_array, const ast_expression *array_size)
|
||||
{
|
||||
if (is_array) {
|
||||
printf("[ ");
|
||||
|
||||
if (array_size)
|
||||
array_size->print();
|
||||
|
||||
printf("] ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_compound_statement::print(void) const
|
||||
{
|
||||
printf("{\n");
|
||||
|
||||
foreach_list_const(n, &this->statements) {
|
||||
ast_node *ast = exec_node_data(ast_node, n, link);
|
||||
ast->print();
|
||||
}
|
||||
|
||||
printf("}\n");
|
||||
}
|
||||
|
||||
|
||||
ast_compound_statement::ast_compound_statement(int new_scope,
|
||||
ast_node *statements)
|
||||
{
|
||||
this->new_scope = new_scope;
|
||||
|
||||
if (statements != NULL) {
|
||||
this->statements.push_degenerate_list_at_head(&statements->link);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_expression::print(void) const
|
||||
{
|
||||
switch (oper) {
|
||||
case ast_assign:
|
||||
case ast_mul_assign:
|
||||
case ast_div_assign:
|
||||
case ast_mod_assign:
|
||||
case ast_add_assign:
|
||||
case ast_sub_assign:
|
||||
case ast_ls_assign:
|
||||
case ast_rs_assign:
|
||||
case ast_and_assign:
|
||||
case ast_xor_assign:
|
||||
case ast_or_assign:
|
||||
subexpressions[0]->print();
|
||||
printf("%s ", operator_string(oper));
|
||||
subexpressions[1]->print();
|
||||
break;
|
||||
|
||||
case ast_field_selection:
|
||||
subexpressions[0]->print();
|
||||
printf(". %s ", primary_expression.identifier);
|
||||
break;
|
||||
|
||||
case ast_plus:
|
||||
case ast_neg:
|
||||
case ast_bit_not:
|
||||
case ast_logic_not:
|
||||
case ast_pre_inc:
|
||||
case ast_pre_dec:
|
||||
printf("%s ", operator_string(oper));
|
||||
subexpressions[0]->print();
|
||||
break;
|
||||
|
||||
case ast_post_inc:
|
||||
case ast_post_dec:
|
||||
subexpressions[0]->print();
|
||||
printf("%s ", operator_string(oper));
|
||||
break;
|
||||
|
||||
case ast_conditional:
|
||||
subexpressions[0]->print();
|
||||
printf("? ");
|
||||
subexpressions[1]->print();
|
||||
printf(": ");
|
||||
subexpressions[1]->print();
|
||||
break;
|
||||
|
||||
case ast_array_index:
|
||||
subexpressions[0]->print();
|
||||
printf("[ ");
|
||||
subexpressions[1]->print();
|
||||
printf("] ");
|
||||
break;
|
||||
|
||||
case ast_function_call: {
|
||||
subexpressions[0]->print();
|
||||
printf("( ");
|
||||
|
||||
foreach_list_const (n, &this->expressions) {
|
||||
if (n != this->expressions.get_head())
|
||||
printf(", ");
|
||||
|
||||
ast_node *ast = exec_node_data(ast_node, n, link);
|
||||
ast->print();
|
||||
}
|
||||
|
||||
printf(") ");
|
||||
break;
|
||||
}
|
||||
|
||||
case ast_identifier:
|
||||
printf("%s ", primary_expression.identifier);
|
||||
break;
|
||||
|
||||
case ast_int_constant:
|
||||
printf("%d ", primary_expression.int_constant);
|
||||
break;
|
||||
|
||||
case ast_uint_constant:
|
||||
printf("%u ", primary_expression.uint_constant);
|
||||
break;
|
||||
|
||||
case ast_float_constant:
|
||||
printf("%f ", primary_expression.float_constant);
|
||||
break;
|
||||
|
||||
case ast_bool_constant:
|
||||
printf("%s ",
|
||||
primary_expression.bool_constant
|
||||
? "true" : "false");
|
||||
break;
|
||||
|
||||
case ast_sequence: {
|
||||
printf("( ");
|
||||
foreach_list_const(n, & this->expressions) {
|
||||
if (n != this->expressions.get_head())
|
||||
printf(", ");
|
||||
|
||||
ast_node *ast = exec_node_data(ast_node, n, link);
|
||||
ast->print();
|
||||
}
|
||||
printf(") ");
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ast_expression::ast_expression(int oper,
|
||||
ast_expression *ex0,
|
||||
ast_expression *ex1,
|
||||
ast_expression *ex2)
|
||||
{
|
||||
this->oper = ast_operators(oper);
|
||||
this->subexpressions[0] = ex0;
|
||||
this->subexpressions[1] = ex1;
|
||||
this->subexpressions[2] = ex2;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_expression_statement::print(void) const
|
||||
{
|
||||
if (expression)
|
||||
expression->print();
|
||||
|
||||
printf("; ");
|
||||
}
|
||||
|
||||
|
||||
ast_expression_statement::ast_expression_statement(ast_expression *ex) :
|
||||
expression(ex)
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_function::print(void) const
|
||||
{
|
||||
return_type->print();
|
||||
printf(" %s (", identifier);
|
||||
|
||||
foreach_list_const(n, & this->parameters) {
|
||||
ast_node *ast = exec_node_data(ast_node, n, link);
|
||||
ast->print();
|
||||
}
|
||||
|
||||
printf(")");
|
||||
}
|
||||
|
||||
|
||||
ast_function::ast_function(void)
|
||||
: is_definition(false), signature(NULL)
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_fully_specified_type::print(void) const
|
||||
{
|
||||
_mesa_ast_type_qualifier_print(& qualifier);
|
||||
specifier->print();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_parameter_declarator::print(void) const
|
||||
{
|
||||
type->print();
|
||||
if (identifier)
|
||||
printf("%s ", identifier);
|
||||
ast_opt_array_size_print(is_array, array_size);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_function_definition::print(void) const
|
||||
{
|
||||
prototype->print();
|
||||
body->print();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_declaration::print(void) const
|
||||
{
|
||||
printf("%s ", identifier);
|
||||
ast_opt_array_size_print(is_array, array_size);
|
||||
|
||||
if (initializer) {
|
||||
printf("= ");
|
||||
initializer->print();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ast_declaration::ast_declaration(char *identifier, int is_array,
|
||||
ast_expression *array_size,
|
||||
ast_expression *initializer)
|
||||
{
|
||||
this->identifier = identifier;
|
||||
this->is_array = is_array;
|
||||
this->array_size = array_size;
|
||||
this->initializer = initializer;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_declarator_list::print(void) const
|
||||
{
|
||||
assert(type || invariant);
|
||||
|
||||
if (type)
|
||||
type->print();
|
||||
else
|
||||
printf("invariant ");
|
||||
|
||||
foreach_list_const (ptr, & this->declarations) {
|
||||
if (ptr != this->declarations.get_head())
|
||||
printf(", ");
|
||||
|
||||
ast_node *ast = exec_node_data(ast_node, ptr, link);
|
||||
ast->print();
|
||||
}
|
||||
|
||||
printf("; ");
|
||||
}
|
||||
|
||||
|
||||
ast_declarator_list::ast_declarator_list(ast_fully_specified_type *type)
|
||||
{
|
||||
this->type = type;
|
||||
this->invariant = false;
|
||||
}
|
||||
|
||||
void
|
||||
ast_jump_statement::print(void) const
|
||||
{
|
||||
switch (mode) {
|
||||
case ast_continue:
|
||||
printf("continue; ");
|
||||
break;
|
||||
case ast_break:
|
||||
printf("break; ");
|
||||
break;
|
||||
case ast_return:
|
||||
printf("return ");
|
||||
if (opt_return_value)
|
||||
opt_return_value->print();
|
||||
|
||||
printf("; ");
|
||||
break;
|
||||
case ast_discard:
|
||||
printf("discard; ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ast_jump_statement::ast_jump_statement(int mode, ast_expression *return_value)
|
||||
{
|
||||
this->mode = ast_jump_modes(mode);
|
||||
|
||||
if (mode == ast_return)
|
||||
opt_return_value = return_value;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_selection_statement::print(void) const
|
||||
{
|
||||
printf("if ( ");
|
||||
condition->print();
|
||||
printf(") ");
|
||||
|
||||
then_statement->print();
|
||||
|
||||
if (else_statement) {
|
||||
printf("else ");
|
||||
else_statement->print();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
ast_selection_statement::ast_selection_statement(ast_expression *condition,
|
||||
ast_node *then_statement,
|
||||
ast_node *else_statement)
|
||||
{
|
||||
this->condition = condition;
|
||||
this->then_statement = then_statement;
|
||||
this->else_statement = else_statement;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_iteration_statement::print(void) const
|
||||
{
|
||||
switch (mode) {
|
||||
case ast_for:
|
||||
printf("for( ");
|
||||
if (init_statement)
|
||||
init_statement->print();
|
||||
printf("; ");
|
||||
|
||||
if (condition)
|
||||
condition->print();
|
||||
printf("; ");
|
||||
|
||||
if (rest_expression)
|
||||
rest_expression->print();
|
||||
printf(") ");
|
||||
|
||||
body->print();
|
||||
break;
|
||||
|
||||
case ast_while:
|
||||
printf("while ( ");
|
||||
if (condition)
|
||||
condition->print();
|
||||
printf(") ");
|
||||
body->print();
|
||||
break;
|
||||
|
||||
case ast_do_while:
|
||||
printf("do ");
|
||||
body->print();
|
||||
printf("while ( ");
|
||||
if (condition)
|
||||
condition->print();
|
||||
printf("); ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ast_iteration_statement::ast_iteration_statement(int mode,
|
||||
ast_node *init,
|
||||
ast_node *condition,
|
||||
ast_expression *rest_expression,
|
||||
ast_node *body)
|
||||
{
|
||||
this->mode = ast_iteration_modes(mode);
|
||||
this->init_statement = init;
|
||||
this->condition = condition;
|
||||
this->rest_expression = rest_expression;
|
||||
this->body = body;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ast_struct_specifier::print(void) const
|
||||
{
|
||||
printf("struct %s { ", name);
|
||||
foreach_list_const(n, &this->declarations) {
|
||||
ast_node *ast = exec_node_data(ast_node, n, link);
|
||||
ast->print();
|
||||
}
|
||||
printf("} ");
|
||||
}
|
||||
|
||||
|
||||
ast_struct_specifier::ast_struct_specifier(char *identifier,
|
||||
ast_node *declarator_list)
|
||||
{
|
||||
if (identifier == NULL) {
|
||||
static unsigned anon_count = 1;
|
||||
identifier = ralloc_asprintf(this, "#anon_struct_%04x", anon_count);
|
||||
anon_count++;
|
||||
}
|
||||
name = identifier;
|
||||
this->declarations.push_degenerate_list_at_head(&declarator_list->link);
|
||||
}
|
||||
|
||||
bool
|
||||
do_common_optimization(exec_list *ir, bool linked, unsigned max_unroll_iterations)
|
||||
{
|
||||
GLboolean progress = GL_FALSE;
|
||||
|
||||
progress = lower_instructions(ir, SUB_TO_ADD_NEG) || progress;
|
||||
|
||||
if (linked) {
|
||||
progress = do_function_inlining(ir) || progress;
|
||||
progress = do_dead_functions(ir) || progress;
|
||||
}
|
||||
progress = do_structure_splitting(ir) || progress;
|
||||
progress = do_if_simplification(ir) || progress;
|
||||
progress = do_discard_simplification(ir) || progress;
|
||||
progress = do_copy_propagation(ir) || progress;
|
||||
if (linked)
|
||||
progress = do_dead_code(ir) || progress;
|
||||
else
|
||||
progress = do_dead_code_unlinked(ir) || progress;
|
||||
progress = do_dead_code_local(ir) || progress;
|
||||
progress = do_tree_grafting(ir) || progress;
|
||||
progress = do_constant_propagation(ir) || progress;
|
||||
if (linked)
|
||||
progress = do_constant_variable(ir) || progress;
|
||||
else
|
||||
progress = do_constant_variable_unlinked(ir) || progress;
|
||||
progress = do_constant_folding(ir) || progress;
|
||||
progress = do_algebraic(ir) || progress;
|
||||
progress = do_lower_jumps(ir) || progress;
|
||||
progress = do_vec_index_to_swizzle(ir) || progress;
|
||||
progress = do_swizzle_swizzle(ir) || progress;
|
||||
progress = do_noop_swizzle(ir) || progress;
|
||||
|
||||
progress = optimize_redundant_jumps(ir) || progress;
|
||||
|
||||
loop_state *ls = analyze_loop_variables(ir);
|
||||
progress = set_loop_controls(ir, ls) || progress;
|
||||
progress = unroll_loops(ir, ls, max_unroll_iterations) || progress;
|
||||
delete ls;
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
/**
|
||||
* To be called at GL teardown time, this frees compiler datastructures.
|
||||
*
|
||||
* After calling this, any previously compiled shaders and shader
|
||||
* programs would be invalid. So this should happen at approximately
|
||||
* program exit.
|
||||
*/
|
||||
void
|
||||
_mesa_destroy_shader_compiler(void)
|
||||
{
|
||||
_mesa_destroy_shader_compiler_caches();
|
||||
|
||||
_mesa_glsl_release_types();
|
||||
}
|
||||
|
||||
/**
|
||||
* Releases compiler caches to trade off performance for memory.
|
||||
*
|
||||
* Intended to be used with glReleaseShaderCompiler().
|
||||
*/
|
||||
void
|
||||
_mesa_destroy_shader_compiler_caches(void)
|
||||
{
|
||||
_mesa_glsl_release_functions();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,273 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef GLSL_PARSER_EXTRAS_H
|
||||
#define GLSL_PARSER_EXTRAS_H
|
||||
|
||||
/*
|
||||
* Most of the definitions here only apply to C++
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "glsl_symbol_table.h"
|
||||
|
||||
enum _mesa_glsl_parser_targets {
|
||||
vertex_shader,
|
||||
geometry_shader,
|
||||
fragment_shader
|
||||
};
|
||||
|
||||
struct gl_context;
|
||||
|
||||
struct _mesa_glsl_parse_state {
|
||||
_mesa_glsl_parse_state(struct gl_context *ctx, GLenum target,
|
||||
void *mem_ctx);
|
||||
|
||||
/* Callers of this ralloc-based new need not call delete. It's
|
||||
* easier to just ralloc_free 'ctx' (or any of its ancestors). */
|
||||
static void* operator new(size_t size, void *ctx)
|
||||
{
|
||||
void *mem = rzalloc_size(ctx, size);
|
||||
assert(mem != NULL);
|
||||
|
||||
return mem;
|
||||
}
|
||||
|
||||
/* If the user *does* call delete, that's OK, we will just
|
||||
* ralloc_free in that case. */
|
||||
static void operator delete(void *mem)
|
||||
{
|
||||
ralloc_free(mem);
|
||||
}
|
||||
|
||||
void *scanner;
|
||||
exec_list translation_unit;
|
||||
glsl_symbol_table *symbols;
|
||||
|
||||
bool es_shader;
|
||||
unsigned language_version;
|
||||
const char *version_string;
|
||||
enum _mesa_glsl_parser_targets target;
|
||||
|
||||
/**
|
||||
* Printable list of GLSL versions supported by the current context
|
||||
*
|
||||
* \note
|
||||
* This string should probably be generated per-context instead of per
|
||||
* invokation of the compiler. This should be changed when the method of
|
||||
* tracking supported GLSL versions changes.
|
||||
*/
|
||||
const char *supported_version_string;
|
||||
|
||||
/**
|
||||
* Implementation defined limits that affect built-in variables, etc.
|
||||
*
|
||||
* \sa struct gl_constants (in mtypes.h)
|
||||
*/
|
||||
struct {
|
||||
/* 1.10 */
|
||||
unsigned MaxLights;
|
||||
unsigned MaxClipPlanes;
|
||||
unsigned MaxTextureUnits;
|
||||
unsigned MaxTextureCoords;
|
||||
unsigned MaxVertexAttribs;
|
||||
unsigned MaxVertexUniformComponents;
|
||||
unsigned MaxVaryingFloats;
|
||||
unsigned MaxVertexTextureImageUnits;
|
||||
unsigned MaxCombinedTextureImageUnits;
|
||||
unsigned MaxTextureImageUnits;
|
||||
unsigned MaxFragmentUniformComponents;
|
||||
|
||||
/* ARB_draw_buffers */
|
||||
unsigned MaxDrawBuffers;
|
||||
|
||||
/**
|
||||
* Set of GLSL versions supported by the current context
|
||||
*
|
||||
* Knowing that version X is supported doesn't mean that versions before
|
||||
* X are also supported. Version 1.00 is only supported in an ES2
|
||||
* context or when GL_ARB_ES2_compatibility is supported. In an OpenGL
|
||||
* 3.0 "forward compatible" context, GLSL 1.10 and 1.20 are \b not
|
||||
* supported.
|
||||
*/
|
||||
/*@{*/
|
||||
unsigned GLSL_100ES:1;
|
||||
unsigned GLSL_110:1;
|
||||
unsigned GLSL_120:1;
|
||||
unsigned GLSL_130:1;
|
||||
/*@}*/
|
||||
} Const;
|
||||
|
||||
/**
|
||||
* During AST to IR conversion, pointer to current IR function
|
||||
*
|
||||
* Will be \c NULL whenever the AST to IR conversion is not inside a
|
||||
* function definition.
|
||||
*/
|
||||
class ir_function_signature *current_function;
|
||||
|
||||
/** Have we found a return statement in this function? */
|
||||
bool found_return;
|
||||
|
||||
/** Was there an error during compilation? */
|
||||
bool error;
|
||||
|
||||
/**
|
||||
* Are all shader inputs / outputs invariant?
|
||||
*
|
||||
* This is set when the 'STDGL invariant(all)' pragma is used.
|
||||
*/
|
||||
bool all_invariant;
|
||||
|
||||
/** Loop or switch statement containing the current instructions. */
|
||||
class ir_instruction *loop_or_switch_nesting;
|
||||
class ast_iteration_statement *loop_or_switch_nesting_ast;
|
||||
|
||||
/** List of structures defined in user code. */
|
||||
const glsl_type **user_structures;
|
||||
unsigned num_user_structures;
|
||||
|
||||
char *info_log;
|
||||
|
||||
/**
|
||||
* \name Enable bits for GLSL extensions
|
||||
*/
|
||||
/*@{*/
|
||||
unsigned ARB_draw_buffers_enable:1;
|
||||
unsigned ARB_draw_buffers_warn:1;
|
||||
unsigned ARB_explicit_attrib_location_enable:1;
|
||||
unsigned ARB_explicit_attrib_location_warn:1;
|
||||
unsigned ARB_fragment_coord_conventions_enable:1;
|
||||
unsigned ARB_fragment_coord_conventions_warn:1;
|
||||
unsigned ARB_texture_rectangle_enable:1;
|
||||
unsigned ARB_texture_rectangle_warn:1;
|
||||
unsigned EXT_texture_array_enable:1;
|
||||
unsigned EXT_texture_array_warn:1;
|
||||
unsigned ARB_shader_stencil_export_enable:1;
|
||||
unsigned ARB_shader_stencil_export_warn:1;
|
||||
/*@}*/
|
||||
|
||||
/** Extensions supported by the OpenGL implementation. */
|
||||
const struct gl_extensions *extensions;
|
||||
|
||||
/** Shaders containing built-in functions that are used for linking. */
|
||||
struct gl_shader *builtins_to_link[16];
|
||||
unsigned num_builtins_to_link;
|
||||
};
|
||||
|
||||
typedef struct YYLTYPE {
|
||||
int first_line;
|
||||
int first_column;
|
||||
int last_line;
|
||||
int last_column;
|
||||
unsigned source;
|
||||
} YYLTYPE;
|
||||
# define YYLTYPE_IS_DECLARED 1
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do { \
|
||||
if (N) \
|
||||
{ \
|
||||
(Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
|
||||
(Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
|
||||
(Current).last_line = YYRHSLOC(Rhs, N).last_line; \
|
||||
(Current).last_column = YYRHSLOC(Rhs, N).last_column; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).first_line = (Current).last_line = \
|
||||
YYRHSLOC(Rhs, 0).last_line; \
|
||||
(Current).first_column = (Current).last_column = \
|
||||
YYRHSLOC(Rhs, 0).last_column; \
|
||||
} \
|
||||
(Current).source = 0; \
|
||||
} while (0)
|
||||
|
||||
extern void _mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state,
|
||||
const char *fmt, ...);
|
||||
|
||||
/**
|
||||
* Emit a warning to the shader log
|
||||
*
|
||||
* \sa _mesa_glsl_error
|
||||
*/
|
||||
extern void _mesa_glsl_warning(const YYLTYPE *locp,
|
||||
_mesa_glsl_parse_state *state,
|
||||
const char *fmt, ...);
|
||||
|
||||
extern void _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state,
|
||||
const char *string);
|
||||
|
||||
extern void _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state);
|
||||
|
||||
union YYSTYPE;
|
||||
extern int _mesa_glsl_lex(union YYSTYPE *yylval, YYLTYPE *yylloc,
|
||||
void *scanner);
|
||||
|
||||
extern int _mesa_glsl_parse(struct _mesa_glsl_parse_state *);
|
||||
|
||||
/**
|
||||
* Process elements of the #extension directive
|
||||
*
|
||||
* \return
|
||||
* If \c name and \c behavior are valid, \c true is returned. Otherwise
|
||||
* \c false is returned.
|
||||
*/
|
||||
extern bool _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp,
|
||||
const char *behavior,
|
||||
YYLTYPE *behavior_locp,
|
||||
_mesa_glsl_parse_state *state);
|
||||
|
||||
/**
|
||||
* Get the textual name of the specified shader target
|
||||
*/
|
||||
extern const char *
|
||||
_mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target);
|
||||
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/*
|
||||
* These definitions apply to C and C++
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int preprocess(void *ctx, const char **shader, char **info_log,
|
||||
const struct gl_extensions *extensions, int api);
|
||||
|
||||
extern void _mesa_destroy_shader_compiler();
|
||||
extern void _mesa_destroy_shader_compiler_caches();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* GLSL_PARSER_EXTRAS_H */
|
||||
@@ -1,164 +0,0 @@
|
||||
/* -*- c++ -*- */
|
||||
/*
|
||||
* Copyright © 2010 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 "glsl_symbol_table.h"
|
||||
|
||||
class symbol_table_entry {
|
||||
public:
|
||||
/* Callers of this ralloc-based new need not call delete. It's
|
||||
* easier to just ralloc_free 'ctx' (or any of its ancestors). */
|
||||
static void* operator new(size_t size, void *ctx)
|
||||
{
|
||||
void *entry = ralloc_size(ctx, size);
|
||||
assert(entry != NULL);
|
||||
return entry;
|
||||
}
|
||||
|
||||
/* If the user *does* call delete, that's OK, we will just ralloc_free. */
|
||||
static void operator delete(void *entry)
|
||||
{
|
||||
ralloc_free(entry);
|
||||
}
|
||||
|
||||
symbol_table_entry(ir_variable *v) : v(v), f(0), t(0) {}
|
||||
symbol_table_entry(ir_function *f) : v(0), f(f), t(0) {}
|
||||
symbol_table_entry(const glsl_type *t) : v(0), f(0), t(t) {}
|
||||
|
||||
ir_variable *v;
|
||||
ir_function *f;
|
||||
const glsl_type *t;
|
||||
};
|
||||
|
||||
glsl_symbol_table::glsl_symbol_table()
|
||||
{
|
||||
this->language_version = 120;
|
||||
this->table = _mesa_symbol_table_ctor();
|
||||
this->mem_ctx = ralloc_context(NULL);
|
||||
}
|
||||
|
||||
glsl_symbol_table::~glsl_symbol_table()
|
||||
{
|
||||
_mesa_symbol_table_dtor(table);
|
||||
ralloc_free(mem_ctx);
|
||||
}
|
||||
|
||||
void glsl_symbol_table::push_scope()
|
||||
{
|
||||
_mesa_symbol_table_push_scope(table);
|
||||
}
|
||||
|
||||
void glsl_symbol_table::pop_scope()
|
||||
{
|
||||
_mesa_symbol_table_pop_scope(table);
|
||||
}
|
||||
|
||||
bool glsl_symbol_table::name_declared_this_scope(const char *name)
|
||||
{
|
||||
return _mesa_symbol_table_symbol_scope(table, -1, name) == 0;
|
||||
}
|
||||
|
||||
bool glsl_symbol_table::add_variable(ir_variable *v)
|
||||
{
|
||||
if (this->language_version == 110) {
|
||||
/* In 1.10, functions and variables have separate namespaces. */
|
||||
symbol_table_entry *existing = get_entry(v->name);
|
||||
if (name_declared_this_scope(v->name)) {
|
||||
/* If there's already an existing function (not a constructor!) in
|
||||
* the current scope, just update the existing entry to include 'v'.
|
||||
*/
|
||||
if (existing->v == NULL && existing->t == NULL) {
|
||||
existing->v = v;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
/* If not declared at this scope, add a new entry. But if an existing
|
||||
* entry includes a function, propagate that to this block - otherwise
|
||||
* the new variable declaration would shadow the function.
|
||||
*/
|
||||
symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(v);
|
||||
if (existing != NULL)
|
||||
entry->f = existing->f;
|
||||
int added = _mesa_symbol_table_add_symbol(table, -1, v->name, entry);
|
||||
assert(added == 0);
|
||||
(void)added;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 1.20+ rules: */
|
||||
symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(v);
|
||||
return _mesa_symbol_table_add_symbol(table, -1, v->name, entry) == 0;
|
||||
}
|
||||
|
||||
bool glsl_symbol_table::add_type(const char *name, const glsl_type *t)
|
||||
{
|
||||
symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(t);
|
||||
return _mesa_symbol_table_add_symbol(table, -1, name, entry) == 0;
|
||||
}
|
||||
|
||||
bool glsl_symbol_table::add_function(ir_function *f)
|
||||
{
|
||||
if (this->language_version == 110 && name_declared_this_scope(f->name)) {
|
||||
/* In 1.10, functions and variables have separate namespaces. */
|
||||
symbol_table_entry *existing = get_entry(f->name);
|
||||
if ((existing->f == NULL) && (existing->t == NULL)) {
|
||||
existing->f = f;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(f);
|
||||
return _mesa_symbol_table_add_symbol(table, -1, f->name, entry) == 0;
|
||||
}
|
||||
|
||||
void glsl_symbol_table::add_global_function(ir_function *f)
|
||||
{
|
||||
symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(f);
|
||||
int added = _mesa_symbol_table_add_global_symbol(table, -1, f->name, entry);
|
||||
assert(added == 0);
|
||||
}
|
||||
|
||||
ir_variable *glsl_symbol_table::get_variable(const char *name)
|
||||
{
|
||||
symbol_table_entry *entry = get_entry(name);
|
||||
return entry != NULL ? entry->v : NULL;
|
||||
}
|
||||
|
||||
const glsl_type *glsl_symbol_table::get_type(const char *name)
|
||||
{
|
||||
symbol_table_entry *entry = get_entry(name);
|
||||
return entry != NULL ? entry->t : NULL;
|
||||
}
|
||||
|
||||
ir_function *glsl_symbol_table::get_function(const char *name)
|
||||
{
|
||||
symbol_table_entry *entry = get_entry(name);
|
||||
return entry != NULL ? entry->f : NULL;
|
||||
}
|
||||
|
||||
symbol_table_entry *glsl_symbol_table::get_entry(const char *name)
|
||||
{
|
||||
return (symbol_table_entry *)
|
||||
_mesa_symbol_table_find_symbol(table, -1, name);
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
/* -*- c++ -*- */
|
||||
/*
|
||||
* Copyright © 2010 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef GLSL_SYMBOL_TABLE
|
||||
#define GLSL_SYMBOL_TABLE
|
||||
|
||||
#include <new>
|
||||
|
||||
extern "C" {
|
||||
#include "program/symbol_table.h"
|
||||
}
|
||||
#include "ir.h"
|
||||
#include "glsl_types.h"
|
||||
|
||||
class symbol_table_entry;
|
||||
|
||||
/**
|
||||
* Facade class for _mesa_symbol_table
|
||||
*
|
||||
* Wraps the existing \c _mesa_symbol_table data structure to enforce some
|
||||
* type safe and some symbol table invariants.
|
||||
*/
|
||||
struct glsl_symbol_table {
|
||||
private:
|
||||
static void
|
||||
_glsl_symbol_table_destructor (glsl_symbol_table *table)
|
||||
{
|
||||
table->~glsl_symbol_table();
|
||||
}
|
||||
|
||||
public:
|
||||
/* Callers of this ralloc-based new need not call delete. It's
|
||||
* easier to just ralloc_free 'ctx' (or any of its ancestors). */
|
||||
static void* operator new(size_t size, void *ctx)
|
||||
{
|
||||
void *table;
|
||||
|
||||
table = ralloc_size(ctx, size);
|
||||
assert(table != NULL);
|
||||
|
||||
ralloc_set_destructor(table, (void (*)(void*)) _glsl_symbol_table_destructor);
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
/* If the user *does* call delete, that's OK, we will just
|
||||
* ralloc_free in that case. Here, C++ will have already called the
|
||||
* destructor so tell ralloc not to do that again. */
|
||||
static void operator delete(void *table)
|
||||
{
|
||||
ralloc_set_destructor(table, NULL);
|
||||
ralloc_free(table);
|
||||
}
|
||||
|
||||
glsl_symbol_table();
|
||||
~glsl_symbol_table();
|
||||
|
||||
unsigned int language_version;
|
||||
|
||||
void push_scope();
|
||||
void pop_scope();
|
||||
|
||||
/**
|
||||
* Determine whether a name was declared at the current scope
|
||||
*/
|
||||
bool name_declared_this_scope(const char *name);
|
||||
|
||||
/**
|
||||
* \name Methods to add symbols to the table
|
||||
*
|
||||
* There is some temptation to rename all these functions to \c add_symbol
|
||||
* or similar. However, this breaks symmetry with the getter functions and
|
||||
* reduces the clarity of the intention of code that uses these methods.
|
||||
*/
|
||||
/*@{*/
|
||||
bool add_variable(ir_variable *v);
|
||||
bool add_type(const char *name, const glsl_type *t);
|
||||
bool add_function(ir_function *f);
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* Add an function at global scope without checking for scoping conflicts.
|
||||
*/
|
||||
void add_global_function(ir_function *f);
|
||||
|
||||
/**
|
||||
* \name Methods to get symbols from the table
|
||||
*/
|
||||
/*@{*/
|
||||
ir_variable *get_variable(const char *name);
|
||||
const glsl_type *get_type(const char *name);
|
||||
ir_function *get_function(const char *name);
|
||||
/*@}*/
|
||||
|
||||
private:
|
||||
symbol_table_entry *get_entry(const char *name);
|
||||
|
||||
struct _mesa_symbol_table *table;
|
||||
void *mem_ctx;
|
||||
};
|
||||
|
||||
#endif /* GLSL_SYMBOL_TABLE */
|
||||
@@ -1,497 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2009 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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "main/core.h" /* for Elements */
|
||||
#include "glsl_symbol_table.h"
|
||||
#include "glsl_parser_extras.h"
|
||||
#include "glsl_types.h"
|
||||
#include "builtin_types.h"
|
||||
extern "C" {
|
||||
#include "program/hash_table.h"
|
||||
}
|
||||
|
||||
hash_table *glsl_type::array_types = NULL;
|
||||
hash_table *glsl_type::record_types = NULL;
|
||||
void *glsl_type::mem_ctx = NULL;
|
||||
|
||||
void
|
||||
glsl_type::init_ralloc_type_ctx(void)
|
||||
{
|
||||
if (glsl_type::mem_ctx == NULL) {
|
||||
glsl_type::mem_ctx = ralloc_autofree_context();
|
||||
assert(glsl_type::mem_ctx != NULL);
|
||||
}
|
||||
}
|
||||
|
||||
glsl_type::glsl_type(GLenum gl_type,
|
||||
glsl_base_type base_type, unsigned vector_elements,
|
||||
unsigned matrix_columns, const char *name) :
|
||||
gl_type(gl_type),
|
||||
base_type(base_type),
|
||||
sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
|
||||
sampler_type(0),
|
||||
vector_elements(vector_elements), matrix_columns(matrix_columns),
|
||||
length(0)
|
||||
{
|
||||
init_ralloc_type_ctx();
|
||||
this->name = ralloc_strdup(this->mem_ctx, name);
|
||||
/* Neither dimension is zero or both dimensions are zero.
|
||||
*/
|
||||
assert((vector_elements == 0) == (matrix_columns == 0));
|
||||
memset(& fields, 0, sizeof(fields));
|
||||
}
|
||||
|
||||
glsl_type::glsl_type(GLenum gl_type,
|
||||
enum glsl_sampler_dim dim, bool shadow, bool array,
|
||||
unsigned type, const char *name) :
|
||||
gl_type(gl_type),
|
||||
base_type(GLSL_TYPE_SAMPLER),
|
||||
sampler_dimensionality(dim), sampler_shadow(shadow),
|
||||
sampler_array(array), sampler_type(type),
|
||||
vector_elements(0), matrix_columns(0),
|
||||
length(0)
|
||||
{
|
||||
init_ralloc_type_ctx();
|
||||
this->name = ralloc_strdup(this->mem_ctx, name);
|
||||
memset(& fields, 0, sizeof(fields));
|
||||
}
|
||||
|
||||
glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
|
||||
const char *name) :
|
||||
base_type(GLSL_TYPE_STRUCT),
|
||||
sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
|
||||
sampler_type(0),
|
||||
vector_elements(0), matrix_columns(0),
|
||||
length(num_fields)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
init_ralloc_type_ctx();
|
||||
this->name = ralloc_strdup(this->mem_ctx, name);
|
||||
this->fields.structure = ralloc_array(this->mem_ctx,
|
||||
glsl_struct_field, length);
|
||||
for (i = 0; i < length; i++) {
|
||||
this->fields.structure[i].type = fields[i].type;
|
||||
this->fields.structure[i].name = ralloc_strdup(this->fields.structure,
|
||||
fields[i].name);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
add_types_to_symbol_table(glsl_symbol_table *symtab,
|
||||
const struct glsl_type *types,
|
||||
unsigned num_types, bool warn)
|
||||
{
|
||||
(void) warn;
|
||||
|
||||
for (unsigned i = 0; i < num_types; i++) {
|
||||
symtab->add_type(types[i].name, & types[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
glsl_type::generate_100ES_types(glsl_symbol_table *symtab)
|
||||
{
|
||||
add_types_to_symbol_table(symtab, builtin_core_types,
|
||||
Elements(builtin_core_types),
|
||||
false);
|
||||
add_types_to_symbol_table(symtab, builtin_structure_types,
|
||||
Elements(builtin_structure_types),
|
||||
false);
|
||||
add_types_to_symbol_table(symtab, void_type, 1, false);
|
||||
}
|
||||
|
||||
void
|
||||
glsl_type::generate_110_types(glsl_symbol_table *symtab)
|
||||
{
|
||||
generate_100ES_types(symtab);
|
||||
|
||||
add_types_to_symbol_table(symtab, builtin_110_types,
|
||||
Elements(builtin_110_types),
|
||||
false);
|
||||
add_types_to_symbol_table(symtab, builtin_110_deprecated_structure_types,
|
||||
Elements(builtin_110_deprecated_structure_types),
|
||||
false);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
glsl_type::generate_120_types(glsl_symbol_table *symtab)
|
||||
{
|
||||
generate_110_types(symtab);
|
||||
|
||||
add_types_to_symbol_table(symtab, builtin_120_types,
|
||||
Elements(builtin_120_types), false);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
glsl_type::generate_130_types(glsl_symbol_table *symtab)
|
||||
{
|
||||
generate_120_types(symtab);
|
||||
|
||||
add_types_to_symbol_table(symtab, builtin_130_types,
|
||||
Elements(builtin_130_types), false);
|
||||
generate_EXT_texture_array_types(symtab, false);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
glsl_type::generate_ARB_texture_rectangle_types(glsl_symbol_table *symtab,
|
||||
bool warn)
|
||||
{
|
||||
add_types_to_symbol_table(symtab, builtin_ARB_texture_rectangle_types,
|
||||
Elements(builtin_ARB_texture_rectangle_types),
|
||||
warn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
glsl_type::generate_EXT_texture_array_types(glsl_symbol_table *symtab,
|
||||
bool warn)
|
||||
{
|
||||
add_types_to_symbol_table(symtab, builtin_EXT_texture_array_types,
|
||||
Elements(builtin_EXT_texture_array_types),
|
||||
warn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
switch (state->language_version) {
|
||||
case 100:
|
||||
assert(state->es_shader);
|
||||
glsl_type::generate_100ES_types(state->symbols);
|
||||
break;
|
||||
case 110:
|
||||
glsl_type::generate_110_types(state->symbols);
|
||||
break;
|
||||
case 120:
|
||||
glsl_type::generate_120_types(state->symbols);
|
||||
break;
|
||||
case 130:
|
||||
glsl_type::generate_130_types(state->symbols);
|
||||
break;
|
||||
default:
|
||||
/* error */
|
||||
break;
|
||||
}
|
||||
|
||||
if (state->ARB_texture_rectangle_enable) {
|
||||
glsl_type::generate_ARB_texture_rectangle_types(state->symbols,
|
||||
state->ARB_texture_rectangle_warn);
|
||||
}
|
||||
|
||||
if (state->EXT_texture_array_enable && state->language_version < 130) {
|
||||
// These are already included in 130; don't create twice.
|
||||
glsl_type::generate_EXT_texture_array_types(state->symbols,
|
||||
state->EXT_texture_array_warn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const glsl_type *glsl_type::get_base_type() const
|
||||
{
|
||||
switch (base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
return uint_type;
|
||||
case GLSL_TYPE_INT:
|
||||
return int_type;
|
||||
case GLSL_TYPE_FLOAT:
|
||||
return float_type;
|
||||
case GLSL_TYPE_BOOL:
|
||||
return bool_type;
|
||||
default:
|
||||
return error_type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_glsl_release_types(void)
|
||||
{
|
||||
if (glsl_type::array_types != NULL) {
|
||||
hash_table_dtor(glsl_type::array_types);
|
||||
glsl_type::array_types = NULL;
|
||||
}
|
||||
|
||||
if (glsl_type::record_types != NULL) {
|
||||
hash_table_dtor(glsl_type::record_types);
|
||||
glsl_type::record_types = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
glsl_type::glsl_type(const glsl_type *array, unsigned length) :
|
||||
base_type(GLSL_TYPE_ARRAY),
|
||||
sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
|
||||
sampler_type(0),
|
||||
vector_elements(0), matrix_columns(0),
|
||||
name(NULL), length(length)
|
||||
{
|
||||
this->fields.array = array;
|
||||
/* Inherit the gl type of the base. The GL type is used for
|
||||
* uniform/statevar handling in Mesa and the arrayness of the type
|
||||
* is represented by the size rather than the type.
|
||||
*/
|
||||
this->gl_type = array->gl_type;
|
||||
|
||||
/* Allow a maximum of 10 characters for the array size. This is enough
|
||||
* for 32-bits of ~0. The extra 3 are for the '[', ']', and terminating
|
||||
* NUL.
|
||||
*/
|
||||
const unsigned name_length = strlen(array->name) + 10 + 3;
|
||||
char *const n = (char *) ralloc_size(this->mem_ctx, name_length);
|
||||
|
||||
if (length == 0)
|
||||
snprintf(n, name_length, "%s[]", array->name);
|
||||
else
|
||||
snprintf(n, name_length, "%s[%u]", array->name, length);
|
||||
|
||||
this->name = n;
|
||||
}
|
||||
|
||||
|
||||
const glsl_type *
|
||||
glsl_type::get_instance(unsigned base_type, unsigned rows, unsigned columns)
|
||||
{
|
||||
if (base_type == GLSL_TYPE_VOID)
|
||||
return void_type;
|
||||
|
||||
if ((rows < 1) || (rows > 4) || (columns < 1) || (columns > 4))
|
||||
return error_type;
|
||||
|
||||
/* Treat GLSL vectors as Nx1 matrices.
|
||||
*/
|
||||
if (columns == 1) {
|
||||
switch (base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
return uint_type + (rows - 1);
|
||||
case GLSL_TYPE_INT:
|
||||
return int_type + (rows - 1);
|
||||
case GLSL_TYPE_FLOAT:
|
||||
return float_type + (rows - 1);
|
||||
case GLSL_TYPE_BOOL:
|
||||
return bool_type + (rows - 1);
|
||||
default:
|
||||
return error_type;
|
||||
}
|
||||
} else {
|
||||
if ((base_type != GLSL_TYPE_FLOAT) || (rows == 1))
|
||||
return error_type;
|
||||
|
||||
/* GLSL matrix types are named mat{COLUMNS}x{ROWS}. Only the following
|
||||
* combinations are valid:
|
||||
*
|
||||
* 1 2 3 4
|
||||
* 1
|
||||
* 2 x x x
|
||||
* 3 x x x
|
||||
* 4 x x x
|
||||
*/
|
||||
#define IDX(c,r) (((c-1)*3) + (r-1))
|
||||
|
||||
switch (IDX(columns, rows)) {
|
||||
case IDX(2,2): return mat2_type;
|
||||
case IDX(2,3): return mat2x3_type;
|
||||
case IDX(2,4): return mat2x4_type;
|
||||
case IDX(3,2): return mat3x2_type;
|
||||
case IDX(3,3): return mat3_type;
|
||||
case IDX(3,4): return mat3x4_type;
|
||||
case IDX(4,2): return mat4x2_type;
|
||||
case IDX(4,3): return mat4x3_type;
|
||||
case IDX(4,4): return mat4_type;
|
||||
default: return error_type;
|
||||
}
|
||||
}
|
||||
|
||||
assert(!"Should not get here.");
|
||||
return error_type;
|
||||
}
|
||||
|
||||
|
||||
const glsl_type *
|
||||
glsl_type::get_array_instance(const glsl_type *base, unsigned array_size)
|
||||
{
|
||||
|
||||
if (array_types == NULL) {
|
||||
array_types = hash_table_ctor(64, hash_table_string_hash,
|
||||
hash_table_string_compare);
|
||||
}
|
||||
|
||||
/* Generate a name using the base type pointer in the key. This is
|
||||
* done because the name of the base type may not be unique across
|
||||
* shaders. For example, two shaders may have different record types
|
||||
* named 'foo'.
|
||||
*/
|
||||
char key[128];
|
||||
snprintf(key, sizeof(key), "%p[%u]", (void *) base, array_size);
|
||||
|
||||
const glsl_type *t = (glsl_type *) hash_table_find(array_types, key);
|
||||
if (t == NULL) {
|
||||
t = new glsl_type(base, array_size);
|
||||
|
||||
hash_table_insert(array_types, (void *) t, ralloc_strdup(mem_ctx, key));
|
||||
}
|
||||
|
||||
assert(t->base_type == GLSL_TYPE_ARRAY);
|
||||
assert(t->length == array_size);
|
||||
assert(t->fields.array == base);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
glsl_type::record_key_compare(const void *a, const void *b)
|
||||
{
|
||||
const glsl_type *const key1 = (glsl_type *) a;
|
||||
const glsl_type *const key2 = (glsl_type *) b;
|
||||
|
||||
/* Return zero is the types match (there is zero difference) or non-zero
|
||||
* otherwise.
|
||||
*/
|
||||
if (strcmp(key1->name, key2->name) != 0)
|
||||
return 1;
|
||||
|
||||
if (key1->length != key2->length)
|
||||
return 1;
|
||||
|
||||
for (unsigned i = 0; i < key1->length; i++) {
|
||||
if (key1->fields.structure[i].type != key2->fields.structure[i].type)
|
||||
return 1;
|
||||
if (strcmp(key1->fields.structure[i].name,
|
||||
key2->fields.structure[i].name) != 0)
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
unsigned
|
||||
glsl_type::record_key_hash(const void *a)
|
||||
{
|
||||
const glsl_type *const key = (glsl_type *) a;
|
||||
char hash_key[128];
|
||||
unsigned size = 0;
|
||||
|
||||
size = snprintf(hash_key, sizeof(hash_key), "%08x", key->length);
|
||||
|
||||
for (unsigned i = 0; i < key->length; i++) {
|
||||
if (size >= sizeof(hash_key))
|
||||
break;
|
||||
|
||||
size += snprintf(& hash_key[size], sizeof(hash_key) - size,
|
||||
"%p", (void *) key->fields.structure[i].type);
|
||||
}
|
||||
|
||||
return hash_table_string_hash(& hash_key);
|
||||
}
|
||||
|
||||
|
||||
const glsl_type *
|
||||
glsl_type::get_record_instance(const glsl_struct_field *fields,
|
||||
unsigned num_fields,
|
||||
const char *name)
|
||||
{
|
||||
const glsl_type key(fields, num_fields, name);
|
||||
|
||||
if (record_types == NULL) {
|
||||
record_types = hash_table_ctor(64, record_key_hash, record_key_compare);
|
||||
}
|
||||
|
||||
const glsl_type *t = (glsl_type *) hash_table_find(record_types, & key);
|
||||
if (t == NULL) {
|
||||
t = new glsl_type(fields, num_fields, name);
|
||||
|
||||
hash_table_insert(record_types, (void *) t, t);
|
||||
}
|
||||
|
||||
assert(t->base_type == GLSL_TYPE_STRUCT);
|
||||
assert(t->length == num_fields);
|
||||
assert(strcmp(t->name, name) == 0);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
const glsl_type *
|
||||
glsl_type::field_type(const char *name) const
|
||||
{
|
||||
if (this->base_type != GLSL_TYPE_STRUCT)
|
||||
return error_type;
|
||||
|
||||
for (unsigned i = 0; i < this->length; i++) {
|
||||
if (strcmp(name, this->fields.structure[i].name) == 0)
|
||||
return this->fields.structure[i].type;
|
||||
}
|
||||
|
||||
return error_type;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
glsl_type::field_index(const char *name) const
|
||||
{
|
||||
if (this->base_type != GLSL_TYPE_STRUCT)
|
||||
return -1;
|
||||
|
||||
for (unsigned i = 0; i < this->length; i++) {
|
||||
if (strcmp(name, this->fields.structure[i].name) == 0)
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
unsigned
|
||||
glsl_type::component_slots() const
|
||||
{
|
||||
switch (this->base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
case GLSL_TYPE_INT:
|
||||
case GLSL_TYPE_FLOAT:
|
||||
case GLSL_TYPE_BOOL:
|
||||
return this->components();
|
||||
|
||||
case GLSL_TYPE_STRUCT: {
|
||||
unsigned size = 0;
|
||||
|
||||
for (unsigned i = 0; i < this->length; i++)
|
||||
size += this->fields.structure[i].type->component_slots();
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
case GLSL_TYPE_ARRAY:
|
||||
return this->length * this->fields.array->component_slots();
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1,476 +0,0 @@
|
||||
/* -*- c++ -*- */
|
||||
/*
|
||||
* Copyright © 2009 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef GLSL_TYPES_H
|
||||
#define GLSL_TYPES_H
|
||||
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
extern "C" {
|
||||
#include "GL/gl.h"
|
||||
}
|
||||
|
||||
#include "ralloc.h"
|
||||
|
||||
struct _mesa_glsl_parse_state;
|
||||
struct glsl_symbol_table;
|
||||
|
||||
extern "C" void
|
||||
_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state);
|
||||
|
||||
extern "C" void
|
||||
_mesa_glsl_release_types(void);
|
||||
|
||||
enum glsl_base_type {
|
||||
GLSL_TYPE_UINT = 0,
|
||||
GLSL_TYPE_INT,
|
||||
GLSL_TYPE_FLOAT,
|
||||
GLSL_TYPE_BOOL,
|
||||
GLSL_TYPE_SAMPLER,
|
||||
GLSL_TYPE_STRUCT,
|
||||
GLSL_TYPE_ARRAY,
|
||||
GLSL_TYPE_VOID,
|
||||
GLSL_TYPE_ERROR
|
||||
};
|
||||
|
||||
enum glsl_sampler_dim {
|
||||
GLSL_SAMPLER_DIM_1D = 0,
|
||||
GLSL_SAMPLER_DIM_2D,
|
||||
GLSL_SAMPLER_DIM_3D,
|
||||
GLSL_SAMPLER_DIM_CUBE,
|
||||
GLSL_SAMPLER_DIM_RECT,
|
||||
GLSL_SAMPLER_DIM_BUF
|
||||
};
|
||||
|
||||
|
||||
struct glsl_type {
|
||||
GLenum gl_type;
|
||||
glsl_base_type base_type;
|
||||
|
||||
unsigned sampler_dimensionality:3;
|
||||
unsigned sampler_shadow:1;
|
||||
unsigned sampler_array:1;
|
||||
unsigned sampler_type:2; /**< Type of data returned using this sampler.
|
||||
* only \c GLSL_TYPE_FLOAT, \c GLSL_TYPE_INT,
|
||||
* and \c GLSL_TYPE_UINT are valid.
|
||||
*/
|
||||
|
||||
/* Callers of this ralloc-based new need not call delete. It's
|
||||
* easier to just ralloc_free 'mem_ctx' (or any of its ancestors). */
|
||||
static void* operator new(size_t size)
|
||||
{
|
||||
if (glsl_type::mem_ctx == NULL) {
|
||||
glsl_type::mem_ctx = ralloc_context(NULL);
|
||||
assert(glsl_type::mem_ctx != NULL);
|
||||
}
|
||||
|
||||
void *type;
|
||||
|
||||
type = ralloc_size(glsl_type::mem_ctx, size);
|
||||
assert(type != NULL);
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
/* If the user *does* call delete, that's OK, we will just
|
||||
* ralloc_free in that case. */
|
||||
static void operator delete(void *type)
|
||||
{
|
||||
ralloc_free(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* \name Vector and matrix element counts
|
||||
*
|
||||
* For scalars, each of these values will be 1. For non-numeric types
|
||||
* these will be 0.
|
||||
*/
|
||||
/*@{*/
|
||||
unsigned vector_elements:3; /**< 1, 2, 3, or 4 vector elements. */
|
||||
unsigned matrix_columns:3; /**< 1, 2, 3, or 4 matrix columns. */
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* Name of the data type
|
||||
*
|
||||
* This may be \c NULL for anonymous structures, for arrays, or for
|
||||
* function types.
|
||||
*/
|
||||
const char *name;
|
||||
|
||||
/**
|
||||
* For \c GLSL_TYPE_ARRAY, this is the length of the array. For
|
||||
* \c GLSL_TYPE_STRUCT, it is the number of elements in the structure and
|
||||
* the number of values pointed to by \c fields.structure (below).
|
||||
*/
|
||||
unsigned length;
|
||||
|
||||
/**
|
||||
* Subtype of composite data types.
|
||||
*/
|
||||
union {
|
||||
const struct glsl_type *array; /**< Type of array elements. */
|
||||
const struct glsl_type *parameters; /**< Parameters to function. */
|
||||
struct glsl_struct_field *structure; /**< List of struct fields. */
|
||||
} fields;
|
||||
|
||||
|
||||
/**
|
||||
* \name Pointers to various public type singletons
|
||||
*/
|
||||
/*@{*/
|
||||
static const glsl_type *const error_type;
|
||||
static const glsl_type *const void_type;
|
||||
static const glsl_type *const int_type;
|
||||
static const glsl_type *const ivec4_type;
|
||||
static const glsl_type *const uint_type;
|
||||
static const glsl_type *const uvec2_type;
|
||||
static const glsl_type *const uvec3_type;
|
||||
static const glsl_type *const uvec4_type;
|
||||
static const glsl_type *const float_type;
|
||||
static const glsl_type *const vec2_type;
|
||||
static const glsl_type *const vec3_type;
|
||||
static const glsl_type *const vec4_type;
|
||||
static const glsl_type *const bool_type;
|
||||
static const glsl_type *const mat2_type;
|
||||
static const glsl_type *const mat2x3_type;
|
||||
static const glsl_type *const mat2x4_type;
|
||||
static const glsl_type *const mat3x2_type;
|
||||
static const glsl_type *const mat3_type;
|
||||
static const glsl_type *const mat3x4_type;
|
||||
static const glsl_type *const mat4x2_type;
|
||||
static const glsl_type *const mat4x3_type;
|
||||
static const glsl_type *const mat4_type;
|
||||
/*@}*/
|
||||
|
||||
|
||||
/**
|
||||
* For numeric and boolean derrived types returns the basic scalar type
|
||||
*
|
||||
* If the type is a numeric or boolean scalar, vector, or matrix type,
|
||||
* this function gets the scalar type of the individual components. For
|
||||
* all other types, including arrays of numeric or boolean types, the
|
||||
* error type is returned.
|
||||
*/
|
||||
const glsl_type *get_base_type() const;
|
||||
|
||||
/**
|
||||
* Query the type of elements in an array
|
||||
*
|
||||
* \return
|
||||
* Pointer to the type of elements in the array for array types, or \c NULL
|
||||
* for non-array types.
|
||||
*/
|
||||
const glsl_type *element_type() const
|
||||
{
|
||||
return is_array() ? fields.array : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the instance of a built-in scalar, vector, or matrix type
|
||||
*/
|
||||
static const glsl_type *get_instance(unsigned base_type, unsigned rows,
|
||||
unsigned columns);
|
||||
|
||||
/**
|
||||
* Get the instance of an array type
|
||||
*/
|
||||
static const glsl_type *get_array_instance(const glsl_type *base,
|
||||
unsigned elements);
|
||||
|
||||
/**
|
||||
* Get the instance of a record type
|
||||
*/
|
||||
static const glsl_type *get_record_instance(const glsl_struct_field *fields,
|
||||
unsigned num_fields,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
* Query the total number of scalars that make up a scalar, vector or matrix
|
||||
*/
|
||||
unsigned components() const
|
||||
{
|
||||
return vector_elements * matrix_columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the number of components slots required to hold this type
|
||||
*
|
||||
* This is used to determine how many uniform or varying locations a type
|
||||
* might occupy.
|
||||
*/
|
||||
unsigned component_slots() const;
|
||||
|
||||
|
||||
/**
|
||||
* Query whether or not a type is a scalar (non-vector and non-matrix).
|
||||
*/
|
||||
bool is_scalar() const
|
||||
{
|
||||
return (vector_elements == 1)
|
||||
&& (base_type >= GLSL_TYPE_UINT)
|
||||
&& (base_type <= GLSL_TYPE_BOOL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether or not a type is a vector
|
||||
*/
|
||||
bool is_vector() const
|
||||
{
|
||||
return (vector_elements > 1)
|
||||
&& (matrix_columns == 1)
|
||||
&& (base_type >= GLSL_TYPE_UINT)
|
||||
&& (base_type <= GLSL_TYPE_BOOL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether or not a type is a matrix
|
||||
*/
|
||||
bool is_matrix() const
|
||||
{
|
||||
/* GLSL only has float matrices. */
|
||||
return (matrix_columns > 1) && (base_type == GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether or not a type is a non-array numeric type
|
||||
*/
|
||||
bool is_numeric() const
|
||||
{
|
||||
return (base_type >= GLSL_TYPE_UINT) && (base_type <= GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether or not a type is an integral type
|
||||
*/
|
||||
bool is_integer() const
|
||||
{
|
||||
return (base_type == GLSL_TYPE_UINT) || (base_type == GLSL_TYPE_INT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether or not a type is a float type
|
||||
*/
|
||||
bool is_float() const
|
||||
{
|
||||
return base_type == GLSL_TYPE_FLOAT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether or not a type is a non-array boolean type
|
||||
*/
|
||||
bool is_boolean() const
|
||||
{
|
||||
return base_type == GLSL_TYPE_BOOL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether or not a type is a sampler
|
||||
*/
|
||||
bool is_sampler() const
|
||||
{
|
||||
return base_type == GLSL_TYPE_SAMPLER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether or not a type is an array
|
||||
*/
|
||||
bool is_array() const
|
||||
{
|
||||
return base_type == GLSL_TYPE_ARRAY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether or not a type is a record
|
||||
*/
|
||||
bool is_record() const
|
||||
{
|
||||
return base_type == GLSL_TYPE_STRUCT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether or not a type is the void type singleton.
|
||||
*/
|
||||
bool is_void() const
|
||||
{
|
||||
return base_type == GLSL_TYPE_VOID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether or not a type is the error type singleton.
|
||||
*/
|
||||
bool is_error() const
|
||||
{
|
||||
return base_type == GLSL_TYPE_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query the full type of a matrix row
|
||||
*
|
||||
* \return
|
||||
* If the type is not a matrix, \c glsl_type::error_type is returned.
|
||||
* Otherwise a type matching the rows of the matrix is returned.
|
||||
*/
|
||||
const glsl_type *row_type() const
|
||||
{
|
||||
return is_matrix()
|
||||
? get_instance(base_type, matrix_columns, 1)
|
||||
: error_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query the full type of a matrix column
|
||||
*
|
||||
* \return
|
||||
* If the type is not a matrix, \c glsl_type::error_type is returned.
|
||||
* Otherwise a type matching the columns of the matrix is returned.
|
||||
*/
|
||||
const glsl_type *column_type() const
|
||||
{
|
||||
return is_matrix()
|
||||
? get_instance(base_type, vector_elements, 1)
|
||||
: error_type;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the type of a structure field
|
||||
*
|
||||
* \return
|
||||
* Pointer to the type of the named field. If the type is not a structure
|
||||
* or the named field does not exist, \c glsl_type::error_type is returned.
|
||||
*/
|
||||
const glsl_type *field_type(const char *name) const;
|
||||
|
||||
|
||||
/**
|
||||
* Get the location of a filed within a record type
|
||||
*/
|
||||
int field_index(const char *name) const;
|
||||
|
||||
|
||||
/**
|
||||
* Query the number of elements in an array type
|
||||
*
|
||||
* \return
|
||||
* The number of elements in the array for array types or -1 for non-array
|
||||
* types. If the number of elements in the array has not yet been declared,
|
||||
* zero is returned.
|
||||
*/
|
||||
int array_size() const
|
||||
{
|
||||
return is_array() ? length : -1;
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* ralloc context for all glsl_type allocations
|
||||
*
|
||||
* Set on the first call to \c glsl_type::new.
|
||||
*/
|
||||
static void *mem_ctx;
|
||||
|
||||
void init_ralloc_type_ctx(void);
|
||||
|
||||
/** Constructor for vector and matrix types */
|
||||
glsl_type(GLenum gl_type,
|
||||
glsl_base_type base_type, unsigned vector_elements,
|
||||
unsigned matrix_columns, const char *name);
|
||||
|
||||
/** Constructor for sampler types */
|
||||
glsl_type(GLenum gl_type,
|
||||
enum glsl_sampler_dim dim, bool shadow, bool array,
|
||||
unsigned type, const char *name);
|
||||
|
||||
/** Constructor for record types */
|
||||
glsl_type(const glsl_struct_field *fields, unsigned num_fields,
|
||||
const char *name);
|
||||
|
||||
/** Constructor for array types */
|
||||
glsl_type(const glsl_type *array, unsigned length);
|
||||
|
||||
/** Hash table containing the known array types. */
|
||||
static struct hash_table *array_types;
|
||||
|
||||
/** Hash table containing the known record types. */
|
||||
static struct hash_table *record_types;
|
||||
|
||||
static int record_key_compare(const void *a, const void *b);
|
||||
static unsigned record_key_hash(const void *key);
|
||||
|
||||
/**
|
||||
* \name Pointers to various type singletons
|
||||
*/
|
||||
/*@{*/
|
||||
static const glsl_type _error_type;
|
||||
static const glsl_type _void_type;
|
||||
static const glsl_type builtin_core_types[];
|
||||
static const glsl_type builtin_structure_types[];
|
||||
static const glsl_type builtin_110_deprecated_structure_types[];
|
||||
static const glsl_type builtin_110_types[];
|
||||
static const glsl_type builtin_120_types[];
|
||||
static const glsl_type builtin_130_types[];
|
||||
static const glsl_type builtin_ARB_texture_rectangle_types[];
|
||||
static const glsl_type builtin_EXT_texture_array_types[];
|
||||
static const glsl_type builtin_EXT_texture_buffer_object_types[];
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* \name Methods to populate a symbol table with built-in types.
|
||||
*
|
||||
* \internal
|
||||
* This is one of the truely annoying things about C++. Methods that are
|
||||
* completely internal and private to a type still have to be advertised to
|
||||
* the world in a public header file.
|
||||
*/
|
||||
/*@{*/
|
||||
static void generate_100ES_types(glsl_symbol_table *);
|
||||
static void generate_110_types(glsl_symbol_table *);
|
||||
static void generate_120_types(glsl_symbol_table *);
|
||||
static void generate_130_types(glsl_symbol_table *);
|
||||
static void generate_ARB_texture_rectangle_types(glsl_symbol_table *, bool);
|
||||
static void generate_EXT_texture_array_types(glsl_symbol_table *, bool);
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* \name Friend functions.
|
||||
*
|
||||
* These functions are friends because they must have C linkage and the
|
||||
* need to call various private methods or access various private static
|
||||
* data.
|
||||
*/
|
||||
/*@{*/
|
||||
friend void _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *);
|
||||
friend void _mesa_glsl_release_types(void);
|
||||
/*@}*/
|
||||
};
|
||||
|
||||
struct glsl_struct_field {
|
||||
const struct glsl_type *type;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
#endif /* GLSL_TYPES_H */
|
||||
@@ -1,102 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 "program/symbol_table.h"
|
||||
#include "glsl_parser_extras.h"
|
||||
#include "ast.h"
|
||||
#include "glsl_types.h"
|
||||
|
||||
ir_rvalue *
|
||||
_mesa_ast_field_selection_to_hir(const ast_expression *expr,
|
||||
exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
void *ctx = state;
|
||||
ir_rvalue *result = NULL;
|
||||
ir_rvalue *op;
|
||||
|
||||
op = expr->subexpressions[0]->hir(instructions, state);
|
||||
|
||||
/* There are two kinds of field selection. There is the selection of a
|
||||
* specific field from a structure, and there is the selection of a
|
||||
* swizzle / mask from a vector. Which is which is determined entirely
|
||||
* by the base type of the thing to which the field selection operator is
|
||||
* being applied.
|
||||
*/
|
||||
YYLTYPE loc = expr->get_location();
|
||||
if (op->type->is_error()) {
|
||||
/* silently propagate the error */
|
||||
} else if (op->type->is_vector()) {
|
||||
ir_swizzle *swiz = ir_swizzle::create(op,
|
||||
expr->primary_expression.identifier,
|
||||
op->type->vector_elements);
|
||||
if (swiz != NULL) {
|
||||
result = swiz;
|
||||
} else {
|
||||
/* FINISHME: Logging of error messages should be moved into
|
||||
* FINISHME: ir_swizzle::create. This allows the generation of more
|
||||
* FINISHME: specific error messages.
|
||||
*/
|
||||
_mesa_glsl_error(& loc, state, "Invalid swizzle / mask `%s'",
|
||||
expr->primary_expression.identifier);
|
||||
}
|
||||
} else if (op->type->base_type == GLSL_TYPE_STRUCT) {
|
||||
result = new(ctx) ir_dereference_record(op,
|
||||
expr->primary_expression.identifier);
|
||||
|
||||
if (result->type->is_error()) {
|
||||
_mesa_glsl_error(& loc, state, "Cannot access field `%s' of "
|
||||
"structure",
|
||||
expr->primary_expression.identifier);
|
||||
}
|
||||
} else if (expr->subexpressions[1] != NULL) {
|
||||
/* Handle "method calls" in GLSL 1.20 - namely, array.length() */
|
||||
if (state->language_version < 120)
|
||||
_mesa_glsl_error(&loc, state, "Methods not supported in GLSL 1.10.");
|
||||
|
||||
ast_expression *call = expr->subexpressions[1];
|
||||
assert(call->oper == ast_function_call);
|
||||
|
||||
const char *method;
|
||||
method = call->subexpressions[0]->primary_expression.identifier;
|
||||
|
||||
if (op->type->is_array() && strcmp(method, "length") == 0) {
|
||||
if (!call->expressions.is_empty())
|
||||
_mesa_glsl_error(&loc, state, "length method takes no arguments.");
|
||||
|
||||
if (op->type->array_size() == 0)
|
||||
_mesa_glsl_error(&loc, state, "length called on unsized array.");
|
||||
|
||||
result = new(ctx) ir_constant(op->type->array_size());
|
||||
} else {
|
||||
_mesa_glsl_error(&loc, state, "Unknown method: `%s'.", method);
|
||||
}
|
||||
} else {
|
||||
_mesa_glsl_error(& loc, state, "Cannot access field `%s' of "
|
||||
"non-structure / non-vector.",
|
||||
expr->primary_expression.identifier);
|
||||
}
|
||||
|
||||
return result ? result : ir_call::get_error_instruction(ctx);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,149 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 ir_basic_block.cpp
|
||||
*
|
||||
* Basic block analysis of instruction streams.
|
||||
*/
|
||||
|
||||
#include "ir.h"
|
||||
#include "ir_visitor.h"
|
||||
#include "ir_basic_block.h"
|
||||
#include "glsl_types.h"
|
||||
|
||||
class ir_has_call_visitor : public ir_hierarchical_visitor {
|
||||
public:
|
||||
ir_has_call_visitor()
|
||||
{
|
||||
has_call = false;
|
||||
}
|
||||
|
||||
virtual ir_visitor_status visit_enter(ir_call *ir)
|
||||
{
|
||||
(void) ir;
|
||||
has_call = true;
|
||||
return visit_stop;
|
||||
}
|
||||
|
||||
bool has_call;
|
||||
};
|
||||
|
||||
bool
|
||||
ir_has_call(ir_instruction *ir)
|
||||
{
|
||||
ir_has_call_visitor v;
|
||||
ir->accept(&v);
|
||||
return v.has_call;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls a user function for every basic block in the instruction stream.
|
||||
*
|
||||
* Basic block analysis is pretty easy in our IR thanks to the lack of
|
||||
* unstructured control flow. We've got:
|
||||
*
|
||||
* ir_loop (for () {}, while () {}, do {} while ())
|
||||
* ir_loop_jump (
|
||||
* ir_if () {}
|
||||
* ir_return
|
||||
* ir_call()
|
||||
*
|
||||
* Note that the basic blocks returned by this don't encompass all
|
||||
* operations performed by the program -- for example, if conditions
|
||||
* don't get returned, nor do the assignments that will be generated
|
||||
* for ir_call parameters.
|
||||
*/
|
||||
void call_for_basic_blocks(exec_list *instructions,
|
||||
void (*callback)(ir_instruction *first,
|
||||
ir_instruction *last,
|
||||
void *data),
|
||||
void *data)
|
||||
{
|
||||
ir_instruction *leader = NULL;
|
||||
ir_instruction *last = NULL;
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, *instructions) {
|
||||
ir_instruction *ir = (ir_instruction *)iter.get();
|
||||
ir_if *ir_if;
|
||||
ir_loop *ir_loop;
|
||||
ir_function *ir_function;
|
||||
|
||||
if (!leader)
|
||||
leader = ir;
|
||||
|
||||
if ((ir_if = ir->as_if())) {
|
||||
callback(leader, ir, data);
|
||||
leader = NULL;
|
||||
|
||||
call_for_basic_blocks(&ir_if->then_instructions, callback, data);
|
||||
call_for_basic_blocks(&ir_if->else_instructions, callback, data);
|
||||
} else if ((ir_loop = ir->as_loop())) {
|
||||
callback(leader, ir, data);
|
||||
leader = NULL;
|
||||
call_for_basic_blocks(&ir_loop->body_instructions, callback, data);
|
||||
} else if (ir->as_return() || ir->as_call()) {
|
||||
callback(leader, ir, data);
|
||||
leader = NULL;
|
||||
} else if ((ir_function = ir->as_function())) {
|
||||
/* A function definition doesn't interrupt our basic block
|
||||
* since execution doesn't go into it. We should process the
|
||||
* bodies of its signatures for BBs, though.
|
||||
*
|
||||
* Note that we miss an opportunity for producing more
|
||||
* maximal BBs between the instructions that precede main()
|
||||
* and the body of main(). Perhaps those instructions ought
|
||||
* to live inside of main().
|
||||
*/
|
||||
foreach_iter(exec_list_iterator, fun_iter, *ir_function) {
|
||||
ir_function_signature *ir_sig;
|
||||
|
||||
ir_sig = (ir_function_signature *)fun_iter.get();
|
||||
|
||||
call_for_basic_blocks(&ir_sig->body, callback, data);
|
||||
}
|
||||
} else if (ir->as_assignment()) {
|
||||
/* If there's a call in the expression tree being assigned,
|
||||
* then that ends the BB too.
|
||||
*
|
||||
* The assumption is that any consumer of the basic block
|
||||
* walker is fine with the fact that the call is somewhere in
|
||||
* the tree even if portions of the tree may be evaluated
|
||||
* after the call.
|
||||
*
|
||||
* A consumer that has an issue with this could not process
|
||||
* the last instruction of the basic block. If doing so,
|
||||
* expression flattener may be useful before using the basic
|
||||
* block finder to get more maximal basic blocks out.
|
||||
*/
|
||||
if (ir_has_call(ir)) {
|
||||
callback(leader, ir, data);
|
||||
leader = NULL;
|
||||
}
|
||||
}
|
||||
last = ir;
|
||||
}
|
||||
if (leader) {
|
||||
callback(leader, last, data);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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.
|
||||
*/
|
||||
|
||||
void call_for_basic_blocks(exec_list *instructions,
|
||||
void (*callback)(ir_instruction *first,
|
||||
ir_instruction *last,
|
||||
void *data),
|
||||
void *data);
|
||||
@@ -1,420 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 <string.h>
|
||||
#include "main/compiler.h"
|
||||
#include "ir.h"
|
||||
#include "glsl_types.h"
|
||||
extern "C" {
|
||||
#include "program/hash_table.h"
|
||||
}
|
||||
|
||||
/**
|
||||
* Duplicate an IR variable
|
||||
*
|
||||
* \note
|
||||
* This will probably be made \c virtual and moved to the base class
|
||||
* eventually.
|
||||
*/
|
||||
ir_variable *
|
||||
ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
ir_variable *var = new(mem_ctx) ir_variable(this->type, this->name,
|
||||
(ir_variable_mode) this->mode);
|
||||
|
||||
var->max_array_access = this->max_array_access;
|
||||
var->read_only = this->read_only;
|
||||
var->centroid = this->centroid;
|
||||
var->invariant = this->invariant;
|
||||
var->interpolation = this->interpolation;
|
||||
var->array_lvalue = this->array_lvalue;
|
||||
var->location = this->location;
|
||||
var->warn_extension = this->warn_extension;
|
||||
var->origin_upper_left = this->origin_upper_left;
|
||||
var->pixel_center_integer = this->pixel_center_integer;
|
||||
var->explicit_location = this->explicit_location;
|
||||
if (this->explicit_location)
|
||||
var->location = this->location;
|
||||
|
||||
if (this->constant_value)
|
||||
var->constant_value = this->constant_value->clone(mem_ctx, ht);
|
||||
|
||||
if (ht) {
|
||||
hash_table_insert(ht, var, (void *)const_cast<ir_variable *>(this));
|
||||
}
|
||||
|
||||
return var;
|
||||
}
|
||||
|
||||
ir_swizzle *
|
||||
ir_swizzle::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
return new(mem_ctx) ir_swizzle(this->val->clone(mem_ctx, ht), this->mask);
|
||||
}
|
||||
|
||||
ir_return *
|
||||
ir_return::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
ir_rvalue *new_value = NULL;
|
||||
|
||||
if (this->value)
|
||||
new_value = this->value->clone(mem_ctx, ht);
|
||||
|
||||
return new(mem_ctx) ir_return(new_value);
|
||||
}
|
||||
|
||||
ir_discard *
|
||||
ir_discard::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
ir_rvalue *new_condition = NULL;
|
||||
|
||||
if (this->condition != NULL)
|
||||
new_condition = this->condition->clone(mem_ctx, ht);
|
||||
|
||||
return new(mem_ctx) ir_discard(new_condition);
|
||||
}
|
||||
|
||||
ir_loop_jump *
|
||||
ir_loop_jump::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
(void)ht;
|
||||
|
||||
return new(mem_ctx) ir_loop_jump(this->mode);
|
||||
}
|
||||
|
||||
ir_if *
|
||||
ir_if::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
ir_if *new_if = new(mem_ctx) ir_if(this->condition->clone(mem_ctx, ht));
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, this->then_instructions) {
|
||||
ir_instruction *ir = (ir_instruction *)iter.get();
|
||||
new_if->then_instructions.push_tail(ir->clone(mem_ctx, ht));
|
||||
}
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, this->else_instructions) {
|
||||
ir_instruction *ir = (ir_instruction *)iter.get();
|
||||
new_if->else_instructions.push_tail(ir->clone(mem_ctx, ht));
|
||||
}
|
||||
|
||||
return new_if;
|
||||
}
|
||||
|
||||
ir_loop *
|
||||
ir_loop::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
ir_loop *new_loop = new(mem_ctx) ir_loop();
|
||||
|
||||
if (this->from)
|
||||
new_loop->from = this->from->clone(mem_ctx, ht);
|
||||
if (this->to)
|
||||
new_loop->to = this->to->clone(mem_ctx, ht);
|
||||
if (this->increment)
|
||||
new_loop->increment = this->increment->clone(mem_ctx, ht);
|
||||
new_loop->counter = counter;
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, this->body_instructions) {
|
||||
ir_instruction *ir = (ir_instruction *)iter.get();
|
||||
new_loop->body_instructions.push_tail(ir->clone(mem_ctx, ht));
|
||||
}
|
||||
|
||||
new_loop->cmp = this->cmp;
|
||||
return new_loop;
|
||||
}
|
||||
|
||||
ir_call *
|
||||
ir_call::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
if (this->type == glsl_type::error_type)
|
||||
return ir_call::get_error_instruction(mem_ctx);
|
||||
|
||||
exec_list new_parameters;
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, this->actual_parameters) {
|
||||
ir_instruction *ir = (ir_instruction *)iter.get();
|
||||
new_parameters.push_tail(ir->clone(mem_ctx, ht));
|
||||
}
|
||||
|
||||
return new(mem_ctx) ir_call(this->callee, &new_parameters);
|
||||
}
|
||||
|
||||
ir_expression *
|
||||
ir_expression::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
ir_rvalue *op[Elements(this->operands)] = { NULL, };
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < get_num_operands(); i++) {
|
||||
op[i] = this->operands[i]->clone(mem_ctx, ht);
|
||||
}
|
||||
|
||||
return new(mem_ctx) ir_expression(this->operation, this->type,
|
||||
op[0], op[1], op[2], op[3]);
|
||||
}
|
||||
|
||||
ir_dereference_variable *
|
||||
ir_dereference_variable::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
ir_variable *new_var;
|
||||
|
||||
if (ht) {
|
||||
new_var = (ir_variable *)hash_table_find(ht, this->var);
|
||||
if (!new_var)
|
||||
new_var = this->var;
|
||||
} else {
|
||||
new_var = this->var;
|
||||
}
|
||||
|
||||
return new(mem_ctx) ir_dereference_variable(new_var);
|
||||
}
|
||||
|
||||
ir_dereference_array *
|
||||
ir_dereference_array::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
return new(mem_ctx) ir_dereference_array(this->array->clone(mem_ctx, ht),
|
||||
this->array_index->clone(mem_ctx,
|
||||
ht));
|
||||
}
|
||||
|
||||
ir_dereference_record *
|
||||
ir_dereference_record::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
return new(mem_ctx) ir_dereference_record(this->record->clone(mem_ctx, ht),
|
||||
this->field);
|
||||
}
|
||||
|
||||
ir_texture *
|
||||
ir_texture::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
ir_texture *new_tex = new(mem_ctx) ir_texture(this->op);
|
||||
new_tex->type = this->type;
|
||||
|
||||
new_tex->sampler = this->sampler->clone(mem_ctx, ht);
|
||||
new_tex->coordinate = this->coordinate->clone(mem_ctx, ht);
|
||||
if (this->projector)
|
||||
new_tex->projector = this->projector->clone(mem_ctx, ht);
|
||||
if (this->shadow_comparitor) {
|
||||
new_tex->shadow_comparitor = this->shadow_comparitor->clone(mem_ctx, ht);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
new_tex->offsets[i] = this->offsets[i];
|
||||
|
||||
switch (this->op) {
|
||||
case ir_tex:
|
||||
break;
|
||||
case ir_txb:
|
||||
new_tex->lod_info.bias = this->lod_info.bias->clone(mem_ctx, ht);
|
||||
break;
|
||||
case ir_txl:
|
||||
case ir_txf:
|
||||
new_tex->lod_info.lod = this->lod_info.lod->clone(mem_ctx, ht);
|
||||
break;
|
||||
case ir_txd:
|
||||
new_tex->lod_info.grad.dPdx = this->lod_info.grad.dPdx->clone(mem_ctx, ht);
|
||||
new_tex->lod_info.grad.dPdy = this->lod_info.grad.dPdy->clone(mem_ctx, ht);
|
||||
break;
|
||||
}
|
||||
|
||||
return new_tex;
|
||||
}
|
||||
|
||||
ir_assignment *
|
||||
ir_assignment::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
ir_rvalue *new_condition = NULL;
|
||||
|
||||
if (this->condition)
|
||||
new_condition = this->condition->clone(mem_ctx, ht);
|
||||
|
||||
return new(mem_ctx) ir_assignment(this->lhs->clone(mem_ctx, ht),
|
||||
this->rhs->clone(mem_ctx, ht),
|
||||
new_condition,
|
||||
this->write_mask);
|
||||
}
|
||||
|
||||
ir_function *
|
||||
ir_function::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
ir_function *copy = new(mem_ctx) ir_function(this->name);
|
||||
|
||||
foreach_list_const(node, &this->signatures) {
|
||||
const ir_function_signature *const sig =
|
||||
(const ir_function_signature *const) node;
|
||||
|
||||
ir_function_signature *sig_copy = sig->clone(mem_ctx, ht);
|
||||
copy->add_signature(sig_copy);
|
||||
|
||||
if (ht != NULL)
|
||||
hash_table_insert(ht, sig_copy,
|
||||
(void *)const_cast<ir_function_signature *>(sig));
|
||||
}
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
ir_function_signature *
|
||||
ir_function_signature::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
ir_function_signature *copy = this->clone_prototype(mem_ctx, ht);
|
||||
|
||||
copy->is_defined = this->is_defined;
|
||||
|
||||
/* Clone the instruction list.
|
||||
*/
|
||||
foreach_list_const(node, &this->body) {
|
||||
const ir_instruction *const inst = (const ir_instruction *) node;
|
||||
|
||||
ir_instruction *const inst_copy = inst->clone(mem_ctx, ht);
|
||||
copy->body.push_tail(inst_copy);
|
||||
}
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
ir_function_signature *
|
||||
ir_function_signature::clone_prototype(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
ir_function_signature *copy =
|
||||
new(mem_ctx) ir_function_signature(this->return_type);
|
||||
|
||||
copy->is_defined = false;
|
||||
copy->is_builtin = this->is_builtin;
|
||||
|
||||
/* Clone the parameter list, but NOT the body.
|
||||
*/
|
||||
foreach_list_const(node, &this->parameters) {
|
||||
const ir_variable *const param = (const ir_variable *) node;
|
||||
|
||||
assert(const_cast<ir_variable *>(param)->as_variable() != NULL);
|
||||
|
||||
ir_variable *const param_copy = param->clone(mem_ctx, ht);
|
||||
copy->parameters.push_tail(param_copy);
|
||||
}
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
ir_constant *
|
||||
ir_constant::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
(void)ht;
|
||||
|
||||
switch (this->type->base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
case GLSL_TYPE_INT:
|
||||
case GLSL_TYPE_FLOAT:
|
||||
case GLSL_TYPE_BOOL:
|
||||
return new(mem_ctx) ir_constant(this->type, &this->value);
|
||||
|
||||
case GLSL_TYPE_STRUCT: {
|
||||
ir_constant *c = new(mem_ctx) ir_constant;
|
||||
|
||||
c->type = this->type;
|
||||
for (exec_node *node = this->components.head
|
||||
; !node->is_tail_sentinel()
|
||||
; node = node->next) {
|
||||
ir_constant *const orig = (ir_constant *) node;
|
||||
|
||||
c->components.push_tail(orig->clone(mem_ctx, NULL));
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
case GLSL_TYPE_ARRAY: {
|
||||
ir_constant *c = new(mem_ctx) ir_constant;
|
||||
|
||||
c->type = this->type;
|
||||
c->array_elements = ralloc_array(c, ir_constant *, this->type->length);
|
||||
for (unsigned i = 0; i < this->type->length; i++) {
|
||||
c->array_elements[i] = this->array_elements[i]->clone(mem_ctx, NULL);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
default:
|
||||
assert(!"Should not get here.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class fixup_ir_call_visitor : public ir_hierarchical_visitor {
|
||||
public:
|
||||
fixup_ir_call_visitor(struct hash_table *ht)
|
||||
{
|
||||
this->ht = ht;
|
||||
}
|
||||
|
||||
virtual ir_visitor_status visit_enter(ir_call *ir)
|
||||
{
|
||||
/* Try to find the function signature referenced by the ir_call in the
|
||||
* table. If it is found, replace it with the value from the table.
|
||||
*/
|
||||
ir_function_signature *sig =
|
||||
(ir_function_signature *) hash_table_find(this->ht, ir->get_callee());
|
||||
if (sig != NULL)
|
||||
ir->set_callee(sig);
|
||||
|
||||
/* Since this may be used before function call parameters are flattened,
|
||||
* the children also need to be processed.
|
||||
*/
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
private:
|
||||
struct hash_table *ht;
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
fixup_function_calls(struct hash_table *ht, exec_list *instructions)
|
||||
{
|
||||
fixup_ir_call_visitor v(ht);
|
||||
v.run(instructions);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
clone_ir_list(void *mem_ctx, exec_list *out, const exec_list *in)
|
||||
{
|
||||
struct hash_table *ht =
|
||||
hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
|
||||
|
||||
foreach_list_const(node, in) {
|
||||
const ir_instruction *const original = (ir_instruction *) node;
|
||||
ir_instruction *copy = original->clone(mem_ctx, ht);
|
||||
|
||||
out->push_tail(copy);
|
||||
}
|
||||
|
||||
/* Make a pass over the cloned tree to fix up ir_call nodes to point to the
|
||||
* cloned ir_function_signature nodes. This cannot be done automatically
|
||||
* during cloning because the ir_call might be a forward reference (i.e.,
|
||||
* the function signature that it references may not have been cloned yet).
|
||||
*/
|
||||
fixup_function_calls(ht, out);
|
||||
|
||||
hash_table_dtor(ht);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,92 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 ir_expression_flattening.cpp
|
||||
*
|
||||
* Takes the leaves of expression trees and makes them dereferences of
|
||||
* assignments of the leaves to temporaries, according to a predicate.
|
||||
*
|
||||
* This is used for automatic function inlining, where we want to take
|
||||
* an expression containing a call and move the call out to its own
|
||||
* assignment so that we can inline it at the appropriate place in the
|
||||
* instruction stream.
|
||||
*/
|
||||
|
||||
#include "ir.h"
|
||||
#include "ir_visitor.h"
|
||||
#include "ir_rvalue_visitor.h"
|
||||
#include "ir_expression_flattening.h"
|
||||
#include "glsl_types.h"
|
||||
|
||||
class ir_expression_flattening_visitor : public ir_rvalue_visitor {
|
||||
public:
|
||||
ir_expression_flattening_visitor(bool (*predicate)(ir_instruction *ir))
|
||||
{
|
||||
this->predicate = predicate;
|
||||
}
|
||||
|
||||
virtual ~ir_expression_flattening_visitor()
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
|
||||
void handle_rvalue(ir_rvalue **rvalue);
|
||||
bool (*predicate)(ir_instruction *ir);
|
||||
};
|
||||
|
||||
void
|
||||
do_expression_flattening(exec_list *instructions,
|
||||
bool (*predicate)(ir_instruction *ir))
|
||||
{
|
||||
ir_expression_flattening_visitor v(predicate);
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, *instructions) {
|
||||
ir_instruction *ir = (ir_instruction *)iter.get();
|
||||
|
||||
ir->accept(&v);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ir_expression_flattening_visitor::handle_rvalue(ir_rvalue **rvalue)
|
||||
{
|
||||
ir_variable *var;
|
||||
ir_assignment *assign;
|
||||
ir_rvalue *ir = *rvalue;
|
||||
|
||||
if (!ir || !this->predicate(ir))
|
||||
return;
|
||||
|
||||
void *ctx = ralloc_parent(ir);
|
||||
|
||||
var = new(ctx) ir_variable(ir->type, "flattening_tmp", ir_var_temporary);
|
||||
base_ir->insert_before(var);
|
||||
|
||||
assign = new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var),
|
||||
ir,
|
||||
NULL);
|
||||
base_ir->insert_before(assign);
|
||||
|
||||
*rvalue = new(ctx) ir_dereference_variable(var);
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 ir_expression_flattening.h
|
||||
*
|
||||
* Takes the leaves of expression trees and makes them dereferences of
|
||||
* assignments of the leaves to temporaries, according to a predicate.
|
||||
*
|
||||
* This is used for automatic function inlining, where we want to take
|
||||
* an expression containing a call and move the call out to its own
|
||||
* assignment so that we can inline it at the appropriate place in the
|
||||
* instruction stream.
|
||||
*/
|
||||
|
||||
void do_expression_flattening(exec_list *instructions,
|
||||
bool (*predicate)(ir_instruction *ir));
|
||||
@@ -1,226 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 "glsl_types.h"
|
||||
#include "ir.h"
|
||||
|
||||
int
|
||||
type_compare(const glsl_type *a, const glsl_type *b)
|
||||
{
|
||||
/* If the types are the same, they trivially match.
|
||||
*/
|
||||
if (a == b)
|
||||
return 0;
|
||||
|
||||
switch (a->base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
case GLSL_TYPE_INT:
|
||||
case GLSL_TYPE_BOOL:
|
||||
/* There is no implicit conversion to or from integer types or bool.
|
||||
*/
|
||||
if ((a->is_integer() != b->is_integer())
|
||||
|| (a->is_boolean() != b->is_boolean()))
|
||||
return -1;
|
||||
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case GLSL_TYPE_FLOAT:
|
||||
if ((a->vector_elements != b->vector_elements)
|
||||
|| (a->matrix_columns != b->matrix_columns))
|
||||
return -1;
|
||||
|
||||
return 1;
|
||||
|
||||
case GLSL_TYPE_SAMPLER:
|
||||
case GLSL_TYPE_STRUCT:
|
||||
/* Samplers and structures must match exactly.
|
||||
*/
|
||||
return -1;
|
||||
|
||||
case GLSL_TYPE_ARRAY:
|
||||
if ((b->base_type != GLSL_TYPE_ARRAY)
|
||||
|| (a->length != b->length))
|
||||
return -1;
|
||||
|
||||
/* From GLSL 1.50 spec, page 27 (page 33 of the PDF):
|
||||
* "There are no implicit array or structure conversions."
|
||||
*
|
||||
* If the comparison of the array element types detects that a conversion
|
||||
* would be required, the array types do not match.
|
||||
*/
|
||||
return (type_compare(a->fields.array, b->fields.array) == 0) ? 0 : -1;
|
||||
|
||||
case GLSL_TYPE_VOID:
|
||||
case GLSL_TYPE_ERROR:
|
||||
default:
|
||||
/* These are all error conditions. It is invalid for a parameter to
|
||||
* a function to be declared as error, void, or a function.
|
||||
*/
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* This point should be unreachable.
|
||||
*/
|
||||
assert(0);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
parameter_lists_match(const exec_list *list_a, const exec_list *list_b)
|
||||
{
|
||||
const exec_node *node_a = list_a->head;
|
||||
const exec_node *node_b = list_b->head;
|
||||
int total_score = 0;
|
||||
|
||||
for (/* empty */
|
||||
; !node_a->is_tail_sentinel()
|
||||
; node_a = node_a->next, node_b = node_b->next) {
|
||||
/* If all of the parameters from the other parameter list have been
|
||||
* exhausted, the lists have different length and, by definition,
|
||||
* do not match.
|
||||
*/
|
||||
if (node_b->is_tail_sentinel())
|
||||
return -1;
|
||||
|
||||
|
||||
const ir_variable *const param = (ir_variable *) node_a;
|
||||
const ir_instruction *const actual = (ir_instruction *) node_b;
|
||||
|
||||
/* Determine whether or not the types match. If the types are an
|
||||
* exact match, the match score is zero. If the types don't match
|
||||
* but the actual parameter can be coerced to the type of the declared
|
||||
* parameter, the match score is one.
|
||||
*/
|
||||
int score;
|
||||
switch ((enum ir_variable_mode)(param->mode)) {
|
||||
case ir_var_auto:
|
||||
case ir_var_uniform:
|
||||
case ir_var_temporary:
|
||||
/* These are all error conditions. It is invalid for a parameter to
|
||||
* a function to be declared as auto (not in, out, or inout) or
|
||||
* as uniform.
|
||||
*/
|
||||
assert(0);
|
||||
return -1;
|
||||
|
||||
case ir_var_in:
|
||||
score = type_compare(param->type, actual->type);
|
||||
break;
|
||||
|
||||
case ir_var_out:
|
||||
score = type_compare(actual->type, param->type);
|
||||
break;
|
||||
|
||||
case ir_var_inout:
|
||||
/* Since there are no bi-directional automatic conversions (e.g.,
|
||||
* there is int -> float but no float -> int), inout parameters must
|
||||
* be exact matches.
|
||||
*/
|
||||
score = (type_compare(actual->type, param->type) == 0) ? 0 : -1;
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
}
|
||||
|
||||
if (score < 0)
|
||||
return -1;
|
||||
|
||||
total_score += score;
|
||||
}
|
||||
|
||||
/* If all of the parameters from the other parameter list have been
|
||||
* exhausted, the lists have different length and, by definition, do not
|
||||
* match.
|
||||
*/
|
||||
if (!node_b->is_tail_sentinel())
|
||||
return -1;
|
||||
|
||||
return total_score;
|
||||
}
|
||||
|
||||
|
||||
ir_function_signature *
|
||||
ir_function::matching_signature(const exec_list *actual_parameters)
|
||||
{
|
||||
ir_function_signature *match = NULL;
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, signatures) {
|
||||
ir_function_signature *const sig =
|
||||
(ir_function_signature *) iter.get();
|
||||
|
||||
const int score = parameter_lists_match(& sig->parameters,
|
||||
actual_parameters);
|
||||
|
||||
if (score == 0)
|
||||
return sig;
|
||||
|
||||
if (score > 0) {
|
||||
if (match != NULL)
|
||||
return NULL;
|
||||
|
||||
match = sig;
|
||||
}
|
||||
}
|
||||
|
||||
return match;
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
parameter_lists_match_exact(const exec_list *list_a, const exec_list *list_b)
|
||||
{
|
||||
const exec_node *node_a = list_a->head;
|
||||
const exec_node *node_b = list_b->head;
|
||||
|
||||
for (/* empty */
|
||||
; !node_a->is_tail_sentinel() && !node_b->is_tail_sentinel()
|
||||
; node_a = node_a->next, node_b = node_b->next) {
|
||||
ir_variable *a = (ir_variable *) node_a;
|
||||
ir_variable *b = (ir_variable *) node_b;
|
||||
|
||||
/* If the types of the parameters do not match, the parameters lists
|
||||
* are different.
|
||||
*/
|
||||
if (a->type != b->type)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Unless both lists are exhausted, they differ in length and, by
|
||||
* definition, do not match.
|
||||
*/
|
||||
return (node_a->is_tail_sentinel() == node_b->is_tail_sentinel());
|
||||
}
|
||||
|
||||
ir_function_signature *
|
||||
ir_function::exact_matching_signature(const exec_list *actual_parameters)
|
||||
{
|
||||
foreach_iter(exec_list_iterator, iter, signatures) {
|
||||
ir_function_signature *const sig =
|
||||
(ir_function_signature *) iter.get();
|
||||
|
||||
if (parameter_lists_match_exact(&sig->parameters, actual_parameters))
|
||||
return sig;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 ir_function_can_inline.cpp
|
||||
*
|
||||
* Determines if we can inline a function call using ir_function_inlining.cpp.
|
||||
*
|
||||
* The primary restriction is that we can't return from the function
|
||||
* other than as the last instruction. We could potentially work
|
||||
* around this for some constructs by flattening control flow and
|
||||
* moving the return to the end, or by using breaks from a do {} while
|
||||
* (0) loop surrounding the function body.
|
||||
*/
|
||||
|
||||
#include "ir.h"
|
||||
|
||||
class ir_function_can_inline_visitor : public ir_hierarchical_visitor {
|
||||
public:
|
||||
ir_function_can_inline_visitor()
|
||||
{
|
||||
this->num_returns = 0;
|
||||
}
|
||||
|
||||
virtual ir_visitor_status visit_enter(ir_return *);
|
||||
|
||||
int num_returns;
|
||||
};
|
||||
|
||||
ir_visitor_status
|
||||
ir_function_can_inline_visitor::visit_enter(ir_return *ir)
|
||||
{
|
||||
(void) ir;
|
||||
this->num_returns++;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
bool
|
||||
can_inline(ir_call *call)
|
||||
{
|
||||
ir_function_can_inline_visitor v;
|
||||
const ir_function_signature *callee = call->get_callee();
|
||||
if (!callee->is_defined)
|
||||
return false;
|
||||
|
||||
v.run((exec_list *) &callee->body);
|
||||
|
||||
/* If the function is empty (no last instruction) or does not end with a
|
||||
* return statement, we need to count the implicit return.
|
||||
*/
|
||||
ir_instruction *last = (ir_instruction *)callee->body.get_tail();
|
||||
if (last == NULL || !last->as_return())
|
||||
v.num_returns++;
|
||||
|
||||
return v.num_returns == 1;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 ir_function_inlining.h
|
||||
*
|
||||
* Replaces calls to functions with the body of the function.
|
||||
*/
|
||||
|
||||
bool can_inline(ir_call *call);
|
||||
@@ -1,297 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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_hierarchical_visitor.h"
|
||||
|
||||
ir_hierarchical_visitor::ir_hierarchical_visitor()
|
||||
{
|
||||
this->base_ir = NULL;
|
||||
this->callback = NULL;
|
||||
this->data = NULL;
|
||||
this->in_assignee = false;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit(ir_variable *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit(ir_constant *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit(ir_loop_jump *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit(ir_dereference_variable *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_enter(ir_loop *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_leave(ir_loop *ir)
|
||||
{
|
||||
(void) ir;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_enter(ir_function_signature *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_leave(ir_function_signature *ir)
|
||||
{
|
||||
(void) ir;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_enter(ir_function *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_leave(ir_function *ir)
|
||||
{
|
||||
(void) ir;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_enter(ir_expression *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_leave(ir_expression *ir)
|
||||
{
|
||||
(void) ir;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_enter(ir_texture *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_leave(ir_texture *ir)
|
||||
{
|
||||
(void) ir;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_enter(ir_swizzle *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_leave(ir_swizzle *ir)
|
||||
{
|
||||
(void) ir;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_enter(ir_dereference_array *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_leave(ir_dereference_array *ir)
|
||||
{
|
||||
(void) ir;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_enter(ir_dereference_record *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_leave(ir_dereference_record *ir)
|
||||
{
|
||||
(void) ir;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_enter(ir_assignment *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_leave(ir_assignment *ir)
|
||||
{
|
||||
(void) ir;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_enter(ir_call *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_leave(ir_call *ir)
|
||||
{
|
||||
(void) ir;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_enter(ir_return *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_leave(ir_return *ir)
|
||||
{
|
||||
(void) ir;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_enter(ir_discard *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_leave(ir_discard *ir)
|
||||
{
|
||||
(void) ir;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_enter(ir_if *ir)
|
||||
{
|
||||
if (this->callback != NULL)
|
||||
this->callback(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_hierarchical_visitor::visit_leave(ir_if *ir)
|
||||
{
|
||||
(void) ir;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
void
|
||||
ir_hierarchical_visitor::run(exec_list *instructions)
|
||||
{
|
||||
visit_list_elements(this, instructions);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
visit_tree(ir_instruction *ir,
|
||||
void (*callback)(class ir_instruction *ir, void *data),
|
||||
void *data)
|
||||
{
|
||||
ir_hierarchical_visitor v;
|
||||
|
||||
v.callback = callback;
|
||||
v.data = data;
|
||||
|
||||
ir->accept(&v);
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
/* -*- c++ -*- */
|
||||
/*
|
||||
* Copyright © 2010 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef IR_HIERARCHICAL_VISITOR_H
|
||||
#define IR_HIERARCHICAL_VISITOR_H
|
||||
|
||||
/**
|
||||
* Enumeration values returned by visit methods to guide processing
|
||||
*/
|
||||
enum ir_visitor_status {
|
||||
visit_continue, /**< Continue visiting as normal. */
|
||||
visit_continue_with_parent, /**< Don't visit siblings, continue w/parent. */
|
||||
visit_stop /**< Stop visiting immediately. */
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Base class of hierarchical visitors of IR instruction trees
|
||||
*
|
||||
* Hierarchical visitors differ from traditional visitors in a couple of
|
||||
* important ways. Rather than having a single \c visit method for each
|
||||
* subclass in the composite, there are three kinds of visit methods.
|
||||
* Leaf-node classes have a traditional \c visit method. Internal-node
|
||||
* classes have a \c visit_enter method, which is invoked just before
|
||||
* processing child nodes, and a \c visit_leave method which is invoked just
|
||||
* after processing child nodes.
|
||||
*
|
||||
* In addition, each visit method and the \c accept methods in the composite
|
||||
* have a return value which guides the navigation. Any of the visit methods
|
||||
* can choose to continue visiting the tree as normal (by returning \c
|
||||
* visit_continue), terminate visiting any further nodes immediately (by
|
||||
* returning \c visit_stop), or stop visiting sibling nodes (by returning \c
|
||||
* visit_continue_with_parent).
|
||||
*
|
||||
* These two changes combine to allow nagivation of children to be implemented
|
||||
* in the composite's \c accept method. The \c accept method for a leaf-node
|
||||
* class will simply call the \c visit method, as usual, and pass its return
|
||||
* value on. The \c accept method for internal-node classes will call the \c
|
||||
* visit_enter method, call the \c accpet method of each child node, and,
|
||||
* finally, call the \c visit_leave method. If any of these return a value
|
||||
* other that \c visit_continue, the correct action must be taken.
|
||||
*
|
||||
* The final benefit is that the hierarchical visitor base class need not be
|
||||
* abstract. Default implementations of every \c visit, \c visit_enter, and
|
||||
* \c visit_leave method can be provided. By default each of these methods
|
||||
* simply returns \c visit_continue. This allows a significant reduction in
|
||||
* derived class code.
|
||||
*
|
||||
* For more information about hierarchical visitors, see:
|
||||
*
|
||||
* http://c2.com/cgi/wiki?HierarchicalVisitorPattern
|
||||
* http://c2.com/cgi/wiki?HierarchicalVisitorDiscussion
|
||||
*/
|
||||
|
||||
class ir_hierarchical_visitor {
|
||||
public:
|
||||
ir_hierarchical_visitor();
|
||||
|
||||
/**
|
||||
* \name Visit methods for leaf-node classes
|
||||
*/
|
||||
/*@{*/
|
||||
virtual ir_visitor_status visit(class ir_variable *);
|
||||
virtual ir_visitor_status visit(class ir_constant *);
|
||||
virtual ir_visitor_status visit(class ir_loop_jump *);
|
||||
|
||||
/**
|
||||
* ir_dereference_variable isn't technically a leaf, but it is treated as a
|
||||
* leaf here for a couple reasons. By not automatically visiting the one
|
||||
* child ir_variable node from the ir_dereference_variable, ir_variable
|
||||
* nodes can always be handled as variable declarations. Code that used
|
||||
* non-hierarchical visitors had to set an "in a dereference" flag to
|
||||
* determine how to handle an ir_variable. By forcing the visitor to
|
||||
* handle the ir_variable within the ir_dereference_variable visitor, this
|
||||
* kludge can be avoided.
|
||||
*
|
||||
* In addition, I can envision no use for having separate enter and leave
|
||||
* methods. Anything that could be done in the enter and leave methods
|
||||
* that couldn't just be done in the visit method.
|
||||
*/
|
||||
virtual ir_visitor_status visit(class ir_dereference_variable *);
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* \name Visit methods for internal-node classes
|
||||
*/
|
||||
/*@{*/
|
||||
virtual ir_visitor_status visit_enter(class ir_loop *);
|
||||
virtual ir_visitor_status visit_leave(class ir_loop *);
|
||||
virtual ir_visitor_status visit_enter(class ir_function_signature *);
|
||||
virtual ir_visitor_status visit_leave(class ir_function_signature *);
|
||||
virtual ir_visitor_status visit_enter(class ir_function *);
|
||||
virtual ir_visitor_status visit_leave(class ir_function *);
|
||||
virtual ir_visitor_status visit_enter(class ir_expression *);
|
||||
virtual ir_visitor_status visit_leave(class ir_expression *);
|
||||
virtual ir_visitor_status visit_enter(class ir_texture *);
|
||||
virtual ir_visitor_status visit_leave(class ir_texture *);
|
||||
virtual ir_visitor_status visit_enter(class ir_swizzle *);
|
||||
virtual ir_visitor_status visit_leave(class ir_swizzle *);
|
||||
virtual ir_visitor_status visit_enter(class ir_dereference_array *);
|
||||
virtual ir_visitor_status visit_leave(class ir_dereference_array *);
|
||||
virtual ir_visitor_status visit_enter(class ir_dereference_record *);
|
||||
virtual ir_visitor_status visit_leave(class ir_dereference_record *);
|
||||
virtual ir_visitor_status visit_enter(class ir_assignment *);
|
||||
virtual ir_visitor_status visit_leave(class ir_assignment *);
|
||||
virtual ir_visitor_status visit_enter(class ir_call *);
|
||||
virtual ir_visitor_status visit_leave(class ir_call *);
|
||||
virtual ir_visitor_status visit_enter(class ir_return *);
|
||||
virtual ir_visitor_status visit_leave(class ir_return *);
|
||||
virtual ir_visitor_status visit_enter(class ir_discard *);
|
||||
virtual ir_visitor_status visit_leave(class ir_discard *);
|
||||
virtual ir_visitor_status visit_enter(class ir_if *);
|
||||
virtual ir_visitor_status visit_leave(class ir_if *);
|
||||
/*@}*/
|
||||
|
||||
|
||||
/**
|
||||
* Utility function to process a linked list of instructions with a visitor
|
||||
*/
|
||||
void run(struct exec_list *instructions);
|
||||
|
||||
/* Some visitors may need to insert new variable declarations and
|
||||
* assignments for portions of a subtree, which means they need a
|
||||
* pointer to the current instruction in the stream, not just their
|
||||
* node in the tree rooted at that instruction.
|
||||
*
|
||||
* This is implemented by visit_list_elements -- if the visitor is
|
||||
* not called by it, nothing good will happen.
|
||||
*/
|
||||
class ir_instruction *base_ir;
|
||||
|
||||
/**
|
||||
* Callback function that is invoked on entry to each node visited.
|
||||
*
|
||||
* \warning
|
||||
* Visitor classes derived from \c ir_hierarchical_visitor \b may \b not
|
||||
* invoke this function. This can be used, for example, to cause the
|
||||
* callback to be invoked on every node type execpt one.
|
||||
*/
|
||||
void (*callback)(class ir_instruction *ir, void *data);
|
||||
|
||||
/**
|
||||
* Extra data parameter passed to the per-node callback function
|
||||
*/
|
||||
void *data;
|
||||
|
||||
/**
|
||||
* Currently in the LHS of an assignment?
|
||||
*
|
||||
* This is set and cleared by the \c ir_assignment::accept method.
|
||||
*/
|
||||
bool in_assignee;
|
||||
};
|
||||
|
||||
void visit_tree(ir_instruction *ir,
|
||||
void (*callback)(class ir_instruction *ir, void *data),
|
||||
void *data);
|
||||
|
||||
ir_visitor_status visit_list_elements(ir_hierarchical_visitor *v, exec_list *l);
|
||||
|
||||
#endif /* IR_HIERARCHICAL_VISITOR_H */
|
||||
@@ -1,378 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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"
|
||||
|
||||
/**
|
||||
* \file ir_hv_accept.cpp
|
||||
* Implementations of all hierarchical visitor accept methods for IR
|
||||
* instructions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Process a list of nodes using a hierarchical vistor
|
||||
*
|
||||
* \warning
|
||||
* This function will operate correctly if a node being processed is removed
|
||||
* from the list. However, if nodes are added to the list after the node being
|
||||
* processed, some of the added nodes may not be processed.
|
||||
*/
|
||||
ir_visitor_status
|
||||
visit_list_elements(ir_hierarchical_visitor *v, exec_list *l)
|
||||
{
|
||||
ir_instruction *prev_base_ir = v->base_ir;
|
||||
|
||||
foreach_list_safe(n, l) {
|
||||
ir_instruction *const ir = (ir_instruction *) n;
|
||||
v->base_ir = ir;
|
||||
ir_visitor_status s = ir->accept(v);
|
||||
|
||||
if (s != visit_continue)
|
||||
return s;
|
||||
}
|
||||
v->base_ir = prev_base_ir;
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_variable::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
return v->visit(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_loop::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
ir_visitor_status s = v->visit_enter(this);
|
||||
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
s = visit_list_elements(v, &this->body_instructions);
|
||||
if (s == visit_stop)
|
||||
return s;
|
||||
|
||||
if (s != visit_continue_with_parent) {
|
||||
if (this->from) {
|
||||
s = this->from->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
}
|
||||
|
||||
if (this->to) {
|
||||
s = this->to->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
}
|
||||
|
||||
if (this->increment) {
|
||||
s = this->increment->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
}
|
||||
}
|
||||
|
||||
return v->visit_leave(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_loop_jump::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
return v->visit(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_function_signature::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
ir_visitor_status s = v->visit_enter(this);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
s = visit_list_elements(v, &this->parameters);
|
||||
if (s == visit_stop)
|
||||
return s;
|
||||
|
||||
s = visit_list_elements(v, &this->body);
|
||||
return (s == visit_stop) ? s : v->visit_leave(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_function::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
ir_visitor_status s = v->visit_enter(this);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
s = visit_list_elements(v, &this->signatures);
|
||||
return (s == visit_stop) ? s : v->visit_leave(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_expression::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
ir_visitor_status s = v->visit_enter(this);
|
||||
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
for (unsigned i = 0; i < this->get_num_operands(); i++) {
|
||||
switch (this->operands[i]->accept(v)) {
|
||||
case visit_continue:
|
||||
break;
|
||||
|
||||
case visit_continue_with_parent:
|
||||
// I wish for Java's labeled break-statement here.
|
||||
goto done;
|
||||
|
||||
case visit_stop:
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
return v->visit_leave(this);
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_texture::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
ir_visitor_status s = v->visit_enter(this);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
s = this->sampler->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
s = this->coordinate->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
if (this->projector) {
|
||||
s = this->projector->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
}
|
||||
|
||||
if (this->shadow_comparitor) {
|
||||
s = this->shadow_comparitor->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
}
|
||||
|
||||
switch (this->op) {
|
||||
case ir_tex:
|
||||
break;
|
||||
case ir_txb:
|
||||
s = this->lod_info.bias->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
break;
|
||||
case ir_txl:
|
||||
case ir_txf:
|
||||
s = this->lod_info.lod->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
break;
|
||||
case ir_txd:
|
||||
s = this->lod_info.grad.dPdx->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
s = this->lod_info.grad.dPdy->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
break;
|
||||
}
|
||||
|
||||
return (s == visit_stop) ? s : v->visit_leave(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_swizzle::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
ir_visitor_status s = v->visit_enter(this);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
s = this->val->accept(v);
|
||||
return (s == visit_stop) ? s : v->visit_leave(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_dereference_variable::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
return v->visit(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_dereference_array::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
ir_visitor_status s = v->visit_enter(this);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
/* The array index is not the target of the assignment, so clear the
|
||||
* 'in_assignee' flag. Restore it after returning from the array index.
|
||||
*/
|
||||
const bool was_in_assignee = v->in_assignee;
|
||||
v->in_assignee = false;
|
||||
s = this->array_index->accept(v);
|
||||
v->in_assignee = was_in_assignee;
|
||||
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
s = this->array->accept(v);
|
||||
return (s == visit_stop) ? s : v->visit_leave(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_dereference_record::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
ir_visitor_status s = v->visit_enter(this);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
s = this->record->accept(v);
|
||||
return (s == visit_stop) ? s : v->visit_leave(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_assignment::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
ir_visitor_status s = v->visit_enter(this);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
v->in_assignee = true;
|
||||
s = this->lhs->accept(v);
|
||||
v->in_assignee = false;
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
s = this->rhs->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
if (this->condition)
|
||||
s = this->condition->accept(v);
|
||||
|
||||
return (s == visit_stop) ? s : v->visit_leave(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_constant::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
return v->visit(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_call::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
ir_visitor_status s = v->visit_enter(this);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
s = visit_list_elements(v, &this->actual_parameters);
|
||||
if (s == visit_stop)
|
||||
return s;
|
||||
|
||||
return v->visit_leave(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_return::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
ir_visitor_status s = v->visit_enter(this);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
ir_rvalue *val = this->get_value();
|
||||
if (val) {
|
||||
s = val->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
}
|
||||
|
||||
return v->visit_leave(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_discard::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
ir_visitor_status s = v->visit_enter(this);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
if (this->condition != NULL) {
|
||||
s = this->condition->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
}
|
||||
|
||||
return v->visit_leave(this);
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_if::accept(ir_hierarchical_visitor *v)
|
||||
{
|
||||
ir_visitor_status s = v->visit_enter(this);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
s = this->condition->accept(v);
|
||||
if (s != visit_continue)
|
||||
return (s == visit_continue_with_parent) ? visit_continue : s;
|
||||
|
||||
if (s != visit_continue_with_parent) {
|
||||
s = visit_list_elements(v, &this->then_instructions);
|
||||
if (s == visit_stop)
|
||||
return s;
|
||||
}
|
||||
|
||||
if (s != visit_continue_with_parent) {
|
||||
s = visit_list_elements(v, &this->else_instructions);
|
||||
if (s == visit_stop)
|
||||
return s;
|
||||
}
|
||||
|
||||
return v->visit_leave(this);
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 ir_import_prototypes.cpp
|
||||
* Import function prototypes from one IR tree into another.
|
||||
*
|
||||
* \author Ian Romanick
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "ir.h"
|
||||
#include "glsl_symbol_table.h"
|
||||
|
||||
/**
|
||||
* Visitor used to import function prototypes
|
||||
*
|
||||
* Normally the \c clone method of either \c ir_function or
|
||||
* \c ir_function_signature could be used. However, we don't want a complete
|
||||
* clone of the \c ir_function_signature. We want everything \b except the
|
||||
* body of the function.
|
||||
*/
|
||||
class import_prototype_visitor : public ir_hierarchical_visitor {
|
||||
public:
|
||||
/**
|
||||
*/
|
||||
import_prototype_visitor(exec_list *list, glsl_symbol_table *symbols,
|
||||
void *mem_ctx)
|
||||
{
|
||||
this->mem_ctx = mem_ctx;
|
||||
this->list = list;
|
||||
this->symbols = symbols;
|
||||
this->function = NULL;
|
||||
}
|
||||
|
||||
virtual ir_visitor_status visit_enter(ir_function *ir)
|
||||
{
|
||||
assert(this->function == NULL);
|
||||
|
||||
this->function = this->symbols->get_function(ir->name);
|
||||
if (!this->function) {
|
||||
this->function = new(this->mem_ctx) ir_function(ir->name);
|
||||
|
||||
list->push_tail(this->function);
|
||||
|
||||
/* Add the new function to the symbol table.
|
||||
*/
|
||||
this->symbols->add_function(this->function);
|
||||
}
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
virtual ir_visitor_status visit_leave(ir_function *ir)
|
||||
{
|
||||
(void) ir;
|
||||
assert(this->function != NULL);
|
||||
|
||||
this->function = NULL;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status visit_enter(ir_function_signature *ir)
|
||||
{
|
||||
assert(this->function != NULL);
|
||||
|
||||
ir_function_signature *copy = ir->clone_prototype(mem_ctx, NULL);
|
||||
|
||||
this->function->add_signature(copy);
|
||||
|
||||
/* Do not process child nodes of the ir_function_signature. There can
|
||||
* never be any nodes inside the ir_function_signature that we care
|
||||
* about. Instead continue with the next sibling.
|
||||
*/
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
|
||||
private:
|
||||
exec_list *list;
|
||||
ir_function *function;
|
||||
glsl_symbol_table *symbols;
|
||||
void *mem_ctx;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Import function prototypes from one IR tree into another
|
||||
*
|
||||
* \param source Source instruction stream containing functions whose
|
||||
* prototypes are to be imported
|
||||
* \param dest Destination instruction stream where new \c ir_function and
|
||||
* \c ir_function_signature nodes will be stored
|
||||
* \param symbols Symbol table where new functions will be stored
|
||||
* \param mem_ctx ralloc memory context used for new allocations
|
||||
*/
|
||||
void
|
||||
import_prototypes(const exec_list *source, exec_list *dest,
|
||||
glsl_symbol_table *symbols, void *mem_ctx)
|
||||
{
|
||||
import_prototype_visitor v(dest, symbols, mem_ctx);
|
||||
|
||||
/* Making source be const is just extra documentation.
|
||||
*/
|
||||
v.run(const_cast<exec_list *>(source));
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 ir_optimization.h
|
||||
*
|
||||
* Prototypes for optimization passes to be called by the compiler and drivers.
|
||||
*/
|
||||
|
||||
/* Operations for lower_instructions() */
|
||||
#define SUB_TO_ADD_NEG 0x01
|
||||
#define DIV_TO_MUL_RCP 0x02
|
||||
#define EXP_TO_EXP2 0x04
|
||||
#define POW_TO_EXP2 0x08
|
||||
#define LOG_TO_LOG2 0x10
|
||||
#define MOD_TO_FRACT 0x20
|
||||
|
||||
bool do_common_optimization(exec_list *ir, bool linked, unsigned max_unroll_iterations);
|
||||
|
||||
bool do_algebraic(exec_list *instructions);
|
||||
bool do_constant_folding(exec_list *instructions);
|
||||
bool do_constant_variable(exec_list *instructions);
|
||||
bool do_constant_variable_unlinked(exec_list *instructions);
|
||||
bool do_copy_propagation(exec_list *instructions);
|
||||
bool do_constant_propagation(exec_list *instructions);
|
||||
bool do_dead_code(exec_list *instructions);
|
||||
bool do_dead_code_local(exec_list *instructions);
|
||||
bool do_dead_code_unlinked(exec_list *instructions);
|
||||
bool do_dead_functions(exec_list *instructions);
|
||||
bool do_function_inlining(exec_list *instructions);
|
||||
bool do_lower_jumps(exec_list *instructions, bool pull_out_jumps = true, bool lower_sub_return = true, bool lower_main_return = false, bool lower_continue = false, bool lower_break = false);
|
||||
bool do_lower_texture_projection(exec_list *instructions);
|
||||
bool do_if_simplification(exec_list *instructions);
|
||||
bool do_discard_simplification(exec_list *instructions);
|
||||
bool lower_if_to_cond_assign(exec_list *instructions, unsigned max_depth = 0);
|
||||
bool do_mat_op_to_vec(exec_list *instructions);
|
||||
bool do_mod_to_fract(exec_list *instructions);
|
||||
bool do_noop_swizzle(exec_list *instructions);
|
||||
bool do_structure_splitting(exec_list *instructions);
|
||||
bool do_sub_to_add_neg(exec_list *instructions);
|
||||
bool do_swizzle_swizzle(exec_list *instructions);
|
||||
bool do_tree_grafting(exec_list *instructions);
|
||||
bool do_vec_index_to_cond_assign(exec_list *instructions);
|
||||
bool do_vec_index_to_swizzle(exec_list *instructions);
|
||||
bool lower_discard(exec_list *instructions);
|
||||
bool lower_instructions(exec_list *instructions, unsigned what_to_lower);
|
||||
bool lower_noise(exec_list *instructions);
|
||||
bool lower_variable_index_to_cond_assign(exec_list *instructions,
|
||||
bool lower_input, bool lower_output, bool lower_temp, bool lower_uniform);
|
||||
bool lower_quadop_vector(exec_list *instructions, bool dont_lower_swz);
|
||||
bool optimize_redundant_jumps(exec_list *instructions);
|
||||
@@ -1,466 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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_print_visitor.h"
|
||||
#include "glsl_types.h"
|
||||
#include "glsl_parser_extras.h"
|
||||
|
||||
static void print_type(const glsl_type *t);
|
||||
|
||||
void
|
||||
ir_instruction::print(void) const
|
||||
{
|
||||
ir_instruction *deconsted = const_cast<ir_instruction *>(this);
|
||||
|
||||
ir_print_visitor v;
|
||||
deconsted->accept(&v);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_print_ir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
if (state) {
|
||||
for (unsigned i = 0; i < state->num_user_structures; i++) {
|
||||
const glsl_type *const s = state->user_structures[i];
|
||||
|
||||
printf("(structure (%s) (%s@%p) (%u) (\n",
|
||||
s->name, s->name, (void *) s, s->length);
|
||||
|
||||
for (unsigned j = 0; j < s->length; j++) {
|
||||
printf("\t((");
|
||||
print_type(s->fields.structure[j].type);
|
||||
printf(")(%s))\n", s->fields.structure[j].name);
|
||||
}
|
||||
|
||||
printf(")\n");
|
||||
}
|
||||
}
|
||||
|
||||
printf("(\n");
|
||||
foreach_iter(exec_list_iterator, iter, *instructions) {
|
||||
ir_instruction *ir = (ir_instruction *)iter.get();
|
||||
ir->print();
|
||||
if (ir->ir_type != ir_type_function)
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n)");
|
||||
}
|
||||
|
||||
|
||||
void ir_print_visitor::indent(void)
|
||||
{
|
||||
for (int i = 0; i < indentation; i++)
|
||||
printf(" ");
|
||||
}
|
||||
|
||||
static void
|
||||
print_type(const glsl_type *t)
|
||||
{
|
||||
if (t->base_type == GLSL_TYPE_ARRAY) {
|
||||
printf("(array ");
|
||||
print_type(t->fields.array);
|
||||
printf(" %u)", t->length);
|
||||
} else if ((t->base_type == GLSL_TYPE_STRUCT)
|
||||
&& (strncmp("gl_", t->name, 3) != 0)) {
|
||||
printf("%s@%p", t->name, (void *) t);
|
||||
} else {
|
||||
printf("%s", t->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ir_print_visitor::visit(ir_variable *ir)
|
||||
{
|
||||
printf("(declare ");
|
||||
|
||||
const char *const cent = (ir->centroid) ? "centroid " : "";
|
||||
const char *const inv = (ir->invariant) ? "invariant " : "";
|
||||
const char *const mode[] = { "", "uniform ", "in ", "out ", "inout ",
|
||||
"temporary " };
|
||||
const char *const interp[] = { "", "flat", "noperspective" };
|
||||
|
||||
printf("(%s%s%s%s) ",
|
||||
cent, inv, mode[ir->mode], interp[ir->interpolation]);
|
||||
|
||||
print_type(ir->type);
|
||||
printf(" %s@%p)", ir->name, (void *) ir);
|
||||
}
|
||||
|
||||
|
||||
void ir_print_visitor::visit(ir_function_signature *ir)
|
||||
{
|
||||
printf("(signature ");
|
||||
indentation++;
|
||||
|
||||
print_type(ir->return_type);
|
||||
printf("\n");
|
||||
indent();
|
||||
|
||||
printf("(parameters\n");
|
||||
indentation++;
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, ir->parameters) {
|
||||
ir_variable *const inst = (ir_variable *) iter.get();
|
||||
|
||||
indent();
|
||||
inst->accept(this);
|
||||
printf("\n");
|
||||
}
|
||||
indentation--;
|
||||
|
||||
indent();
|
||||
printf(")\n");
|
||||
|
||||
indent();
|
||||
|
||||
printf("(\n");
|
||||
indentation++;
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, ir->body) {
|
||||
ir_instruction *const inst = (ir_instruction *) iter.get();
|
||||
|
||||
indent();
|
||||
inst->accept(this);
|
||||
printf("\n");
|
||||
}
|
||||
indentation--;
|
||||
indent();
|
||||
printf("))\n");
|
||||
indentation--;
|
||||
}
|
||||
|
||||
|
||||
void ir_print_visitor::visit(ir_function *ir)
|
||||
{
|
||||
printf("(function %s\n", ir->name);
|
||||
indentation++;
|
||||
foreach_iter(exec_list_iterator, iter, *ir) {
|
||||
ir_function_signature *const sig = (ir_function_signature *) iter.get();
|
||||
indent();
|
||||
sig->accept(this);
|
||||
printf("\n");
|
||||
}
|
||||
indentation--;
|
||||
indent();
|
||||
printf(")\n\n");
|
||||
}
|
||||
|
||||
|
||||
void ir_print_visitor::visit(ir_expression *ir)
|
||||
{
|
||||
printf("(expression ");
|
||||
|
||||
print_type(ir->type);
|
||||
|
||||
printf(" %s ", ir->operator_string());
|
||||
|
||||
for (unsigned i = 0; i < ir->get_num_operands(); i++) {
|
||||
ir->operands[i]->accept(this);
|
||||
}
|
||||
|
||||
printf(") ");
|
||||
}
|
||||
|
||||
|
||||
void ir_print_visitor::visit(ir_texture *ir)
|
||||
{
|
||||
printf("(%s ", ir->opcode_string());
|
||||
|
||||
ir->sampler->accept(this);
|
||||
printf(" ");
|
||||
|
||||
ir->coordinate->accept(this);
|
||||
|
||||
printf(" (%d %d %d) ", ir->offsets[0], ir->offsets[1], ir->offsets[2]);
|
||||
|
||||
if (ir->op != ir_txf) {
|
||||
if (ir->projector)
|
||||
ir->projector->accept(this);
|
||||
else
|
||||
printf("1");
|
||||
|
||||
if (ir->shadow_comparitor) {
|
||||
printf(" ");
|
||||
ir->shadow_comparitor->accept(this);
|
||||
} else {
|
||||
printf(" ()");
|
||||
}
|
||||
}
|
||||
|
||||
printf(" ");
|
||||
switch (ir->op)
|
||||
{
|
||||
case ir_tex:
|
||||
break;
|
||||
case ir_txb:
|
||||
ir->lod_info.bias->accept(this);
|
||||
break;
|
||||
case ir_txl:
|
||||
case ir_txf:
|
||||
ir->lod_info.lod->accept(this);
|
||||
break;
|
||||
case ir_txd:
|
||||
printf("(");
|
||||
ir->lod_info.grad.dPdx->accept(this);
|
||||
printf(" ");
|
||||
ir->lod_info.grad.dPdy->accept(this);
|
||||
printf(")");
|
||||
break;
|
||||
};
|
||||
printf(")");
|
||||
}
|
||||
|
||||
|
||||
void ir_print_visitor::visit(ir_swizzle *ir)
|
||||
{
|
||||
const unsigned swiz[4] = {
|
||||
ir->mask.x,
|
||||
ir->mask.y,
|
||||
ir->mask.z,
|
||||
ir->mask.w,
|
||||
};
|
||||
|
||||
printf("(swiz ");
|
||||
for (unsigned i = 0; i < ir->mask.num_components; i++) {
|
||||
printf("%c", "xyzw"[swiz[i]]);
|
||||
}
|
||||
printf(" ");
|
||||
ir->val->accept(this);
|
||||
printf(")");
|
||||
}
|
||||
|
||||
|
||||
void ir_print_visitor::visit(ir_dereference_variable *ir)
|
||||
{
|
||||
ir_variable *var = ir->variable_referenced();
|
||||
printf("(var_ref %s@%p) ", var->name, (void *) var);
|
||||
}
|
||||
|
||||
|
||||
void ir_print_visitor::visit(ir_dereference_array *ir)
|
||||
{
|
||||
printf("(array_ref ");
|
||||
ir->array->accept(this);
|
||||
ir->array_index->accept(this);
|
||||
printf(") ");
|
||||
}
|
||||
|
||||
|
||||
void ir_print_visitor::visit(ir_dereference_record *ir)
|
||||
{
|
||||
printf("(record_ref ");
|
||||
ir->record->accept(this);
|
||||
printf(" %s) ", ir->field);
|
||||
}
|
||||
|
||||
|
||||
void ir_print_visitor::visit(ir_assignment *ir)
|
||||
{
|
||||
printf("(assign ");
|
||||
|
||||
if (ir->condition)
|
||||
ir->condition->accept(this);
|
||||
else
|
||||
printf("(constant bool (1))");
|
||||
|
||||
|
||||
char mask[5];
|
||||
unsigned j = 0;
|
||||
|
||||
for (unsigned i = 0; i < 4; i++) {
|
||||
if ((ir->write_mask & (1 << i)) != 0) {
|
||||
mask[j] = "xyzw"[i];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
mask[j] = '\0';
|
||||
|
||||
printf(" (%s) ", mask);
|
||||
|
||||
ir->lhs->accept(this);
|
||||
|
||||
printf(" ");
|
||||
|
||||
ir->rhs->accept(this);
|
||||
printf(") ");
|
||||
}
|
||||
|
||||
|
||||
void ir_print_visitor::visit(ir_constant *ir)
|
||||
{
|
||||
const glsl_type *const base_type = ir->type->get_base_type();
|
||||
|
||||
printf("(constant ");
|
||||
print_type(ir->type);
|
||||
printf(" (");
|
||||
|
||||
if (ir->type->is_array()) {
|
||||
for (unsigned i = 0; i < ir->type->length; i++)
|
||||
ir->get_array_element(i)->accept(this);
|
||||
} else if (ir->type->is_record()) {
|
||||
ir_constant *value = (ir_constant *) ir->components.get_head();
|
||||
for (unsigned i = 0; i < ir->type->length; i++) {
|
||||
printf("(%s ", ir->type->fields.structure->name);
|
||||
value->accept(this);
|
||||
printf(")");
|
||||
|
||||
value = (ir_constant *) value->next;
|
||||
}
|
||||
} else {
|
||||
for (unsigned i = 0; i < ir->type->components(); i++) {
|
||||
if (i != 0)
|
||||
printf(" ");
|
||||
switch (base_type->base_type) {
|
||||
case GLSL_TYPE_UINT: printf("%u", ir->value.u[i]); break;
|
||||
case GLSL_TYPE_INT: printf("%d", ir->value.i[i]); break;
|
||||
case GLSL_TYPE_FLOAT: printf("%f", ir->value.f[i]); break;
|
||||
case GLSL_TYPE_BOOL: printf("%d", ir->value.b[i]); break;
|
||||
default: assert(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
printf(")) ");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ir_print_visitor::visit(ir_call *ir)
|
||||
{
|
||||
printf("(call %s (", ir->callee_name());
|
||||
foreach_iter(exec_list_iterator, iter, *ir) {
|
||||
ir_instruction *const inst = (ir_instruction *) iter.get();
|
||||
|
||||
inst->accept(this);
|
||||
}
|
||||
printf("))\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ir_print_visitor::visit(ir_return *ir)
|
||||
{
|
||||
printf("(return");
|
||||
|
||||
ir_rvalue *const value = ir->get_value();
|
||||
if (value) {
|
||||
printf(" ");
|
||||
value->accept(this);
|
||||
}
|
||||
|
||||
printf(")");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ir_print_visitor::visit(ir_discard *ir)
|
||||
{
|
||||
printf("(discard ");
|
||||
|
||||
if (ir->condition != NULL) {
|
||||
printf(" ");
|
||||
ir->condition->accept(this);
|
||||
}
|
||||
|
||||
printf(")");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ir_print_visitor::visit(ir_if *ir)
|
||||
{
|
||||
printf("(if ");
|
||||
ir->condition->accept(this);
|
||||
|
||||
printf("(\n");
|
||||
indentation++;
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, ir->then_instructions) {
|
||||
ir_instruction *const inst = (ir_instruction *) iter.get();
|
||||
|
||||
indent();
|
||||
inst->accept(this);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
indentation--;
|
||||
indent();
|
||||
printf(")\n");
|
||||
|
||||
indent();
|
||||
if (!ir->else_instructions.is_empty()) {
|
||||
printf("(\n");
|
||||
indentation++;
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, ir->else_instructions) {
|
||||
ir_instruction *const inst = (ir_instruction *) iter.get();
|
||||
|
||||
indent();
|
||||
inst->accept(this);
|
||||
printf("\n");
|
||||
}
|
||||
indentation--;
|
||||
indent();
|
||||
printf("))\n");
|
||||
} else {
|
||||
printf("())\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ir_print_visitor::visit(ir_loop *ir)
|
||||
{
|
||||
printf("(loop (");
|
||||
if (ir->counter != NULL)
|
||||
ir->counter->accept(this);
|
||||
printf(") (");
|
||||
if (ir->from != NULL)
|
||||
ir->from->accept(this);
|
||||
printf(") (");
|
||||
if (ir->to != NULL)
|
||||
ir->to->accept(this);
|
||||
printf(") (");
|
||||
if (ir->increment != NULL)
|
||||
ir->increment->accept(this);
|
||||
printf(") (\n");
|
||||
indentation++;
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, ir->body_instructions) {
|
||||
ir_instruction *const inst = (ir_instruction *) iter.get();
|
||||
|
||||
indent();
|
||||
inst->accept(this);
|
||||
printf("\n");
|
||||
}
|
||||
indentation--;
|
||||
indent();
|
||||
printf("))\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ir_print_visitor::visit(ir_loop_jump *ir)
|
||||
{
|
||||
printf("%s", ir->is_break() ? "break" : "continue");
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
/* -*- c++ -*- */
|
||||
/*
|
||||
* Copyright © 2010 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef IR_PRINT_VISITOR_H
|
||||
#define IR_PRINT_VISITOR_H
|
||||
|
||||
#include "ir.h"
|
||||
#include "ir_visitor.h"
|
||||
|
||||
extern void _mesa_print_ir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state);
|
||||
|
||||
/**
|
||||
* Abstract base class of visitors of IR instruction trees
|
||||
*/
|
||||
class ir_print_visitor : public ir_visitor {
|
||||
public:
|
||||
ir_print_visitor()
|
||||
{
|
||||
indentation = 0;
|
||||
}
|
||||
|
||||
virtual ~ir_print_visitor()
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
|
||||
void indent(void);
|
||||
|
||||
/**
|
||||
* \name Visit methods
|
||||
*
|
||||
* As typical for the visitor pattern, there must be one \c visit method for
|
||||
* each concrete subclass of \c ir_instruction. Virtual base classes within
|
||||
* the hierarchy should not have \c visit methods.
|
||||
*/
|
||||
/*@{*/
|
||||
virtual void visit(ir_variable *);
|
||||
virtual void visit(ir_function_signature *);
|
||||
virtual void visit(ir_function *);
|
||||
virtual void visit(ir_expression *);
|
||||
virtual void visit(ir_texture *);
|
||||
virtual void visit(ir_swizzle *);
|
||||
virtual void visit(ir_dereference_variable *);
|
||||
virtual void visit(ir_dereference_array *);
|
||||
virtual void visit(ir_dereference_record *);
|
||||
virtual void visit(ir_assignment *);
|
||||
virtual void visit(ir_constant *);
|
||||
virtual void visit(ir_call *);
|
||||
virtual void visit(ir_return *);
|
||||
virtual void visit(ir_discard *);
|
||||
virtual void visit(ir_if *);
|
||||
virtual void visit(ir_loop *);
|
||||
virtual void visit(ir_loop_jump *);
|
||||
/*@}*/
|
||||
|
||||
private:
|
||||
int indentation;
|
||||
};
|
||||
|
||||
#endif /* IR_PRINT_VISITOR_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,34 +0,0 @@
|
||||
/* -*- c++ -*- */
|
||||
/*
|
||||
* Copyright © 2010 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef IR_READER_H
|
||||
#define IR_READER_H
|
||||
|
||||
#include "ir.h"
|
||||
|
||||
void _mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions,
|
||||
const char *src, bool scan_for_prototypes);
|
||||
|
||||
#endif /* IR_READER_H */
|
||||
@@ -1,141 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 ir_rvalue_visitor.cpp
|
||||
*
|
||||
* Generic class to implement the common pattern we have of wanting to
|
||||
* visit each ir_rvalue * and possibly change that node to a different
|
||||
* class.
|
||||
*/
|
||||
|
||||
#include "ir.h"
|
||||
#include "ir_visitor.h"
|
||||
#include "ir_rvalue_visitor.h"
|
||||
#include "ir_print_visitor.h"
|
||||
#include "glsl_types.h"
|
||||
|
||||
ir_visitor_status
|
||||
ir_rvalue_visitor::visit_leave(ir_expression *ir)
|
||||
{
|
||||
unsigned int operand;
|
||||
|
||||
for (operand = 0; operand < ir->get_num_operands(); operand++) {
|
||||
handle_rvalue(&ir->operands[operand]);
|
||||
}
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_rvalue_visitor::visit_leave(ir_texture *ir)
|
||||
{
|
||||
handle_rvalue(&ir->coordinate);
|
||||
handle_rvalue(&ir->projector);
|
||||
handle_rvalue(&ir->shadow_comparitor);
|
||||
|
||||
switch (ir->op) {
|
||||
case ir_tex:
|
||||
break;
|
||||
case ir_txb:
|
||||
handle_rvalue(&ir->lod_info.bias);
|
||||
break;
|
||||
case ir_txf:
|
||||
case ir_txl:
|
||||
handle_rvalue(&ir->lod_info.lod);
|
||||
break;
|
||||
case ir_txd:
|
||||
handle_rvalue(&ir->lod_info.grad.dPdx);
|
||||
handle_rvalue(&ir->lod_info.grad.dPdy);
|
||||
break;
|
||||
}
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_rvalue_visitor::visit_leave(ir_swizzle *ir)
|
||||
{
|
||||
handle_rvalue(&ir->val);
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_rvalue_visitor::visit_leave(ir_dereference_array *ir)
|
||||
{
|
||||
/* The array index is not the target of the assignment, so clear the
|
||||
* 'in_assignee' flag. Restore it after returning from the array index.
|
||||
*/
|
||||
const bool was_in_assignee = this->in_assignee;
|
||||
this->in_assignee = false;
|
||||
handle_rvalue(&ir->array_index);
|
||||
this->in_assignee = was_in_assignee;
|
||||
|
||||
handle_rvalue(&ir->array);
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_rvalue_visitor::visit_leave(ir_dereference_record *ir)
|
||||
{
|
||||
handle_rvalue(&ir->record);
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_rvalue_visitor::visit_leave(ir_assignment *ir)
|
||||
{
|
||||
handle_rvalue(&ir->rhs);
|
||||
handle_rvalue(&ir->condition);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_rvalue_visitor::visit_leave(ir_call *ir)
|
||||
{
|
||||
foreach_iter(exec_list_iterator, iter, *ir) {
|
||||
ir_rvalue *param = (ir_rvalue *)iter.get();
|
||||
ir_rvalue *new_param = param;
|
||||
handle_rvalue(&new_param);
|
||||
|
||||
if (new_param != param) {
|
||||
param->replace_with(new_param);
|
||||
}
|
||||
}
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_rvalue_visitor::visit_leave(ir_return *ir)
|
||||
{
|
||||
handle_rvalue(&ir->value);;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_rvalue_visitor::visit_leave(ir_if *ir)
|
||||
{
|
||||
handle_rvalue(&ir->condition);
|
||||
return visit_continue;
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 ir_rvalue_visitor.h
|
||||
*
|
||||
* Generic class to implement the common pattern we have of wanting to
|
||||
* visit each ir_rvalue * and possibly change that node to a different
|
||||
* class. Just implement handle_rvalue() and you will be called with
|
||||
* a pointer to each rvalue in the tree.
|
||||
*/
|
||||
|
||||
class ir_rvalue_visitor : public ir_hierarchical_visitor {
|
||||
public:
|
||||
|
||||
virtual ir_visitor_status visit_leave(ir_assignment *);
|
||||
virtual ir_visitor_status visit_leave(ir_call *);
|
||||
virtual ir_visitor_status visit_leave(ir_dereference_array *);
|
||||
virtual ir_visitor_status visit_leave(ir_dereference_record *);
|
||||
virtual ir_visitor_status visit_leave(ir_expression *);
|
||||
virtual ir_visitor_status visit_leave(ir_if *);
|
||||
virtual ir_visitor_status visit_leave(ir_return *);
|
||||
virtual ir_visitor_status visit_leave(ir_swizzle *);
|
||||
virtual ir_visitor_status visit_leave(ir_texture *);
|
||||
|
||||
virtual void handle_rvalue(ir_rvalue **rvalue) = 0;
|
||||
};
|
||||
@@ -1,162 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 ir_set_program_inouts.cpp
|
||||
*
|
||||
* Sets the InputsRead and OutputsWritten of Mesa programs.
|
||||
*
|
||||
* Mesa programs (gl_program, not gl_shader_program) have a set of
|
||||
* flags indicating which varyings are read and written. Computing
|
||||
* which are actually read from some sort of backend code can be
|
||||
* tricky when variable array indexing involved. So this pass
|
||||
* provides support for setting InputsRead and OutputsWritten right
|
||||
* from the GLSL IR.
|
||||
*/
|
||||
|
||||
extern "C" {
|
||||
#include "main/core.h" /* for struct gl_program */
|
||||
#include "program/hash_table.h"
|
||||
}
|
||||
#include "ir.h"
|
||||
#include "ir_visitor.h"
|
||||
#include "glsl_types.h"
|
||||
|
||||
class ir_set_program_inouts_visitor : public ir_hierarchical_visitor {
|
||||
public:
|
||||
ir_set_program_inouts_visitor(struct gl_program *prog)
|
||||
{
|
||||
this->prog = prog;
|
||||
this->ht = hash_table_ctor(0,
|
||||
hash_table_pointer_hash,
|
||||
hash_table_pointer_compare);
|
||||
}
|
||||
~ir_set_program_inouts_visitor()
|
||||
{
|
||||
hash_table_dtor(this->ht);
|
||||
}
|
||||
|
||||
virtual ir_visitor_status visit_enter(ir_dereference_array *);
|
||||
virtual ir_visitor_status visit_enter(ir_function_signature *);
|
||||
virtual ir_visitor_status visit(ir_dereference_variable *);
|
||||
virtual ir_visitor_status visit(ir_variable *);
|
||||
|
||||
struct gl_program *prog;
|
||||
struct hash_table *ht;
|
||||
};
|
||||
|
||||
static void
|
||||
mark(struct gl_program *prog, ir_variable *var, int offset, int len)
|
||||
{
|
||||
/* As of GLSL 1.20, varyings can only be floats, floating-point
|
||||
* vectors or matrices, or arrays of them. For Mesa programs using
|
||||
* InputsRead/OutputsWritten, everything but matrices uses one
|
||||
* slot, while matrices use a slot per column. Presumably
|
||||
* something doing a more clever packing would use something other
|
||||
* than InputsRead/OutputsWritten.
|
||||
*/
|
||||
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (var->mode == ir_var_in)
|
||||
prog->InputsRead |= BITFIELD64_BIT(var->location + offset + i);
|
||||
else
|
||||
prog->OutputsWritten |= BITFIELD64_BIT(var->location + offset + i);
|
||||
}
|
||||
}
|
||||
|
||||
/* Default handler: Mark all the locations in the variable as used. */
|
||||
ir_visitor_status
|
||||
ir_set_program_inouts_visitor::visit(ir_dereference_variable *ir)
|
||||
{
|
||||
if (hash_table_find(this->ht, ir->var) == NULL)
|
||||
return visit_continue;
|
||||
|
||||
if (ir->type->is_array()) {
|
||||
for (unsigned int i = 0; i < ir->type->length; i++) {
|
||||
mark(this->prog, ir->var, i,
|
||||
ir->type->length * ir->type->fields.array->matrix_columns);
|
||||
}
|
||||
} else {
|
||||
mark(this->prog, ir->var, 0, ir->type->matrix_columns);
|
||||
}
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_set_program_inouts_visitor::visit_enter(ir_dereference_array *ir)
|
||||
{
|
||||
ir_dereference_variable *deref_var;
|
||||
ir_constant *index = ir->array_index->as_constant();
|
||||
deref_var = ir->array->as_dereference_variable();
|
||||
ir_variable *var = NULL;
|
||||
|
||||
/* Check that we're dereferencing a shader in or out */
|
||||
if (deref_var)
|
||||
var = (ir_variable *)hash_table_find(this->ht, deref_var->var);
|
||||
|
||||
if (index && var) {
|
||||
int width = 1;
|
||||
|
||||
if (deref_var->type->is_array() &&
|
||||
deref_var->type->fields.array->is_matrix()) {
|
||||
width = deref_var->type->fields.array->matrix_columns;
|
||||
}
|
||||
|
||||
mark(this->prog, var, index->value.i[0] * width, width);
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_set_program_inouts_visitor::visit(ir_variable *ir)
|
||||
{
|
||||
if (ir->mode == ir_var_in ||
|
||||
ir->mode == ir_var_out) {
|
||||
hash_table_insert(this->ht, ir, ir);
|
||||
}
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_set_program_inouts_visitor::visit_enter(ir_function_signature *ir)
|
||||
{
|
||||
/* We don't want to descend into the function parameters and
|
||||
* consider them as shader inputs or outputs.
|
||||
*/
|
||||
visit_list_elements(this, &ir->body);
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
|
||||
void
|
||||
do_set_program_inouts(exec_list *instructions, struct gl_program *prog)
|
||||
{
|
||||
ir_set_program_inouts_visitor v(prog);
|
||||
|
||||
prog->InputsRead = 0;
|
||||
prog->OutputsWritten = 0;
|
||||
visit_list_elements(&v, instructions);
|
||||
}
|
||||
@@ -1,529 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 ir_validate.cpp
|
||||
*
|
||||
* Attempts to verify that various invariants of the IR tree are true.
|
||||
*
|
||||
* In particular, at the moment it makes sure that no single
|
||||
* ir_instruction node except for ir_variable appears multiple times
|
||||
* in the ir tree. ir_variable does appear multiple times: Once as a
|
||||
* declaration in an exec_list, and multiple times as the endpoint of
|
||||
* a dereference chain.
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "ir.h"
|
||||
#include "ir_hierarchical_visitor.h"
|
||||
#include "program/hash_table.h"
|
||||
#include "glsl_types.h"
|
||||
|
||||
class ir_validate : public ir_hierarchical_visitor {
|
||||
public:
|
||||
ir_validate()
|
||||
{
|
||||
this->ht = hash_table_ctor(0, hash_table_pointer_hash,
|
||||
hash_table_pointer_compare);
|
||||
|
||||
this->current_function = NULL;
|
||||
|
||||
this->callback = ir_validate::validate_ir;
|
||||
this->data = ht;
|
||||
}
|
||||
|
||||
~ir_validate()
|
||||
{
|
||||
hash_table_dtor(this->ht);
|
||||
}
|
||||
|
||||
virtual ir_visitor_status visit(ir_variable *v);
|
||||
virtual ir_visitor_status visit(ir_dereference_variable *ir);
|
||||
virtual ir_visitor_status visit(ir_if *ir);
|
||||
|
||||
virtual ir_visitor_status visit_leave(ir_loop *ir);
|
||||
virtual ir_visitor_status visit_enter(ir_function *ir);
|
||||
virtual ir_visitor_status visit_leave(ir_function *ir);
|
||||
virtual ir_visitor_status visit_enter(ir_function_signature *ir);
|
||||
|
||||
virtual ir_visitor_status visit_leave(ir_expression *ir);
|
||||
virtual ir_visitor_status visit_leave(ir_swizzle *ir);
|
||||
|
||||
virtual ir_visitor_status visit_enter(ir_assignment *ir);
|
||||
|
||||
static void validate_ir(ir_instruction *ir, void *data);
|
||||
|
||||
ir_function *current_function;
|
||||
|
||||
struct hash_table *ht;
|
||||
};
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_validate::visit(ir_dereference_variable *ir)
|
||||
{
|
||||
if ((ir->var == NULL) || (ir->var->as_variable() == NULL)) {
|
||||
printf("ir_dereference_variable @ %p does not specify a variable %p\n",
|
||||
(void *) ir, (void *) ir->var);
|
||||
abort();
|
||||
}
|
||||
|
||||
if (hash_table_find(ht, ir->var) == NULL) {
|
||||
printf("ir_dereference_variable @ %p specifies undeclared variable "
|
||||
"`%s' @ %p\n",
|
||||
(void *) ir, ir->var->name, (void *) ir->var);
|
||||
abort();
|
||||
}
|
||||
|
||||
this->validate_ir(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_validate::visit(ir_if *ir)
|
||||
{
|
||||
if (ir->condition->type != glsl_type::bool_type) {
|
||||
printf("ir_if condition %s type instead of bool.\n",
|
||||
ir->condition->type->name);
|
||||
ir->print();
|
||||
printf("\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_validate::visit_leave(ir_loop *ir)
|
||||
{
|
||||
if (ir->counter != NULL) {
|
||||
if ((ir->from == NULL) || (ir->from == NULL) || (ir->increment == NULL)) {
|
||||
printf("ir_loop has invalid loop controls:\n"
|
||||
" counter: %p\n"
|
||||
" from: %p\n"
|
||||
" to: %p\n"
|
||||
" increment: %p\n",
|
||||
(void *) ir->counter, (void *) ir->from, (void *) ir->to,
|
||||
(void *) ir->increment);
|
||||
abort();
|
||||
}
|
||||
|
||||
if ((ir->cmp < ir_binop_less) || (ir->cmp > ir_binop_nequal)) {
|
||||
printf("ir_loop has invalid comparitor %d\n", ir->cmp);
|
||||
abort();
|
||||
}
|
||||
} else {
|
||||
if ((ir->from != NULL) || (ir->from != NULL) || (ir->increment != NULL)) {
|
||||
printf("ir_loop has invalid loop controls:\n"
|
||||
" counter: %p\n"
|
||||
" from: %p\n"
|
||||
" to: %p\n"
|
||||
" increment: %p\n",
|
||||
(void *) ir->counter, (void *) ir->from, (void *) ir->to,
|
||||
(void *) ir->increment);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_validate::visit_enter(ir_function *ir)
|
||||
{
|
||||
/* Function definitions cannot be nested.
|
||||
*/
|
||||
if (this->current_function != NULL) {
|
||||
printf("Function definition nested inside another function "
|
||||
"definition:\n");
|
||||
printf("%s %p inside %s %p\n",
|
||||
ir->name, (void *) ir,
|
||||
this->current_function->name, (void *) this->current_function);
|
||||
abort();
|
||||
}
|
||||
|
||||
/* Store the current function hierarchy being traversed. This is used
|
||||
* by the function signature visitor to ensure that the signatures are
|
||||
* linked with the correct functions.
|
||||
*/
|
||||
this->current_function = ir;
|
||||
|
||||
this->validate_ir(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_validate::visit_leave(ir_function *ir)
|
||||
{
|
||||
assert(ralloc_parent(ir->name) == ir);
|
||||
|
||||
this->current_function = NULL;
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_validate::visit_enter(ir_function_signature *ir)
|
||||
{
|
||||
if (this->current_function != ir->function()) {
|
||||
printf("Function signature nested inside wrong function "
|
||||
"definition:\n");
|
||||
printf("%p inside %s %p instead of %s %p\n",
|
||||
(void *) ir,
|
||||
this->current_function->name, (void *) this->current_function,
|
||||
ir->function_name(), (void *) ir->function());
|
||||
abort();
|
||||
}
|
||||
|
||||
this->validate_ir(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_validate::visit_leave(ir_expression *ir)
|
||||
{
|
||||
switch (ir->operation) {
|
||||
case ir_unop_bit_not:
|
||||
assert(ir->operands[0]->type == ir->type);
|
||||
break;
|
||||
case ir_unop_logic_not:
|
||||
assert(ir->type->base_type == GLSL_TYPE_BOOL);
|
||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
|
||||
break;
|
||||
|
||||
case ir_unop_neg:
|
||||
case ir_unop_abs:
|
||||
case ir_unop_sign:
|
||||
case ir_unop_rcp:
|
||||
case ir_unop_rsq:
|
||||
case ir_unop_sqrt:
|
||||
assert(ir->type == ir->operands[0]->type);
|
||||
break;
|
||||
|
||||
case ir_unop_exp:
|
||||
case ir_unop_log:
|
||||
case ir_unop_exp2:
|
||||
case ir_unop_log2:
|
||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
|
||||
assert(ir->type == ir->operands[0]->type);
|
||||
break;
|
||||
|
||||
case ir_unop_f2i:
|
||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
|
||||
assert(ir->type->base_type == GLSL_TYPE_INT);
|
||||
break;
|
||||
case ir_unop_i2f:
|
||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);
|
||||
assert(ir->type->base_type == GLSL_TYPE_FLOAT);
|
||||
break;
|
||||
case ir_unop_f2b:
|
||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
|
||||
assert(ir->type->base_type == GLSL_TYPE_BOOL);
|
||||
break;
|
||||
case ir_unop_b2f:
|
||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
|
||||
assert(ir->type->base_type == GLSL_TYPE_FLOAT);
|
||||
break;
|
||||
case ir_unop_i2b:
|
||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);
|
||||
assert(ir->type->base_type == GLSL_TYPE_BOOL);
|
||||
break;
|
||||
case ir_unop_b2i:
|
||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
|
||||
assert(ir->type->base_type == GLSL_TYPE_INT);
|
||||
break;
|
||||
case ir_unop_u2f:
|
||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT);
|
||||
assert(ir->type->base_type == GLSL_TYPE_FLOAT);
|
||||
break;
|
||||
|
||||
case ir_unop_any:
|
||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
|
||||
assert(ir->type == glsl_type::bool_type);
|
||||
break;
|
||||
|
||||
case ir_unop_trunc:
|
||||
case ir_unop_round_even:
|
||||
case ir_unop_ceil:
|
||||
case ir_unop_floor:
|
||||
case ir_unop_fract:
|
||||
case ir_unop_sin:
|
||||
case ir_unop_cos:
|
||||
case ir_unop_sin_reduced:
|
||||
case ir_unop_cos_reduced:
|
||||
case ir_unop_dFdx:
|
||||
case ir_unop_dFdy:
|
||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
|
||||
assert(ir->operands[0]->type == ir->type);
|
||||
break;
|
||||
|
||||
case ir_unop_noise:
|
||||
/* XXX what can we assert here? */
|
||||
break;
|
||||
|
||||
case ir_binop_add:
|
||||
case ir_binop_sub:
|
||||
case ir_binop_mul:
|
||||
case ir_binop_div:
|
||||
case ir_binop_mod:
|
||||
case ir_binop_min:
|
||||
case ir_binop_max:
|
||||
case ir_binop_pow:
|
||||
if (ir->operands[0]->type->is_scalar())
|
||||
assert(ir->operands[1]->type == ir->type);
|
||||
else if (ir->operands[1]->type->is_scalar())
|
||||
assert(ir->operands[0]->type == ir->type);
|
||||
else if (ir->operands[0]->type->is_vector() &&
|
||||
ir->operands[1]->type->is_vector()) {
|
||||
assert(ir->operands[0]->type == ir->operands[1]->type);
|
||||
assert(ir->operands[0]->type == ir->type);
|
||||
}
|
||||
break;
|
||||
|
||||
case ir_binop_less:
|
||||
case ir_binop_greater:
|
||||
case ir_binop_lequal:
|
||||
case ir_binop_gequal:
|
||||
case ir_binop_equal:
|
||||
case ir_binop_nequal:
|
||||
/* The semantics of the IR operators differ from the GLSL <, >, <=, >=,
|
||||
* ==, and != operators. The IR operators perform a component-wise
|
||||
* comparison on scalar or vector types and return a boolean scalar or
|
||||
* vector type of the same size.
|
||||
*/
|
||||
assert(ir->type->base_type == GLSL_TYPE_BOOL);
|
||||
assert(ir->operands[0]->type == ir->operands[1]->type);
|
||||
assert(ir->operands[0]->type->is_vector()
|
||||
|| ir->operands[0]->type->is_scalar());
|
||||
assert(ir->operands[0]->type->vector_elements
|
||||
== ir->type->vector_elements);
|
||||
break;
|
||||
|
||||
case ir_binop_all_equal:
|
||||
case ir_binop_any_nequal:
|
||||
/* GLSL == and != operate on scalars, vectors, matrices and arrays, and
|
||||
* return a scalar boolean. The IR matches that.
|
||||
*/
|
||||
assert(ir->type == glsl_type::bool_type);
|
||||
assert(ir->operands[0]->type == ir->operands[1]->type);
|
||||
break;
|
||||
|
||||
case ir_binop_lshift:
|
||||
case ir_binop_rshift:
|
||||
assert(ir->operands[0]->type->is_integer() &&
|
||||
ir->operands[1]->type->is_integer());
|
||||
if (ir->operands[0]->type->is_scalar()) {
|
||||
assert(ir->operands[1]->type->is_scalar());
|
||||
}
|
||||
if (ir->operands[0]->type->is_vector() &&
|
||||
ir->operands[1]->type->is_vector()) {
|
||||
assert(ir->operands[0]->type->components() ==
|
||||
ir->operands[1]->type->components());
|
||||
}
|
||||
assert(ir->type == ir->operands[0]->type);
|
||||
break;
|
||||
|
||||
case ir_binop_bit_and:
|
||||
case ir_binop_bit_xor:
|
||||
case ir_binop_bit_or:
|
||||
assert(ir->operands[0]->type->base_type ==
|
||||
ir->operands[1]->type->base_type);
|
||||
assert(ir->type->is_integer());
|
||||
if (ir->operands[0]->type->is_vector() &&
|
||||
ir->operands[1]->type->is_vector()) {
|
||||
assert(ir->operands[0]->type->vector_elements ==
|
||||
ir->operands[1]->type->vector_elements);
|
||||
}
|
||||
break;
|
||||
|
||||
case ir_binop_logic_and:
|
||||
case ir_binop_logic_xor:
|
||||
case ir_binop_logic_or:
|
||||
assert(ir->type == glsl_type::bool_type);
|
||||
assert(ir->operands[0]->type == glsl_type::bool_type);
|
||||
assert(ir->operands[1]->type == glsl_type::bool_type);
|
||||
break;
|
||||
|
||||
case ir_binop_dot:
|
||||
assert(ir->type == glsl_type::float_type);
|
||||
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
|
||||
assert(ir->operands[0]->type->is_vector());
|
||||
assert(ir->operands[0]->type == ir->operands[1]->type);
|
||||
break;
|
||||
|
||||
case ir_quadop_vector:
|
||||
/* The vector operator collects some number of scalars and generates a
|
||||
* vector from them.
|
||||
*
|
||||
* - All of the operands must be scalar.
|
||||
* - Number of operands must matche the size of the resulting vector.
|
||||
* - Base type of the operands must match the base type of the result.
|
||||
*/
|
||||
assert(ir->type->is_vector());
|
||||
switch (ir->type->vector_elements) {
|
||||
case 2:
|
||||
assert(ir->operands[0]->type->is_scalar());
|
||||
assert(ir->operands[0]->type->base_type == ir->type->base_type);
|
||||
assert(ir->operands[1]->type->is_scalar());
|
||||
assert(ir->operands[1]->type->base_type == ir->type->base_type);
|
||||
assert(ir->operands[2] == NULL);
|
||||
assert(ir->operands[3] == NULL);
|
||||
break;
|
||||
case 3:
|
||||
assert(ir->operands[0]->type->is_scalar());
|
||||
assert(ir->operands[0]->type->base_type == ir->type->base_type);
|
||||
assert(ir->operands[1]->type->is_scalar());
|
||||
assert(ir->operands[1]->type->base_type == ir->type->base_type);
|
||||
assert(ir->operands[2]->type->is_scalar());
|
||||
assert(ir->operands[2]->type->base_type == ir->type->base_type);
|
||||
assert(ir->operands[3] == NULL);
|
||||
break;
|
||||
case 4:
|
||||
assert(ir->operands[0]->type->is_scalar());
|
||||
assert(ir->operands[0]->type->base_type == ir->type->base_type);
|
||||
assert(ir->operands[1]->type->is_scalar());
|
||||
assert(ir->operands[1]->type->base_type == ir->type->base_type);
|
||||
assert(ir->operands[2]->type->is_scalar());
|
||||
assert(ir->operands[2]->type->base_type == ir->type->base_type);
|
||||
assert(ir->operands[3]->type->is_scalar());
|
||||
assert(ir->operands[3]->type->base_type == ir->type->base_type);
|
||||
break;
|
||||
default:
|
||||
/* The is_vector assertion above should prevent execution from ever
|
||||
* getting here.
|
||||
*/
|
||||
assert(!"Should not get here.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_validate::visit_leave(ir_swizzle *ir)
|
||||
{
|
||||
int chans[4] = {ir->mask.x, ir->mask.y, ir->mask.z, ir->mask.w};
|
||||
|
||||
for (unsigned int i = 0; i < ir->type->vector_elements; i++) {
|
||||
if (chans[i] >= ir->val->type->vector_elements) {
|
||||
printf("ir_swizzle @ %p specifies a channel not present "
|
||||
"in the value.\n", (void *) ir);
|
||||
ir->print();
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_validate::visit(ir_variable *ir)
|
||||
{
|
||||
/* An ir_variable is the one thing that can (and will) appear multiple times
|
||||
* in an IR tree. It is added to the hashtable so that it can be used
|
||||
* in the ir_dereference_variable handler to ensure that a variable is
|
||||
* declared before it is dereferenced.
|
||||
*/
|
||||
if (ir->name)
|
||||
assert(ralloc_parent(ir->name) == ir);
|
||||
|
||||
hash_table_insert(ht, ir, ir);
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
ir_visitor_status
|
||||
ir_validate::visit_enter(ir_assignment *ir)
|
||||
{
|
||||
const ir_dereference *const lhs = ir->lhs;
|
||||
if (lhs->type->is_scalar() || lhs->type->is_vector()) {
|
||||
if (ir->write_mask == 0) {
|
||||
printf("Assignment LHS is %s, but write mask is 0:\n",
|
||||
lhs->type->is_scalar() ? "scalar" : "vector");
|
||||
ir->print();
|
||||
abort();
|
||||
}
|
||||
|
||||
int lhs_components = 0;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (ir->write_mask & (1 << i))
|
||||
lhs_components++;
|
||||
}
|
||||
|
||||
if (lhs_components != ir->rhs->type->vector_elements) {
|
||||
printf("Assignment count of LHS write mask channels enabled not\n"
|
||||
"matching RHS vector size (%d LHS, %d RHS).\n",
|
||||
lhs_components, ir->rhs->type->vector_elements);
|
||||
ir->print();
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
this->validate_ir(ir, this->data);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
void
|
||||
ir_validate::validate_ir(ir_instruction *ir, void *data)
|
||||
{
|
||||
struct hash_table *ht = (struct hash_table *) data;
|
||||
|
||||
if (hash_table_find(ht, ir)) {
|
||||
printf("Instruction node present twice in ir tree:\n");
|
||||
ir->print();
|
||||
printf("\n");
|
||||
abort();
|
||||
}
|
||||
hash_table_insert(ht, ir, ir);
|
||||
}
|
||||
|
||||
void
|
||||
check_node_type(ir_instruction *ir, void *data)
|
||||
{
|
||||
(void) data;
|
||||
|
||||
if (ir->ir_type <= ir_type_unset || ir->ir_type >= ir_type_max) {
|
||||
printf("Instruction node with unset type\n");
|
||||
ir->print(); printf("\n");
|
||||
}
|
||||
assert(ir->type != glsl_type::error_type);
|
||||
}
|
||||
|
||||
void
|
||||
validate_ir_tree(exec_list *instructions)
|
||||
{
|
||||
ir_validate v;
|
||||
|
||||
v.run(instructions);
|
||||
|
||||
foreach_iter(exec_list_iterator, iter, *instructions) {
|
||||
ir_instruction *ir = (ir_instruction *)iter.get();
|
||||
|
||||
visit_tree(ir, check_node_type, NULL);
|
||||
}
|
||||
}
|
||||
@@ -1,508 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 "glsl_parser_extras.h"
|
||||
#include "glsl_symbol_table.h"
|
||||
#include "builtin_variables.h"
|
||||
|
||||
static void generate_ARB_draw_buffers_variables(exec_list *,
|
||||
struct _mesa_glsl_parse_state *,
|
||||
bool, _mesa_glsl_parser_targets);
|
||||
|
||||
static ir_variable *
|
||||
add_variable(const char *name, enum ir_variable_mode mode, int slot,
|
||||
const glsl_type *type, exec_list *instructions,
|
||||
glsl_symbol_table *symtab)
|
||||
{
|
||||
ir_variable *var = new(symtab) ir_variable(type, name, mode);
|
||||
|
||||
switch (var->mode) {
|
||||
case ir_var_auto:
|
||||
case ir_var_in:
|
||||
case ir_var_uniform:
|
||||
var->read_only = true;
|
||||
break;
|
||||
case ir_var_inout:
|
||||
case ir_var_out:
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
var->location = slot;
|
||||
var->explicit_location = (slot >= 0);
|
||||
|
||||
/* Once the variable is created an initialized, add it to the symbol table
|
||||
* and add the declaration to the IR stream.
|
||||
*/
|
||||
instructions->push_tail(var);
|
||||
|
||||
symtab->add_variable(var);
|
||||
return var;
|
||||
}
|
||||
|
||||
static ir_variable *
|
||||
add_uniform(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state,
|
||||
const char *name, const glsl_type *type)
|
||||
{
|
||||
return add_variable(name, ir_var_uniform, -1, type, instructions,
|
||||
state->symbols);
|
||||
}
|
||||
|
||||
static void
|
||||
add_builtin_variable(const builtin_variable *proto, exec_list *instructions,
|
||||
glsl_symbol_table *symtab)
|
||||
{
|
||||
/* Create a new variable declaration from the description supplied by
|
||||
* the caller.
|
||||
*/
|
||||
const glsl_type *const type = symtab->get_type(proto->type);
|
||||
|
||||
assert(type != NULL);
|
||||
|
||||
add_variable(proto->name, proto->mode, proto->slot, type, instructions,
|
||||
symtab);
|
||||
}
|
||||
|
||||
static void
|
||||
add_builtin_constant(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state,
|
||||
const char *name, int value)
|
||||
{
|
||||
ir_variable *const var = add_variable(name, ir_var_auto,
|
||||
-1, glsl_type::int_type,
|
||||
instructions, state->symbols);
|
||||
var->constant_value = new(var) ir_constant(value);
|
||||
}
|
||||
|
||||
/* Several constants in GLSL ES have different names than normal desktop GLSL.
|
||||
* Therefore, this function should only be called on the ES path.
|
||||
*/
|
||||
static void
|
||||
generate_100ES_uniforms(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
add_builtin_constant(instructions, state, "gl_MaxVertexAttribs",
|
||||
state->Const.MaxVertexAttribs);
|
||||
add_builtin_constant(instructions, state, "gl_MaxVertexUniformVectors",
|
||||
state->Const.MaxVertexUniformComponents);
|
||||
add_builtin_constant(instructions, state, "gl_MaxVaryingVectors",
|
||||
state->Const.MaxVaryingFloats / 4);
|
||||
add_builtin_constant(instructions, state, "gl_MaxVertexTextureImageUnits",
|
||||
state->Const.MaxVertexTextureImageUnits);
|
||||
add_builtin_constant(instructions, state, "gl_MaxCombinedTextureImageUnits",
|
||||
state->Const.MaxCombinedTextureImageUnits);
|
||||
add_builtin_constant(instructions, state, "gl_MaxTextureImageUnits",
|
||||
state->Const.MaxTextureImageUnits);
|
||||
add_builtin_constant(instructions, state, "gl_MaxFragmentUniformVectors",
|
||||
state->Const.MaxFragmentUniformComponents);
|
||||
|
||||
add_uniform(instructions, state, "gl_DepthRange",
|
||||
state->symbols->get_type("gl_DepthRangeParameters"));
|
||||
}
|
||||
|
||||
static void
|
||||
generate_110_uniforms(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
for (unsigned i = 0
|
||||
; i < Elements(builtin_110_deprecated_uniforms)
|
||||
; i++) {
|
||||
add_builtin_variable(& builtin_110_deprecated_uniforms[i],
|
||||
instructions, state->symbols);
|
||||
}
|
||||
|
||||
add_builtin_constant(instructions, state, "gl_MaxLights",
|
||||
state->Const.MaxLights);
|
||||
add_builtin_constant(instructions, state, "gl_MaxClipPlanes",
|
||||
state->Const.MaxClipPlanes);
|
||||
add_builtin_constant(instructions, state, "gl_MaxTextureUnits",
|
||||
state->Const.MaxTextureUnits);
|
||||
add_builtin_constant(instructions, state, "gl_MaxTextureCoords",
|
||||
state->Const.MaxTextureCoords);
|
||||
add_builtin_constant(instructions, state, "gl_MaxVertexAttribs",
|
||||
state->Const.MaxVertexAttribs);
|
||||
add_builtin_constant(instructions, state, "gl_MaxVertexUniformComponents",
|
||||
state->Const.MaxVertexUniformComponents);
|
||||
add_builtin_constant(instructions, state, "gl_MaxVaryingFloats",
|
||||
state->Const.MaxVaryingFloats);
|
||||
add_builtin_constant(instructions, state, "gl_MaxVertexTextureImageUnits",
|
||||
state->Const.MaxVertexTextureImageUnits);
|
||||
add_builtin_constant(instructions, state, "gl_MaxCombinedTextureImageUnits",
|
||||
state->Const.MaxCombinedTextureImageUnits);
|
||||
add_builtin_constant(instructions, state, "gl_MaxTextureImageUnits",
|
||||
state->Const.MaxTextureImageUnits);
|
||||
add_builtin_constant(instructions, state, "gl_MaxFragmentUniformComponents",
|
||||
state->Const.MaxFragmentUniformComponents);
|
||||
|
||||
const glsl_type *const mat4_array_type =
|
||||
glsl_type::get_array_instance(glsl_type::mat4_type,
|
||||
state->Const.MaxTextureCoords);
|
||||
|
||||
add_uniform(instructions, state, "gl_TextureMatrix", mat4_array_type);
|
||||
add_uniform(instructions, state, "gl_TextureMatrixInverse", mat4_array_type);
|
||||
add_uniform(instructions, state, "gl_TextureMatrixTranspose", mat4_array_type);
|
||||
add_uniform(instructions, state, "gl_TextureMatrixInverseTranspose", mat4_array_type);
|
||||
|
||||
add_uniform(instructions, state, "gl_DepthRange",
|
||||
state->symbols->get_type("gl_DepthRangeParameters"));
|
||||
|
||||
add_uniform(instructions, state, "gl_ClipPlane",
|
||||
glsl_type::get_array_instance(glsl_type::vec4_type,
|
||||
state->Const.MaxClipPlanes));
|
||||
add_uniform(instructions, state, "gl_Point",
|
||||
state->symbols->get_type("gl_PointParameters"));
|
||||
|
||||
const glsl_type *const material_parameters_type =
|
||||
state->symbols->get_type("gl_MaterialParameters");
|
||||
add_uniform(instructions, state, "gl_FrontMaterial", material_parameters_type);
|
||||
add_uniform(instructions, state, "gl_BackMaterial", material_parameters_type);
|
||||
|
||||
const glsl_type *const light_source_array_type =
|
||||
glsl_type::get_array_instance(state->symbols->get_type("gl_LightSourceParameters"), state->Const.MaxLights);
|
||||
|
||||
add_uniform(instructions, state, "gl_LightSource", light_source_array_type);
|
||||
|
||||
const glsl_type *const light_model_products_type =
|
||||
state->symbols->get_type("gl_LightModelProducts");
|
||||
add_uniform(instructions, state, "gl_FrontLightModelProduct",
|
||||
light_model_products_type);
|
||||
add_uniform(instructions, state, "gl_BackLightModelProduct",
|
||||
light_model_products_type);
|
||||
|
||||
const glsl_type *const light_products_type =
|
||||
glsl_type::get_array_instance(state->symbols->get_type("gl_LightProducts"),
|
||||
state->Const.MaxLights);
|
||||
add_uniform(instructions, state, "gl_FrontLightProduct", light_products_type);
|
||||
add_uniform(instructions, state, "gl_BackLightProduct", light_products_type);
|
||||
|
||||
add_uniform(instructions, state, "gl_TextureEnvColor",
|
||||
glsl_type::get_array_instance(glsl_type::vec4_type,
|
||||
state->Const.MaxTextureUnits));
|
||||
|
||||
const glsl_type *const texcoords_vec4 =
|
||||
glsl_type::get_array_instance(glsl_type::vec4_type,
|
||||
state->Const.MaxTextureCoords);
|
||||
add_uniform(instructions, state, "gl_EyePlaneS", texcoords_vec4);
|
||||
add_uniform(instructions, state, "gl_EyePlaneT", texcoords_vec4);
|
||||
add_uniform(instructions, state, "gl_EyePlaneR", texcoords_vec4);
|
||||
add_uniform(instructions, state, "gl_EyePlaneQ", texcoords_vec4);
|
||||
add_uniform(instructions, state, "gl_ObjectPlaneS", texcoords_vec4);
|
||||
add_uniform(instructions, state, "gl_ObjectPlaneT", texcoords_vec4);
|
||||
add_uniform(instructions, state, "gl_ObjectPlaneR", texcoords_vec4);
|
||||
add_uniform(instructions, state, "gl_ObjectPlaneQ", texcoords_vec4);
|
||||
|
||||
add_uniform(instructions, state, "gl_Fog",
|
||||
state->symbols->get_type("gl_FogParameters"));
|
||||
}
|
||||
|
||||
/* This function should only be called for ES, not desktop GL. */
|
||||
static void
|
||||
generate_100ES_vs_variables(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
for (unsigned i = 0; i < Elements(builtin_core_vs_variables); i++) {
|
||||
add_builtin_variable(& builtin_core_vs_variables[i],
|
||||
instructions, state->symbols);
|
||||
}
|
||||
|
||||
generate_100ES_uniforms(instructions, state);
|
||||
|
||||
generate_ARB_draw_buffers_variables(instructions, state, false,
|
||||
vertex_shader);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
generate_110_vs_variables(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
for (unsigned i = 0; i < Elements(builtin_core_vs_variables); i++) {
|
||||
add_builtin_variable(& builtin_core_vs_variables[i],
|
||||
instructions, state->symbols);
|
||||
}
|
||||
|
||||
for (unsigned i = 0
|
||||
; i < Elements(builtin_110_deprecated_vs_variables)
|
||||
; i++) {
|
||||
add_builtin_variable(& builtin_110_deprecated_vs_variables[i],
|
||||
instructions, state->symbols);
|
||||
}
|
||||
generate_110_uniforms(instructions, state);
|
||||
|
||||
/* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
|
||||
*
|
||||
* "As with all arrays, indices used to subscript gl_TexCoord must
|
||||
* either be an integral constant expressions, or this array must be
|
||||
* re-declared by the shader with a size. The size can be at most
|
||||
* gl_MaxTextureCoords. Using indexes close to 0 may aid the
|
||||
* implementation in preserving varying resources."
|
||||
*/
|
||||
const glsl_type *const vec4_array_type =
|
||||
glsl_type::get_array_instance(glsl_type::vec4_type, 0);
|
||||
|
||||
add_variable("gl_TexCoord", ir_var_out, VERT_RESULT_TEX0, vec4_array_type,
|
||||
instructions, state->symbols);
|
||||
|
||||
generate_ARB_draw_buffers_variables(instructions, state, false,
|
||||
vertex_shader);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
generate_120_vs_variables(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
/* GLSL version 1.20 did not add any built-in variables in the vertex
|
||||
* shader.
|
||||
*/
|
||||
generate_110_vs_variables(instructions, state);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
generate_130_vs_variables(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
generate_120_vs_variables(instructions, state);
|
||||
|
||||
for (unsigned i = 0; i < Elements(builtin_130_vs_variables); i++) {
|
||||
add_builtin_variable(& builtin_130_vs_variables[i],
|
||||
instructions, state->symbols);
|
||||
}
|
||||
|
||||
const glsl_type *const clip_distance_array_type =
|
||||
glsl_type::get_array_instance(glsl_type::float_type,
|
||||
state->Const.MaxClipPlanes);
|
||||
|
||||
/* FINISHME: gl_ClipDistance needs a real location assigned. */
|
||||
add_variable("gl_ClipDistance", ir_var_out, -1, clip_distance_array_type,
|
||||
instructions, state->symbols);
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
initialize_vs_variables(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
|
||||
switch (state->language_version) {
|
||||
case 100:
|
||||
generate_100ES_vs_variables(instructions, state);
|
||||
break;
|
||||
case 110:
|
||||
generate_110_vs_variables(instructions, state);
|
||||
break;
|
||||
case 120:
|
||||
generate_120_vs_variables(instructions, state);
|
||||
break;
|
||||
case 130:
|
||||
generate_130_vs_variables(instructions, state);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* This function should only be called for ES, not desktop GL. */
|
||||
static void
|
||||
generate_100ES_fs_variables(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
for (unsigned i = 0; i < Elements(builtin_core_fs_variables); i++) {
|
||||
add_builtin_variable(& builtin_core_fs_variables[i],
|
||||
instructions, state->symbols);
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < Elements(builtin_100ES_fs_variables); i++) {
|
||||
add_builtin_variable(& builtin_100ES_fs_variables[i],
|
||||
instructions, state->symbols);
|
||||
}
|
||||
|
||||
generate_100ES_uniforms(instructions, state);
|
||||
|
||||
generate_ARB_draw_buffers_variables(instructions, state, false,
|
||||
fragment_shader);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_110_fs_variables(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
for (unsigned i = 0; i < Elements(builtin_core_fs_variables); i++) {
|
||||
add_builtin_variable(& builtin_core_fs_variables[i],
|
||||
instructions, state->symbols);
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < Elements(builtin_110_fs_variables); i++) {
|
||||
add_builtin_variable(& builtin_110_fs_variables[i],
|
||||
instructions, state->symbols);
|
||||
}
|
||||
|
||||
for (unsigned i = 0
|
||||
; i < Elements(builtin_110_deprecated_fs_variables)
|
||||
; i++) {
|
||||
add_builtin_variable(& builtin_110_deprecated_fs_variables[i],
|
||||
instructions, state->symbols);
|
||||
}
|
||||
generate_110_uniforms(instructions, state);
|
||||
|
||||
/* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
|
||||
*
|
||||
* "As with all arrays, indices used to subscript gl_TexCoord must
|
||||
* either be an integral constant expressions, or this array must be
|
||||
* re-declared by the shader with a size. The size can be at most
|
||||
* gl_MaxTextureCoords. Using indexes close to 0 may aid the
|
||||
* implementation in preserving varying resources."
|
||||
*/
|
||||
const glsl_type *const vec4_array_type =
|
||||
glsl_type::get_array_instance(glsl_type::vec4_type, 0);
|
||||
|
||||
add_variable("gl_TexCoord", ir_var_in, FRAG_ATTRIB_TEX0, vec4_array_type,
|
||||
instructions, state->symbols);
|
||||
|
||||
generate_ARB_draw_buffers_variables(instructions, state, false,
|
||||
fragment_shader);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
generate_ARB_draw_buffers_variables(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state,
|
||||
bool warn, _mesa_glsl_parser_targets target)
|
||||
{
|
||||
/* gl_MaxDrawBuffers is available in all shader stages.
|
||||
*/
|
||||
ir_variable *const mdb =
|
||||
add_variable("gl_MaxDrawBuffers", ir_var_auto, -1,
|
||||
glsl_type::int_type, instructions, state->symbols);
|
||||
|
||||
if (warn)
|
||||
mdb->warn_extension = "GL_ARB_draw_buffers";
|
||||
|
||||
mdb->constant_value = new(mdb)
|
||||
ir_constant(int(state->Const.MaxDrawBuffers));
|
||||
|
||||
|
||||
/* gl_FragData is only available in the fragment shader.
|
||||
*/
|
||||
if (target == fragment_shader) {
|
||||
const glsl_type *const vec4_array_type =
|
||||
glsl_type::get_array_instance(glsl_type::vec4_type,
|
||||
state->Const.MaxDrawBuffers);
|
||||
|
||||
ir_variable *const fd =
|
||||
add_variable("gl_FragData", ir_var_out, FRAG_RESULT_DATA0,
|
||||
vec4_array_type, instructions, state->symbols);
|
||||
|
||||
if (warn)
|
||||
fd->warn_extension = "GL_ARB_draw_buffers";
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
generate_ARB_shader_stencil_export_variables(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state,
|
||||
bool warn)
|
||||
{
|
||||
/* gl_FragStencilRefARB is only available in the fragment shader.
|
||||
*/
|
||||
ir_variable *const fd =
|
||||
add_variable("gl_FragStencilRefARB", ir_var_out, FRAG_RESULT_STENCIL,
|
||||
glsl_type::int_type, instructions, state->symbols);
|
||||
|
||||
if (warn)
|
||||
fd->warn_extension = "GL_ARB_shader_stencil_export";
|
||||
}
|
||||
|
||||
static void
|
||||
generate_120_fs_variables(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
generate_110_fs_variables(instructions, state);
|
||||
|
||||
for (unsigned i = 0
|
||||
; i < Elements(builtin_120_fs_variables)
|
||||
; i++) {
|
||||
add_builtin_variable(& builtin_120_fs_variables[i],
|
||||
instructions, state->symbols);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
generate_130_fs_variables(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
generate_120_fs_variables(instructions, state);
|
||||
|
||||
const glsl_type *const clip_distance_array_type =
|
||||
glsl_type::get_array_instance(glsl_type::float_type,
|
||||
state->Const.MaxClipPlanes);
|
||||
|
||||
/* FINISHME: gl_ClipDistance needs a real location assigned. */
|
||||
add_variable("gl_ClipDistance", ir_var_in, -1, clip_distance_array_type,
|
||||
instructions, state->symbols);
|
||||
}
|
||||
|
||||
static void
|
||||
initialize_fs_variables(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
|
||||
switch (state->language_version) {
|
||||
case 100:
|
||||
generate_100ES_fs_variables(instructions, state);
|
||||
break;
|
||||
case 110:
|
||||
generate_110_fs_variables(instructions, state);
|
||||
break;
|
||||
case 120:
|
||||
generate_120_fs_variables(instructions, state);
|
||||
break;
|
||||
case 130:
|
||||
generate_130_fs_variables(instructions, state);
|
||||
break;
|
||||
}
|
||||
|
||||
if (state->ARB_shader_stencil_export_enable)
|
||||
generate_ARB_shader_stencil_export_variables(instructions, state,
|
||||
state->ARB_shader_stencil_export_warn);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_glsl_initialize_variables(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
switch (state->target) {
|
||||
case vertex_shader:
|
||||
initialize_vs_variables(instructions, state);
|
||||
break;
|
||||
case geometry_shader:
|
||||
break;
|
||||
case fragment_shader:
|
||||
initialize_fs_variables(instructions, state);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2010 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 ir_variable_refcount.cpp
|
||||
*
|
||||
* Provides a visitor which produces a list of variables referenced,
|
||||
* how many times they were referenced and assigned, and whether they
|
||||
* were defined in the scope.
|
||||
*/
|
||||
|
||||
#include "ir.h"
|
||||
#include "ir_visitor.h"
|
||||
#include "ir_variable_refcount.h"
|
||||
#include "glsl_types.h"
|
||||
|
||||
|
||||
// constructor
|
||||
variable_entry::variable_entry(ir_variable *var)
|
||||
{
|
||||
this->var = var;
|
||||
assign = NULL;
|
||||
assigned_count = 0;
|
||||
declaration = false;
|
||||
referenced_count = 0;
|
||||
}
|
||||
|
||||
|
||||
variable_entry *
|
||||
ir_variable_refcount_visitor::get_variable_entry(ir_variable *var)
|
||||
{
|
||||
assert(var);
|
||||
foreach_iter(exec_list_iterator, iter, this->variable_list) {
|
||||
variable_entry *entry = (variable_entry *)iter.get();
|
||||
if (entry->var == var)
|
||||
return entry;
|
||||
}
|
||||
|
||||
variable_entry *entry = new(mem_ctx) variable_entry(var);
|
||||
assert(entry->referenced_count == 0);
|
||||
this->variable_list.push_tail(entry);
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_variable_refcount_visitor::visit(ir_variable *ir)
|
||||
{
|
||||
variable_entry *entry = this->get_variable_entry(ir);
|
||||
if (entry)
|
||||
entry->declaration = true;
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_variable_refcount_visitor::visit(ir_dereference_variable *ir)
|
||||
{
|
||||
ir_variable *const var = ir->variable_referenced();
|
||||
variable_entry *entry = this->get_variable_entry(var);
|
||||
|
||||
if (entry)
|
||||
entry->referenced_count++;
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_variable_refcount_visitor::visit_enter(ir_function_signature *ir)
|
||||
{
|
||||
/* We don't want to descend into the function parameters and
|
||||
* dead-code eliminate them, so just accept the body here.
|
||||
*/
|
||||
visit_list_elements(this, &ir->body);
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
ir_variable_refcount_visitor::visit_leave(ir_assignment *ir)
|
||||
{
|
||||
variable_entry *entry;
|
||||
entry = this->get_variable_entry(ir->lhs->variable_referenced());
|
||||
if (entry) {
|
||||
entry->assigned_count++;
|
||||
if (entry->assign == NULL)
|
||||
entry->assign = ir;
|
||||
}
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user