Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts: configure.ac src/gallium/drivers/r600/r600_state_inlines.h src/gallium/tests/trivial/Makefile src/gallium/winsys/g3dvl/dri/XF86dri.c src/gallium/winsys/g3dvl/dri/driclient.c src/gallium/winsys/g3dvl/dri/driclient.h src/gallium/winsys/g3dvl/dri/xf86dri.h src/gallium/winsys/g3dvl/dri/xf86dristr.h src/gallium/winsys/r600/drm/r600_bo.c
This commit is contained in:
commit
c3b2230b71
16
Makefile
16
Makefile
|
@ -183,7 +183,7 @@ ultrix-gcc:
|
|||
|
||||
# Rules for making release tarballs
|
||||
|
||||
VERSION=7.11-devel
|
||||
VERSION=7.12-devel
|
||||
DIRECTORY = Mesa-$(VERSION)
|
||||
LIB_NAME = MesaLib-$(VERSION)
|
||||
GLUT_NAME = MesaGLUT-$(VERSION)
|
||||
|
@ -345,6 +345,16 @@ EGL_FILES = \
|
|||
$(DIRECTORY)/src/egl/main/*.pc.in \
|
||||
$(DIRECTORY)/src/egl/main/*.def
|
||||
|
||||
GBM_FILES = \
|
||||
$(DIRECTORY)/src/gbm/Makefile \
|
||||
$(DIRECTORY)/src/gbm/main/*.pc.in \
|
||||
$(DIRECTORY)/src/gbm/main/*.[ch] \
|
||||
$(DIRECTORY)/src/gbm/main/Makefile \
|
||||
$(DIRECTORY)/src/gbm/backends/Makefile \
|
||||
$(DIRECTORY)/src/gbm/backends/Makefile.template \
|
||||
$(DIRECTORY)/src/gbm/backends/*/*.[ch] \
|
||||
$(DIRECTORY)/src/gbm/backends/*/Makefile \
|
||||
|
||||
GALLIUM_FILES = \
|
||||
$(DIRECTORY)/src/mesa/state_tracker/*[ch] \
|
||||
$(DIRECTORY)/src/gallium/Makefile \
|
||||
|
@ -376,8 +386,7 @@ DRI_FILES = \
|
|||
$(DIRECTORY)/src/glx/Makefile \
|
||||
$(DIRECTORY)/src/glx/*.[ch] \
|
||||
$(APPLE_DRI_FILES) \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/Makefile* \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
|
||||
|
@ -443,6 +452,7 @@ LIB_FILES = \
|
|||
$(MAPI_FILES) \
|
||||
$(ES_FILES) \
|
||||
$(EGL_FILES) \
|
||||
$(GBM_FILES) \
|
||||
$(GALLIUM_FILES) \
|
||||
$(DRI_FILES) \
|
||||
$(SGI_GLU_FILES) \
|
||||
|
|
58
SConstruct
58
SConstruct
|
@ -40,6 +40,9 @@ env = Environment(
|
|||
ENV = os.environ,
|
||||
)
|
||||
|
||||
# XXX: This creates a many problems as it saves...
|
||||
#opts.Save('config.py', env)
|
||||
|
||||
# Backwards compatability with old target configuration variable
|
||||
try:
|
||||
targets = ARGUMENTS['targets']
|
||||
|
@ -80,44 +83,6 @@ env.Append(CPPPATH = [
|
|||
if env['msvc']:
|
||||
env.Append(CPPPATH = ['#include/c99'])
|
||||
|
||||
# Embedded
|
||||
if env['platform'] == 'embedded':
|
||||
env.Append(CPPDEFINES = [
|
||||
'_POSIX_SOURCE',
|
||||
('_POSIX_C_SOURCE', '199309L'),
|
||||
'_SVID_SOURCE',
|
||||
'_BSD_SOURCE',
|
||||
'_GNU_SOURCE',
|
||||
|
||||
'PTHREADS',
|
||||
])
|
||||
env.Append(LIBS = [
|
||||
'm',
|
||||
'pthread',
|
||||
'dl',
|
||||
])
|
||||
|
||||
# Posix
|
||||
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
|
||||
env.Append(CPPDEFINES = [
|
||||
'_POSIX_SOURCE',
|
||||
('_POSIX_C_SOURCE', '199309L'),
|
||||
'_SVID_SOURCE',
|
||||
'_BSD_SOURCE',
|
||||
'_GNU_SOURCE',
|
||||
'PTHREADS',
|
||||
'HAVE_POSIX_MEMALIGN',
|
||||
])
|
||||
if env['gcc']:
|
||||
env.Append(CFLAGS = ['-fvisibility=hidden'])
|
||||
if env['platform'] == 'darwin':
|
||||
env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE'])
|
||||
env.Append(LIBS = [
|
||||
'm',
|
||||
'pthread',
|
||||
'dl',
|
||||
])
|
||||
|
||||
# for debugging
|
||||
#print env.Dump()
|
||||
|
||||
|
@ -130,7 +95,7 @@ if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
|
|||
#
|
||||
|
||||
# Create host environent
|
||||
if env['crosscompile'] and env['platform'] != 'embedded':
|
||||
if env['crosscompile'] and not env['embedded']:
|
||||
host_env = Environment(
|
||||
options = opts,
|
||||
# no tool used
|
||||
|
@ -179,3 +144,18 @@ SConscript(
|
|||
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
|
||||
)
|
||||
|
||||
|
||||
########################################################################
|
||||
# List all aliases
|
||||
|
||||
try:
|
||||
from SCons.Node.Alias import default_ans
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
aliases = default_ans.keys()
|
||||
aliases.sort()
|
||||
env.Help('\n')
|
||||
env.Help('Recognized targets:\n')
|
||||
for alias in aliases:
|
||||
env.Help(' %s\n' % alias)
|
||||
|
|
|
@ -79,14 +79,17 @@ def AddOptions(opts):
|
|||
from SCons.Options.EnumOption import EnumOption
|
||||
opts.Add(EnumOption('build', 'build type', 'debug',
|
||||
allowed_values=('debug', 'checked', 'profile', 'release')))
|
||||
opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
|
||||
opts.Add(BoolOption('verbose', 'verbose output', 'no'))
|
||||
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
|
||||
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
|
||||
opts.Add(EnumOption('platform', 'target platform', host_platform,
|
||||
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos', 'freebsd8')))
|
||||
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'cygwin', 'sunos', 'freebsd8')))
|
||||
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
|
||||
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
|
||||
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
|
||||
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
|
||||
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
|
||||
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
|
||||
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
|
||||
opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
|
||||
if host_platform == 'windows':
|
||||
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
|
||||
|
|
|
@ -75,6 +75,7 @@ GLESv2_LIB = GLESv2
|
|||
VG_LIB = OpenVG
|
||||
GLAPI_LIB = glapi
|
||||
WAYLAND_EGL_LIB = wayland-egl
|
||||
GBM_LIB = gbm
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = @GL_LIB_NAME@
|
||||
|
@ -88,6 +89,7 @@ GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
|
|||
VG_LIB_NAME = @VG_LIB_NAME@
|
||||
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
|
||||
WAYLAND_EGL_LIB_NAME = @WAYLAND_EGL_LIB_NAME@
|
||||
GBM_LIB_NAME = @GBM_LIB_NAME@
|
||||
|
||||
# Globs used to install the lib and all symlinks
|
||||
GL_LIB_GLOB = @GL_LIB_GLOB@
|
||||
|
@ -101,6 +103,7 @@ GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
|
|||
VG_LIB_GLOB = @VG_LIB_GLOB@
|
||||
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
|
||||
WAYLAND_EGL_LIB_GLOB = @WAYLAND_EGL_LIB_GLOB@
|
||||
GBM_LIB_GLOB = @GBM_LIB_GLOB@
|
||||
|
||||
# Directories to build
|
||||
LIB_DIR = @LIB_DIR@
|
||||
|
@ -108,6 +111,7 @@ SRC_DIRS = @SRC_DIRS@
|
|||
GLU_DIRS = @GLU_DIRS@
|
||||
DRIVER_DIRS = @DRIVER_DIRS@
|
||||
EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
|
||||
GBM_BACKEND_DIRS = @GBM_BACKEND_DIRS@
|
||||
GALLIUM_DIRS = @GALLIUM_DIRS@
|
||||
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
|
||||
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
|
||||
|
@ -147,7 +151,8 @@ GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
|
|||
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
|
||||
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
|
||||
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
|
||||
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIBPATH) @WAYLAND_EGL_LIB_DEPS@
|
||||
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @WAYLAND_EGL_LIB_DEPS@
|
||||
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) @GBM_LIB_DEPS@
|
||||
|
||||
# DRI dependencies
|
||||
MESA_MODULES = @MESA_MODULES@
|
||||
|
@ -212,6 +217,9 @@ EGL_PC_CFLAGS = @GL_PC_CFLAGS@
|
|||
WAYLAND_EGL_PC_REQ_PRIV = @WAYLAND_EGL_PC_REQ_PRIV@
|
||||
WAYLAND_EGL_PC_LIB_PRIV = @WAYLAND_EGL_PC_LIB_PRIV@
|
||||
WAYLAND_EGL_PC_CFLAGS = @WAYLAND_EGL_PC_CFLAGS@
|
||||
GBM_PC_REQ_PRIV = @GBM_PC_REQ_PRIV@
|
||||
GBM_PC_LIB_PRIV = @GBM_PC_LIB_PRIV@
|
||||
GBM_PC_CFLAGS = @GBM_PC_CFLAGS@
|
||||
|
||||
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
|
||||
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
|
||||
|
|
|
@ -9,7 +9,7 @@ CONFIG_NAME = default
|
|||
|
||||
# Version info
|
||||
MESA_MAJOR=7
|
||||
MESA_MINOR=11
|
||||
MESA_MINOR=12
|
||||
MESA_TINY=0
|
||||
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
|
||||
|
||||
|
@ -63,7 +63,7 @@ GLESv2_LIB = GLESv2
|
|||
VG_LIB = OpenVG
|
||||
GLAPI_LIB = glapi
|
||||
WAYLAND_EGL_LIB = wayland-egl
|
||||
|
||||
GBM_LIB = gbm
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = lib$(GL_LIB).so
|
||||
|
@ -77,6 +77,7 @@ GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
|
|||
VG_LIB_NAME = lib$(VG_LIB).so
|
||||
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
|
||||
WAYLAND_EGL_LIB_NAME = lib$(WAYLAND_EGL_LIB).so
|
||||
GBM_LIB_NAME = lib$(GBM_LIB).so
|
||||
|
||||
# globs used to install the lib and all symlinks
|
||||
GL_LIB_GLOB = $(GL_LIB_NAME)*
|
||||
|
@ -90,6 +91,7 @@ GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
|
|||
VG_LIB_GLOB = $(VG_LIB_NAME)*
|
||||
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
|
||||
WAYLAND_EGL_LIB_GLOB = $(WAYLAND_EGL_LIB_NAME)*
|
||||
GBM_LIB_GLOB = $(GBM_LIB_NAME)*
|
||||
|
||||
DRI_CFLAGS = $(CFLAGS)
|
||||
DRI_CXXFLAGS = $(CXXFLAGS)
|
||||
|
@ -113,6 +115,9 @@ DRIVER_DIRS = x11 osmesa
|
|||
# EGL drivers to build
|
||||
EGL_DRIVERS_DIRS = glx
|
||||
|
||||
# gbm backends to build
|
||||
GBM_BACKEND_DIRS = dri
|
||||
|
||||
# Gallium directories and
|
||||
GALLIUM_DIRS = auxiliary drivers state_trackers
|
||||
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
|
||||
|
@ -140,6 +145,7 @@ GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
|||
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
||||
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
||||
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm
|
||||
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) -ludev -ldl
|
||||
|
||||
# Program dependencies - specific GL/glut libraries added in Makefiles
|
||||
APP_LIB_DEPS = -lm
|
||||
|
@ -159,6 +165,9 @@ DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
|
|||
# EGL driver install directory
|
||||
EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl
|
||||
|
||||
# gbm backend install directory
|
||||
GBM_BACKEND_INSTALL_DIR = $(INSTALL_LIB_DIR)/gbm
|
||||
|
||||
# Xorg driver install directory (for xorg state-tracker)
|
||||
XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
|
||||
|
||||
|
@ -191,3 +200,6 @@ VG_PC_CFLAGS =
|
|||
WAYLAND_EGL_PC_REQ_PRIV =
|
||||
WAYLAND_EGL_PC_LIB_PRIV =
|
||||
WAYLAND_EGL_PC_CFLAGS =
|
||||
GBM_PC_REQ_PRIV =
|
||||
GBM_PC_LIB_PRIV =
|
||||
GBM_PC_CFLAGS =
|
||||
|
|
|
@ -42,3 +42,6 @@ endif
|
|||
|
||||
LD = g++
|
||||
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++
|
||||
|
||||
# to allow the NV drivers to compile
|
||||
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
|
||||
|
|
1090
configure.ac
1090
configure.ac
File diff suppressed because it is too large
Load Diff
|
@ -40,7 +40,7 @@ glTexParameterI, glGetTexParameterI commands DONE
|
|||
glVertexAttribI commands DONE (but converts int
|
||||
values to floats)
|
||||
Depth format cube textures 0% done
|
||||
|
||||
GLX_ARB_create_context (GLX 1.4 is required) not started
|
||||
|
||||
|
||||
GL 3.1:
|
||||
|
@ -49,7 +49,7 @@ GLSL 1.40 not started
|
|||
Instanced drawing (GL_ARB_draw_instanced) DONE (gallium, swrast)
|
||||
Buffer copying (GL_ARB_copy_buffer) DONE
|
||||
Primitive restart (GL_NV_primitive_restart) DONE (gallium)
|
||||
16 vertex texture image units not started
|
||||
16 vertex texture image units DONE
|
||||
Texture buffer objs (GL_ARB_texture_buffer_object) not started
|
||||
Rectangular textures (GL_ARB_texture_rectangle) DONE
|
||||
Uniform buffer objs (GL_ARB_uniform_buffer_object) not started
|
||||
|
@ -69,6 +69,7 @@ Seamless cubemaps (GL_ARB_seamless_cube_map) DONE
|
|||
Multisample textures (GL_ARB_texture_multisample) not started
|
||||
Frag depth clamp (GL_ARB_depth_clamp) DONE
|
||||
Fence objects (GL_ARB_sync) DONE
|
||||
GLX_ARB_create_context_profile not started
|
||||
|
||||
|
||||
GL 3.3:
|
||||
|
|
|
@ -29,12 +29,14 @@ directly dispatched to the drivers.</p>
|
|||
the driver for your hardware. For example</p>
|
||||
|
||||
<pre>
|
||||
$ ./configure --enable-gles2 --enable-openvg --enable-gallium-nouveau
|
||||
$ ./configure --enable-gles1 --enable-gles2 \
|
||||
--with-dri-drivers=... \
|
||||
--with-gallium-drivers=...
|
||||
</pre>
|
||||
|
||||
<p>The main library and OpenGL is enabled by default. The first option above
|
||||
enables <a href="opengles.html">OpenGL ES 2.x</a>. The second option enables
|
||||
<a href="openvg.html">OpenVG</a>.</p>
|
||||
<p>The main library and OpenGL is enabled by default. The first two options
|
||||
above enables <a href="opengles.html">OpenGL ES 1.x and 2.x</a>. The last two
|
||||
options enables the listed classic and and Gallium drivers respectively.</p>
|
||||
|
||||
</li>
|
||||
|
||||
|
@ -42,8 +44,8 @@ enables <a href="opengles.html">OpenGL ES 2.x</a>. The second option enables
|
|||
</ol>
|
||||
|
||||
<p>In the given example, it will build and install <code>libEGL</code>,
|
||||
<code>libGL</code>, <code>libGLESv1_CM</code>, <code>libGLESv2</code>,
|
||||
<code>libOpenVG</code>, and one or more EGL drivers.</p>
|
||||
<code>libGL</code>, <code>libGLESv1_CM</code>, <code>libGLESv2</code>, and one
|
||||
or more EGL drivers.</p>
|
||||
|
||||
<h3>Configure Options</h3>
|
||||
|
||||
|
@ -65,6 +67,12 @@ drivers will be installed to <code>${libdir}/egl</code>.</p>
|
|||
|
||||
</li>
|
||||
|
||||
<li><code>--enable-gallium-egl</code>
|
||||
|
||||
<p>Enable the optional <code>egl_gallium</code> driver.</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li><code>--with-egl-platforms</code>
|
||||
|
||||
<p>List the platforms (window systems) to support. Its argument is a comma
|
||||
|
@ -88,15 +96,17 @@ internal library that supports multiple APIs.</p>
|
|||
|
||||
</li>
|
||||
|
||||
<li><code>--enable-openvg</code>
|
||||
<li><code>--enable-shared-glapi</code>
|
||||
|
||||
<p>OpenVG must be explicitly enabled by this option.</p>
|
||||
<p>By default, <code>libGL</code> has its own copy of <code>libglapi</code>.
|
||||
This options makes <code>libGL</code> use the shared <code>libglapi</code>. This
|
||||
is required if applications mix OpenGL and OpenGL ES.</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li><code>--enable-gallium-egl</code>
|
||||
<li><code>--enable-openvg</code>
|
||||
|
||||
<p>Explicitly enable or disable <code>egl_gallium</code>.</p>
|
||||
<p>OpenVG must be explicitly enabled by this option.</p>
|
||||
|
||||
</li>
|
||||
|
||||
|
@ -220,8 +230,7 @@ distribution.</p>
|
|||
<p>Generally, <code>egl_dri2</code> is preferred over <code>egl_gallium</code>
|
||||
when the system already has DRI drivers. As <code>egl_gallium</code> is loaded
|
||||
before <code>egl_dri2</code> when both are available, <code>egl_gallium</code>
|
||||
may either be disabled with <code>--disable-gallium-egl</code> or packaged
|
||||
separately.</p>
|
||||
is disabled by default.</p>
|
||||
|
||||
<h2>Developers</h2>
|
||||
|
||||
|
@ -307,17 +316,5 @@ not be called with the sample display at the same time. If a driver has access
|
|||
to an <code>EGLDisplay</code> without going through the EGL APIs, the driver
|
||||
should as well lock the display before using it.
|
||||
|
||||
<h3>TODOs</h3>
|
||||
|
||||
<ul>
|
||||
<li>Pass the conformance tests</li>
|
||||
<li>Mixed use of OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is supported. But
|
||||
which one of <code>libGL.so</code>, <code>libGLESv1_CM.so</code>, and
|
||||
<code>libGLESv2.so</code> should an application link to? Bad things may happen
|
||||
when, say, an application is linked to <code>libGLESv2.so</code> and
|
||||
<code>libcairo</code>, which is linked to <code>libGL.so</code> instead.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -11,11 +11,18 @@
|
|||
<H1>News</H1>
|
||||
|
||||
|
||||
<h2>June 13, 2011</h2>
|
||||
|
||||
<p>
|
||||
<a href="relnotes-7.10.3.html">Mesa 7.10.3</a> is released. This is a bug
|
||||
fix release.
|
||||
</p>
|
||||
|
||||
<h2>April 6, 2011</h2>
|
||||
|
||||
<p>
|
||||
<a href="relnotes-7.10.2.html">Mesa 7.10.2</a> is released. This is a bug
|
||||
fix release release.
|
||||
fix release.
|
||||
</p>
|
||||
|
||||
<h2>March 2, 2011</h2>
|
||||
|
|
|
@ -34,27 +34,10 @@ EGL drivers for your hardware.</p>
|
|||
|
||||
<h2>Run the Demos</h2>
|
||||
|
||||
<p>There are some demos in <code>progs/egl/</code>. You can use them to test
|
||||
your build. For example,</p>
|
||||
|
||||
<pre>
|
||||
$ cd progs/egl/eglut
|
||||
$ make
|
||||
$ cd ../opengles1
|
||||
$ make
|
||||
$ ./torus_x11
|
||||
</pre>
|
||||
<p>There are some demos in <code>mesa/demos</code> repository.</p>
|
||||
|
||||
<h2>Developers</h2>
|
||||
|
||||
<h3>Internal Libraries</h3>
|
||||
|
||||
<table border="1" style="text-align: center;">
|
||||
<tr><td>Library Name</td><td>Used By</td><td>Enabled</td><td>OpenGL</td><td>OpenGL ES 1.x</td><td>OpenGL ES 2.x</td></tr>
|
||||
<tr><td><code>libmesa.a</td><td>Classic DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
|
||||
<tr><td><code>libmesagallium.a</td><td>Gallium EGL and DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
|
||||
</table>
|
||||
|
||||
<h3>Dispatch Table</h3>
|
||||
|
||||
<p>OpenGL ES has an additional indirection when dispatching fucntions</p>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<H1>OpenVG State Tracker</H1>
|
||||
|
||||
<p>
|
||||
The current version of the OpenVG state tracker implements OpenVG 1.0.
|
||||
The current version of the OpenVG state tracker implements OpenVG 1.1.
|
||||
</p>
|
||||
<p>
|
||||
More informations about OpenVG can be found at
|
||||
|
@ -26,9 +26,9 @@ Please refer to <a href="egl.html">Mesa EGL</a> for more information about EGL.
|
|||
|
||||
<h2>Building the library</h2>
|
||||
<ol>
|
||||
<li>Run <code>configure</code> with <code>--enable-openvg</code>. If you do
|
||||
not need OpenGL, you can add <code>--disable-opengl</code> to save the
|
||||
compilation time.</li>
|
||||
<li>Run <code>configure</code> with <code>--enable-openvg</code> and
|
||||
<code>--enable-gallium-egl</code>. If you do not need OpenGL, you can add
|
||||
<code>--disable-opengl</code> to save the compilation time.</li>
|
||||
|
||||
<li>Build and install Mesa as usual.</li>
|
||||
</ol>
|
||||
|
@ -36,7 +36,7 @@ compilation time.</li>
|
|||
<h3>Sample build</h3>
|
||||
A sample build looks as follows:
|
||||
<pre>
|
||||
$ ./configure --disable-opengl --enable-openvg
|
||||
$ ./configure --disable-opengl --enable-openvg --enable-gallium-egl
|
||||
$ make
|
||||
$ make install
|
||||
</pre>
|
||||
|
|
|
@ -0,0 +1,303 @@
|
|||
<HTML>
|
||||
|
||||
<head>
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
</head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 7.10.3 Release Notes / June 13, 2011</H1>
|
||||
|
||||
<p>
|
||||
Mesa 7.10.3 is a bug fix release which fixes bugs found since the 7.10.2 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 7.10.3 implements the OpenGL 2.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 2.1.
|
||||
</p>
|
||||
<p>
|
||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
|
||||
for DRI hardware acceleration.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
d77b02034c11d6c2a55c07f82367d780 MesaLib-7.10.3.tar.gz
|
||||
8c38fe8266be8e1ed1d84076ba5a703b MesaLib-7.10.3.tar.bz2
|
||||
614d063ecd170940d9ae7b355d365d59 MesaLib-7.10.3.zip
|
||||
8768fd562ede7ed763d92b2d22232d7a MesaGLUT-7.10.3.tar.gz
|
||||
1496415b89da9549f0f3b34d9622e2e2 MesaGLUT-7.10.3.tar.bz2
|
||||
1f29d0e7398fd3bf9f36f5db02941198 MesaGLUT-7.10.3.zip
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None.</p>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<p>This list is likely incomplete.</p>
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29162">Bug 29162</a> - mesa/darwin is severly broken</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31590">Bug 31590</a> - Black space between colors on mole hill example</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32395">Bug 32395</a> - [glsl] Incorrect code generation for shadow2DProj() with bias</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32564">Bug 32564</a> - [llvmpipe] prog: Unknown command line argument '-disable-mmx'. Try: 'prog -help' with llvm-2.9svn</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32835">Bug 32835</a> - [glsl] recursive #define results in infinite stack recursion</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33303">Bug 33303</a> - [glsl] ir_constant_expression.cpp:72: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == op[1]->type->base_type' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33314">Bug 33314</a> - [glsl] ir_constant_expression.cpp:122: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == GLSL_TYPE_BOOL' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33512">Bug 33512</a> - [SNB] case ogles2conform/GL/gl_FragCoord/gl_FragCoord_xy_frag.test and gl_FragCoord_w_frag.test fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34280">Bug 34280</a> - r200 mesa-7.10 font distortion</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34321">Bug 34321</a> - The ARB_fragment_program subset of ARB_draw_buffers not implemented</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35603">Bug 35603</a> - GLSL compiler freezes compiling shaders</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36173">Bug 36173</a> - struct renderbuffer's 'format' field never set when using FBO</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36238">Bug 36238</a> - Mesa release files don't contain scons control files</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36410">Bug 36410</a> - [SNB] Rendering errors in 3DMMES subtest taiji</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36527">Bug 36527</a> - [wine] Wolfenstein: Failed to translate rgb instruction.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36651">Bug 36651</a> - mesa requires bison and flex to build but configure does not check for them</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36738">Bug 36738</a> - Openarena crash with r300g, swrastg + llvm > 2.8</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37648">Bug 37648</a> - Logic error in mesa/main/teximage.c:texsubimage</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37739">Bug 37739</a> - Color clear of FBO without color buffer crashes</li>
|
||||
|
||||
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
<p>The full set of changes can be viewed by using the following GIT command:</p>
|
||||
|
||||
<pre>
|
||||
git log mesa-7.10.2..mesa-7.10.3
|
||||
</pre>
|
||||
|
||||
<p>Alan Hourihane (1):
|
||||
<ul>
|
||||
<li>Check for out of memory when creating fence</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Alex Buell (1):
|
||||
<ul>
|
||||
<li>configure: bump LIBDRM_REQUIRED to 2.4.24</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Alex Deucher (2):
|
||||
<ul>
|
||||
<li>r600c: add new pci ids</li>
|
||||
<li>r600g: add new pci ids</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Brian Paul (19):
|
||||
<ul>
|
||||
<li>docs: add link to 7.10.2 release notes</li>
|
||||
<li>scons: remove dangling reference to state_trackers/python/SConscript</li>
|
||||
<li>Makefile: add missing Scons files</li>
|
||||
<li>llvmpipe: document issue with LLVM 2.8 and earlier with AVX</li>
|
||||
<li>docs: replace llvmpipe/README with docs/llvmpipe.html</li>
|
||||
<li>glsl: add static qualifier to silence warning</li>
|
||||
<li>glsl: add cast to silence signed/unsigned comparison warning</li>
|
||||
<li>mesa: s/height/depth/ in texsubimage()</li>
|
||||
<li>mesa: fix void pointer arithmetic warnings</li>
|
||||
<li>mesa: add some missing GLAPIENTRY keywords</li>
|
||||
<li>mesa: check that flex/bison are installed</li>
|
||||
<li>st/mesa: fix incorrect texture level/face/slice accesses</li>
|
||||
<li>draw: fix edge flag handling in clipper (for unfilled tris/quads/polygons)</li>
|
||||
<li>vbo: check array indexes to prevent negative indexing</li>
|
||||
<li>vbo: remove node->count > 0 test in vbo_save_playback_vertex_list()</li>
|
||||
<li>st/mesa: fix software accum buffer format bug</li>
|
||||
<li>mesa: add include/c99/inttypes.h include/c99/stdbool.h include/c99/stdint.h files to tarballs</li>
|
||||
<li>docs: 7.10.3 release notes skeleton file, links</li>
|
||||
<li>mesa: bump version to 7.10.3</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Carl Worth (2):
|
||||
<ul>
|
||||
<li>glcpp: Simplify calling convention of parser's active_list functions</li>
|
||||
<li>glcpp: Fix attempts to expand recursive macros infinitely (bug #32835).</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Dave Airlie (1):
|
||||
<ul>
|
||||
<li>st/mesa: fix compressed mipmap generation.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Eric Anholt (19):
|
||||
<ul>
|
||||
<li>i965: Fix the VS thread limits for GT1, and clarify the WM limits on both.</li>
|
||||
<li>glsl: Avoid cascading errors when looking for a scalar boolean and failing.</li>
|
||||
<li>glsl: Semantically check the RHS of `&&' even when short-circuiting.</li>
|
||||
<li>glsl: Semantically check the RHS of `||' even when short-circuiting.</li>
|
||||
<li>glsl: When we've emitted a semantic error for ==, return a bool constant.</li>
|
||||
<li>glsl: Perform type checking on "^^" operands.</li>
|
||||
<li>intel: Use _mesa_base_tex_format for FBO texture attachments.</li>
|
||||
<li>swrast: Don't assert against glReadPixels of GL_RED and GL_RG.</li>
|
||||
<li>mesa: Add a gl_renderbuffer.RowStride field like textures have.</li>
|
||||
<li>mesa: Add a function to set up the default renderbuffer accessors.</li>
|
||||
<li>intel: Use Mesa core's renderbuffer accessors for depth.</li>
|
||||
<li>mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*</li>
|
||||
<li>mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*</li>
|
||||
<li>mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.</li>
|
||||
<li>swrast: Don't try to adjust_colors for <8bpc when handling R16, RG1616.</li>
|
||||
<li>intel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.</li>
|
||||
<li>Revert "intel: Add spans code for the ARB_texture_rg support."</li>
|
||||
<li>mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.</li>
|
||||
<li>mesa: Add support for OPTION ATI_draw_buffers to ARB_fp.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Hans de Goede (1):
|
||||
<ul>
|
||||
<li>texstore: fix regression stricter check for memcpy path for unorm88 and unorm1616</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Henri Verbeet (3):
|
||||
<ul>
|
||||
<li>mesa: Also update the color draw buffer if it's explicitly set to GL_NONE.</li>
|
||||
<li>glx: Destroy dri2Hash on DRI2 display destruction.</li>
|
||||
<li>glx: Only remove the glx_display from the list after it's destroyed.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Ian Romanick (9):
|
||||
<ul>
|
||||
<li>docs: Add 7.10.2 md5sums</li>
|
||||
<li>glsl: Fix off-by-one error setting max_array_access for non-constant indexing</li>
|
||||
<li>ir_to_mesa: Handle shadow compare w/projection and LOD bias correctly</li>
|
||||
<li>intel: Fix ROUND_DOWN_TO macro</li>
|
||||
<li>glsl: Regenerate compiler and glcpp files from cherry picks</li>
|
||||
<li>i965: Remove hint_gs_always and resulting dead code</li>
|
||||
<li>mesa: Don't try to clear a NULL renderbuffer</li>
|
||||
<li>mesa: Ignore blits to/from missing buffers</li>
|
||||
<li>docs: Add list of bugs fixed in 7.10.3 release</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Jeremy Huddleston (18):
|
||||
<ul>
|
||||
<li>apple: Update GL specs</li>
|
||||
<li>apple: Rename glcontextmodes.[ch] to glxconfig.[ch]</li>
|
||||
<li>apple: Rename __GLcontextModes to struct glx_config</li>
|
||||
<li>apple: Rename GLXcontext</li>
|
||||
<li>apple: Re-add driContext and do_destroy</li>
|
||||
<li>apple: Rename _gl_context_modes_find_visual to glx_config_find_visual</li>
|
||||
<li>apple: Rename GLXcontext</li>
|
||||
<li>apple: Change from XExtDisplayInfo to struct glx_display</li>
|
||||
<li>apple: ifdef out come glapi-foo on darwin</li>
|
||||
<li>glx: Dead code removal</li>
|
||||
<li>apple: Build darwin using applegl rather than indirect</li>
|
||||
<li>apple: Fix build failures in applegl_glx.c</li>
|
||||
<li>darwin: Define GALLIUM_DRIVERS_DIRS in darwin config</li>
|
||||
<li>apple: Package applegl source into MesaLib tarball</li>
|
||||
<li>darwin: Set VG_LIB_{NAME,GLOB} to fix make install</li>
|
||||
<li>darwin: Don't link against libGL when building libOSMesa</li>
|
||||
<li>darwin: Fix VG_LIB_GLOB to also match the unversioned symlink</li>
|
||||
<li>osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>José Fonseca (13):
|
||||
<ul>
|
||||
<li>llvmpipe: Update readme.</li>
|
||||
<li>mesa: GL_PROVOKING_VERTEX_EXT is a GLenum, not GLboolean.</li>
|
||||
<li>mesa: Fix GetVertexAttrib* inside display lists.</li>
|
||||
<li>draw: Fix draw_variant_output::format's type.</li>
|
||||
<li>gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.</li>
|
||||
<li>gallivm: Fix for dynamically linked LLVM 2.8 library.</li>
|
||||
<li>st/wgl: Adjust the pbuffer invisible window size.</li>
|
||||
<li>st/wgl: Fix debug output format specifiers of stw_framebuffer_get_size().</li>
|
||||
<li>st/wgl: Prevent spurious framebuffer sizes when the window is minimized.</li>
|
||||
<li>st/wgl: Cope with zero width/height windows.</li>
|
||||
<li>st/wgl: Allow to create pbuffers bigger than the desktop.</li>
|
||||
<li>st/wgl: Remove buggy assertion.</li>
|
||||
<li>wgl: Don't hold on to user supplied HDC.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Kenneth Graunke (10):
|
||||
<ul>
|
||||
<li>i965/fs: Switch W and 1/W in Sandybridge interpolation setup.</li>
|
||||
<li>i965: Refactor Sandybridge implied move handling.</li>
|
||||
<li>i965: Resolve implied moves in brw_dp_READ_4_vs_relative.</li>
|
||||
<li>intel: Add IS_GT2 macro for recognizing Sandybridge GT2 systems.</li>
|
||||
<li>i965: Allocate the whole URB to the VS and fix calculations for Gen6.</li>
|
||||
<li>intel: Support glCopyTexImage() from ARGB8888 to XRGB8888.</li>
|
||||
<li>glsl: Fix memory error when creating the supported version string.</li>
|
||||
<li>glsl: Regenerate autogenerated file builtin_function.cpp.</li>
|
||||
<li>i965: Rename various gen6 #defines to match the documentation.</li>
|
||||
<li>i965: Never enable the GS on Gen6.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Kostas Georgiou (1):
|
||||
<ul>
|
||||
<li>r600c/g: Add pci id for FirePro 2270</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Marek Olšák (18):
|
||||
<ul>
|
||||
<li>tgsi/ureg: bump the limit of immediates</li>
|
||||
<li>st/mesa: fix changing internal format via RenderbufferStorage</li>
|
||||
<li>st/mesa: GenerateMipmap should not be killed by conditional rendering</li>
|
||||
<li>swrast: BlitFramebuffer should not be killed by conditional rendering</li>
|
||||
<li>st/mesa: BlitFramebuffer should not be killed by conditional rendering</li>
|
||||
<li>st/mesa: CopyTex(Sub)Image should not be killed by conditional rendering</li>
|
||||
<li>st/mesa: conditional rendering should not kill texture decompression via blit</li>
|
||||
<li>mesa: forbid UseProgram to be called inside Begin/End</li>
|
||||
<li>mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End</li>
|
||||
<li>mesa: queries of non-existent FBO attachments should return INVALID_OPERATION</li>
|
||||
<li>r300g: fix draw_vbo splitting on r3xx-r4xx</li>
|
||||
<li>r300g: fix texturing with non-3D textures and wrap R mode set to sample border</li>
|
||||
<li>r300g: fix occlusion queries when depth test is disabled or zbuffer is missing</li>
|
||||
<li>r300g: clear can be killed by render condition</li>
|
||||
<li>st/mesa: remove asserts in st_texture_image_copy</li>
|
||||
<li>mesa: fix up assertion in _mesa_source_buffer_exists</li>
|
||||
<li>mesa: invalidate framebuffer if internal format of renderbuffer is changed</li>
|
||||
<li>mesa: return after invalidating renderbuffer</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Matt Turner (1):
|
||||
<ul>
|
||||
<li>r300/compiler: align memory allocations to 8-bytes</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Tom Stellard (3):
|
||||
<ul>
|
||||
<li>r300/compiler: Fix incorrect presubtract conversion</li>
|
||||
<li>r300/compiler: Fix dataflow analysis bug with ELSE blocks</li>
|
||||
<li>r300/compiler: Limit instructions to 3 source selects</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Vinson Lee (1):
|
||||
<ul>
|
||||
<li>gallivm: Disable MMX-disabling code on llvm-2.9.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Zou Nan hai (1):
|
||||
<ul>
|
||||
<li>i965: Align interleaved URB write length to 2</li>
|
||||
</ul></p>
|
||||
|
||||
<p>pepp (1):
|
||||
<ul>
|
||||
<li>st/mesa: assign renderbuffer's format field when allocating storage</li>
|
||||
</ul></p>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -45,7 +45,7 @@ tbd
|
|||
<li>GL_ARB_robustness (all drivers)
|
||||
<li>GL_ARB_sampler_objects (gallium drivers)
|
||||
<li>GL_ARB_seamless_cube_map (gallium r600)
|
||||
<li>GL_ARB_shader_texture_lod (gallium drivers)
|
||||
<li>GL_ARB_shader_texture_lod (gallium drivers, i965)
|
||||
<li>GL_ARB_sync (gallium drivers only, intel support was in 7.6)
|
||||
<li>GL_ARB_texture_compression_rgtc (gallium drivers, swrast, i965)
|
||||
<li>GL_ARB_texture_float (gallium, i965)
|
||||
|
|
|
@ -14,6 +14,7 @@ The release notes summarize what's new or changed in each Mesa release.
|
|||
|
||||
<UL>
|
||||
<LI><A HREF="relnotes-7.11.html">7.11 release notes</A>
|
||||
<LI><A HREF="relnotes-7.10.3.html">7.10.3 release notes</A>
|
||||
<LI><A HREF="relnotes-7.10.2.html">7.10.2 release notes</A>
|
||||
<LI><A HREF="relnotes-7.10.1.html">7.10.1 release notes</A>
|
||||
<LI><A HREF="relnotes-7.10.html">7.10 release notes</A>
|
||||
|
|
|
@ -84,6 +84,12 @@ typedef struct wl_display *EGLNativeDisplayType;
|
|||
typedef struct wl_egl_pixmap *EGLNativePixmapType;
|
||||
typedef struct wl_egl_window *EGLNativeWindowType;
|
||||
|
||||
#elif defined(__GBM__)
|
||||
|
||||
typedef struct gbm_device *EGLNativeDisplayType;
|
||||
typedef struct gbm_bo *EGLNativePixmapType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
|
||||
#elif defined(__unix__) || defined(__unix)
|
||||
|
||||
#ifdef MESA_EGL_NO_X11_HEADERS
|
||||
|
|
|
@ -849,6 +849,11 @@ struct __DRIimageExtensionRec {
|
|||
void *loaderPrivate);
|
||||
|
||||
GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
|
||||
|
||||
/**
|
||||
* The new __DRIimage will share the content with the old one, see dup(2).
|
||||
*/
|
||||
__DRIimage *(*dupImage)(__DRIimage *image, void *loaderPrivate);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -33,6 +33,8 @@ Custom builders and methods.
|
|||
import os
|
||||
import os.path
|
||||
import re
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
import SCons.Action
|
||||
import SCons.Builder
|
||||
|
@ -154,15 +156,90 @@ def createCodeGenerateMethod(env):
|
|||
env.AddMethod(code_generate, 'CodeGenerate')
|
||||
|
||||
|
||||
def _pkg_check_modules(env, name, modules):
|
||||
'''Simple wrapper for pkg-config.'''
|
||||
|
||||
env['HAVE_' + name] = False
|
||||
|
||||
# For backwards compatability
|
||||
env[name.lower()] = False
|
||||
|
||||
if env['platform'] == 'windows':
|
||||
return
|
||||
|
||||
if not env.Detect('pkg-config'):
|
||||
return
|
||||
|
||||
if subprocess.call(["pkg-config", "--exists", ' '.join(modules)]) != 0:
|
||||
return
|
||||
|
||||
# Other flags may affect the compilation of unrelated targets, so store
|
||||
# them with a prefix, (e.g., XXX_CFLAGS, XXX_LIBS, etc)
|
||||
try:
|
||||
flags = env.ParseFlags('!pkg-config --cflags --libs ' + ' '.join(modules))
|
||||
except OSError:
|
||||
return
|
||||
prefix = name + '_'
|
||||
for flag_name, flag_value in flags.iteritems():
|
||||
assert '_' not in flag_name
|
||||
env[prefix + flag_name] = flag_value
|
||||
|
||||
env['HAVE_' + name] = True
|
||||
|
||||
def pkg_check_modules(env, name, modules):
|
||||
|
||||
sys.stdout.write('Checking for %s...' % name)
|
||||
_pkg_check_modules(env, name, modules)
|
||||
result = env['HAVE_' + name]
|
||||
sys.stdout.write(' %s\n' % ['no', 'yes'][int(bool(result))])
|
||||
|
||||
# XXX: For backwards compatability
|
||||
env[name.lower()] = result
|
||||
|
||||
|
||||
def pkg_use_modules(env, names):
|
||||
'''Search for all environment flags that match NAME_FOO and append them to
|
||||
the FOO environment variable.'''
|
||||
|
||||
names = env.Flatten(names)
|
||||
|
||||
for name in names:
|
||||
prefix = name + '_'
|
||||
|
||||
if not 'HAVE_' + name in env:
|
||||
print 'Attempt to use unknown module %s' % name
|
||||
env.Exit(1)
|
||||
|
||||
if not env['HAVE_' + name]:
|
||||
print 'Attempt to use unavailable module %s' % name
|
||||
env.Exit(1)
|
||||
|
||||
flags = {}
|
||||
for flag_name, flag_value in env.Dictionary().iteritems():
|
||||
if flag_name.startswith(prefix):
|
||||
flag_name = flag_name[len(prefix):]
|
||||
if '_' not in flag_name:
|
||||
flags[flag_name] = flag_value
|
||||
if flags:
|
||||
env.MergeFlags(flags)
|
||||
|
||||
|
||||
def createPkgConfigMethods(env):
|
||||
env.AddMethod(pkg_check_modules, 'PkgCheckModules')
|
||||
env.AddMethod(pkg_use_modules, 'PkgUseModules')
|
||||
|
||||
|
||||
def generate(env):
|
||||
"""Common environment generation code"""
|
||||
|
||||
if env.get('quiet', True):
|
||||
verbose = env.get('verbose', False) or not env.get('quiet', True)
|
||||
if not verbose:
|
||||
quietCommandLines(env)
|
||||
|
||||
# Custom builders and methods
|
||||
createConvenienceLibBuilder(env)
|
||||
createCodeGenerateMethod(env)
|
||||
createPkgConfigMethods(env)
|
||||
|
||||
# for debugging
|
||||
#print env.Dump()
|
||||
|
|
|
@ -104,41 +104,6 @@ def num_jobs():
|
|||
return 1
|
||||
|
||||
|
||||
def pkg_config_modules(env, name, modules):
|
||||
'''Simple wrapper for pkg-config.'''
|
||||
|
||||
env[name] = False
|
||||
|
||||
if env['platform'] == 'windows':
|
||||
return
|
||||
|
||||
if not env.Detect('pkg-config'):
|
||||
return
|
||||
|
||||
if subprocess.call(["pkg-config", "--exists", ' '.join(modules)]) != 0:
|
||||
return
|
||||
|
||||
# Put -I and -L flags directly into the environment, as these don't affect
|
||||
# the compilation of targets that do not use them
|
||||
try:
|
||||
env.ParseConfig('pkg-config --cflags-only-I --libs-only-L ' + ' '.join(modules))
|
||||
except OSError:
|
||||
return
|
||||
|
||||
# Other flags may affect the compilation of unrelated targets, so store
|
||||
# them with a prefix, (e.g., XXX_CFLAGS, XXX_LIBS, etc)
|
||||
try:
|
||||
flags = env.ParseFlags('!pkg-config --cflags-only-other --libs-only-l --libs-only-other ' + ' '.join(modules))
|
||||
except OSError:
|
||||
return
|
||||
prefix = name.upper() + '_'
|
||||
for flag_name, flag_value in flags.iteritems():
|
||||
env[prefix + flag_name] = flag_value
|
||||
|
||||
env[name] = True
|
||||
|
||||
|
||||
|
||||
def generate(env):
|
||||
"""Common environment generation code"""
|
||||
|
||||
|
@ -247,6 +212,8 @@ def generate(env):
|
|||
# configuration. See also http://www.scons.org/wiki/AdvancedBuildExample
|
||||
build_topdir = 'build'
|
||||
build_subdir = env['platform']
|
||||
if env['embedded']:
|
||||
build_subdir = 'embedded-' + build_subdir
|
||||
if env['machine'] != 'generic':
|
||||
build_subdir += '-' + env['machine']
|
||||
if env['build'] != 'release':
|
||||
|
@ -277,6 +244,31 @@ def generate(env):
|
|||
cppdefines += ['NDEBUG']
|
||||
if env['build'] == 'profile':
|
||||
cppdefines += ['PROFILE']
|
||||
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
|
||||
cppdefines += [
|
||||
'_POSIX_SOURCE',
|
||||
('_POSIX_C_SOURCE', '199309L'),
|
||||
'_SVID_SOURCE',
|
||||
'_BSD_SOURCE',
|
||||
'_GNU_SOURCE',
|
||||
'PTHREADS',
|
||||
'HAVE_POSIX_MEMALIGN',
|
||||
]
|
||||
if env['platform'] == 'darwin':
|
||||
cppdefines += [
|
||||
'_DARWIN_C_SOURCE',
|
||||
'GLX_USE_APPLEGL',
|
||||
'GLX_DIRECT_RENDERING',
|
||||
]
|
||||
else:
|
||||
cppdefines += [
|
||||
'GLX_DIRECT_RENDERING',
|
||||
'GLX_INDIRECT_RENDERING',
|
||||
]
|
||||
if env['platform'] in ('linux', 'freebsd'):
|
||||
cppdefines += ['HAVE_ALIAS']
|
||||
else:
|
||||
cppdefines += ['GLX_ALIAS_UNSUPPORTED']
|
||||
if platform == 'windows':
|
||||
cppdefines += [
|
||||
'WIN32',
|
||||
|
@ -349,8 +341,8 @@ def generate(env):
|
|||
if platform == 'wince':
|
||||
cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE']
|
||||
cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE_OGL']
|
||||
if platform == 'embedded':
|
||||
cppdefines += ['PIPE_OS_EMBEDDED']
|
||||
if env['embedded']:
|
||||
cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED']
|
||||
env.Append(CPPDEFINES = cppdefines)
|
||||
|
||||
# C compiler options
|
||||
|
@ -367,6 +359,8 @@ def generate(env):
|
|||
ccflags += ['-O0']
|
||||
else:
|
||||
ccflags += ['-O3']
|
||||
# Work around aliasing bugs - developers should comment this out
|
||||
ccflags += ['-fno-strict-aliasing']
|
||||
ccflags += ['-g3']
|
||||
if env['build'] in ('checked', 'profile'):
|
||||
# See http://code.google.com/p/jrfonseca/wiki/Gprof2Dot#Which_options_should_I_pass_to_gcc_when_compiling_for_profiling?
|
||||
|
@ -403,6 +397,8 @@ def generate(env):
|
|||
ccflags += ['-m64']
|
||||
if platform == 'darwin':
|
||||
ccflags += ['-fno-common']
|
||||
if env['platform'] != 'windows':
|
||||
ccflags += ['-fvisibility=hidden']
|
||||
# See also:
|
||||
# - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||
ccflags += [
|
||||
|
@ -421,10 +417,10 @@ def generate(env):
|
|||
]
|
||||
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
|
||||
ccflags += [
|
||||
'-Werror=pointer-arith',
|
||||
'-Wpointer-arith',
|
||||
]
|
||||
cflags += [
|
||||
'-Werror=declaration-after-statement',
|
||||
'-Wdeclaration-after-statement',
|
||||
]
|
||||
if msvc:
|
||||
# See also:
|
||||
|
@ -595,7 +591,10 @@ def generate(env):
|
|||
env['LINK'] = env['CXX']
|
||||
|
||||
# Default libs
|
||||
env.Append(LIBS = [])
|
||||
libs = []
|
||||
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
|
||||
libs += ['m', 'pthread', 'dl']
|
||||
env.Append(LIBS = libs)
|
||||
|
||||
# Load tools
|
||||
env.Tool('lex')
|
||||
|
@ -603,19 +602,21 @@ def generate(env):
|
|||
if env['llvm']:
|
||||
env.Tool('llvm')
|
||||
|
||||
pkg_config_modules(env, 'x11', ['x11', 'xext'])
|
||||
pkg_config_modules(env, 'drm', ['libdrm'])
|
||||
pkg_config_modules(env, 'drm_intel', ['libdrm_intel'])
|
||||
pkg_config_modules(env, 'drm_radeon', ['libdrm_radeon'])
|
||||
pkg_config_modules(env, 'xorg', ['xorg-server'])
|
||||
pkg_config_modules(env, 'kms', ['libkms'])
|
||||
|
||||
env['dri'] = env['x11'] and env['drm']
|
||||
|
||||
# Custom builders and methods
|
||||
env.Tool('custom')
|
||||
createInstallMethods(env)
|
||||
|
||||
env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage', 'xfixes'])
|
||||
env.PkgCheckModules('XF86VIDMODE', ['xxf86vm'])
|
||||
env.PkgCheckModules('DRM', ['libdrm'])
|
||||
env.PkgCheckModules('DRM_INTEL', ['libdrm_intel'])
|
||||
env.PkgCheckModules('DRM_RADEON', ['libdrm_radeon'])
|
||||
env.PkgCheckModules('XORG', ['xorg-server'])
|
||||
env.PkgCheckModules('KMS', ['libkms'])
|
||||
env.PkgCheckModules('UDEV', ['libudev'])
|
||||
|
||||
env['dri'] = env['x11'] and env['drm']
|
||||
|
||||
# for debugging
|
||||
#print env.Dump()
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ SConscript('mesa/SConscript')
|
|||
SConscript('mapi/vgapi/SConscript')
|
||||
|
||||
if env['platform'] != 'embedded':
|
||||
SConscript('glx/SConscript')
|
||||
SConscript('egl/main/SConscript')
|
||||
SConscript('glu/sgi/SConscript')
|
||||
SConscript('glut/glx/SConscript')
|
||||
|
|
|
@ -4,12 +4,14 @@ TOP = ../../../..
|
|||
include $(TOP)/configs/current
|
||||
|
||||
EGL_DRIVER = egl_dri2
|
||||
EGL_SOURCES = egl_dri2.c platform_drm.c common.c
|
||||
EGL_SOURCES = egl_dri2.c common.c
|
||||
|
||||
EGL_INCLUDES = \
|
||||
-I$(TOP)/include \
|
||||
-I$(TOP)/src/egl/main \
|
||||
-I$(TOP)/src/mapi \
|
||||
-I$(TOP)/src/gbm/main \
|
||||
-I$(TOP)/src/gbm/backends/dri \
|
||||
-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
|
||||
$(LIBUDEV_CFLAGS) \
|
||||
$(LIBDRM_CFLAGS)
|
||||
|
@ -29,6 +31,11 @@ EGL_INCLUDES += -DHAVE_X11_PLATFORM $(XCB_DRI2_CFLAGS)
|
|||
EGL_LIBS += $(XCB_DRI2_LIBS)
|
||||
endif
|
||||
|
||||
ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
|
||||
EGL_SOURCES += platform_drm.c
|
||||
EGL_INCLUDES += -DHAVE_DRM_PLATFORM
|
||||
endif
|
||||
|
||||
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
|
||||
EGL_SOURCES += platform_wayland.c
|
||||
EGL_INCLUDES += -DHAVE_WAYLAND_PLATFORM $(WAYLAND_CFLAGS) \
|
||||
|
|
|
@ -97,6 +97,18 @@ EGLint dri2_to_egl_attribute_map[] = {
|
|||
0, /* __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE */
|
||||
};
|
||||
|
||||
static EGLBoolean
|
||||
dri2_match_config(const _EGLConfig *conf, const _EGLConfig *criteria)
|
||||
{
|
||||
if (_eglCompareConfigs(conf, criteria, NULL, EGL_FALSE) != 0)
|
||||
return EGL_FALSE;
|
||||
|
||||
if (!_eglMatchConfig(conf, criteria))
|
||||
return EGL_FALSE;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
struct dri2_egl_config *
|
||||
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
|
||||
int depth, EGLint surface_type, const EGLint *attr_list)
|
||||
|
@ -190,7 +202,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
|
|||
base.ConfigID = EGL_DONT_CARE;
|
||||
base.SurfaceType = EGL_DONT_CARE;
|
||||
num_configs = _eglFilterArray(disp->Configs, (void **) &matching_config, 1,
|
||||
(_EGLArrayForEach) _eglMatchConfig, &base);
|
||||
(_EGLArrayForEach) dri2_match_config, &base);
|
||||
|
||||
if (num_configs == 1) {
|
||||
conf = (struct dri2_egl_config *) matching_config;
|
||||
|
@ -232,7 +244,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
|
|||
return conf;
|
||||
}
|
||||
|
||||
static __DRIimage *
|
||||
__DRIimage *
|
||||
dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data)
|
||||
{
|
||||
_EGLDisplay *disp = data;
|
||||
|
@ -322,8 +334,8 @@ dri2_bind_extensions(struct dri2_egl_display *dri2_dpy,
|
|||
return ret;
|
||||
}
|
||||
|
||||
EGLBoolean
|
||||
dri2_load_driver(_EGLDisplay *disp)
|
||||
static const __DRIextension **
|
||||
dri2_open_driver(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = disp->DriverData;
|
||||
const __DRIextension **extensions;
|
||||
|
@ -362,9 +374,9 @@ dri2_load_driver(_EGLDisplay *disp)
|
|||
|
||||
if (dri2_dpy->driver == NULL) {
|
||||
_eglLog(_EGL_WARNING,
|
||||
"DRI2: failed to open any driver (search paths %s)",
|
||||
search_paths);
|
||||
return EGL_FALSE;
|
||||
"DRI2: failed to open %s (search paths %s)",
|
||||
dri2_dpy->driver_name, search_paths);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
_eglLog(_EGL_DEBUG, "DRI2: dlopen(%s)", path);
|
||||
|
@ -373,59 +385,59 @@ dri2_load_driver(_EGLDisplay *disp)
|
|||
_eglLog(_EGL_WARNING,
|
||||
"DRI2: driver exports no extensions (%s)", dlerror());
|
||||
dlclose(dri2_dpy->driver);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
if (strcmp(dri2_dpy->driver_name, "swrast") == 0) {
|
||||
if (!dri2_bind_extensions(dri2_dpy, swrast_driver_extensions, extensions)) {
|
||||
dlclose(dri2_dpy->driver);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
} else {
|
||||
if (!dri2_bind_extensions(dri2_dpy, dri2_driver_extensions, extensions)) {
|
||||
dlclose(dri2_dpy->driver);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
}
|
||||
return extensions;
|
||||
}
|
||||
|
||||
EGLBoolean
|
||||
dri2_load_driver(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = disp->DriverData;
|
||||
const __DRIextension **extensions;
|
||||
|
||||
extensions = dri2_open_driver(disp);
|
||||
if (!extensions)
|
||||
return EGL_FALSE;
|
||||
|
||||
if (!dri2_bind_extensions(dri2_dpy, dri2_driver_extensions, extensions)) {
|
||||
dlclose(dri2_dpy->driver);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
EGLBoolean
|
||||
dri2_create_screen(_EGLDisplay *disp)
|
||||
dri2_load_driver_swrast(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = disp->DriverData;
|
||||
const __DRIextension **extensions;
|
||||
struct dri2_egl_display *dri2_dpy;
|
||||
unsigned int api_mask;
|
||||
|
||||
dri2_dpy = disp->DriverData;
|
||||
|
||||
if (dri2_dpy->dri2) {
|
||||
dri2_dpy->dri_screen =
|
||||
dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions,
|
||||
&dri2_dpy->driver_configs, disp);
|
||||
} else {
|
||||
assert(dri2_dpy->swrast);
|
||||
dri2_dpy->dri_screen =
|
||||
dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
|
||||
&dri2_dpy->driver_configs, disp);
|
||||
dri2_dpy->driver_name = "swrast";
|
||||
extensions = dri2_open_driver(disp);
|
||||
if (!extensions) {
|
||||
/* try again with swrastg */
|
||||
dri2_dpy->driver_name = "swrastg";
|
||||
extensions = dri2_open_driver(disp);
|
||||
}
|
||||
|
||||
if (dri2_dpy->dri_screen == NULL) {
|
||||
_eglLog(_EGL_WARNING, "DRI2: failed to create dri screen");
|
||||
if (!extensions)
|
||||
return EGL_FALSE;
|
||||
|
||||
if (!dri2_bind_extensions(dri2_dpy, swrast_driver_extensions, extensions)) {
|
||||
dlclose(dri2_dpy->driver);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
|
||||
|
||||
if (dri2_dpy->dri2) {
|
||||
if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
|
||||
goto cleanup_dri_screen;
|
||||
} else {
|
||||
assert(dri2_dpy->swrast);
|
||||
if (!dri2_bind_extensions(dri2_dpy, swrast_core_extensions, extensions))
|
||||
goto cleanup_dri_screen;
|
||||
}
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
dri2_setup_screen(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
unsigned int api_mask;
|
||||
|
||||
if (dri2_dpy->dri2) {
|
||||
if (dri2_dpy->dri2->base.version >= 2)
|
||||
|
@ -468,6 +480,46 @@ dri2_create_screen(_EGLDisplay *disp)
|
|||
disp->Extensions.KHR_image_base = EGL_TRUE;
|
||||
disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
EGLBoolean
|
||||
dri2_create_screen(_EGLDisplay *disp)
|
||||
{
|
||||
const __DRIextension **extensions;
|
||||
struct dri2_egl_display *dri2_dpy;
|
||||
|
||||
dri2_dpy = disp->DriverData;
|
||||
|
||||
if (dri2_dpy->dri2) {
|
||||
dri2_dpy->dri_screen =
|
||||
dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions,
|
||||
&dri2_dpy->driver_configs, disp);
|
||||
} else {
|
||||
assert(dri2_dpy->swrast);
|
||||
dri2_dpy->dri_screen =
|
||||
dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
|
||||
&dri2_dpy->driver_configs, disp);
|
||||
}
|
||||
|
||||
if (dri2_dpy->dri_screen == NULL) {
|
||||
_eglLog(_EGL_WARNING, "DRI2: failed to create dri screen");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
dri2_dpy->own_dri_screen = 1;
|
||||
|
||||
extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
|
||||
|
||||
if (dri2_dpy->dri2) {
|
||||
if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
|
||||
goto cleanup_dri_screen;
|
||||
} else {
|
||||
assert(dri2_dpy->swrast);
|
||||
if (!dri2_bind_extensions(dri2_dpy, swrast_core_extensions, extensions))
|
||||
goto cleanup_dri_screen;
|
||||
}
|
||||
|
||||
dri2_setup_screen(disp);
|
||||
|
||||
return EGL_TRUE;
|
||||
|
||||
|
@ -496,10 +548,12 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_LIBUDEV
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
case _EGL_PLATFORM_DRM:
|
||||
if (disp->Options.TestOnly)
|
||||
return EGL_TRUE;
|
||||
return dri2_initialize_drm(drv, disp);
|
||||
#endif
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
case _EGL_PLATFORM_WAYLAND:
|
||||
if (disp->Options.TestOnly)
|
||||
|
@ -524,14 +578,30 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
_eglReleaseDisplayResources(drv, disp);
|
||||
_eglCleanupDisplay(disp);
|
||||
|
||||
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
|
||||
if (dri2_dpy->own_dri_screen)
|
||||
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
|
||||
if (dri2_dpy->fd)
|
||||
close(dri2_dpy->fd);
|
||||
dlclose(dri2_dpy->driver);
|
||||
if (dri2_dpy->driver)
|
||||
dlclose(dri2_dpy->driver);
|
||||
|
||||
if (disp->PlatformDisplay == NULL) {
|
||||
switch (disp->Platform) {
|
||||
#ifdef HAVE_X11_PLATFORM
|
||||
if (disp->PlatformDisplay == NULL)
|
||||
xcb_disconnect(dri2_dpy->conn);
|
||||
case _EGL_PLATFORM_X11:
|
||||
xcb_disconnect(dri2_dpy->conn);
|
||||
break;
|
||||
#endif
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
case _EGL_PLATFORM_WAYLAND:
|
||||
wl_display_destroy(dri2_dpy->wl_dpy);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
free(dri2_dpy);
|
||||
disp->DriverData = NULL;
|
||||
|
||||
|
|
|
@ -44,6 +44,10 @@
|
|||
#include <GL/gl.h>
|
||||
#include <GL/internal/dri_interface.h>
|
||||
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
#include <gbm_driint.h>
|
||||
#endif
|
||||
|
||||
#include "eglconfig.h"
|
||||
#include "eglcontext.h"
|
||||
#include "egldisplay.h"
|
||||
|
@ -69,6 +73,7 @@ struct dri2_egl_display
|
|||
int dri2_major;
|
||||
int dri2_minor;
|
||||
__DRIscreen *dri_screen;
|
||||
int own_dri_screen;
|
||||
const __DRIconfig **driver_configs;
|
||||
void *driver;
|
||||
__DRIcoreExtension *core;
|
||||
|
@ -79,12 +84,16 @@ struct dri2_egl_display
|
|||
__DRIimageExtension *image;
|
||||
int fd;
|
||||
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
struct gbm_dri_device *gbm_dri;
|
||||
#endif
|
||||
|
||||
char *device_name;
|
||||
char *driver_name;
|
||||
|
||||
__DRIdri2LoaderExtension dri2_loader_extension;
|
||||
__DRIswrastLoaderExtension swrast_loader_extension;
|
||||
const __DRIextension *extensions[3];
|
||||
const __DRIextension *extensions[4];
|
||||
|
||||
#ifdef HAVE_X11_PLATFORM
|
||||
xcb_connection_t *conn;
|
||||
|
@ -110,6 +119,7 @@ struct dri2_egl_context
|
|||
enum wayland_buffer_type {
|
||||
WL_BUFFER_FRONT,
|
||||
WL_BUFFER_BACK,
|
||||
WL_BUFFER_THIRD,
|
||||
WL_BUFFER_COUNT
|
||||
};
|
||||
|
||||
|
@ -145,9 +155,11 @@ struct dri2_egl_surface
|
|||
struct wl_egl_window *wl_win;
|
||||
struct wl_egl_pixmap *wl_pix;
|
||||
struct wl_buffer *wl_drm_buffer[WL_BUFFER_COUNT];
|
||||
int wl_buffer_lock[WL_BUFFER_COUNT];
|
||||
int dx;
|
||||
int dy;
|
||||
__DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT];
|
||||
__DRIbuffer *third_buffer;
|
||||
__DRIbuffer *pending_buffer;
|
||||
EGLBoolean block_swap_buffers;
|
||||
#endif
|
||||
|
@ -182,9 +194,19 @@ extern const __DRIuseInvalidateExtension use_invalidate;
|
|||
EGLBoolean
|
||||
dri2_load_driver(_EGLDisplay *disp);
|
||||
|
||||
/* Helper for platforms not using dri2_create_screen */
|
||||
void
|
||||
dri2_setup_screen(_EGLDisplay *disp);
|
||||
|
||||
EGLBoolean
|
||||
dri2_load_driver_swrast(_EGLDisplay *disp);
|
||||
|
||||
EGLBoolean
|
||||
dri2_create_screen(_EGLDisplay *disp);
|
||||
|
||||
__DRIimage *
|
||||
dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data);
|
||||
|
||||
struct dri2_egl_config *
|
||||
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
|
||||
int depth, EGLint surface_type, const EGLint *attr_list);
|
||||
|
|
|
@ -33,6 +33,50 @@
|
|||
|
||||
#include "egl_dri2.h"
|
||||
|
||||
static _EGLImage *
|
||||
dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
|
||||
EGLClientBuffer buffer, const EGLint *attr_list)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct gbm_dri_bo *dri_bo = gbm_dri_bo((struct gbm_bo *) buffer);
|
||||
struct dri2_egl_image *dri2_img;
|
||||
|
||||
dri2_img = malloc(sizeof *dri2_img);
|
||||
if (!dri2_img) {
|
||||
_eglError(EGL_BAD_ALLOC, "dri2_create_image_khr_pixmap");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!_eglInitImage(&dri2_img->base, disp)) {
|
||||
free(dri2_img);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dri2_img->dri_image = dri2_dpy->image->dupImage(dri_bo->image, dri2_img);
|
||||
if (dri2_img->dri_image == NULL) {
|
||||
free(dri2_img);
|
||||
_eglError(EGL_BAD_ALLOC, "dri2_create_image_khr_pixmap");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &dri2_img->base;
|
||||
}
|
||||
|
||||
static _EGLImage *
|
||||
dri2_drm_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLContext *ctx, EGLenum target,
|
||||
EGLClientBuffer buffer, const EGLint *attr_list)
|
||||
{
|
||||
(void) drv;
|
||||
|
||||
switch (target) {
|
||||
case EGL_NATIVE_PIXMAP_KHR:
|
||||
return dri2_create_image_khr_pixmap(disp, ctx, buffer, attr_list);
|
||||
default:
|
||||
return dri2_create_image_khr(drv, disp, ctx, target, buffer, attr_list);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
dri2_drm_authenticate(_EGLDisplay *disp, uint32_t id)
|
||||
{
|
||||
|
@ -45,57 +89,58 @@ EGLBoolean
|
|||
dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy;
|
||||
struct gbm_device *gbm;
|
||||
int i;
|
||||
|
||||
dri2_dpy = malloc(sizeof *dri2_dpy);
|
||||
if (!dri2_dpy)
|
||||
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
|
||||
|
||||
|
||||
memset(dri2_dpy, 0, sizeof *dri2_dpy);
|
||||
|
||||
disp->DriverData = (void *) dri2_dpy;
|
||||
dri2_dpy->fd = (int) (intptr_t) disp->PlatformDisplay;
|
||||
|
||||
dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd);
|
||||
if (dri2_dpy->driver_name == NULL)
|
||||
return _eglError(EGL_BAD_ALLOC, "DRI2: failed to get driver name");
|
||||
|
||||
dri2_dpy->device_name = dri2_get_device_name_for_fd(dri2_dpy->fd);
|
||||
if (dri2_dpy->device_name == NULL) {
|
||||
_eglError(EGL_BAD_ALLOC, "DRI2: failed to get device name");
|
||||
goto cleanup_driver_name;
|
||||
gbm = (struct gbm_device *) disp->PlatformDisplay;
|
||||
if (strcmp(gbm_device_get_backend_name(gbm), "drm") != 0) {
|
||||
free(dri2_dpy);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
if (!dri2_load_driver(disp))
|
||||
goto cleanup_device_name;
|
||||
dri2_dpy->gbm_dri = gbm_dri_device(gbm);
|
||||
if (dri2_dpy->gbm_dri->base.type != GBM_DRM_DRIVER_TYPE_DRI) {
|
||||
free(dri2_dpy);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
dri2_dpy->extensions[0] = &image_lookup_extension.base;
|
||||
dri2_dpy->extensions[1] = &use_invalidate.base;
|
||||
dri2_dpy->extensions[2] = NULL;
|
||||
dri2_dpy->fd = gbm_device_get_fd(gbm);
|
||||
dri2_dpy->device_name = dri2_get_device_name_for_fd(dri2_dpy->fd);
|
||||
dri2_dpy->driver_name = dri2_dpy->gbm_dri->base.driver_name;
|
||||
|
||||
if (!dri2_create_screen(disp))
|
||||
goto cleanup_driver;
|
||||
dri2_dpy->dri_screen = dri2_dpy->gbm_dri->screen;
|
||||
dri2_dpy->core = dri2_dpy->gbm_dri->core;
|
||||
dri2_dpy->dri2 = dri2_dpy->gbm_dri->dri2;
|
||||
dri2_dpy->image = dri2_dpy->gbm_dri->image;
|
||||
dri2_dpy->driver_configs = dri2_dpy->gbm_dri->driver_configs;
|
||||
|
||||
dri2_dpy->gbm_dri->lookup_image = dri2_lookup_egl_image;
|
||||
dri2_dpy->gbm_dri->lookup_user_data = disp;
|
||||
|
||||
dri2_setup_screen(disp);
|
||||
|
||||
for (i = 0; dri2_dpy->driver_configs[i]; i++)
|
||||
dri2_add_config(disp, dri2_dpy->driver_configs[i], i + 1, 0, 0, NULL);
|
||||
dri2_add_config(disp, dri2_dpy->driver_configs[i],
|
||||
i + 1, 0, 0, NULL);
|
||||
|
||||
drv->API.CreateImageKHR = dri2_drm_create_image_khr;
|
||||
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
|
||||
#endif
|
||||
dri2_dpy->authenticate = dri2_drm_authenticate;
|
||||
|
||||
|
||||
/* we're supporting EGL 1.4 */
|
||||
disp->VersionMajor = 1;
|
||||
disp->VersionMinor = 4;
|
||||
|
||||
return EGL_TRUE;
|
||||
|
||||
cleanup_driver:
|
||||
dlclose(dri2_dpy->driver);
|
||||
cleanup_device_name:
|
||||
free(dri2_dpy->device_name);
|
||||
cleanup_driver_name:
|
||||
free(dri2_dpy->driver_name);
|
||||
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
|
|
@ -59,6 +59,29 @@ force_roundtrip(struct wl_display *display)
|
|||
wl_display_iterate(display, WL_DISPLAY_READABLE);
|
||||
}
|
||||
|
||||
static void
|
||||
wl_buffer_release(void *data, struct wl_buffer *buffer)
|
||||
{
|
||||
struct dri2_egl_surface *dri2_surf = data;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < WL_BUFFER_COUNT; ++i)
|
||||
if (dri2_surf->wl_drm_buffer[i] == buffer)
|
||||
break;
|
||||
|
||||
assert(i <= WL_BUFFER_COUNT);
|
||||
|
||||
/* not found? */
|
||||
if (i == WL_BUFFER_COUNT)
|
||||
return;
|
||||
|
||||
dri2_surf->wl_buffer_lock[i] = 0;
|
||||
|
||||
}
|
||||
|
||||
static struct wl_buffer_listener wl_buffer_listener = {
|
||||
wl_buffer_release
|
||||
};
|
||||
|
||||
/**
|
||||
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
|
||||
|
@ -85,13 +108,16 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
|
|||
if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
|
||||
goto cleanup_surf;
|
||||
|
||||
for (i = 0; i < WL_BUFFER_COUNT; ++i)
|
||||
for (i = 0; i < WL_BUFFER_COUNT; ++i) {
|
||||
dri2_surf->wl_drm_buffer[i] = NULL;
|
||||
dri2_surf->wl_buffer_lock[i] = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < __DRI_BUFFER_COUNT; ++i)
|
||||
dri2_surf->dri_buffers[i] = NULL;
|
||||
|
||||
dri2_surf->pending_buffer = NULL;
|
||||
dri2_surf->third_buffer = NULL;
|
||||
dri2_surf->block_swap_buffers = EGL_FALSE;
|
||||
|
||||
switch (type) {
|
||||
|
@ -187,6 +213,11 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
|
|||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->dri_buffers[i]);
|
||||
|
||||
if (dri2_surf->third_buffer) {
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->third_buffer);
|
||||
}
|
||||
|
||||
free(surf);
|
||||
|
||||
return EGL_TRUE;
|
||||
|
@ -215,10 +246,14 @@ wayland_create_buffer(struct dri2_egl_surface *dri2_surf,
|
|||
{
|
||||
struct dri2_egl_display *dri2_dpy =
|
||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||
struct wl_buffer *buf;
|
||||
|
||||
return wl_drm_create_buffer(dri2_dpy->wl_drm, buffer->name,
|
||||
dri2_surf->base.Width, dri2_surf->base.Height,
|
||||
buffer->pitch, visual);
|
||||
buf = wl_drm_create_buffer(dri2_dpy->wl_drm, buffer->name,
|
||||
dri2_surf->base.Width, dri2_surf->base.Height,
|
||||
buffer->pitch, visual);
|
||||
wl_buffer_add_listener(buf, &wl_buffer_listener, dri2_surf);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -232,6 +267,8 @@ dri2_process_back_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
|
|||
switch (dri2_surf->type) {
|
||||
case DRI2_WINDOW_SURFACE:
|
||||
/* allocate a front buffer for our double-buffered window*/
|
||||
if (dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] != NULL)
|
||||
break;
|
||||
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] =
|
||||
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
|
||||
__DRI_BUFFER_FRONT_LEFT, format,
|
||||
|
@ -289,6 +326,12 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
|
|||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||
int i;
|
||||
|
||||
if (dri2_surf->third_buffer) {
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->third_buffer);
|
||||
dri2_surf->third_buffer = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < __DRI_BUFFER_COUNT; ++i) {
|
||||
if (dri2_surf->dri_buffers[i]) {
|
||||
switch (i) {
|
||||
|
@ -309,6 +352,76 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
|
|||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
pointer_swap(const void **p1, const void **p2)
|
||||
{
|
||||
const void *tmp = *p1;
|
||||
*p1 = *p2;
|
||||
*p2 = tmp;
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_third_buffer(struct dri2_egl_surface *dri2_surf)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy =
|
||||
dri2_egl_display(dri2_surf->base.Resource.Display);
|
||||
|
||||
if (dri2_surf->third_buffer == NULL)
|
||||
return;
|
||||
|
||||
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
|
||||
dri2_surf->third_buffer);
|
||||
dri2_surf->third_buffer = NULL;
|
||||
|
||||
if (dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD])
|
||||
wl_buffer_destroy(dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD]);
|
||||
dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD] = NULL;
|
||||
dri2_surf->wl_buffer_lock[WL_BUFFER_THIRD] = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
swap_wl_buffers(struct dri2_egl_surface *dri2_surf,
|
||||
enum wayland_buffer_type a, enum wayland_buffer_type b)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
tmp = dri2_surf->wl_buffer_lock[a];
|
||||
dri2_surf->wl_buffer_lock[a] = dri2_surf->wl_buffer_lock[b];
|
||||
dri2_surf->wl_buffer_lock[b] = tmp;
|
||||
|
||||
pointer_swap((const void **) &dri2_surf->wl_drm_buffer[a],
|
||||
(const void **) &dri2_surf->wl_drm_buffer[b]);
|
||||
}
|
||||
|
||||
static void
|
||||
swap_back_and_third(struct dri2_egl_surface *dri2_surf)
|
||||
{
|
||||
if (dri2_surf->wl_buffer_lock[WL_BUFFER_THIRD])
|
||||
destroy_third_buffer(dri2_surf);
|
||||
|
||||
pointer_swap((const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT],
|
||||
(const void **) &dri2_surf->third_buffer);
|
||||
|
||||
swap_wl_buffers(dri2_surf, WL_BUFFER_BACK, WL_BUFFER_THIRD);
|
||||
}
|
||||
|
||||
static void
|
||||
dri2_prior_buffer_creation(struct dri2_egl_surface *dri2_surf,
|
||||
unsigned int type)
|
||||
{
|
||||
switch (type) {
|
||||
case __DRI_BUFFER_BACK_LEFT:
|
||||
if (dri2_surf->wl_buffer_lock[WL_BUFFER_BACK])
|
||||
swap_back_and_third(dri2_surf);
|
||||
else if (dri2_surf->third_buffer)
|
||||
destroy_third_buffer(dri2_surf);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static __DRIbuffer *
|
||||
dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
|
||||
int *width, int *height,
|
||||
|
@ -335,6 +448,7 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
|
|||
if (dri2_surf->wl_drm_buffer[i])
|
||||
wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]);
|
||||
dri2_surf->wl_drm_buffer[i] = NULL;
|
||||
dri2_surf->wl_buffer_lock[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -343,6 +457,8 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
|
|||
assert(attachments[i] < __DRI_BUFFER_COUNT);
|
||||
assert(dri2_surf->buffer_count < 5);
|
||||
|
||||
dri2_prior_buffer_creation(dri2_surf, attachments[i]);
|
||||
|
||||
if (dri2_surf->dri_buffers[attachments[i]] == NULL) {
|
||||
|
||||
dri2_surf->dri_buffers[attachments[i]] =
|
||||
|
@ -443,14 +559,6 @@ wayland_frame_callback(struct wl_surface *surface, void *data, uint32_t time)
|
|||
dri2_surf->block_swap_buffers = EGL_FALSE;
|
||||
}
|
||||
|
||||
static inline void
|
||||
pointer_swap(const void **p1, const void **p2)
|
||||
{
|
||||
const void *tmp = *p1;
|
||||
*p1 = *p2;
|
||||
*p2 = tmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called via eglSwapBuffers(), drv->API.SwapBuffers().
|
||||
*/
|
||||
|
@ -466,8 +574,8 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
|
|||
|
||||
dri2_surf->block_swap_buffers = EGL_TRUE;
|
||||
wl_display_frame_callback(dri2_dpy->wl_dpy,
|
||||
dri2_surf->wl_win->surface,
|
||||
wayland_frame_callback, dri2_surf);
|
||||
dri2_surf->wl_win->surface,
|
||||
wayland_frame_callback, dri2_surf);
|
||||
|
||||
if (dri2_surf->type == DRI2_WINDOW_SURFACE) {
|
||||
pointer_swap(
|
||||
|
@ -479,8 +587,7 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
|
|||
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]->attachment =
|
||||
__DRI_BUFFER_BACK_LEFT;
|
||||
|
||||
pointer_swap((const void **) &dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT],
|
||||
(const void **) &dri2_surf->wl_drm_buffer[WL_BUFFER_BACK]);
|
||||
swap_wl_buffers(dri2_surf, WL_BUFFER_FRONT, WL_BUFFER_BACK);
|
||||
|
||||
if (!dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT])
|
||||
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT] =
|
||||
|
@ -493,6 +600,7 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
|
|||
wl_surface_attach(dri2_surf->wl_win->surface,
|
||||
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT],
|
||||
dri2_surf->dx, dri2_surf->dy);
|
||||
dri2_surf->wl_buffer_lock[WL_BUFFER_FRONT] = 1;
|
||||
|
||||
dri2_surf->wl_win->attached_width = dri2_surf->base.Width;
|
||||
dri2_surf->wl_win->attached_height = dri2_surf->base.Height;
|
||||
|
@ -676,7 +784,13 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
memset(dri2_dpy, 0, sizeof *dri2_dpy);
|
||||
|
||||
disp->DriverData = (void *) dri2_dpy;
|
||||
dri2_dpy->wl_dpy = disp->PlatformDisplay;
|
||||
if (disp->PlatformDisplay == NULL) {
|
||||
dri2_dpy->wl_dpy = wl_display_connect(NULL);
|
||||
if (dri2_dpy->wl_dpy == NULL)
|
||||
goto cleanup_dpy;
|
||||
} else {
|
||||
dri2_dpy->wl_dpy = disp->PlatformDisplay;
|
||||
}
|
||||
|
||||
id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
|
||||
if (id == 0)
|
||||
|
@ -714,7 +828,8 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
|
||||
dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
|
||||
dri2_dpy->extensions[1] = &image_lookup_extension.base;
|
||||
dri2_dpy->extensions[2] = NULL;
|
||||
dri2_dpy->extensions[2] = &use_invalidate.base;
|
||||
dri2_dpy->extensions[3] = NULL;
|
||||
|
||||
if (!dri2_create_screen(disp))
|
||||
goto cleanup_driver;
|
||||
|
|
|
@ -479,10 +479,19 @@ dri2_connect(struct dri2_egl_display *dri2_dpy)
|
|||
xcb_generic_error_t *error;
|
||||
xcb_screen_iterator_t s;
|
||||
char *driver_name, *device_name;
|
||||
const xcb_query_extension_reply_t *extension;
|
||||
|
||||
xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_xfixes_id);
|
||||
xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_dri2_id);
|
||||
|
||||
extension = xcb_get_extension_data(dri2_dpy->conn, &xcb_xfixes_id);
|
||||
if (!(extension && extension->present))
|
||||
return EGL_FALSE;
|
||||
|
||||
extension = xcb_get_extension_data(dri2_dpy->conn, &xcb_dri2_id);
|
||||
if (!(extension && extension->present))
|
||||
return EGL_FALSE;
|
||||
|
||||
xfixes_query_cookie = xcb_xfixes_query_version(dri2_dpy->conn,
|
||||
XCB_XFIXES_MAJOR_VERSION,
|
||||
XCB_XFIXES_MINOR_VERSION);
|
||||
|
@ -906,9 +915,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
goto cleanup_dpy;
|
||||
}
|
||||
|
||||
dri2_dpy->driver_name = dri2_strndup("swrast", strlen("swrast"));
|
||||
|
||||
if (!dri2_load_driver(disp))
|
||||
if (!dri2_load_driver_swrast(disp))
|
||||
goto cleanup_conn;
|
||||
|
||||
dri2_dpy->swrast_loader_extension.base.name = __DRI_SWRAST_LOADER;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
|
@ -10,19 +12,19 @@
|
|||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
|
|
|
@ -61,9 +61,13 @@ LOCAL_LIBS += $(TOP)/src/egl/drivers/dri2/libegl_dri2.a
|
|||
ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
|
||||
EGL_LIB_DEPS += $(XCB_DRI2_LIBS)
|
||||
endif
|
||||
ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
|
||||
EGL_LIB_DEPS += -lgbm
|
||||
endif
|
||||
EGL_LIB_DEPS += $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS)
|
||||
endif
|
||||
|
||||
|
||||
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
|
||||
LOCAL_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
|
||||
endif
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Public EGL API entrypoints
|
||||
*
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLAPI_INCLUDED
|
||||
#define EGLAPI_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,31 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -1,3 +1,31 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLARRAY_INCLUDED
|
||||
#define EGLARRAY_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,32 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLCOMPILER_INCLUDED
|
||||
#define EGLCOMPILER_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* EGL Configuration (pixel format) functions.
|
||||
*/
|
||||
|
@ -305,6 +335,7 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
|
|||
break;
|
||||
default:
|
||||
assert(0);
|
||||
mask = 0;
|
||||
break;
|
||||
}
|
||||
if (val & ~mask)
|
||||
|
@ -456,8 +487,6 @@ _eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
|
|||
return EGL_FALSE;
|
||||
|
||||
switch (attr) {
|
||||
case EGL_MATCH_NATIVE_PIXMAP:
|
||||
return EGL_FALSE;
|
||||
case EGL_Y_INVERTED_NOK:
|
||||
return conf->Display->Extensions.NOK_texture_from_pixmap;
|
||||
default:
|
||||
|
@ -634,7 +663,7 @@ void _eglSwapConfigs(const _EGLConfig **conf1, const _EGLConfig **conf2)
|
|||
* qsort() in that the compare function accepts an additional
|
||||
* argument.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
_eglSortConfigs(const _EGLConfig **configs, EGLint count,
|
||||
EGLint (*compare)(const _EGLConfig *, const _EGLConfig *,
|
||||
void *),
|
||||
|
@ -672,34 +701,27 @@ _eglSortConfigs(const _EGLConfig **configs, EGLint count,
|
|||
}
|
||||
|
||||
|
||||
static int
|
||||
_eglFallbackCompare(const _EGLConfig *conf1, const _EGLConfig *conf2,
|
||||
void *priv_data)
|
||||
{
|
||||
const _EGLConfig *criteria = (const _EGLConfig *) priv_data;
|
||||
return _eglCompareConfigs(conf1, conf2, criteria, EGL_TRUE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Typical fallback routine for eglChooseConfig
|
||||
* A helper function for implementing eglChooseConfig. See _eglFilterArray and
|
||||
* _eglSortConfigs for the meanings of match and compare.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglChooseConfig(_EGLDriver *drv, _EGLDisplay *disp, const EGLint *attrib_list,
|
||||
EGLConfig *configs, EGLint config_size, EGLint *num_configs)
|
||||
_eglFilterConfigArray(_EGLArray *array, EGLConfig *configs,
|
||||
EGLint config_size, EGLint *num_configs,
|
||||
EGLBoolean (*match)(const _EGLConfig *, void *),
|
||||
EGLint (*compare)(const _EGLConfig *, const _EGLConfig *,
|
||||
void *),
|
||||
void *priv_data)
|
||||
{
|
||||
_EGLConfig **configList, criteria;
|
||||
_EGLConfig **configList;
|
||||
EGLint i, count;
|
||||
|
||||
if (!num_configs)
|
||||
return _eglError(EGL_BAD_PARAMETER, "eglChooseConfigs");
|
||||
|
||||
if (!_eglParseConfigAttribList(&criteria, disp, attrib_list))
|
||||
return _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
|
||||
|
||||
/* get the number of matched configs */
|
||||
count = _eglFilterArray(disp->Configs, NULL, 0,
|
||||
(_EGLArrayForEach) _eglMatchConfig, (void *) &criteria);
|
||||
count = _eglFilterArray(array, NULL, 0,
|
||||
(_EGLArrayForEach) match, priv_data);
|
||||
if (!count) {
|
||||
*num_configs = count;
|
||||
return EGL_TRUE;
|
||||
|
@ -710,13 +732,13 @@ _eglChooseConfig(_EGLDriver *drv, _EGLDisplay *disp, const EGLint *attrib_list,
|
|||
return _eglError(EGL_BAD_ALLOC, "eglChooseConfig(out of memory)");
|
||||
|
||||
/* get the matched configs */
|
||||
_eglFilterArray(disp->Configs, (void **) configList, count,
|
||||
(_EGLArrayForEach) _eglMatchConfig, (void *) &criteria);
|
||||
_eglFilterArray(array, (void **) configList, count,
|
||||
(_EGLArrayForEach) match, priv_data);
|
||||
|
||||
/* perform sorting of configs */
|
||||
if (configs && count) {
|
||||
_eglSortConfigs((const _EGLConfig **) configList, count,
|
||||
_eglFallbackCompare, (void *) &criteria);
|
||||
compare, priv_data);
|
||||
count = MIN2(count, config_size);
|
||||
for (i = 0; i < count; i++)
|
||||
configs[i] = _eglGetConfigHandle(configList[i]);
|
||||
|
@ -730,6 +752,41 @@ _eglChooseConfig(_EGLDriver *drv, _EGLDisplay *disp, const EGLint *attrib_list,
|
|||
}
|
||||
|
||||
|
||||
static EGLBoolean
|
||||
_eglFallbackMatch(const _EGLConfig *conf, void *priv_data)
|
||||
{
|
||||
return _eglMatchConfig(conf, (const _EGLConfig *) priv_data);
|
||||
}
|
||||
|
||||
|
||||
static EGLint
|
||||
_eglFallbackCompare(const _EGLConfig *conf1, const _EGLConfig *conf2,
|
||||
void *priv_data)
|
||||
{
|
||||
return _eglCompareConfigs(conf1, conf2,
|
||||
(const _EGLConfig *) priv_data, EGL_TRUE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Typical fallback routine for eglChooseConfig
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglChooseConfig(_EGLDriver *drv, _EGLDisplay *disp, const EGLint *attrib_list,
|
||||
EGLConfig *configs, EGLint config_size, EGLint *num_configs)
|
||||
{
|
||||
_EGLConfig criteria;
|
||||
|
||||
if (!_eglParseConfigAttribList(&criteria, disp, attrib_list))
|
||||
return _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
|
||||
|
||||
return _eglFilterConfigArray(disp->Configs,
|
||||
configs, config_size, num_configs,
|
||||
_eglFallbackMatch, _eglFallbackCompare,
|
||||
(void *) &criteria);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fallback for eglGetConfigAttrib.
|
||||
*/
|
||||
|
@ -739,6 +796,16 @@ _eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
|
|||
{
|
||||
if (!_eglIsConfigAttribValid(conf, attribute))
|
||||
return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
|
||||
|
||||
/* nonqueryable attributes */
|
||||
switch (attribute) {
|
||||
case EGL_MATCH_NATIVE_PIXMAP:
|
||||
return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!value)
|
||||
return _eglError(EGL_BAD_PARAMETER, "eglGetConfigAttrib");
|
||||
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLCONFIG_INCLUDED
|
||||
#define EGLCONFIG_INCLUDED
|
||||
|
||||
|
@ -172,11 +202,13 @@ _eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
|
|||
const _EGLConfig *criteria, EGLBoolean compare_id);
|
||||
|
||||
|
||||
PUBLIC void
|
||||
_eglSortConfigs(const _EGLConfig **configs, EGLint count,
|
||||
EGLint (*compare)(const _EGLConfig *, const _EGLConfig *,
|
||||
void *),
|
||||
void *priv_data);
|
||||
PUBLIC EGLBoolean
|
||||
_eglFilterConfigArray(_EGLArray *array, EGLConfig *configs,
|
||||
EGLint config_size, EGLint *num_configs,
|
||||
EGLBoolean (*match)(const _EGLConfig *, void *),
|
||||
EGLint (*compare)(const _EGLConfig *, const _EGLConfig *,
|
||||
void *),
|
||||
void *filter_data);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLCONTEXT_INCLUDED
|
||||
#define EGLCONTEXT_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,31 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "egllog.h"
|
||||
|
|
|
@ -1,3 +1,31 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLCURRENT_INCLUDED
|
||||
#define EGLCURRENT_INCLUDED
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
|
@ -10,23 +10,22 @@
|
|||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal EGL defines
|
||||
*/
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Functions related to EGLDisplay.
|
||||
*/
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLDISPLAY_INCLUDED
|
||||
#define EGLDISPLAY_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Functions for choosing and opening/loading device drivers.
|
||||
*/
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLDRIVER_INCLUDED
|
||||
#define EGLDRIVER_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,31 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include "egltypedefs.h"
|
||||
#include "egldriver.h"
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include "eglglobals.h"
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLGLOBALS_INCLUDED
|
||||
#define EGLGLOBALS_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,32 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -1,3 +1,32 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLIMAGE_INCLUDED
|
||||
#define EGLIMAGE_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Logging facility for debug/info messages.
|
||||
* _EGL_FATAL messages are printed to stderr
|
||||
|
|
|
@ -1,3 +1,32 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLLOG_INCLUDED
|
||||
#define EGLLOG_INCLUDED
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
|
@ -10,19 +12,19 @@
|
|||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
|
@ -10,19 +12,19 @@
|
|||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLMODE_INCLUDED
|
||||
#define EGLMODE_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,31 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009 Chia-I Wu <olvaffe@gmail.com>
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLMUTEX_INCLUDED
|
||||
#define EGLMUTEX_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* Ideas for screen management extension to EGL.
|
||||
*
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLSCREEN_INCLUDED
|
||||
#define EGLSCREEN_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* String utils.
|
||||
*/
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010-2011 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLSTRING_INCLUDED
|
||||
#define EGLSTRING_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Surface-related functions.
|
||||
*/
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLSURFACE_INCLUDED
|
||||
#define EGLSURFACE_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,31 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "eglsync.h"
|
||||
|
|
|
@ -1,3 +1,31 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLSYNC_INCLUDED
|
||||
#define EGLSYNC_INCLUDED
|
||||
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLTYPEDEFS_INCLUDED
|
||||
#define EGLTYPEDEFS_INCLUDED
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ depend:
|
|||
clean:
|
||||
rm -rf libwayland-drm.a $(wayland_drm_OBJECTS) \
|
||||
$(GEN_SOURCES) $(GEN_HEADERS)
|
||||
rm -f depend depend.bak
|
||||
|
||||
install:
|
||||
@echo -n ""
|
||||
|
|
|
@ -88,17 +88,17 @@ drm_create_buffer(struct wl_client *client, struct wl_drm *drm,
|
|||
{
|
||||
struct wl_drm_buffer *buffer;
|
||||
|
||||
buffer = malloc(sizeof *buffer);
|
||||
buffer = calloc(1, sizeof *buffer);
|
||||
if (buffer == NULL) {
|
||||
wl_client_post_no_memory(client);
|
||||
return;
|
||||
}
|
||||
|
||||
buffer->drm = drm;
|
||||
buffer->buffer.compositor = NULL;
|
||||
buffer->buffer.width = width;
|
||||
buffer->buffer.height = height;
|
||||
buffer->buffer.visual = visual;
|
||||
buffer->buffer.client = client;
|
||||
|
||||
if (!visual || visual->object.interface != &wl_visual_interface) {
|
||||
wl_client_post_error(client, &drm->object,
|
||||
|
|
|
@ -53,7 +53,7 @@ if env['drm']:
|
|||
# Needed by some state trackers
|
||||
SConscript('winsys/sw/null/SConscript')
|
||||
|
||||
if env['platform'] != 'embedded':
|
||||
if not env['embedded']:
|
||||
SConscript('state_trackers/vega/SConscript')
|
||||
SConscript('state_trackers/egl/SConscript')
|
||||
|
||||
|
@ -66,8 +66,8 @@ if env['platform'] != 'embedded':
|
|||
if env['dri'] and env['xorg']:
|
||||
SConscript('state_trackers/xorg/SConscript')
|
||||
|
||||
if env['platform'] == 'windows':
|
||||
SConscript('state_trackers/wgl/SConscript')
|
||||
if env['platform'] == 'windows':
|
||||
SConscript('state_trackers/wgl/SConscript')
|
||||
|
||||
#
|
||||
# Winsys
|
||||
|
@ -83,55 +83,55 @@ SConscript([
|
|||
'targets/graw-null/SConscript',
|
||||
])
|
||||
|
||||
if env['platform'] != 'embedded':
|
||||
if not env['embedded']:
|
||||
SConscript([
|
||||
'targets/egl-static/SConscript'
|
||||
])
|
||||
|
||||
if env['x11']:
|
||||
SConscript([
|
||||
'targets/graw-xlib/SConscript',
|
||||
'targets/libgl-xlib/SConscript',
|
||||
])
|
||||
|
||||
if env['platform'] == 'windows':
|
||||
SConscript([
|
||||
'targets/graw-gdi/SConscript',
|
||||
'targets/libgl-gdi/SConscript',
|
||||
])
|
||||
|
||||
if env['dri']:
|
||||
SConscript([
|
||||
'targets/SConscript.dri',
|
||||
'targets/dri-swrast/SConscript',
|
||||
'targets/dri-vmwgfx/SConscript',
|
||||
#'targets/dri-nouveau/SConscript',
|
||||
])
|
||||
if env['drm_intel']:
|
||||
if env['x11']:
|
||||
SConscript([
|
||||
'targets/dri-i915/SConscript',
|
||||
'targets/dri-i965/SConscript',
|
||||
])
|
||||
if env['drm_radeon']:
|
||||
SConscript([
|
||||
'targets/dri-r300/SConscript',
|
||||
'targets/dri-r600/SConscript',
|
||||
'targets/graw-xlib/SConscript',
|
||||
'targets/libgl-xlib/SConscript',
|
||||
])
|
||||
|
||||
if env['xorg'] and env['drm']:
|
||||
SConscript([
|
||||
#'targets/xorg-i915/SConscript',
|
||||
#'targets/xorg-i965/SConscript',
|
||||
#'targets/xorg-nouveau/SConscript',
|
||||
#'targets/xorg-radeon/SConscript',
|
||||
'targets/xorg-vmwgfx/SConscript',
|
||||
])
|
||||
if env['platform'] == 'windows':
|
||||
SConscript([
|
||||
'targets/graw-gdi/SConscript',
|
||||
'targets/libgl-gdi/SConscript',
|
||||
])
|
||||
|
||||
if env['dri']:
|
||||
SConscript([
|
||||
'targets/SConscript.dri',
|
||||
'targets/dri-swrast/SConscript',
|
||||
'targets/dri-vmwgfx/SConscript',
|
||||
#'targets/dri-nouveau/SConscript',
|
||||
])
|
||||
if env['drm_intel']:
|
||||
SConscript([
|
||||
'targets/dri-i915/SConscript',
|
||||
'targets/dri-i965/SConscript',
|
||||
])
|
||||
if env['drm_radeon']:
|
||||
SConscript([
|
||||
'targets/dri-r300/SConscript',
|
||||
'targets/dri-r600/SConscript',
|
||||
])
|
||||
|
||||
if env['xorg'] and env['drm']:
|
||||
SConscript([
|
||||
#'targets/xorg-i915/SConscript',
|
||||
#'targets/xorg-i965/SConscript',
|
||||
#'targets/xorg-nouveau/SConscript',
|
||||
#'targets/xorg-radeon/SConscript',
|
||||
'targets/xorg-vmwgfx/SConscript',
|
||||
])
|
||||
|
||||
|
||||
#
|
||||
# Unit tests & tools
|
||||
#
|
||||
|
||||
if env['platform'] != 'embedded':
|
||||
if not env['embedded']:
|
||||
SConscript('tests/unit/SConscript')
|
||||
SConscript('tests/graw/SConscript')
|
||||
|
|
|
@ -1163,6 +1163,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
|
|||
struct lp_build_loop_state lp_loop;
|
||||
const int max_vertices = 4;
|
||||
LLVMValueRef outputs[PIPE_MAX_SHADER_OUTPUTS][NUM_CHANNELS];
|
||||
LLVMValueRef fetch_max;
|
||||
void *code;
|
||||
struct lp_build_sampler_soa *sampler = 0;
|
||||
LLVMValueRef ret, ret_ptr;
|
||||
|
@ -1234,6 +1235,10 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
|
|||
draw_llvm_variant_key_samplers(&variant->key),
|
||||
context_ptr);
|
||||
|
||||
fetch_max = LLVMBuildSub(builder, count,
|
||||
lp_build_const_int32(gallivm, 1),
|
||||
"fetch_max");
|
||||
|
||||
#if DEBUG_STORE
|
||||
lp_build_printf(builder, "start = %d, end = %d, step = %d\n",
|
||||
start, end, step);
|
||||
|
@ -1257,6 +1262,12 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
|
|||
builder,
|
||||
lp_loop.counter,
|
||||
lp_build_const_int32(gallivm, i), "");
|
||||
|
||||
/* make sure we're not out of bounds which can happen
|
||||
* if fetch_count % 4 != 0, because on the last iteration
|
||||
* a few of the 4 vertex fetches will be out of bounds */
|
||||
true_index = lp_build_min(&bld, true_index, fetch_max);
|
||||
|
||||
for (j = 0; j < draw->pt.nr_vertex_elements; ++j) {
|
||||
struct pipe_vertex_element *velem = &draw->pt.vertex_element[j];
|
||||
LLVMValueRef vb_index = lp_build_const_int32(gallivm, velem->vertex_buffer_index);
|
||||
|
|
|
@ -784,6 +784,14 @@ aaline_destroy(struct draw_stage *stage)
|
|||
|
||||
draw_free_temp_verts( stage );
|
||||
|
||||
/* restore the old entry points */
|
||||
pipe->create_fs_state = aaline->driver_create_fs_state;
|
||||
pipe->bind_fs_state = aaline->driver_bind_fs_state;
|
||||
pipe->delete_fs_state = aaline->driver_delete_fs_state;
|
||||
|
||||
pipe->bind_fragment_sampler_states = aaline->driver_bind_sampler_states;
|
||||
pipe->set_fragment_sampler_views = aaline->driver_set_sampler_views;
|
||||
|
||||
FREE( stage );
|
||||
}
|
||||
|
||||
|
|
|
@ -768,7 +768,16 @@ aapoint_reset_stipple_counter(struct draw_stage *stage)
|
|||
static void
|
||||
aapoint_destroy(struct draw_stage *stage)
|
||||
{
|
||||
struct aapoint_stage* aapoint = aapoint_stage(stage);
|
||||
struct pipe_context *pipe = stage->draw->pipe;
|
||||
|
||||
draw_free_temp_verts( stage );
|
||||
|
||||
/* restore the old entry points */
|
||||
pipe->create_fs_state = aapoint->driver_create_fs_state;
|
||||
pipe->bind_fs_state = aapoint->driver_bind_fs_state;
|
||||
pipe->delete_fs_state = aapoint->driver_delete_fs_state;
|
||||
|
||||
FREE( stage );
|
||||
}
|
||||
|
||||
|
|
|
@ -207,7 +207,11 @@ lp_disassemble(const void* func)
|
|||
}
|
||||
|
||||
raw_debug_ostream Out;
|
||||
#if HAVE_LLVM >= 0x0300
|
||||
TargetMachine *TM = T->createTargetMachine(Triple, sys::getHostCPUName(), "");
|
||||
#else
|
||||
TargetMachine *TM = T->createTargetMachine(Triple, "");
|
||||
#endif
|
||||
|
||||
#if HAVE_LLVM >= 0x0300
|
||||
unsigned int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
|
||||
|
@ -287,7 +291,11 @@ lp_disassemble(const void* func)
|
|||
|
||||
pc += Size;
|
||||
|
||||
#if HAVE_LLVM >= 0x0300
|
||||
const MCInstrDesc &TID = TII->get(Inst.getOpcode());
|
||||
#else
|
||||
const TargetInstrDesc &TID = TII->get(Inst.getOpcode());
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Keep track of forward jumps to a nearby address.
|
||||
|
|
|
@ -83,8 +83,12 @@ lp_set_target_options(void)
|
|||
* to only assume a 4 bytes alignment for backwards compatibility.
|
||||
*/
|
||||
#if defined(PIPE_ARCH_X86)
|
||||
#if HAVE_LLVM >= 0x0300
|
||||
llvm::StackAlignmentOverride = 4;
|
||||
#else
|
||||
llvm::StackAlignment = 4;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG) || defined(PROFILE)
|
||||
llvm::NoFramePointerElim = true;
|
||||
|
|
|
@ -167,8 +167,8 @@ def trifan(intype, outtype):
|
|||
|
||||
def polygon(intype, outtype):
|
||||
preamble(intype, outtype, prim='polygon')
|
||||
print ' for (j = i = 0; j < nr; j+=6, i++) { '
|
||||
do_tri( intype, outtype, 'out+j', '0', 'i+1', 'i+2' );
|
||||
print ' for (j = i = 0; j < nr; j+=2, i++) { '
|
||||
line( intype, outtype, 'out+j', 'i', '(i+1)%(nr/2)' )
|
||||
print ' }'
|
||||
postamble()
|
||||
|
||||
|
|
|
@ -71,6 +71,11 @@ static void generate_linear_uint( unsigned nr,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Given a primitive type and number of vertices, return the number of vertices
|
||||
* needed to draw the primitive with fill mode = PIPE_POLYGON_MODE_LINE using
|
||||
* separate lines (PIPE_PRIM_LINES).
|
||||
*/
|
||||
static unsigned nr_lines( unsigned prim,
|
||||
unsigned nr )
|
||||
{
|
||||
|
@ -86,7 +91,7 @@ static unsigned nr_lines( unsigned prim,
|
|||
case PIPE_PRIM_QUAD_STRIP:
|
||||
return (nr - 2) / 2 * 8;
|
||||
case PIPE_PRIM_POLYGON:
|
||||
return (nr - 2) * 6;
|
||||
return 2 * nr; /* a line (two verts) for each polygon edge */
|
||||
default:
|
||||
assert(0);
|
||||
return 0;
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "pipe/p_compiler.h"
|
||||
|
||||
|
||||
#if defined(PIPE_OS_EMBEDDED)
|
||||
#if defined(PIPE_SUBSYSTEM_EMBEDDED)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -58,8 +58,6 @@ extern "C" {
|
|||
# define os_break() __debugbreak()
|
||||
#elif defined(PIPE_OS_UNIX)
|
||||
# define os_break() kill(getpid(), SIGTRAP)
|
||||
#elif defined(PIPE_OS_EMBEDDED)
|
||||
void os_break(void);
|
||||
#else
|
||||
# define os_break() abort()
|
||||
#endif
|
||||
|
@ -70,8 +68,6 @@ void os_break(void);
|
|||
*/
|
||||
#if defined(DEBUG) || defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) || defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
|
||||
# define os_abort() os_break()
|
||||
#elif defined(PIPE_OS_EMBEDDED)
|
||||
void os_abort(void);
|
||||
#else
|
||||
# define os_abort() abort()
|
||||
#endif
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include "util/u_debug.h" /* for assert */
|
||||
|
||||
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_EMBEDDED) || defined(PIPE_OS_CYGWIN)
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
|
||||
|
||||
#include <pthread.h> /* POSIX threads headers */
|
||||
#include <stdio.h> /* for perror() */
|
||||
|
@ -314,7 +314,7 @@ typedef int64_t pipe_condvar;
|
|||
* pipe_barrier
|
||||
*/
|
||||
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_EMBEDDED)
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
|
||||
|
||||
typedef pthread_barrier_t pipe_barrier;
|
||||
|
||||
|
@ -442,7 +442,7 @@ pipe_semaphore_wait(pipe_semaphore *sema)
|
|||
*/
|
||||
|
||||
typedef struct {
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_EMBEDDED) || defined(PIPE_OS_CYGWIN)
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
|
||||
pthread_key_t key;
|
||||
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
|
||||
DWORD key;
|
||||
|
@ -457,7 +457,7 @@ typedef struct {
|
|||
static INLINE void
|
||||
pipe_tsd_init(pipe_tsd *tsd)
|
||||
{
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_EMBEDDED) || defined(PIPE_OS_CYGWIN)
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
|
||||
if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
|
||||
perror("pthread_key_create(): failed to allocate key for thread specific data");
|
||||
exit(-1);
|
||||
|
@ -474,7 +474,7 @@ pipe_tsd_get(pipe_tsd *tsd)
|
|||
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
|
||||
pipe_tsd_init(tsd);
|
||||
}
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_EMBEDDED) || defined(PIPE_OS_CYGWIN)
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
|
||||
return pthread_getspecific(tsd->key);
|
||||
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
|
||||
assert(0);
|
||||
|
@ -491,7 +491,7 @@ pipe_tsd_set(pipe_tsd *tsd, void *value)
|
|||
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
|
||||
pipe_tsd_init(tsd);
|
||||
}
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_EMBEDDED) || defined(PIPE_OS_CYGWIN)
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
|
||||
if (pthread_setspecific(tsd->key, value) != 0) {
|
||||
perror("pthread_set_specific() failed");
|
||||
exit(-1);
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
|
||||
#include "pipe/p_config.h"
|
||||
|
||||
#if !defined(PIPE_OS_EMBEDDED)
|
||||
|
||||
#if defined(PIPE_OS_UNIX)
|
||||
# include <sys/time.h> /* timeval */
|
||||
#elif defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
|
||||
|
@ -123,6 +121,3 @@ os_time_sleep(int64_t usecs)
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* !PIPE_OS_EMBEDDED */
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
#include "galahad/glhd_public.h"
|
||||
#endif
|
||||
|
||||
#ifdef GALLIUM_NOOP
|
||||
#include "noop/noop_public.h"
|
||||
#endif
|
||||
|
||||
static INLINE struct pipe_screen *
|
||||
debug_screen_wrap(struct pipe_screen *screen)
|
||||
{
|
||||
|
@ -38,6 +42,10 @@ debug_screen_wrap(struct pipe_screen *screen)
|
|||
screen = galahad_screen_create(screen);
|
||||
#endif
|
||||
|
||||
#if defined(GALLIUM_NOOP)
|
||||
screen = noop_screen_create(screen);
|
||||
#endif
|
||||
|
||||
return screen;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
|
||||
#ifndef INLINE_DEBUG_HELPER_H
|
||||
#define INLINE_DEBUG_HELPER_H
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "util/u_debug.h"
|
||||
|
||||
|
||||
/* Helper function to wrap a screen with
|
||||
* one or more debug driver: rbug, trace.
|
||||
*/
|
||||
|
||||
#ifdef GALLIUM_TRACE
|
||||
#include "trace/tr_public.h"
|
||||
#endif
|
||||
|
||||
#ifdef GALLIUM_RBUG
|
||||
#include "rbug/rbug_public.h"
|
||||
#endif
|
||||
|
||||
#ifdef GALLIUM_GALAHAD
|
||||
#include "galahad/glhd_public.h"
|
||||
#endif
|
||||
|
||||
#ifdef GALLIUM_NOOP
|
||||
#include "noop/noop_public.h"
|
||||
#endif
|
||||
|
||||
static INLINE struct pipe_screen *
|
||||
debug_screen_wrap(struct pipe_screen *screen)
|
||||
{
|
||||
#if defined(GALLIUM_RBUG)
|
||||
screen = rbug_screen_create(screen);
|
||||
#endif
|
||||
|
||||
#if defined(GALLIUM_TRACE)
|
||||
screen = trace_screen_create(screen);
|
||||
#endif
|
||||
|
||||
#if defined(GALLIUM_GALAHAD)
|
||||
screen = galahad_screen_create(screen);
|
||||
#endif
|
||||
|
||||
#if defined(GALLIUM_NOOP)
|
||||
screen = noop_screen_create(screen);
|
||||
#endif
|
||||
|
||||
return screen;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -48,7 +48,7 @@
|
|||
|
||||
void _debug_vprintf(const char *format, va_list ap)
|
||||
{
|
||||
#if defined(PIPE_OS_WINDOWS) || defined(PIPE_OS_EMBEDDED)
|
||||
#if defined(PIPE_OS_WINDOWS) || defined(PIPE_SUBSYSTEM_EMBEDDED)
|
||||
/* We buffer until we find a newline. */
|
||||
static char buf[4096] = {'\0'};
|
||||
size_t len = strlen(buf);
|
||||
|
|
|
@ -72,6 +72,22 @@ struct u_upload_mgr *u_upload_create( struct pipe_context *pipe,
|
|||
return upload;
|
||||
}
|
||||
|
||||
void u_upload_unmap( struct u_upload_mgr *upload )
|
||||
{
|
||||
if (upload->transfer) {
|
||||
struct pipe_box *box = &upload->transfer->box;
|
||||
if (upload->offset > box->x) {
|
||||
|
||||
pipe_buffer_flush_mapped_range(upload->pipe, upload->transfer,
|
||||
box->x, upload->offset - box->x);
|
||||
}
|
||||
pipe_transfer_unmap(upload->pipe, upload->transfer);
|
||||
pipe_transfer_destroy(upload->pipe, upload->transfer);
|
||||
upload->transfer = NULL;
|
||||
upload->map = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Release old buffer.
|
||||
*
|
||||
* This must usually be called prior to firing the command stream
|
||||
|
@ -84,15 +100,7 @@ struct u_upload_mgr *u_upload_create( struct pipe_context *pipe,
|
|||
void u_upload_flush( struct u_upload_mgr *upload )
|
||||
{
|
||||
/* Unmap and unreference the upload buffer. */
|
||||
if (upload->transfer) {
|
||||
if (upload->offset) {
|
||||
pipe_buffer_flush_mapped_range(upload->pipe, upload->transfer,
|
||||
0, upload->offset);
|
||||
}
|
||||
pipe_transfer_unmap(upload->pipe, upload->transfer);
|
||||
pipe_transfer_destroy(upload->pipe, upload->transfer);
|
||||
upload->transfer = NULL;
|
||||
}
|
||||
u_upload_unmap(upload);
|
||||
pipe_resource_reference( &upload->buffer, NULL );
|
||||
upload->size = 0;
|
||||
}
|
||||
|
@ -172,6 +180,15 @@ enum pipe_error u_upload_alloc( struct u_upload_mgr *upload,
|
|||
|
||||
offset = MAX2(upload->offset, alloc_offset);
|
||||
|
||||
if (!upload->map) {
|
||||
upload->map = pipe_buffer_map_range(upload->pipe, upload->buffer,
|
||||
offset, upload->size - offset,
|
||||
PIPE_TRANSFER_WRITE |
|
||||
PIPE_TRANSFER_FLUSH_EXPLICIT |
|
||||
PIPE_TRANSFER_UNSYNCHRONIZED,
|
||||
&upload->transfer);
|
||||
}
|
||||
|
||||
assert(offset < upload->buffer->width0);
|
||||
assert(offset + size <= upload->buffer->width0);
|
||||
assert(size);
|
||||
|
@ -223,10 +240,11 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
|
|||
struct pipe_transfer *transfer = NULL;
|
||||
const char *map = NULL;
|
||||
|
||||
map = (const char *)pipe_buffer_map(upload->pipe,
|
||||
inbuf,
|
||||
PIPE_TRANSFER_READ,
|
||||
&transfer);
|
||||
map = (const char *)pipe_buffer_map_range(upload->pipe,
|
||||
inbuf,
|
||||
offset, size,
|
||||
PIPE_TRANSFER_READ,
|
||||
&transfer);
|
||||
|
||||
if (map == NULL) {
|
||||
ret = PIPE_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -239,7 +257,7 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
|
|||
ret = u_upload_data( upload,
|
||||
min_out_offset,
|
||||
size,
|
||||
map + offset,
|
||||
map,
|
||||
out_offset,
|
||||
outbuf, flushed );
|
||||
|
||||
|
|
|
@ -56,15 +56,27 @@ struct u_upload_mgr *u_upload_create( struct pipe_context *pipe,
|
|||
*/
|
||||
void u_upload_destroy( struct u_upload_mgr *upload );
|
||||
|
||||
/* Unmap and release old buffer.
|
||||
/* Unmap and release old upload buffer.
|
||||
*
|
||||
* This is like u_upload_unmap() except the upload buffer is released for
|
||||
* recycling. This should be called on real hardware flushes on systems
|
||||
* that don't support the PIPE_TRANSFER_UNSYNCHRONIZED flag, as otherwise
|
||||
* the next u_upload_buffer will cause a sync on the buffer.
|
||||
*/
|
||||
|
||||
void u_upload_flush( struct u_upload_mgr *upload );
|
||||
|
||||
/**
|
||||
* Unmap upload buffer
|
||||
*
|
||||
* \param upload Upload manager
|
||||
*
|
||||
* This must usually be called prior to firing the command stream
|
||||
* which references the upload buffer, as many memory managers either
|
||||
* don't like firing a mapped buffer or cause subsequent maps of a
|
||||
* fired buffer to wait. For now, it's easiest just to grab a new
|
||||
* buffer.
|
||||
* fired buffer to wait.
|
||||
*/
|
||||
void u_upload_flush( struct u_upload_mgr *upload );
|
||||
void u_upload_unmap( struct u_upload_mgr *upload );
|
||||
|
||||
/**
|
||||
* Sub-allocate new memory from the upload buffer.
|
||||
|
|
|
@ -152,9 +152,9 @@ void u_vbuf_mgr_destroy(struct u_vbuf_mgr *mgrb)
|
|||
}
|
||||
|
||||
|
||||
static void u_vbuf_translate_begin(struct u_vbuf_mgr_priv *mgr,
|
||||
int min_index, int max_index,
|
||||
boolean *upload_flushed)
|
||||
static enum u_vbuf_return_flags
|
||||
u_vbuf_translate_begin(struct u_vbuf_mgr_priv *mgr,
|
||||
int min_index, int max_index)
|
||||
{
|
||||
struct translate_key key;
|
||||
struct translate_element *te;
|
||||
|
@ -166,6 +166,7 @@ static void u_vbuf_translate_begin(struct u_vbuf_mgr_priv *mgr,
|
|||
struct pipe_resource *out_buffer = NULL;
|
||||
unsigned i, num_verts, out_offset;
|
||||
struct pipe_vertex_element new_velems[PIPE_MAX_ATTRIBS];
|
||||
boolean upload_flushed = FALSE;
|
||||
|
||||
memset(&key, 0, sizeof(key));
|
||||
memset(tr_elem_index, 0xff, sizeof(tr_elem_index));
|
||||
|
@ -248,7 +249,7 @@ static void u_vbuf_translate_begin(struct u_vbuf_mgr_priv *mgr,
|
|||
u_upload_alloc(mgr->b.uploader,
|
||||
key.output_stride * min_index,
|
||||
key.output_stride * num_verts,
|
||||
&out_offset, &out_buffer, upload_flushed,
|
||||
&out_offset, &out_buffer, &upload_flushed,
|
||||
(void**)&out_map);
|
||||
|
||||
out_offset -= key.output_stride * min_index;
|
||||
|
@ -308,6 +309,8 @@ static void u_vbuf_translate_begin(struct u_vbuf_mgr_priv *mgr,
|
|||
}
|
||||
|
||||
pipe_resource_reference(&out_buffer, NULL);
|
||||
|
||||
return upload_flushed ? U_VBUF_UPLOAD_FLUSHED : 0;
|
||||
}
|
||||
|
||||
static void u_vbuf_translate_end(struct u_vbuf_mgr_priv *mgr)
|
||||
|
@ -510,14 +513,15 @@ void u_vbuf_mgr_set_vertex_buffers(struct u_vbuf_mgr *mgrb,
|
|||
mgr->b.nr_real_vertex_buffers = count;
|
||||
}
|
||||
|
||||
static void u_vbuf_upload_buffers(struct u_vbuf_mgr_priv *mgr,
|
||||
int min_index, int max_index,
|
||||
unsigned instance_count,
|
||||
boolean *upload_flushed)
|
||||
static enum u_vbuf_return_flags
|
||||
u_vbuf_upload_buffers(struct u_vbuf_mgr_priv *mgr,
|
||||
int min_index, int max_index,
|
||||
unsigned instance_count)
|
||||
{
|
||||
unsigned i, nr = mgr->ve->count;
|
||||
unsigned count = max_index + 1 - min_index;
|
||||
boolean uploaded[PIPE_MAX_ATTRIBS] = {0};
|
||||
enum u_vbuf_return_flags retval = 0;
|
||||
|
||||
for (i = 0; i < nr; i++) {
|
||||
unsigned index = mgr->ve->ve[i].vertex_buffer_index;
|
||||
|
@ -537,6 +541,11 @@ static void u_vbuf_upload_buffers(struct u_vbuf_mgr_priv *mgr,
|
|||
} else if (vb->stride) {
|
||||
first = vb->stride * min_index;
|
||||
size = vb->stride * count;
|
||||
|
||||
/* Unusual case when stride is smaller than the format size.
|
||||
* XXX This won't work with interleaved arrays. */
|
||||
if (mgr->ve->native_format_size[i] > vb->stride)
|
||||
size += mgr->ve->native_format_size[i] - vb->stride;
|
||||
} else {
|
||||
first = 0;
|
||||
size = mgr->ve->native_format_size[i];
|
||||
|
@ -551,11 +560,14 @@ static void u_vbuf_upload_buffers(struct u_vbuf_mgr_priv *mgr,
|
|||
vb->buffer_offset -= first;
|
||||
|
||||
uploaded[index] = TRUE;
|
||||
*upload_flushed = *upload_flushed || flushed;
|
||||
if (flushed)
|
||||
retval |= U_VBUF_UPLOAD_FLUSHED;
|
||||
} else {
|
||||
assert(mgr->b.real_vertex_buffer[index]);
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void u_vbuf_mgr_compute_max_index(struct u_vbuf_mgr_priv *mgr)
|
||||
|
@ -597,14 +609,13 @@ static void u_vbuf_mgr_compute_max_index(struct u_vbuf_mgr_priv *mgr)
|
|||
}
|
||||
}
|
||||
|
||||
void u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgrb,
|
||||
const struct pipe_draw_info *info,
|
||||
boolean *buffers_updated,
|
||||
boolean *uploader_flushed)
|
||||
enum u_vbuf_return_flags
|
||||
u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgrb,
|
||||
const struct pipe_draw_info *info)
|
||||
{
|
||||
struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
|
||||
boolean bufs_updated = FALSE, upload_flushed = FALSE;
|
||||
int min_index, max_index;
|
||||
enum u_vbuf_return_flags retval = 0;
|
||||
|
||||
u_vbuf_mgr_compute_max_index(mgr);
|
||||
|
||||
|
@ -617,27 +628,20 @@ void u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgrb,
|
|||
|
||||
/* Translate vertices with non-native layouts or formats. */
|
||||
if (mgr->incompatible_vb_layout || mgr->ve->incompatible_layout) {
|
||||
u_vbuf_translate_begin(mgr, min_index, max_index, &upload_flushed);
|
||||
retval |= u_vbuf_translate_begin(mgr, min_index, max_index);
|
||||
|
||||
if (mgr->fallback_ve) {
|
||||
bufs_updated = TRUE;
|
||||
retval |= U_VBUF_BUFFERS_UPDATED;
|
||||
}
|
||||
}
|
||||
|
||||
/* Upload user buffers. */
|
||||
if (mgr->any_user_vbs) {
|
||||
u_vbuf_upload_buffers(mgr, min_index, max_index, info->instance_count,
|
||||
&upload_flushed);
|
||||
bufs_updated = TRUE;
|
||||
}
|
||||
|
||||
/* Set the return values. */
|
||||
if (buffers_updated) {
|
||||
*buffers_updated = bufs_updated;
|
||||
}
|
||||
if (uploader_flushed) {
|
||||
*uploader_flushed = upload_flushed;
|
||||
retval |= u_vbuf_upload_buffers(mgr, min_index, max_index,
|
||||
info->instance_count);
|
||||
retval |= U_VBUF_BUFFERS_UPDATED;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
void u_vbuf_mgr_draw_end(struct u_vbuf_mgr *mgrb)
|
||||
|
|
|
@ -78,6 +78,11 @@ enum u_fetch_alignment {
|
|||
U_VERTEX_FETCH_DWORD_ALIGNED
|
||||
};
|
||||
|
||||
enum u_vbuf_return_flags {
|
||||
U_VBUF_BUFFERS_UPDATED = 1,
|
||||
U_VBUF_UPLOAD_FLUSHED = 2
|
||||
};
|
||||
|
||||
|
||||
struct u_vbuf_mgr *
|
||||
u_vbuf_mgr_create(struct pipe_context *pipe,
|
||||
|
@ -105,10 +110,9 @@ void u_vbuf_mgr_set_vertex_buffers(struct u_vbuf_mgr *mgr,
|
|||
unsigned count,
|
||||
const struct pipe_vertex_buffer *bufs);
|
||||
|
||||
void u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgr,
|
||||
const struct pipe_draw_info *info,
|
||||
boolean *buffers_updated,
|
||||
boolean *uploader_flushed);
|
||||
enum u_vbuf_return_flags
|
||||
u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgr,
|
||||
const struct pipe_draw_info *info);
|
||||
|
||||
void u_vbuf_mgr_draw_end(struct u_vbuf_mgr *mgr);
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ C_SOURCES = \
|
|||
i915_screen.c \
|
||||
i915_prim_emit.c \
|
||||
i915_prim_vbuf.c \
|
||||
i915_query.c \
|
||||
i915_resource.c \
|
||||
i915_resource_texture.c \
|
||||
i915_resource_buffer.c \
|
||||
|
|
|
@ -16,6 +16,7 @@ i915 = env.ConvenienceLibrary(
|
|||
'i915_fpc_translate.c',
|
||||
'i915_prim_emit.c',
|
||||
'i915_prim_vbuf.c',
|
||||
'i915_query.c',
|
||||
'i915_screen.c',
|
||||
'i915_state.c',
|
||||
'i915_state_derived.c',
|
||||
|
|
|
@ -26,5 +26,20 @@ Random list of problems with i915g:
|
|||
- src/xvmc/i915_structs.h in xf86-video-intel has a few more bits of various
|
||||
commands defined. Scavenge them and see what's useful.
|
||||
|
||||
- Do smarter remapping. Right now we send everything onto tex coords 0-7.
|
||||
We could also use diffuse/specular and pack two sets of 2D coords in a single
|
||||
4D. Is it a big problem though? We're more limited by the # of texture
|
||||
indirections and the # of instructions.
|
||||
|
||||
- Leverage draw to enable more caps:
|
||||
* PIPE_CAP_TGSI_INSTANCEID
|
||||
* PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS
|
||||
|
||||
- Finish front/back face. We need to add face support to lp_build_system_values_array and use it in draw_llvm.c.
|
||||
|
||||
- Replace constants and immediates which are 0,1,-1 or a combination of those with a swizzle.
|
||||
|
||||
- i915_delete_fs_state doesn't call draw_delete_fragment_shader. Why?
|
||||
|
||||
Other bugs can be found here:
|
||||
https://bugs.freedesktop.org/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&component=Drivers/Gallium/i915g
|
||||
|
|
|
@ -66,7 +66,7 @@ i915_clear_emit(struct pipe_context *pipe, unsigned buffers, const float *rgba,
|
|||
else
|
||||
clear_color = (u_color.ui & 0xffff) | (u_color.ui << 16);
|
||||
|
||||
util_pack_color(rgba, PIPE_FORMAT_B8G8R8A8_UNORM, &u_color);
|
||||
util_pack_color(rgba, cbuf->format, &u_color);
|
||||
clear_color8888 = u_color.ui;
|
||||
} else
|
||||
clear_color = clear_color8888 = 0;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "i915_state.h"
|
||||
#include "i915_screen.h"
|
||||
#include "i915_surface.h"
|
||||
#include "i915_query.h"
|
||||
#include "i915_batch.h"
|
||||
#include "i915_resource.h"
|
||||
|
||||
|
@ -53,13 +54,11 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
|||
struct i915_context *i915 = i915_context(pipe);
|
||||
struct draw_context *draw = i915->draw;
|
||||
void *mapped_indices = NULL;
|
||||
unsigned cbuf_dirty;
|
||||
|
||||
|
||||
/*
|
||||
* Ack vs contants here, helps ipers a lot.
|
||||
*/
|
||||
cbuf_dirty = i915->dirty & I915_NEW_VS_CONSTANTS;
|
||||
i915->dirty &= ~I915_NEW_VS_CONSTANTS;
|
||||
|
||||
if (i915->dirty)
|
||||
|
@ -72,15 +71,13 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
|||
mapped_indices = i915_buffer(i915->index_buffer.buffer)->data;
|
||||
draw_set_mapped_index_buffer(draw, mapped_indices);
|
||||
|
||||
if (cbuf_dirty) {
|
||||
if (i915->constants[PIPE_SHADER_VERTEX])
|
||||
draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0,
|
||||
i915_buffer(i915->constants[PIPE_SHADER_VERTEX])->data,
|
||||
(i915->current.num_user_constants[PIPE_SHADER_VERTEX] *
|
||||
4 * sizeof(float)));
|
||||
else
|
||||
draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0, NULL, 0);
|
||||
}
|
||||
if (i915->constants[PIPE_SHADER_VERTEX])
|
||||
draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0,
|
||||
i915_buffer(i915->constants[PIPE_SHADER_VERTEX])->data,
|
||||
(i915->current.num_user_constants[PIPE_SHADER_VERTEX] *
|
||||
4 * sizeof(float)));
|
||||
else
|
||||
draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0, NULL, 0);
|
||||
|
||||
/*
|
||||
* Do the drawing
|
||||
|
@ -106,7 +103,7 @@ static void i915_destroy(struct pipe_context *pipe)
|
|||
|
||||
if (i915->blitter)
|
||||
util_blitter_destroy(i915->blitter);
|
||||
|
||||
|
||||
if(i915->batch)
|
||||
i915->iws->batchbuffer_destroy(i915->batch);
|
||||
|
||||
|
@ -150,6 +147,8 @@ i915_create_context(struct pipe_screen *screen, void *priv)
|
|||
/* init this before draw */
|
||||
util_slab_create(&i915->transfer_pool, sizeof(struct pipe_transfer),
|
||||
16, UTIL_SLAB_SINGLETHREADED);
|
||||
util_slab_create(&i915->texture_transfer_pool, sizeof(struct i915_transfer),
|
||||
16, UTIL_SLAB_SINGLETHREADED);
|
||||
|
||||
/* Batch stream debugging is a bit hacked up at the moment:
|
||||
*/
|
||||
|
@ -170,9 +169,11 @@ i915_create_context(struct pipe_screen *screen, void *priv)
|
|||
i915_init_state_functions(i915);
|
||||
i915_init_flush_functions(i915);
|
||||
i915_init_resource_functions(i915);
|
||||
i915_init_query_functions(i915);
|
||||
|
||||
draw_install_aaline_stage(i915->draw, &i915->base);
|
||||
draw_install_aapoint_stage(i915->draw, &i915->base);
|
||||
draw_enable_point_sprites(i915->draw, TRUE);
|
||||
|
||||
/* augmented draw pipeline clobbers state functions */
|
||||
i915_init_fixup_state_functions(i915);
|
||||
|
|
|
@ -102,6 +102,8 @@ struct i915_fragment_shader
|
|||
|
||||
struct tgsi_shader_info info;
|
||||
|
||||
struct draw_fragment_shader *draw_data;
|
||||
|
||||
uint *program;
|
||||
uint program_len;
|
||||
|
||||
|
@ -260,6 +262,7 @@ struct i915_context {
|
|||
int num_validation_buffers;
|
||||
|
||||
struct util_slab_mempool transfer_pool;
|
||||
struct util_slab_mempool texture_transfer_pool;
|
||||
|
||||
/** blitter/hw-clear */
|
||||
struct blitter_context* blitter;
|
||||
|
|
|
@ -37,6 +37,9 @@
|
|||
|
||||
#define I915_PROGRAM_SIZE 192
|
||||
|
||||
/* Use those indices for pos/face routing, must be >= I915_TEX_UNITS */
|
||||
#define I915_SEMANTIC_POS 10
|
||||
#define I915_SEMANTIC_FACE 11
|
||||
|
||||
|
||||
/**
|
||||
|
@ -67,13 +70,13 @@ struct i915_fp_compile {
|
|||
uint temp_flag; /**< Tracks temporary regs which are in use */
|
||||
uint utemp_flag; /**< Tracks TYPE_U temporary regs which are in use */
|
||||
|
||||
uint register_phases[16];
|
||||
uint nr_tex_indirect;
|
||||
uint nr_tex_insn;
|
||||
uint nr_alu_insn;
|
||||
uint nr_decl_insn;
|
||||
|
||||
boolean error; /**< Set if i915_program_error() is called */
|
||||
uint wpos_tex;
|
||||
uint NumNativeInstructions;
|
||||
uint NumNativeAluInstructions;
|
||||
uint NumNativeTexInstructions;
|
||||
|
|
|
@ -67,7 +67,7 @@ i915_get_temp(struct i915_fp_compile *p)
|
|||
{
|
||||
int bit = ffs(~p->temp_flag);
|
||||
if (!bit) {
|
||||
i915_program_error(p, "i915_get_temp: out of temporaries\n");
|
||||
i915_program_error(p, "i915_get_temp: out of temporaries");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ i915_get_utemp(struct i915_fp_compile * p)
|
|||
{
|
||||
int bit = ffs(~p->utemp_flag);
|
||||
if (!bit) {
|
||||
i915_program_error(p, "i915_get_utemp: out of temporaries\n");
|
||||
i915_program_error(p, "i915_get_utemp: out of temporaries");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -128,9 +128,13 @@ i915_emit_decl(struct i915_fp_compile *p,
|
|||
else
|
||||
return reg;
|
||||
|
||||
*(p->decl++) = (D0_DCL | D0_DEST(reg) | d0_flags);
|
||||
*(p->decl++) = D1_MBZ;
|
||||
*(p->decl++) = D2_MBZ;
|
||||
if (p->decl< p->declarations + I915_PROGRAM_SIZE) {
|
||||
*(p->decl++) = (D0_DCL | D0_DEST(reg) | d0_flags);
|
||||
*(p->decl++) = D1_MBZ;
|
||||
*(p->decl++) = D2_MBZ;
|
||||
}
|
||||
else
|
||||
i915_program_error(p, "Out of declarations");
|
||||
|
||||
p->nr_decl_insn++;
|
||||
return reg;
|
||||
|
@ -187,9 +191,16 @@ i915_emit_arith(struct i915_fp_compile * p,
|
|||
p->utemp_flag = old_utemp_flag; /* restore */
|
||||
}
|
||||
|
||||
*(p->csr++) = (op | A0_DEST(dest) | mask | saturate | A0_SRC0(src0));
|
||||
*(p->csr++) = (A1_SRC0(src0) | A1_SRC1(src1));
|
||||
*(p->csr++) = (A2_SRC1(src1) | A2_SRC2(src2));
|
||||
if (p->csr< p->program + I915_PROGRAM_SIZE) {
|
||||
*(p->csr++) = (op | A0_DEST(dest) | mask | saturate | A0_SRC0(src0));
|
||||
*(p->csr++) = (A1_SRC0(src0) | A1_SRC1(src1));
|
||||
*(p->csr++) = (A2_SRC1(src1) | A2_SRC2(src2));
|
||||
}
|
||||
else
|
||||
i915_program_error(p, "Out of instructions");
|
||||
|
||||
if (GET_UREG_TYPE(dest) == REG_TYPE_R)
|
||||
p->register_phases[GET_UREG_NR(dest)] = p->nr_tex_indirect;
|
||||
|
||||
p->nr_alu_insn++;
|
||||
return dest;
|
||||
|
@ -245,17 +256,31 @@ uint i915_emit_texld( struct i915_fp_compile *p,
|
|||
assert(GET_UREG_TYPE(dest) != REG_TYPE_CONST);
|
||||
assert(dest == UREG(GET_UREG_TYPE(dest), GET_UREG_NR(dest)));
|
||||
|
||||
/* is the sampler coord a texcoord input reg? */
|
||||
if (GET_UREG_TYPE(coord) != REG_TYPE_T) {
|
||||
p->nr_tex_indirect++;
|
||||
/* Output register being oC or oD defines a phase boundary */
|
||||
if (GET_UREG_TYPE(dest) == REG_TYPE_OC ||
|
||||
GET_UREG_TYPE(dest) == REG_TYPE_OD)
|
||||
p->nr_tex_indirect++;
|
||||
|
||||
/* Reading from an r# register whose contents depend on output of the
|
||||
* current phase defines a phase boundary.
|
||||
*/
|
||||
if (GET_UREG_TYPE(coord) == REG_TYPE_R &&
|
||||
p->register_phases[GET_UREG_NR(coord)] == p->nr_tex_indirect)
|
||||
p->nr_tex_indirect++;
|
||||
|
||||
if (p->csr< p->program + I915_PROGRAM_SIZE) {
|
||||
*(p->csr++) = (opcode |
|
||||
T0_DEST( dest ) |
|
||||
T0_SAMPLER( sampler ));
|
||||
|
||||
*(p->csr++) = T1_ADDRESS_REG( coord );
|
||||
*(p->csr++) = T2_MBZ;
|
||||
}
|
||||
else
|
||||
i915_program_error(p, "Out of instructions");
|
||||
|
||||
*(p->csr++) = (opcode |
|
||||
T0_DEST( dest ) |
|
||||
T0_SAMPLER( sampler ));
|
||||
|
||||
*(p->csr++) = T1_ADDRESS_REG( coord );
|
||||
*(p->csr++) = T2_MBZ;
|
||||
if (GET_UREG_TYPE(dest) == REG_TYPE_R)
|
||||
p->register_phases[GET_UREG_NR(dest)] = p->nr_tex_indirect;
|
||||
|
||||
p->nr_tex_insn++;
|
||||
}
|
||||
|
@ -293,7 +318,7 @@ i915_emit_const1f(struct i915_fp_compile * p, float c0)
|
|||
}
|
||||
}
|
||||
|
||||
i915_program_error(p, "i915_emit_const1f: out of constants\n");
|
||||
i915_program_error(p, "i915_emit_const1f: out of constants");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -313,6 +338,8 @@ i915_emit_const2f(struct i915_fp_compile * p, float c0, float c1)
|
|||
if (c1 == 1.0)
|
||||
return swizzle(i915_emit_const1f(p, c0), X, ONE, Z, W);
|
||||
|
||||
// XXX emit swizzle here for 0, 1, -1 and any combination thereof
|
||||
// we can use swizzle + neg for that
|
||||
for (reg = 0; reg < I915_MAX_CONSTANT; reg++) {
|
||||
if (ifs->constant_flags[reg] == 0xf ||
|
||||
ifs->constant_flags[reg] == I915_CONSTFLAG_USER)
|
||||
|
@ -329,12 +356,10 @@ i915_emit_const2f(struct i915_fp_compile * p, float c0, float c1)
|
|||
}
|
||||
}
|
||||
|
||||
i915_program_error(p, "i915_emit_const2f: out of constants\n");
|
||||
i915_program_error(p, "i915_emit_const2f: out of constants");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint
|
||||
i915_emit_const4f(struct i915_fp_compile * p,
|
||||
float c0, float c1, float c2, float c3)
|
||||
|
@ -342,6 +367,9 @@ i915_emit_const4f(struct i915_fp_compile * p,
|
|||
struct i915_fragment_shader *ifs = p->shader;
|
||||
unsigned reg;
|
||||
|
||||
// XXX emit swizzle here for 0, 1, -1 and any combination thereof
|
||||
// we can use swizzle + neg for that
|
||||
printf("const %f %f %f %f\n",c0,c1,c2,c3);
|
||||
for (reg = 0; reg < I915_MAX_CONSTANT; reg++) {
|
||||
if (ifs->constant_flags[reg] == 0xf &&
|
||||
ifs->constants[reg][0] == c0 &&
|
||||
|
@ -363,7 +391,7 @@ i915_emit_const4f(struct i915_fp_compile * p,
|
|||
}
|
||||
}
|
||||
|
||||
i915_program_error(p, "i915_emit_const4f: out of constants\n");
|
||||
i915_program_error(p, "i915_emit_const4f: out of constants");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,9 @@
|
|||
|
||||
#include "draw/draw_vertex.h"
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Simple pass-through fragment shader to use when we don't have
|
||||
|
@ -72,19 +75,33 @@ static unsigned passthrough[] =
|
|||
|
||||
|
||||
/* 1, -1/3!, 1/5!, -1/7! */
|
||||
static const float sin_constants[4] = { 1.0,
|
||||
static const float scs_sin_constants[4] = { 1.0,
|
||||
-1.0f / (3 * 2 * 1),
|
||||
1.0f / (5 * 4 * 3 * 2 * 1),
|
||||
-1.0f / (7 * 6 * 5 * 4 * 3 * 2 * 1)
|
||||
};
|
||||
|
||||
/* 1, -1/2!, 1/4!, -1/6! */
|
||||
static const float cos_constants[4] = { 1.0,
|
||||
static const float scs_cos_constants[4] = { 1.0,
|
||||
-1.0f / (2 * 1),
|
||||
1.0f / (4 * 3 * 2 * 1),
|
||||
-1.0f / (6 * 5 * 4 * 3 * 2 * 1)
|
||||
};
|
||||
|
||||
/* 2*pi, -(2*pi)^3/3!, (2*pi)^5/5!, -(2*pi)^7/7! */
|
||||
static const float sin_constants[4] = { 2.0 * M_PI,
|
||||
-8.0f * M_PI * M_PI * M_PI / (3 * 2 * 1),
|
||||
32.0f * M_PI * M_PI * M_PI * M_PI * M_PI / (5 * 4 * 3 * 2 * 1),
|
||||
-128.0f * M_PI * M_PI * M_PI * M_PI * M_PI * M_PI * M_PI / (7 * 6 * 5 * 4 * 3 * 2 * 1)
|
||||
};
|
||||
|
||||
/* 1, -(2*pi)^2/2!, (2*pi)^4/4!, -(2*pi)^6/6! */
|
||||
static const float cos_constants[4] = { 1.0,
|
||||
-4.0f * M_PI * M_PI / (2 * 1),
|
||||
16.0f * M_PI * M_PI * M_PI * M_PI / (4 * 3 * 2 * 1),
|
||||
-64.0f * M_PI * M_PI * M_PI * M_PI * M_PI * M_PI / (6 * 5 * 4 * 3 * 2 * 1)
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -185,12 +202,12 @@ src_vector(struct i915_fp_compile *p,
|
|||
|
||||
switch (sem_name) {
|
||||
case TGSI_SEMANTIC_POSITION:
|
||||
debug_printf("SKIP SEM POS\n");
|
||||
/*
|
||||
assert(p->wpos_tex != -1);
|
||||
src = i915_emit_decl(p, REG_TYPE_T, p->wpos_tex, D0_CHANNEL_ALL);
|
||||
*/
|
||||
break;
|
||||
{
|
||||
/* for fragcoord */
|
||||
int real_tex_unit = get_mapping(fs, I915_SEMANTIC_POS);
|
||||
src = i915_emit_decl(p, REG_TYPE_T, T_TEX0 + real_tex_unit, D0_CHANNEL_ALL);
|
||||
break;
|
||||
}
|
||||
case TGSI_SEMANTIC_COLOR:
|
||||
if (sem_ind == 0) {
|
||||
src = i915_emit_decl(p, REG_TYPE_T, T_DIFFUSE, D0_CHANNEL_ALL);
|
||||
|
@ -212,6 +229,13 @@ src_vector(struct i915_fp_compile *p,
|
|||
src = i915_emit_decl(p, REG_TYPE_T, T_TEX0 + real_tex_unit, D0_CHANNEL_ALL);
|
||||
break;
|
||||
}
|
||||
case TGSI_SEMANTIC_FACE:
|
||||
{
|
||||
/* for back/front faces */
|
||||
int real_tex_unit = get_mapping(fs, I915_SEMANTIC_FACE);
|
||||
src = i915_emit_decl(p, REG_TYPE_T, T_TEX0 + real_tex_unit, D0_CHANNEL_X);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
i915_program_error(p, "Bad source->Index");
|
||||
return 0;
|
||||
|
@ -237,7 +261,6 @@ src_vector(struct i915_fp_compile *p,
|
|||
source->Register.SwizzleZ,
|
||||
source->Register.SwizzleW);
|
||||
|
||||
|
||||
/* There's both negate-all-components and per-component negation.
|
||||
* Try to handle both here.
|
||||
*/
|
||||
|
@ -252,6 +275,9 @@ src_vector(struct i915_fp_compile *p,
|
|||
/* XXX enable these assertions, or fix things */
|
||||
assert(!source->Register.Absolute);
|
||||
#endif
|
||||
if (source->Register.Absolute)
|
||||
debug_printf("Unhandled absolute value\n");
|
||||
|
||||
return src;
|
||||
}
|
||||
|
||||
|
@ -419,11 +445,6 @@ emit_simple_arith_swap2(struct i915_fp_compile *p,
|
|||
emit_simple_arith(p, &inst2, opcode, numArgs, fs);
|
||||
}
|
||||
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Translate TGSI instruction to i915 instruction.
|
||||
*
|
||||
|
@ -477,13 +498,6 @@ i915_translate_instruction(struct i915_fp_compile *p,
|
|||
|
||||
i915_emit_arith(p, A0_MOD, tmp, A0_DEST_CHANNEL_X, 0, tmp, 0, 0);
|
||||
|
||||
/* By choosing different taylor constants, could get rid of this mul:
|
||||
*/
|
||||
i915_emit_arith(p,
|
||||
A0_MUL,
|
||||
tmp, A0_DEST_CHANNEL_X, 0,
|
||||
tmp, i915_emit_const1f(p, (float) (M_PI * 2.0)), 0);
|
||||
|
||||
/*
|
||||
* t0.xy = MUL x.xx11, x.x1111 ; x^2, x, 1, 1
|
||||
* t0 = MUL t0.xyxy t0.xx11 ; x^4, x^3, x^2, 1
|
||||
|
@ -516,6 +530,18 @@ i915_translate_instruction(struct i915_fp_compile *p,
|
|||
i915_emit_const4fv(p, cos_constants), 0);
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_DDX:
|
||||
case TGSI_OPCODE_DDY:
|
||||
/* XXX We just output 0 here */
|
||||
debug_printf("Punting DDX/DDX\n");
|
||||
src0 = get_result_vector(p, &inst->Dst[0]);
|
||||
i915_emit_arith(p,
|
||||
A0_MOV,
|
||||
get_result_vector(p, &inst->Dst[0]),
|
||||
get_result_flags(inst), 0,
|
||||
swizzle(src0, ZERO, ZERO, ZERO, ZERO), 0, 0);
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_DP2:
|
||||
src0 = src_vector(p, &inst->Src[0], fs);
|
||||
src1 = src_vector(p, &inst->Src[1], fs);
|
||||
|
@ -754,9 +780,9 @@ i915_translate_instruction(struct i915_fp_compile *p,
|
|||
* t0.xy = MUL x.xx11, x.x1111 ; x^2, x, 1, 1
|
||||
* t0 = MUL t0.xyxy t0.xx11 ; x^4, x^3, x^2, x
|
||||
* t1 = MUL t0.xyyw t0.yz11 ; x^7 x^5 x^3 x
|
||||
* scs.x = DP4 t1, sin_constants
|
||||
* scs.x = DP4 t1, scs_sin_constants
|
||||
* t1 = MUL t0.xxz1 t0.z111 ; x^6 x^4 x^2 1
|
||||
* scs.y = DP4 t1, cos_constants
|
||||
* scs.y = DP4 t1, scs_cos_constants
|
||||
*/
|
||||
i915_emit_arith(p,
|
||||
A0_MUL,
|
||||
|
@ -791,7 +817,7 @@ i915_translate_instruction(struct i915_fp_compile *p,
|
|||
get_result_vector(p, &inst->Dst[0]),
|
||||
A0_DEST_CHANNEL_Y, 0,
|
||||
swizzle(tmp1, W, Z, Y, X),
|
||||
i915_emit_const4fv(p, sin_constants), 0);
|
||||
i915_emit_const4fv(p, scs_sin_constants), 0);
|
||||
}
|
||||
|
||||
if (writemask & TGSI_WRITEMASK_X) {
|
||||
|
@ -806,7 +832,7 @@ i915_translate_instruction(struct i915_fp_compile *p,
|
|||
get_result_vector(p, &inst->Dst[0]),
|
||||
A0_DEST_CHANNEL_X, 0,
|
||||
swizzle(tmp, ONE, Z, Y, X),
|
||||
i915_emit_const4fv(p, cos_constants), 0);
|
||||
i915_emit_const4fv(p, scs_cos_constants), 0);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -853,13 +879,6 @@ i915_translate_instruction(struct i915_fp_compile *p,
|
|||
|
||||
i915_emit_arith(p, A0_MOD, tmp, A0_DEST_CHANNEL_X, 0, tmp, 0, 0);
|
||||
|
||||
/* By choosing different taylor constants, could get rid of this mul:
|
||||
*/
|
||||
i915_emit_arith(p,
|
||||
A0_MUL,
|
||||
tmp, A0_DEST_CHANNEL_X, 0,
|
||||
tmp, i915_emit_const1f(p, (float) (M_PI * 2.0)), 0);
|
||||
|
||||
/*
|
||||
* t0.xy = MUL x.xx11, x.x1111 ; x^2, x, 1, 1
|
||||
* t0 = MUL t0.xyxy t0.xx11 ; x^4, x^3, x^2, x
|
||||
|
@ -907,7 +926,7 @@ i915_translate_instruction(struct i915_fp_compile *p,
|
|||
break;
|
||||
|
||||
case TGSI_OPCODE_SNE:
|
||||
/* if we're neither < nor > then we're != */
|
||||
/* if we're < or > then we're != */
|
||||
src0 = src_vector(p, &inst->Src[0], fs);
|
||||
src1 = src_vector(p, &inst->Src[1], fs);
|
||||
tmp = i915_get_utemp(p);
|
||||
|
@ -1070,9 +1089,11 @@ i915_translate_instructions(struct i915_fp_compile *p,
|
|||
for (i = parse.FullToken.FullDeclaration.Range.First;
|
||||
i <= parse.FullToken.FullDeclaration.Range.Last;
|
||||
i++) {
|
||||
assert(i < I915_MAX_TEMPORARY);
|
||||
/* XXX just use shader->info->file_mask[TGSI_FILE_TEMPORARY] */
|
||||
p->temp_flag |= (1 << i); /* mark temp as used */
|
||||
if (i >= I915_MAX_TEMPORARY)
|
||||
debug_printf("Too many temps (%d)\n",i);
|
||||
else
|
||||
/* XXX just use shader->info->file_mask[TGSI_FILE_TEMPORARY] */
|
||||
p->temp_flag |= (1 << i); /* mark temp as used */
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -1144,6 +1165,8 @@ i915_init_compile(struct i915_context *i915,
|
|||
ifs->num_constants = 0;
|
||||
memset(ifs->constant_flags, 0, sizeof(ifs->constant_flags));
|
||||
|
||||
memset(&p->register_phases, 0, sizeof(p->register_phases));
|
||||
|
||||
for (i = 0; i < I915_TEX_UNITS; i++)
|
||||
ifs->generic_mapping[i] = -1;
|
||||
|
||||
|
@ -1161,8 +1184,6 @@ i915_init_compile(struct i915_context *i915,
|
|||
p->temp_flag = ~0x0 << I915_MAX_TEMPORARY;
|
||||
p->utemp_flag = ~0x7;
|
||||
|
||||
p->wpos_tex = -1;
|
||||
|
||||
/* initialize the first program word */
|
||||
*(p->decl++) = _3DSTATE_PIXEL_SHADER_PROGRAM;
|
||||
|
||||
|
@ -1181,7 +1202,7 @@ i915_fini_compile(struct i915_context *i915, struct i915_fp_compile *p)
|
|||
unsigned long decl_size = (unsigned long) (p->decl - p->declarations);
|
||||
|
||||
if (p->nr_tex_indirect > I915_MAX_TEX_INDIRECT)
|
||||
i915_program_error(p, "Exceeded max nr indirect texture lookups");
|
||||
debug_printf("Exceeded max nr indirect texture lookups\n");
|
||||
|
||||
if (p->nr_tex_insn > I915_MAX_TEX_INSN)
|
||||
i915_program_error(p, "Exceeded max TEX instructions");
|
||||
|
@ -1234,40 +1255,6 @@ i915_fini_compile(struct i915_context *i915, struct i915_fp_compile *p)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Find an unused texture coordinate slot to use for fragment WPOS.
|
||||
* Update p->fp->wpos_tex with the result (-1 if no used texcoord slot is found).
|
||||
*/
|
||||
static void
|
||||
i915_find_wpos_space(struct i915_fp_compile *p)
|
||||
{
|
||||
#if 0
|
||||
const uint inputs
|
||||
= p->shader->inputs_read | (1 << TGSI_ATTRIB_POS); /*XXX hack*/
|
||||
uint i;
|
||||
|
||||
p->wpos_tex = -1;
|
||||
|
||||
if (inputs & (1 << TGSI_ATTRIB_POS)) {
|
||||
for (i = 0; i < I915_TEX_UNITS; i++) {
|
||||
if ((inputs & (1 << (TGSI_ATTRIB_TEX0 + i))) == 0) {
|
||||
p->wpos_tex = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
i915_program_error(p, "No free texcoord for wpos value");
|
||||
}
|
||||
#else
|
||||
if (p->shader->info.input_semantic_name[0] == TGSI_SEMANTIC_POSITION) {
|
||||
/* frag shader using the fragment position input */
|
||||
#if 0
|
||||
assert(0);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1314,7 +1301,6 @@ i915_translate_fragment_program( struct i915_context *i915,
|
|||
}
|
||||
|
||||
p = i915_init_compile(i915, fs);
|
||||
i915_find_wpos_space(p);
|
||||
|
||||
i915_translate_instructions(p, tokens, fs);
|
||||
i915_fixup_depth_write(p);
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2011 The Chromium OS authors.
|
||||
* 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 GOOGLE 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
/* Fake occlusion queries which return 0, it's better than crashing */
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
|
||||
#include "util/u_memory.h"
|
||||
|
||||
#include "i915_context.h"
|
||||
#include "i915_query.h"
|
||||
|
||||
struct i915_query
|
||||
{
|
||||
unsigned query;
|
||||
};
|
||||
|
||||
static struct pipe_query *i915_create_query(struct pipe_context *ctx,
|
||||
unsigned query_type)
|
||||
{
|
||||
struct i915_query *query = CALLOC_STRUCT( i915_query );
|
||||
|
||||
return (struct pipe_query *)query;
|
||||
}
|
||||
|
||||
static void i915_destroy_query(struct pipe_context *ctx,
|
||||
struct pipe_query *query)
|
||||
{
|
||||
FREE(query);
|
||||
}
|
||||
|
||||
static void i915_begin_query(struct pipe_context *ctx,
|
||||
struct pipe_query *query)
|
||||
{
|
||||
}
|
||||
|
||||
static void i915_end_query(struct pipe_context *ctx, struct pipe_query *query)
|
||||
{
|
||||
}
|
||||
|
||||
static boolean i915_get_query_result(struct pipe_context *ctx,
|
||||
struct pipe_query *query,
|
||||
boolean wait,
|
||||
void *vresult)
|
||||
{
|
||||
uint64_t *result = (uint64_t*)vresult;
|
||||
|
||||
/* 2* viewport Max */
|
||||
*result = 512*1024*1024;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
i915_init_query_functions(struct i915_context *i915)
|
||||
{
|
||||
i915->base.create_query = i915_create_query;
|
||||
i915->base.destroy_query = i915_destroy_query;
|
||||
i915->base.begin_query = i915_begin_query;
|
||||
i915->base.end_query = i915_end_query;
|
||||
i915->base.get_query_result = i915_get_query_result;
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2011 The Chromium OS authors.
|
||||
* 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 GOOGLE 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 I915_QUERY_H
|
||||
#define I915_QUERY_H
|
||||
|
||||
struct i915_context;
|
||||
struct pipe_context;
|
||||
|
||||
void i915_init_query_functions( struct i915_context *i915 );
|
||||
|
||||
#endif /* I915_QUERY_H */
|
|
@ -170,6 +170,13 @@
|
|||
#define COLOR_BUF_RGB555 (1<<8)
|
||||
#define COLOR_BUF_RGB565 (2<<8)
|
||||
#define COLOR_BUF_ARGB8888 (3<<8)
|
||||
#define COLOR_BUF_YCRCB_SWAP (4<<8)
|
||||
#define COLOR_BUF_YCRCB_NORMAL (5<<8)
|
||||
#define COLOR_BUF_YCRCB_SWAPUV (6<<8)
|
||||
#define COLOR_BUF_YCRCB_SWAPUVY (7<<8)
|
||||
#define COLOR_BUF_ARGB4444 (8<<8)
|
||||
#define COLOR_BUF_ARGB1555 (9<<8)
|
||||
#define COLOR_BUF_ARGB2101010 (10<<8)
|
||||
#define DEPTH_FRMT_16_FIXED 0
|
||||
#define DEPTH_FRMT_16_FLOAT (1<<2)
|
||||
#define DEPTH_FRMT_24_FIXED_8_OTHER (2<<2)
|
||||
|
|
|
@ -7,12 +7,12 @@
|
|||
|
||||
static struct pipe_resource *
|
||||
i915_resource_create(struct pipe_screen *screen,
|
||||
const struct pipe_resource *template)
|
||||
const struct pipe_resource *template)
|
||||
{
|
||||
if (template->target == PIPE_BUFFER)
|
||||
return i915_buffer_create(screen, template);
|
||||
else
|
||||
return i915_texture_create(screen, template);
|
||||
return i915_texture_create(screen, template, FALSE);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,15 @@ struct i915_buffer {
|
|||
boolean free_on_destroy;
|
||||
};
|
||||
|
||||
|
||||
/* Texture transfer. */
|
||||
struct i915_transfer {
|
||||
/* Base class. */
|
||||
struct pipe_transfer b;
|
||||
struct pipe_resource *staging_texture;
|
||||
};
|
||||
|
||||
|
||||
#define I915_MAX_TEXTURE_2D_LEVELS 12 /* max 2048x2048 */
|
||||
#define I915_MAX_TEXTURE_3D_LEVELS 9 /* max 256x256x256 */
|
||||
|
||||
|
@ -101,7 +110,8 @@ static INLINE struct i915_buffer *i915_buffer(struct pipe_resource *resource)
|
|||
|
||||
struct pipe_resource *
|
||||
i915_texture_create(struct pipe_screen *screen,
|
||||
const struct pipe_resource *template);
|
||||
const struct pipe_resource *template,
|
||||
boolean force_untiled);
|
||||
|
||||
struct pipe_resource *
|
||||
i915_texture_from_handle(struct pipe_screen * screen,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue