aboutsummaryrefslogtreecommitdiff
path: root/mesalib
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib')
-rw-r--r--mesalib/configure.ac38
-rw-r--r--mesalib/docs/GL3.txt2
-rw-r--r--mesalib/docs/index.html12
-rw-r--r--mesalib/docs/relnotes.html2
-rw-r--r--mesalib/docs/relnotes/10.2.9.html101
-rw-r--r--mesalib/docs/relnotes/10.3.1.html158
-rw-r--r--mesalib/docs/relnotes/10.4.html1
-rw-r--r--mesalib/src/glsl/README16
-rw-r--r--mesalib/src/mesa/drivers/common/meta_blit.c1
-rw-r--r--mesalib/src/mesa/main/bufferobj.c21
-rw-r--r--mesalib/src/mesa/main/bufferobj.h2
-rw-r--r--mesalib/src/mesa/main/dd.h2
-rw-r--r--mesalib/src/mesa/main/mtypes.h13
-rw-r--r--mesalib/src/mesa/main/shared.c2
-rw-r--r--mesalib/src/mesa/main/teximage.c6
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c4
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_eglimage.c3
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c13
-rw-r--r--mesalib/src/mesa/state_tracker/st_gen_mipmap.c2
-rw-r--r--mesalib/src/mesa/state_tracker/st_texture.c6
-rw-r--r--mesalib/src/mesa/state_tracker/st_texture.h3
-rw-r--r--mesalib/src/mesa/state_tracker/st_vdpau.c4
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_api.c2
-rw-r--r--mesalib/src/mesa/vbo/vbo_save_api.c4
24 files changed, 355 insertions, 63 deletions
diff --git a/mesalib/configure.ac b/mesalib/configure.ac
index 680dff4ab..0ed932544 100644
--- a/mesalib/configure.ac
+++ b/mesalib/configure.ac
@@ -1126,14 +1126,13 @@ if test "x$enable_dri" = xyes; then
fi
# Check for expat
- PKG_CHECK_EXISTS([expat], [have_expat=yes], [have_expat=no])
- if test "x$have_expat" = "xyes"; then
- PKG_CHECK_MODULES([EXPAT], [expat], [],
- AC_MSG_ERROR([Expat required for DRI.]))
- else
- # expat version 2.0 and earlier do not provide expat.pc
- EXPAT_LIBS=-lexpat
- fi
+ PKG_CHECK_MODULES([EXPAT], [expat], [],
+ # expat version 2.0 and earlier do not provide expat.pc
+ [AC_CHECK_HEADER([expat.h],[],
+ [AC_MSG_ERROR([Expat headers required for DRI not found])])
+ AC_CHECK_LIB([expat],[XML_ParserCreate],[],
+ [AC_MSG_ERROR([Expat library required for DRI not found])])
+ EXPAT_LIBS="-lexpat"])
DRICOMMON_NEED_LIBDRM=no
# If we are building any DRI driver other than swrast.
@@ -1438,7 +1437,6 @@ AM_CONDITIONAL(HAVE_ST_OMX, test "x$enable_omx" = xyes)
if test "x$enable_va" = xyes; then
PKG_CHECK_MODULES([VA], [libva >= 0.35.0 x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED],
[VA_LIBS="`$PKG_CONFIG --libs x11-xcb xcb-dri2`"])
- GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS va"
enable_gallium_loader=$enable_shared_pipe_drivers
fi
AM_CONDITIONAL(HAVE_ST_VA, test "x$enable_va" = xyes)
@@ -1786,38 +1784,30 @@ if test "x$enable_gallium_tests" = xyes; then
fi
AM_CONDITIONAL(HAVE_GALLIUM_TESTS, test "x$enable_gallium_tests" = xyes)
-VDPAU_LIB_INSTALL_DIR_DEFAULT=''
-if test "x$enable_vdpau" = xyes; then
- VDPAU_LIB_INSTALL_DIR_DEFAULT=`$PKG_CONFIG --variable=moduledir vdpau`
-fi
-
dnl Directory for VDPAU libs
AC_ARG_WITH([vdpau-libdir],
[AS_HELP_STRING([--with-vdpau-libdir=DIR],
- [directory for the VDPAU libraries @<:@default=`pkg-config --variable=moduledir vdpau`@:>@])],
+ [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
[VDPAU_LIB_INSTALL_DIR="$withval"],
- [VDPAU_LIB_INSTALL_DIR="$VDPAU_LIB_INSTALL_DIR_DEFAULT"])
+ [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
AC_SUBST([VDPAU_LIB_INSTALL_DIR])
-OMX_LIB_INSTALL_DIR_DEFAULT=''
-if test "x$enable_omx" = xyes; then
- OMX_LIB_INSTALL_DIR_DEFAULT=`$PKG_CONFIG --variable=pluginsdir libomxil-bellagio`
-fi
+dnl Directory for OMX libs
AC_ARG_WITH([omx-libdir],
[AS_HELP_STRING([--with-omx-libdir=DIR],
- [directory for the OMX libraries @<:@default=`pkg-config --variable=pluginsdir libomxil-bellagio`@:>@])],
+ [directory for the OMX libraries])],
[OMX_LIB_INSTALL_DIR="$withval"],
- [OMX_LIB_INSTALL_DIR="$OMX_LIB_INSTALL_DIR_DEFAULT"])
+ [OMX_LIB_INSTALL_DIR=`$PKG_CONFIG --define-variable=libdir=\$libdir --variable=pluginsdir libomxil-bellagio`])
AC_SUBST([OMX_LIB_INSTALL_DIR])
dnl Directory for VA libs
AC_ARG_WITH([va-libdir],
[AS_HELP_STRING([--with-va-libdir=DIR],
- [directory for the VA libraries @<:@default=`pkg-config libva --variable=driverdir`@:>@])],
+ [directory for the VA libraries @<:@${libdir}/dri@:>@])],
[VA_LIB_INSTALL_DIR="$withval"],
- [VA_LIB_INSTALL_DIR=`pkg-config libva --variable=driverdir`])
+ [VA_LIB_INSTALL_DIR="${libdir}/dri"])
AC_SUBST([VA_LIB_INSTALL_DIR])
dnl
diff --git a/mesalib/docs/GL3.txt b/mesalib/docs/GL3.txt
index 5adc7598c..07d1d2c49 100644
--- a/mesalib/docs/GL3.txt
+++ b/mesalib/docs/GL3.txt
@@ -110,7 +110,7 @@ GL 4.0, GLSL 4.00:
- Interpolation functions DONE ()
- New overload resolution rules DONE
GL_ARB_gpu_shader_fp64 started (Dave)
- GL_ARB_sample_shading DONE (i965, nv50, nvc0, radeonsi)
+ GL_ARB_sample_shading DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_shader_subroutine not started
GL_ARB_tessellation_shader started (Chris, Ilia)
GL_ARB_texture_buffer_object_rgb32 DONE (i965, nvc0, r600, radeonsi, llvmpipe, softpipe)
diff --git a/mesalib/docs/index.html b/mesalib/docs/index.html
index 98162bbe9..244a7a3b2 100644
--- a/mesalib/docs/index.html
+++ b/mesalib/docs/index.html
@@ -16,6 +16,18 @@
<h1>News</h1>
+<h2>October 12, 2014</h2>
+<p>
+<a href="relnotes/10.2.9.html">Mesa 10.2.9</a>
+and <a href="relnotes/10.3.1.html">Mesa 10.3.1</a> are released.
+
+These are bug-fix releases from the 10.2 and 10.3 branches, respectively.
+<br>
+NOTE: It is anticipated that 10.2.9 will be the final release in the 10.2
+series. Users of 10.2 are encouraged to migrate to the 10.3 series in order
+to obtain future fixes.
+</p>
+
<h2>September 19, 2014</h2>
<p>
<a href="relnotes/10.3.html">Mesa 10.3</a> is released. This is a new
diff --git a/mesalib/docs/relnotes.html b/mesalib/docs/relnotes.html
index 0a4c3de1d..d546e8589 100644
--- a/mesalib/docs/relnotes.html
+++ b/mesalib/docs/relnotes.html
@@ -21,6 +21,8 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<ul>
+<li><a href="relnotes/10.3.1.html">10.3.1 release notes</a>
+<li><a href="relnotes/10.2.9.html">10.2.9 release notes</a>
<li><a href="relnotes/10.3.html">10.3 release notes</a>
<li><a href="relnotes/10.2.8.html">10.2.8 release notes</a>
<li><a href="relnotes/10.2.7.html">10.2.7 release notes</a>
diff --git a/mesalib/docs/relnotes/10.2.9.html b/mesalib/docs/relnotes/10.2.9.html
new file mode 100644
index 000000000..7a9f639d9
--- /dev/null
+++ b/mesalib/docs/relnotes/10.2.9.html
@@ -0,0 +1,101 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <title>Mesa Release Notes</title>
+ <link rel="stylesheet" type="text/css" href="../mesa.css">
+</head>
+<body>
+
+<div class="header">
+ <h1>The Mesa 3D Graphics Library</h1>
+</div>
+
+<iframe src="../contents.html"></iframe>
+<div class="content">
+
+<h1>Mesa 10.2.9 Release Notes / October 12, 2014</h1>
+
+<p>
+Mesa 10.2.9 is a bug fix release which fixes bugs found since the 10.2.8 release.
+This is the final planned release for the 10.2 branch.
+</p>
+<p>
+Mesa 10.2.9 implements the OpenGL 3.3 API, but the version reported by
+glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
+glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
+Some drivers don't support all the features required in OpenGL 3.3. OpenGL
+3.3 is <strong>only</strong> available if requested at context creation
+because compatibility contexts are not supported.
+</p>
+
+<h2>SHA256 checksums</h2>
+<pre>
+f8d62857eed8f604a57710c58a8ffcfb8dab2dc4977ec27c956c7c4fd14032f6 MesaLib-10.2.9.tar.gz
+f6031f8b7113a92325b60635c504c510490eebb2e707119bbff7bd86aa34657d MesaLib-10.2.9.tar.bz2
+11c0ef4f3308fc29d9f15a77fd8f4842a946fce9e830250a1c95b171a446171a MesaLib-10.2.9.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=79462">Bug 79462</a> - [NVC0/Codegen] Shader compilation falis in spill logic</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83570">Bug 83570</a> - Glyphy demo throws unhandled Integer division by zero exception</li>
+
+</ul>
+
+<h2>Changes</h2>
+<p>Andreas Pokorny (2):</p>
+<ul>
+ <li>egl/drm: expose KHR_image_pixmap extension</li>
+ <li>i915: Fix black buffers when importing prime fds</li>
+</ul>
+
+<p>Emil Velikov (2):</p>
+<ul>
+ <li>docs: Add sha256 sums for the 10.2.8 release</li>
+ <li>Update VERSION to 10.2.9</li>
+</ul>
+
+<p>Ilia Mirkin (1):</p>
+<ul>
+ <li>nv50/ir: avoid deleting pseudo instructions too early</li>
+</ul>
+
+<p>Marek Olšák (3):</p>
+<ul>
+ <li>radeonsi: release GS rings at context destruction</li>
+ <li>radeonsi: properly destroy the GS copy shader and scratch_bo for compute</li>
+ <li>st/dri: remove GALLIUM_MSAA and __GL_FSAA_MODE environment variables</li>
+</ul>
+
+<p>Roland Scheidegger (1):</p>
+<ul>
+ <li>gallivm: fix idiv</li>
+</ul>
+
+<p>Thomas Hellstrom (1):</p>
+<ul>
+ <li>st/xa: Fix regression in xa_yuv_planar_blit()</li>
+</ul>
+
+<p>Tom Stellard (1):</p>
+<ul>
+ <li>configure.ac: Compute LLVM_VERSION_PATCH using llvm-config</li>
+</ul>
+
+<p>rconde (1):</p>
+<ul>
+ <li>gallivm,tgsi: fix idiv by zero crash</li>
+</ul>
+
+</div>
+</body>
+</html>
diff --git a/mesalib/docs/relnotes/10.3.1.html b/mesalib/docs/relnotes/10.3.1.html
new file mode 100644
index 000000000..7de0506c2
--- /dev/null
+++ b/mesalib/docs/relnotes/10.3.1.html
@@ -0,0 +1,158 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <title>Mesa Release Notes</title>
+ <link rel="stylesheet" type="text/css" href="../mesa.css">
+</head>
+<body>
+
+<div class="header">
+ <h1>The Mesa 3D Graphics Library</h1>
+</div>
+
+<iframe src="../contents.html"></iframe>
+<div class="content">
+
+<h1>Mesa 10.3.1 Release Notes / October 12, 2014</h1>
+
+<p>
+Mesa 10.3.1 is a bug fix release which fixes bugs found since the 10.3 release.
+</p>
+<p>
+Mesa 10.3.1 implements the OpenGL 3.3 API, but the version reported by
+glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
+glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
+Some drivers don't support all the features required in OpenGL 3.3. OpenGL
+3.3 is <strong>only</strong> available if requested at context creation
+because compatibility contexts are not supported.
+</p>
+
+<h2>SHA256 checksums</h2>
+<pre>
+155afcbad17be8bb80282c761b957d5cc716c14a1fa16c4f5ee04e76df729c6d MesaLib-10.3.1.tar.gz
+b081d077d717e5d56f2d59677490856052c41573e50378ff86d6c72456714add MesaLib-10.3.1.tar.bz2
+07a14febfed06412d519e091a62d24513fee6745f1a6f8a8f1956bfe04b77d15 MesaLib-10.3.1.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=79462">Bug 79462</a> - [NVC0/Codegen] Shader compilation falis in spill logic</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82932">Bug 82932</a> - [SNB+ Bisected]Ogles3conform ES3-CTS.shaders.indexing.vector_subscript.vec3_static_loop_subscript_write_direct_read_vertex fails</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83506">Bug 83506</a> - [UBO] row_major layout ignored inside structures</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83533">Bug 83533</a> - [UBO] nested structures don't get appropriate padding</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83570">Bug 83570</a> - Glyphy demo throws unhandled Integer division by zero exception</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83741">Bug 83741</a> - [UBO] row_major layout partially ignored for arrays of structures</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84178">Bug 84178</a> - Big glamor regression in Xorg server 1.6.99.1 GIT: x11perf 1.5 Test: PutImage XY 500x500 Square</li>
+
+</ul>
+
+<h2>Changes</h2>
+
+<p>Andreas Pokorny (2):</p>
+<ul>
+ <li>egl/drm: expose KHR_image_pixmap extension</li>
+ <li>i915: Fix black buffers when importing prime fds</li>
+</ul>
+
+<p>Brian Paul (1):</p>
+<ul>
+ <li>mesa: fix prog_optimize.c assertions triggered by SWZ opcode</li>
+</ul>
+
+<p>Emil Velikov (2):</p>
+<ul>
+ <li>docs: Add 10.3 sha256 sums, news item and link release notes</li>
+ <li>Update VERSION to 10.3.1</li>
+</ul>
+
+<p>Ian Romanick (4):</p>
+<ul>
+ <li>glsl: Make sure fields after small structs have correct padding</li>
+ <li>glsl: Make sure row-major array-of-structure get correct layout</li>
+ <li>glsl: Round struct size up to at least 16 bytes</li>
+ <li>glsl: Strip arrayness from ir_type_dereference_variable too</li>
+</ul>
+
+<p>Ilia Mirkin (5):</p>
+<ul>
+ <li>nv50/ir: avoid deleting pseudo instructions too early</li>
+ <li>gm107/ir: fix manual TXD for array targets</li>
+ <li>gm107/ir: fix texture argument order</li>
+ <li>gm107/ir: add support for indirect const buffer selection</li>
+ <li>gm107/ir: take relative pfetch offset into account</li>
+</ul>
+
+<p>Keith Packard (1):</p>
+<ul>
+ <li>glx/dri3: Provide error diagnostics when DRI3 allocation fails</li>
+</ul>
+
+<p>Kenneth Graunke (2):</p>
+<ul>
+ <li>mesa: Use proper structure for glGet*(GL_TEXTURE_COORD_ARRAY*).</li>
+ <li>mesa: Set correct array element in vbo_exec_vtx_init.</li>
+</ul>
+
+<p>Marek Olšák (3):</p>
+<ul>
+ <li>radeonsi: release GS rings at context destruction</li>
+ <li>radeonsi: properly destroy the GS copy shader and scratch_bo for compute</li>
+ <li>st/dri: remove GALLIUM_MSAA and __GL_FSAA_MODE environment variables</li>
+</ul>
+
+<p>Michel Dänzer (1):</p>
+<ul>
+ <li>st/mesa: Use PIPE_USAGE_STAGING for GL_STATIC/DYNAMIC/STREAM_READ buffers</li>
+</ul>
+
+<p>Richard Sandiford (2):</p>
+<ul>
+ <li>mesa: Fix alpha component in unpack_R8G8B8X8_SRGB.</li>
+ <li>swrast: Fix handling of MESA_FORMAT_L8A8_SRGB for big-endian</li>
+</ul>
+
+<p>Roland Scheidegger (1):</p>
+<ul>
+ <li>gallivm: fix idiv</li>
+</ul>
+
+<p>Thomas Hellstrom (1):</p>
+<ul>
+ <li>st/xa: Fix regression in xa_yuv_planar_blit()</li>
+</ul>
+
+<p>Tom Stellard (2):</p>
+<ul>
+ <li>clover: Add support to mem objects for multiple destructor callbacks v2</li>
+ <li>configure.ac: Compute LLVM_VERSION_PATCH using llvm-config</li>
+</ul>
+
+<p>Tomasz Figa (3):</p>
+<ul>
+ <li>util: Include in Android builds</li>
+ <li>st/mesa: Generate format_info.c in Android builds</li>
+ <li>st/mesa: Fix paths used in Android builds</li>
+</ul>
+
+<p>rconde (1):</p>
+<ul>
+ <li>gallivm,tgsi: fix idiv by zero crash</li>
+</ul>
+
+</div>
+</body>
+</html>
diff --git a/mesalib/docs/relnotes/10.4.html b/mesalib/docs/relnotes/10.4.html
index e6813d3d1..64cbfaefa 100644
--- a/mesalib/docs/relnotes/10.4.html
+++ b/mesalib/docs/relnotes/10.4.html
@@ -44,6 +44,7 @@ Note: some of the new features are only available with certain drivers.
</p>
<ul>
+<li>GL_ARB_sample_shading on r600</li>
<li>GL_ARB_texture_view on nv50, nvc0</li>
</ul>
diff --git a/mesalib/src/glsl/README b/mesalib/src/glsl/README
index 0a0afccdc..2f93f12ff 100644
--- a/mesalib/src/glsl/README
+++ b/mesalib/src/glsl/README
@@ -8,7 +8,7 @@ passed straight through. See glcpp/*
2) lex and yacc-based parser takes the preprocessed string and
generates the AST (abstract syntax tree). Almost no checking is
-performed in this stage. See glsl_lexer.lpp and glsl_parser.ypp.
+performed in this stage. See glsl_lexer.ll and glsl_parser.yy.
3) The AST is converted to "HIR". This is the intermediate
representation of the compiler. Constructors are generated, function
@@ -34,7 +34,7 @@ linked in.
7) The driver performs code generation out of the IR, taking a linked
shader program and producing a compiled program for each stage. See
-ir_to_mesa.cpp for Mesa IR code generation.
+../mesa/program/ir_to_mesa.cpp for Mesa IR code generation.
FAQ:
@@ -126,7 +126,7 @@ optimizations like CSE where one must navigate an expression tree.
Q: Why no SSA representation?
-A: Converting an IR tree to SSA form makes dead code elmimination,
+A: Converting an IR tree to SSA form makes dead code elimination,
common subexpression elimination, and many other optimizations much
easier. However, in our primarily vector-based language, there's some
major questions as to how it would work. Do we do SSA on the scalar
@@ -134,9 +134,9 @@ or vector level? If we do it at the vector level, we're going to end
up with many different versions of the variable when encountering code
like:
-(assign (constant bool (1)) (swiz x (var_ref __retval) ) (var_ref a) )
-(assign (constant bool (1)) (swiz y (var_ref __retval) ) (var_ref b) )
-(assign (constant bool (1)) (swiz z (var_ref __retval) ) (var_ref c) )
+(assign (constant bool (1)) (swiz x (var_ref __retval) ) (var_ref a) )
+(assign (constant bool (1)) (swiz y (var_ref __retval) ) (var_ref b) )
+(assign (constant bool (1)) (swiz z (var_ref __retval) ) (var_ref c) )
If every masked update of a component relies on the previous value of
the variable, then we're probably going to be quite limited in our
@@ -183,7 +183,7 @@ ir_validate.cpp (check users have the right types)
You may also need to update the backends if they will see the new expr type:
-../mesa/shaders/ir_to_mesa.cpp
+../mesa/program/ir_to_mesa.cpp
You can then use the new expression from builtins (if all backends
would rather see it), or scan the IR and convert to use your new
@@ -225,4 +225,4 @@ Initially, there really wasn't one. We have since adopted one:
- Files that implement a class that is used throught the code should
take the name of that class (e.g., ir_hierarchical_visitor.cpp).
- Files that contain code not fitting in one of the previous
- categories should have a sensible name (e.g., glsl_parser.ypp).
+ categories should have a sensible name (e.g., glsl_parser.yy).
diff --git a/mesalib/src/mesa/drivers/common/meta_blit.c b/mesalib/src/mesa/drivers/common/meta_blit.c
index c6616d93d..01cb532fe 100644
--- a/mesalib/src/mesa/drivers/common/meta_blit.c
+++ b/mesalib/src/mesa/drivers/common/meta_blit.c
@@ -134,6 +134,7 @@ setup_glsl_msaa_blit_scaled_shader(struct gl_context *ctx,
break;
default:
_mesa_problem(ctx, "Unsupported sample count %d\n", samples);
+ unreachable("Unsupported sample count");
}
/* Create sample map string. */
diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c
index b6879ceb5..0ee88560f 100644
--- a/mesalib/src/mesa/main/bufferobj.c
+++ b/mesalib/src/mesa/main/bufferobj.c
@@ -389,14 +389,14 @@ convert_clear_buffer_data(struct gl_context *ctx,
* Default callback for the \c dd_function_table::NewBufferObject() hook.
*/
static struct gl_buffer_object *
-_mesa_new_buffer_object( struct gl_context *ctx, GLuint name, GLenum target )
+_mesa_new_buffer_object(struct gl_context *ctx, GLuint name)
{
struct gl_buffer_object *obj;
(void) ctx;
obj = MALLOC_STRUCT(gl_buffer_object);
- _mesa_initialize_buffer_object(ctx, obj, name, target);
+ _mesa_initialize_buffer_object(ctx, obj, name);
return obj;
}
@@ -494,12 +494,10 @@ _mesa_reference_buffer_object_(struct gl_context *ctx,
* Initialize a buffer object to default values.
*/
void
-_mesa_initialize_buffer_object( struct gl_context *ctx,
- struct gl_buffer_object *obj,
- GLuint name, GLenum target )
+_mesa_initialize_buffer_object(struct gl_context *ctx,
+ struct gl_buffer_object *obj,
+ GLuint name)
{
- (void) target;
-
memset(obj, 0, sizeof(struct gl_buffer_object));
mtx_init(&obj->Mutex, mtx_plain);
obj->RefCount = 1;
@@ -906,7 +904,7 @@ _mesa_handle_bind_buffer_gen(struct gl_context *ctx,
* never used before, allocate a buffer object now.
*/
ASSERT(ctx->Driver.NewBufferObject);
- buf = ctx->Driver.NewBufferObject(ctx, buffer, target);
+ buf = ctx->Driver.NewBufferObject(ctx, buffer);
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", caller);
return false;
@@ -2652,6 +2650,12 @@ set_ubo_binding(struct gl_context *ctx,
binding->Offset = offset;
binding->Size = size;
binding->AutomaticSize = autoSize;
+
+ /* If this is a real buffer object, mark it has having been used
+ * at some point as a UBO.
+ */
+ if (size >= 0)
+ bufObj->UsageHistory |= USAGE_UNIFORM_BUFFER;
}
/**
@@ -2764,6 +2768,7 @@ set_atomic_buffer_binding(struct gl_context *ctx,
} else {
binding->Offset = offset;
binding->Size = size;
+ bufObj->UsageHistory |= USAGE_ATOMIC_COUNTER_BUFFER;
}
}
diff --git a/mesalib/src/mesa/main/bufferobj.h b/mesalib/src/mesa/main/bufferobj.h
index 0779605c0..fe294fc0b 100644
--- a/mesalib/src/mesa/main/bufferobj.h
+++ b/mesalib/src/mesa/main/bufferobj.h
@@ -103,7 +103,7 @@ _mesa_multi_bind_lookup_bufferobj(struct gl_context *ctx,
extern void
_mesa_initialize_buffer_object(struct gl_context *ctx,
struct gl_buffer_object *obj,
- GLuint name, GLenum target);
+ GLuint name);
extern void
_mesa_reference_buffer_object_(struct gl_context *ctx,
diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h
index c130b14a5..c07e83ad9 100644
--- a/mesalib/src/mesa/main/dd.h
+++ b/mesalib/src/mesa/main/dd.h
@@ -602,7 +602,7 @@ struct dd_function_table {
*/
/*@{*/
struct gl_buffer_object * (*NewBufferObject)(struct gl_context *ctx,
- GLuint buffer, GLenum target);
+ GLuint buffer);
void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj );
diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h
index 5e9453b2f..9f44edac6 100644
--- a/mesalib/src/mesa/main/mtypes.h
+++ b/mesalib/src/mesa/main/mtypes.h
@@ -1465,6 +1465,16 @@ struct gl_buffer_mapping {
/**
+ * Usages we've seen for a buffer object.
+ */
+typedef enum {
+ USAGE_UNIFORM_BUFFER = 0x1,
+ USAGE_TEXTURE_BUFFER = 0x2,
+ USAGE_ATOMIC_COUNTER_BUFFER = 0x4,
+} gl_buffer_usage;
+
+
+/**
* GL_ARB_vertex/pixel_buffer_object buffer object
*/
struct gl_buffer_object
@@ -1481,6 +1491,7 @@ struct gl_buffer_object
GLboolean Written; /**< Ever written to? (for debugging) */
GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */
GLboolean Immutable; /**< GL_ARB_buffer_storage */
+ gl_buffer_usage UsageHistory; /**< How has this buffer been used so far? */
struct gl_buffer_mapping Mappings[MAP_COUNT];
};
@@ -4060,6 +4071,8 @@ struct gl_driver_flags
*/
uint64_t NewUniformBuffer;
+ uint64_t NewTextureBuffer;
+
/**
* gl_context::AtomicBufferBindings
*/
diff --git a/mesalib/src/mesa/main/shared.c b/mesalib/src/mesa/main/shared.c
index 7ef932ff0..f74a8232f 100644
--- a/mesalib/src/mesa/main/shared.c
+++ b/mesalib/src/mesa/main/shared.c
@@ -86,7 +86,7 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
shared->SamplerObjects = _mesa_NewHashTable();
/* Allocate the default buffer object */
- shared->NullBufferObj = ctx->Driver.NewBufferObject(ctx, 0, 0);
+ shared->NullBufferObj = ctx->Driver.NewBufferObject(ctx, 0);
/* Create default texture objects */
for (i = 0; i < NUM_TEXTURE_TARGETS; i++) {
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index c0298af8e..4f4bb11dd 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -4652,6 +4652,12 @@ texbufferrange(struct gl_context *ctx, GLenum target, GLenum internalFormat,
texObj->BufferSize = size;
}
_mesa_unlock_texture(ctx, texObj);
+
+ ctx->NewDriverState |= ctx->DriverFlags.NewTextureBuffer;
+
+ if (bufObj) {
+ bufObj->UsageHistory |= USAGE_TEXTURE_BUFFER;
+ }
}
diff --git a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
index d53602c8b..55f36442a 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -54,14 +54,14 @@
* internal structure where somehow shared.
*/
static struct gl_buffer_object *
-st_bufferobj_alloc(struct gl_context *ctx, GLuint name, GLenum target)
+st_bufferobj_alloc(struct gl_context *ctx, GLuint name)
{
struct st_buffer_object *st_obj = ST_CALLOC_STRUCT(st_buffer_object);
if (!st_obj)
return NULL;
- _mesa_initialize_buffer_object(ctx, &st_obj->Base, name, target);
+ _mesa_initialize_buffer_object(ctx, &st_obj->Base, name);
return &st_obj->Base;
}
diff --git a/mesalib/src/mesa/state_tracker/st_cb_eglimage.c b/mesalib/src/mesa/state_tracker/st_cb_eglimage.c
index 34eb80959..8531afb29 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_eglimage.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_eglimage.c
@@ -96,6 +96,7 @@ st_bind_surface(struct gl_context *ctx, GLenum target,
struct gl_texture_image *texImage,
struct pipe_surface *ps)
{
+ struct st_context *st = st_context(ctx);
struct st_texture_object *stObj;
struct st_texture_image *stImage;
GLenum internalFormat;
@@ -124,7 +125,7 @@ st_bind_surface(struct gl_context *ctx, GLenum target,
/* FIXME create a non-default sampler view from the pipe_surface? */
pipe_resource_reference(&stObj->pt, ps->texture);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
pipe_resource_reference(&stImage->pt, stObj->pt);
stObj->width0 = ps->width;
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index dfa188a3f..a8dbb7888 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -152,10 +152,11 @@ static void
st_DeleteTextureObject(struct gl_context *ctx,
struct gl_texture_object *texObj)
{
+ struct st_context *st = st_context(ctx);
struct st_texture_object *stObj = st_texture_object(texObj);
pipe_resource_reference(&stObj->pt, NULL);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
st_texture_free_sampler_views(stObj);
_mesa_delete_texture_object(ctx, texObj);
}
@@ -512,7 +513,7 @@ st_AllocTextureImageBuffer(struct gl_context *ctx,
/* The parent texture object does not have space for this image */
pipe_resource_reference(&stObj->pt, NULL);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
if (!guess_and_alloc_texture(st, stObj, stImage)) {
/* Probably out of memory.
@@ -1571,13 +1572,13 @@ st_finalize_texture(struct gl_context *ctx,
if (!st_obj) {
pipe_resource_reference(&stObj->pt, NULL);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
return GL_TRUE;
}
if (st_obj->buffer != stObj->pt) {
pipe_resource_reference(&stObj->pt, st_obj->buffer);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
stObj->width0 = stObj->pt->width0 / _mesa_get_format_bytes(tObj->_BufferObjectFormat);
stObj->height0 = 1;
stObj->depth0 = 1;
@@ -1598,7 +1599,7 @@ st_finalize_texture(struct gl_context *ctx,
firstImage->pt != stObj->pt &&
(!stObj->pt || firstImage->pt->last_level >= stObj->pt->last_level)) {
pipe_resource_reference(&stObj->pt, firstImage->pt);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
}
/* If this texture comes from a window system, there is nothing else to do. */
@@ -1646,7 +1647,7 @@ st_finalize_texture(struct gl_context *ctx,
* gallium texture now. We'll make a new one below.
*/
pipe_resource_reference(&stObj->pt, NULL);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
st->dirty.st |= ST_NEW_FRAMEBUFFER;
}
}
diff --git a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
index 18cf504a7..26e1c21f6 100644
--- a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
@@ -124,7 +124,7 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
/* release the old tex (will likely be freed too) */
pipe_resource_reference(&oldTex, NULL);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
}
else {
/* Make sure that the base texture image data is present in the
diff --git a/mesalib/src/mesa/state_tracker/st_texture.c b/mesalib/src/mesa/state_tracker/st_texture.c
index 5996b7d1b..ada984189 100644
--- a/mesalib/src/mesa/state_tracker/st_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_texture.c
@@ -519,12 +519,14 @@ st_texture_release_sampler_view(struct st_context *st,
}
void
-st_texture_release_all_sampler_views(struct st_texture_object *stObj)
+st_texture_release_all_sampler_views(struct st_context *st,
+ struct st_texture_object *stObj)
{
GLuint i;
+ /* XXX This should use sampler_views[i]->pipe, not st->pipe */
for (i = 0; i < stObj->num_sampler_views; ++i)
- pipe_sampler_view_reference(&stObj->sampler_views[i], NULL);
+ pipe_sampler_view_release(st->pipe, &stObj->sampler_views[i]);
}
diff --git a/mesalib/src/mesa/state_tracker/st_texture.h b/mesalib/src/mesa/state_tracker/st_texture.h
index ce1cf8b0a..d66afcb56 100644
--- a/mesalib/src/mesa/state_tracker/st_texture.h
+++ b/mesalib/src/mesa/state_tracker/st_texture.h
@@ -255,7 +255,8 @@ st_texture_release_sampler_view(struct st_context *st,
struct st_texture_object *stObj);
extern void
-st_texture_release_all_sampler_views(struct st_texture_object *stObj);
+st_texture_release_all_sampler_views(struct st_context *st,
+ struct st_texture_object *stObj);
void
st_texture_free_sampler_views(struct st_texture_object *stObj);
diff --git a/mesalib/src/mesa/state_tracker/st_vdpau.c b/mesalib/src/mesa/state_tracker/st_vdpau.c
index 8c10cdaf3..6ccaf3e3f 100644
--- a/mesalib/src/mesa/state_tracker/st_vdpau.c
+++ b/mesalib/src/mesa/state_tracker/st_vdpau.c
@@ -139,7 +139,7 @@ st_vdpau_map_surface(struct gl_context *ctx, GLenum target, GLenum access,
texFormat);
pipe_resource_reference(&stObj->pt, res);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
pipe_resource_reference(&stImage->pt, res);
u_sampler_view_default_template(&templ, res, res->format);
@@ -172,7 +172,7 @@ st_vdpau_unmap_surface(struct gl_context *ctx, GLenum target, GLenum access,
struct st_texture_image *stImage = st_texture_image(texImage);
pipe_resource_reference(&stObj->pt, NULL);
- st_texture_release_all_sampler_views(stObj);
+ st_texture_release_all_sampler_views(st, stObj);
pipe_resource_reference(&stImage->pt, NULL);
_mesa_dirty_texobj(ctx, texObj);
diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c
index 2871100ae..5f8250e78 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_api.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_api.c
@@ -997,7 +997,7 @@ void vbo_use_buffer_objects(struct gl_context *ctx)
/* Allocate a real buffer object now */
_mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL);
- exec->vtx.bufferobj = ctx->Driver.NewBufferObject(ctx, bufName, target);
+ exec->vtx.bufferobj = ctx->Driver.NewBufferObject(ctx, bufName);
if (!ctx->Driver.BufferData(ctx, target, size, NULL, usage,
GL_MAP_WRITE_BIT |
GL_DYNAMIC_STORAGE_BIT |
diff --git a/mesalib/src/mesa/vbo/vbo_save_api.c b/mesalib/src/mesa/vbo/vbo_save_api.c
index 1c6b91942..848eedaa4 100644
--- a/mesalib/src/mesa/vbo/vbo_save_api.c
+++ b/mesalib/src/mesa/vbo/vbo_save_api.c
@@ -191,9 +191,7 @@ alloc_vertex_store(struct gl_context *ctx)
* user. Perhaps there could be a special number for internal
* buffers:
*/
- vertex_store->bufferobj = ctx->Driver.NewBufferObject(ctx,
- VBO_BUF_ID,
- GL_ARRAY_BUFFER_ARB);
+ vertex_store->bufferobj = ctx->Driver.NewBufferObject(ctx, VBO_BUF_ID);
if (vertex_store->bufferobj) {
save->out_of_memory =
!ctx->Driver.BufferData(ctx,